diff --git a/.gitignore b/.gitignore index eae03c9..a90ef7e 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,4 @@ temp/ # Wiki synthesis staging (transient; review-before-apply). Keep only the README. .claude/wiki_staging/* !.claude/wiki_staging/README.md +.tmp-* diff --git a/.tmp-xen-snapvdi.py b/.tmp-xen-snapvdi.py deleted file mode 100644 index c45cdec..0000000 --- a/.tmp-xen-snapvdi.py +++ /dev/null @@ -1,17 +0,0 @@ -import os, paramiko -host="192.168.0.104"; user="root"; pw=os.environ["XEN_PW"] -c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) -c.connect(host, username=user, password=pw, timeout=20, - disabled_algorithms={'pubkeys': ['rsa-sha2-256','rsa-sha2-512']}, - look_for_keys=False, allow_agent=False) -def run(cmd): - i,o,e=c.exec_command(cmd,timeout=120); return (o.read().decode(errors="replace")+e.read().decode(errors="replace")).strip() -g_vdi="828ea0ff-04c7-4f7c-9e4d-baa9e15d72bd" # G: = "2003 Disk 2" xvdb -print("=== snapshotting G: VDI for consistent export ===") -snap=run(f'xe vdi-snapshot uuid={g_vdi}') -print("snapshot VDI uuid:", snap) -print("=== snapshot details ===") -print(run(f"xe vdi-param-list uuid={snap} | grep -iE 'uuid \\(|name-label|virtual-size|is-a-snapshot|sr-name-label'")) -print("=== dom0 free space (confirm we must stream, not stage locally) ===") -print(run("df -h / /var/tmp 2>/dev/null | head")) -c.close() diff --git a/.tmp-xen-token.py b/.tmp-xen-token.py deleted file mode 100644 index a705cd9..0000000 --- a/.tmp-xen-token.py +++ /dev/null @@ -1,18 +0,0 @@ -import os, paramiko -host="192.168.0.104"; user="root"; pw=os.environ["XEN_PW"] -c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) -c.connect(host, username=user, password=pw, timeout=20, - disabled_algorithms={'pubkeys': ['rsa-sha2-256','rsa-sha2-512']}, - look_for_keys=False, allow_agent=False) -def run(cmd): - i,o,e=c.exec_command(cmd,timeout=60); return (o.read().decode(errors="replace")+e.read().decode(errors="replace")).strip() -# Generate a temporary XenAPI session ref for the HTTP export (avoids putting root pw in the RMM command log) -pyc = ( -"import XenAPI;" -"s=XenAPI.Session('https://localhost');" -"s.login_with_password('root', __import__('os').environ['XPW'], '1.0', 'g-migration');" -"print(s._session)" -) -out=run(f"XPW='{pw}' python -c \"{pyc}\"") -print("SESSION_REF:", out) -c.close() diff --git a/clients/valleywide/app-modernization/CONTEXT.md b/clients/valleywide/app-modernization/CONTEXT.md index 8db44ec..4610173 100644 --- a/clients/valleywide/app-modernization/CONTEXT.md +++ b/clients/valleywide/app-modernization/CONTEXT.md @@ -73,3 +73,22 @@ No `.vbp` project file, no other forms/modules. The 19 `.vbp` / 44 `.frm` elsewh data DB; plus other Darv-project DBs (HealthCare/ACA). Pull on demand. **Next:** run VB Decompiler Pro against `ORDERS0727-2015.exe` (P-Code -> ~70-80% recovery). + +--- + +## Update 2026-06-13 (later) — SOURCE FULLY RECOVERED (supersedes "still lost" above) + +The complete VWP "Orders" VB6 source was recovered from **`F:\Darv\Darv.rar`** on +**WINFileSvr (192.168.0.35)** — a 51 GB backup of Darv's dev machine (extracted to +`F:\Darv\Darv-rar`, 135 GB). The full project tree is present, with multiple versions: +- **Newest:** `…\Kingston\Project\VWP_Current\ORDERS_C.vbp` (2020-06-09) — 128 `.frm`, 4 `.bas`; + `ORDERS_C` references 80 forms + 10 OCX (TABCTL32, Crystal `Crystl32`, True DBGrid, FarPoint Spread). +- Also: `VWP_Inv`, `VWP_Update`, `VWP_Current_0317`; historical `ORDERSold.vbp` (2002), `ORDERSSave`. + +**Staged to repo:** `source-code/Orders-VWP_Current-2020/` — 12.2 MB pure source +(147 `.frm`, 4 `.bas`, 5 `.vbp`). Databases left on the server. + +**Decompilation (VB Decompiler Pro) is NO LONGER NEEDED** — we have the real, buildable source. +Stack now confirmed from source: **VB6 (P-Code), Jet/Access `.mdb`, Crystal Reports, heavy OCX +dependency** (TABCTL32, True DBGrid Pro, FarPoint Spread, Flp32a30). Next: set up a VB6 build env +to confirm it compiles, then scope the modernization from actual source. Tracked on ticket #32280. diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO.bas b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO.bas new file mode 100644 index 0000000..e5a42ad --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO.bas @@ -0,0 +1,1435 @@ +Attribute VB_Name = "modADO" +Option Explicit + +Public goConn As New Connection +Public goConn2 As New Connection +Public goConn3 As New Connection +Public goConn4 As New Connection +Public gintNTOID As Long ' this is to work with superceded takeoffs +Public gintPONUM As Long, gintPAYID As Long, gboolBAG As Boolean +Public gintTOID As Long, gintPRINT As Long, gbytINV_TYPE As Byte +Public gstrBEGDATE As String, gstrENDDATE As String +Public gintDEST As Integer, gintCOPY As Integer +Public gintLOTID As Long, gintPERCENT As Integer +Public gintPROJID As Long, glngORDERID As Long +Public gintOPTID As Long ', gboolMAS90 As Boolean +Public gintREPAIRID As Long, gintORDER As Long, glngPS_ID As Long, glngTIMEID As Long +Public gintESTID As Long, gstrPO As String, gintCOCODE As Integer +Public gstrLOGIN As String, gbytSECURITY As Byte, glngPO_NUM As Long +Public gintCREWID As Integer, gstrCREW As String, glngPSID As Long +Public gstrFLAG As String, gstrPONUM As String, gstrTYPE As String +Public gboolPRINT As Boolean, gboolLOGIN As Boolean, gstrMODULE As String +Public gboolSYN As Boolean, gsngWAGE As Single, gdteUPDATE As Date, gbool2FIN As Boolean +Public gboolPULTE As Boolean, gboolCERTIFIED As Boolean, gboolPSpecialCALC As Boolean +Public gboolAP As Boolean + + +Public gconACTION As Byte ' 1 = Add, 2 = Change, 3 = Delete, 5 = Copy + +Public Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long + +Public Const LB_SETTABSTOPS = &H192 +Public Sub DataBase() + +'*** Means that Main Database at VWP has been Updated +'tblTake - rename UPDATE to LSave and LUUser to LSUser *** +'tblTake - Add UPDATE and LUUser to End of Table - same type as renamed fields *** +'tblTake - Add OpenFlg (Yes/No) *** +'tblPlans - Add OpenFlg (Yes/No) *** +'tblPlans - Add Verified (Yes/No) *** +'tblPlans - rename UPDATE to LSave and LUUser to LSUser *** +'tblPlans - Add UPDATE and LUUser to End of Table - same type as renamed fields *** +'tblPlans - Add IMPORT (Date/Time) and IMUser (Text 6) *** +'tblPlans - Add SOURCE (Text 8) *** +'tblProject = add TAPE (Yes/No) *** +'tblLotInfo - Add OpenFlg (Yes/No) *** +'tblLotInfo - Add IMPORT (Date/Time) and IMUser (Text 6) *** +'tblLotInfo - Add CALCDATE (Date/Time) *** +'tblLotInfo - Add MultiPay (Yes/No) +'tblPOPTION - Add Invoice (Yes/No) - This it to indicate if this item should be excluded from the invoice +'tblPOPTION - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblOPTION - Add Invoice (Yes/No) - This it to indicate if this item should be excluded from the invoice +'tblOPTION - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblLotInfo - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblLotInfo - Add PAYCOMPLETE (YES/NO) +'tblLotInfo - ADD PAYYSTUCCO INTEGER +'tblLotInfo - ADD PAYYLATH INTEGER +'tblLotInfo - Add PayMetal Integer +'tblLotInfo - Add NoPayIssue (Yes/No) +'tblPaySheet - Create new table +'tblPaySheet - Add PAYID - Autonumber +'tblPaySheet - Add LOTID - Long +'tblPaySheet - Add TYPE Text 1 (L/S/V) +'tblPaySheet - Add PayYdge - Long +'tblPaySheet - Add Metal - Long +'tblPaySheet - Add PAID (Yes./No) +'tblPaySheet - Add Amt Single +'tblPaySheet - Add YRate Single +'tblPaySheet - Add MRage Single +'tblOPTION - Add Invoice Y/N +'tblOPTION - Add OTStone +'tblPaySheet - Add CREWID Long +'tblPaySheet - Add SHEET Integer (to know which pay sheet number) + + +End Sub +Public Sub Main() +Dim boolPerform As Boolean +Dim boolPerform2 As Boolean +Dim boolPerform3 As Boolean +Dim boolPerform4 As Boolean + + On Error GoTo Error_EH + + Screen.MousePointer = vbHourglass + + ' Open the Database Engine + boolPerform = DataOpen(goConn) + boolPerform2 = DataOpen2(goConn2) + boolPerform3 = DataOpen3(goConn3) + boolPerform4 = DataOpen4(goConn4) + + If boolPerform2 Then +' gboolMAS90 = vbFalse +' gboolMAS90 = vbTrue + Else +' gboolMAS90 = vbTrue +' gboolMAS90 = vbFalse + End If + If boolPerform Then + frmSplash.Show 1 + gboolLOGIN = False + frmLogin.Show 1 + If gboolLOGIN Then + frmMain.Show + End If + End If +' End If + + Screen.MousePointer = vbDefault + Exit Sub + +Error_EH: + gstrMODULE = "Module ADO.BAS - Sub Main" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Public Function DataOpen(oConn As Connection) As Boolean + On Error GoTo Open_EH + + oConn.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn.ConnectionString = ConnectString() + + ' Set the mode of the connection + oConn.Mode = adModeReadWrite + + ' Open the Connection + oConn.Open + + DataOpen = True + + Exit Function + +Open_EH: + Call ErrorHandler(goConn) + DataOpen = False + Exit Function +End Function + +Public Function DataOpen2(oConn2 As Connection) As Boolean + On Error GoTo Open_EH + + oConn2.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn2.ConnectionString = ConnectString2() + + ' Set the mode of the connection + oConn2.Mode = adModeReadWrite + + ' Open the Connection + oConn2.Open + + DataOpen2 = True + + Exit Function + +Open_EH: +' Call ErrorHandler(goConn2) + DataOpen2 = False + Exit Function +End Function + +Public Function DataOpen3(oConn3 As Connection) As Boolean + On Error GoTo Open_EH + + oConn3.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn3.ConnectionString = ConnectString3() + + ' Set the mode of the connection + oConn3.Mode = adModeReadWrite + + ' Open the Connection + oConn3.Open + + DataOpen3 = True + + Exit Function + +Open_EH: +' Call ErrorHandler(goConn3) + DataOpen3 = False + Exit Function +End Function + +Public Function DataOpen4(oConn4 As Connection) As Boolean + On Error GoTo Open_EH + + oConn4.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn4.ConnectionString = ConnectString4() + + ' Set the mode of the connection + oConn4.Mode = adModeReadWrite + + ' Open the Connection + oConn4.Open + + DataOpen4 = True + + Exit Function + +Open_EH: + Call ErrorHandler(goConn4) + DataOpen4 = False + Exit Function +End Function + +Public Function ConnectString() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + 'Provider=MSDASQL.1;Password="";Persist Security Info=True;User ID=DWW;Data Source=SOTAMAS90 +' ConnectString = "DSN=VWPMAS90" + + ' "UID=DWW;PWD=;" & _ + ' "DATABASE=Employees" + +' ConnectString = "DSN=SOTAMAS90;" & _ +' "UID=DWW;PWD=;" ' & _ + '"DATABASE=" + + + ' SQL Server using OLE DB Provider + 'ConnectString = "Provider = sqloledb;" & _ + ' "Data Source = (local);" & _ + ' "Initial Catalog = Employees;" & _ + ' "User Id = sa;" & _ + ' "Password = ; " + + ' Jet MDB + strDB = App.Path & "\vwp.mdb" +' ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ +' ";Data Source=" & strDB & _ +' ";User Id=admin;" & _ +' "Password=" ' "; + ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ + ";Data Source=" & strDB +' ";Data Source=vwp\vwp.mdb" +' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vwp\vwp.mdb" +' ";Data Source=vwp\vwp.mdb" +End Function + +Public Function ConnectString2() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + + ConnectString2 = "DSN=VWPMAS90" + +End Function + +Public Function ConnectString3() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + + ConnectString3 = "DSN=MSCMAS90" + +End Function + +Public Function ConnectString4() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + 'Provider=MSDASQL.1;Password="";Persist Security Info=True;User ID=DWW;Data Source=SOTAMAS90 +' ConnectString = "DSN=VWPMAS90" + + ' "UID=DWW;PWD=;" & _ + ' "DATABASE=Employees" + +' ConnectString = "DSN=SOTAMAS90;" & _ +' "UID=DWW;PWD=;" ' & _ + '"DATABASE=" + + + ' SQL Server using OLE DB Provider + 'ConnectString = "Provider = sqloledb;" & _ + ' "Data Source = (local);" & _ + ' "Initial Catalog = Employees;" & _ + ' "User Id = sa;" & _ + ' "Password = ; " + + ' Jet MDB + strDB = App.Path & "\vwp4.mdb" +' ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ +' ";Data Source=" & strDB & _ +' ";User Id=admin;" & _ +' "Password=" ' "; + ConnectString4 = "Provider=Microsoft.Jet.OLEDB.4.0" & _ + ";Data Source=" & strDB +' ";Data Source=vwp\vwp.mdb" +' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vwp\vwp.mdb" +' ";Data Source=vwp\vwp.mdb" +End Function + +Public Sub ErrorHandler(oConn As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub ErrorHandler3(oConn2 As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn2.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub ErrorHandler4(oConn4 As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn4.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub AppQuit() + On Error Resume Next + + If goConn.State = adStateOpen Then + goConn.Close + Set goConn = Nothing + End If + If goConn2.State = adStateOpen Then + goConn2.Close + Set goConn2 = Nothing + End If + If goConn3.State = adStateOpen Then + goConn3.Close + Set goConn3 = Nothing + End If + If goConn4.State = adStateOpen Then + goConn4.Close + Set goConn4 = Nothing + End If + + + End +End Sub + +Public Function Str2Field(strValue As String) As Variant + If IsNull(strValue) Then + strValue = "" + If Trim$(strValue) = "" Then + Str2Field = Null + Else + Str2Field = strValue + End If + Else + If Trim$(strValue) = "" Then + Str2Field = Null + Else + Str2Field = strValue + End If + End If +End Function +Public Function Integer2Field(strValue As Variant) As Integer +' If strValue = "" Or strValue = " " Then +' If Trim$(strValue) = "" Then +' Integer2Field = 0 +' Else + If IsNull(strValue) Then + Integer2Field = 0 + ElseIf Trim$(strValue) = "" Then + Integer2Field = 0 + Else + Integer2Field = CInt(strValue) + End If +' End If + +End Function + +Public Function Long2Field(strValue As Variant) As Integer +' If Trim$(strValue) = "" Then +' Long2Field = 0 +' Else + If IsNull(strValue) Then + Long2Field = 0 + ElseIf Trim$(strValue) = "" Then + Long2Field = 0 + Else + Long2Field = CLng(strValue) + End If +' End If + +End Function + +Public Function Single2Field(strValue As Variant) As Single +' If Trim$(strValue) = "" Then +' Single2Field = 0 +' Else + If IsNull(strValue) Then + Single2Field = 0 + ElseIf Trim$(strValue) = "" Then + Single2Field = 0 + Else + Single2Field = CSng(strValue) + End If +' End If + +End Function + +Public Function Date2Field(strValue As String) As Variant + If strValue = "" Then + Date2Field = Null + ElseIf strValue = "" Then + Date2Field = Null + Else + If IsDate(strValue) Then + Date2Field = CDate(strValue) + Else + Date2Field = Null + End If + End If +End Function + +Public Function Double2Field(strValue As String) As Variant + If IsNull(strValue) Then + Double2Field = 0 + ElseIf Trim$(strValue) = "" Then + Double2Field = 0 + Else + Double2Field = CDbl(strValue) + End If +' If strValue = "" Then +' Double2Field = Null +' Else +' If IsNumeric(strValue) Then +' Double2Field = CDbl(strValue) +' Else +' Double2Field = Null +' End If +' End If +End Function + +Public Function Field2Str(vntField As Variant) As String + If IsNull(vntField) Then + Field2Str = "" + ElseIf vntField = "" Then + Field2Str = "" + Else + Field2Str = Trim$(CStr(vntField)) + End If +End Function +Public Function Field2Str2(vntField As Variant) As String +' If vntField = "" Then +' Field2Str2 = 0 +' Else + If IsNull(vntField) Then + Field2Str2 = 0 + ElseIf Trim$(vntField) = "" Then + Field2Str2 = 0 + Else + Field2Str2 = Trim$(CStr(vntField)) + End If +' End If +End Function + +Public Function Field2Long(vntField As Variant) As Long + If IsNull(vntField) Then + Field2Long = -1 + ElseIf vntField = "" Then + Field2Long = 0 + Else + Field2Long = CLng(vntField) + End If +End Function + +Public Function Field2Double(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Double = 0 +' Else + If IsNull(vntField) Then + Field2Double = 0 + ElseIf Trim$(vntField) = "" Then + Field2Double = 0 + Else + Field2Double = CDbl(vntField) + End If +' End If +End Function + +Public Function Field2Single(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Double = 0 +' Else + If IsNull(vntField) Then + Field2Single = 0 + ElseIf Trim$(vntField) = "" Then + Field2Single = 0 + Else + Field2Single = CSng(vntField) +' Field2Single = CDbl(vntField) + End If +' End If +End Function + +Public Function Field2Decimal(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Decimal = 0 +' Else + If IsNull(vntField) Then + Field2Decimal = 0 + ElseIf Trim$(vntField) = "" Then + Field2Decimal = 0 + Else + Field2Decimal = CDec(vntField) + End If +' End If +End Function + +Public Function Field2Integer(vntField As Variant) As Long +' If Trim$(vntField) = "" Then + +' Else + If IsNull(vntField) Then + Field2Integer = 0 + ElseIf Trim$(vntField) = "" Then + Field2Integer = 0 + Else + Field2Integer = CInt(vntField) + End If +' End If +End Function + +Public Function Field2CheckBox(vntField As Variant) As Integer + If IsNull(vntField) Then + Field2CheckBox = vbUnchecked + Else + Field2CheckBox = IIf(vntField, vbChecked, vbUnchecked) + End If +End Function + +Public Function Field2TrueFalse(vntField As Variant) As Integer + If IsNull(vntField) Then + Field2TrueFalse = False + Else + Field2TrueFalse = IIf(vntField, vbTrue, vbFalse) +' Field2TrueFalse = IIf(vntField, True, False) + End If +End Function + +Public Sub ListFindItem(ctlAny As Control, lngValue As Long) + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If ctlAny.ItemData(intLoop) = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItem3(ctlAny As Control, lngValue As Long) + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If Field2Long(Left(ctlAny.ItemData(intLoop), 3)) = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +'Public Sub ListFindItem2(ctlAny As Control, lngValue As String) +' Dim intLoop As Integer +' Dim boolFound As Boolean + +' For intLoop = 0 To ctlAny.ListCount - 1 +' If ctlAny.ItemData(intLoop) > lngValue Then +' ctlAny.ListIndex = intLoop - 1 +' boolFound = True +' intLoop = ctlAny.ListCount +' End If +' Next + +' If Not boolFound Then +' ctlAny.ListIndex = -1 +' End If +'End Sub + +Public Sub ListFindItem2(ctlAny As Control, lngValue As Long) + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If ctlAny.ItemData(intLoop) > lngValue Then + ctlAny.ListIndex = intLoop - 1 + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Function ListReposition(lstCtrl As Control, _ + intINDEX As Integer) As Integer + If lstCtrl.ListCount = 0 Then + ListReposition = -1 + Else + intINDEX = intINDEX + 1 + + If intINDEX >= lstCtrl.ListCount - 1 Then + ListReposition = lstCtrl.ListCount - 1 + Else + intINDEX = intINDEX - 1 + If intINDEX <= 0 Then + ListReposition = 0 + Else + ListReposition = intINDEX + End If + End If + End If +End Function +Public Sub CBFindString(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Trim$(UCase$(strSTR)) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString3(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Left$(UCase$(strSTR), 2) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString1(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Left$(UCase$(strSTR), 1) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString4(ctrControlName As Control, strFindStr As String) +'This Routine will find something in the Item Data are of a control. +'This works best when looking for an amount that not just the list index number. + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 + strSTR = ctrControlName.ItemData(intLoop) + If Left$(UCase$(strSTR), 4) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString5(ctrControlName As Control, strFindStr As String) +'This Routine will find something in the Item Data are of a control. +'This works best when looking for an amount that not just the list index number. + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 + strSTR = ctrControlName.ItemData(intLoop) + If Left$(UCase$(strSTR), 4) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString2(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String, strID As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + strID = Left(Trim$(UCase$(strSTR)), 3) + If Field2Str2(strID) = Trim(UCase$(strFindStr)) Then +' If Left(Trim$(UCase$(strStr)), 3) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Exit Sub + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +'Public Function FindTexture(strTable As String, strField As String, strTYPE As String) +'Dim oRF As Recordset +'Dim strSQL As String + +' strSQL = "SELECT * FROM '" & strtable & "' WHERE '" & strField & "' = '" & strName & "'" +' Set oRF = New Recordset +' oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRF.EOF Then +' strTYPE = Field2Str(oRF!id) +' Else +' strTYPE = "" +' End If + +'End Function + +Public Function FieldSelect(lstCtrl As Control) + lstCtrl.SelStart = 0 + If lstCtrl.MaxLength > 0 Then + lstCtrl.SelLength = lstCtrl.MaxLength + Else + lstCtrl.SelLength = 1000 + End If +End Function + +Public Sub ErrorHandler2() + Set frmError.ErrorObj = Err + frmError.Show vbModal +End Sub + +Public Sub LotChange(strProjLot As String, strAction As String) + + Load frmChange + frmChange.lblProjLot = strProjLot + frmChange.lblAction = strAction + + + frmChange.Show 1 + +End Sub + +Public Sub LotChange2(strProjLot As String, strAction As String, strItem As String, strQTY1 As String, strQTY2 As String) + + Load frmChange + frmChange.lblProjLot = strProjLot + frmChange.lblAction = strAction + frmChange.txtNotes2 = " - " & Trim(strItem) & " - " & strQTY1 & " To " & strQTY2 + + frmChange.Show 1 + +End Sub + +Public Function FindMax(ByVal strFile As String, ByVal strField As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT Max(" & strField & ") as MAXField from " & strFile 'tblOption" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + FindMax = oRSMAX!maxfield + oRSMAX.Close + +End Function + +Public Function FindMax2(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD As String, ByVal lngID As Long) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT Max(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD & " = " & lngID 'tblOption" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + FindMax2 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindMax4(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' FindMax4 = oRSMAX!maxfield + FindMax4 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindMax6(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT MAX(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' FindMax4 = oRSMAX!maxfield + FindMax6 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindSum(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSSUM As Recordset +'Dim strField As String, strFile As String + +' strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD & " = " & lngID 'tblOption" + strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSSUM = New Recordset + oRSSUM.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSSUM.EOF Then + FindSum = Field2Str2(oRSSUM!maxfield) + Else + FindSum = 0 + End If + oRSSUM.Close + +End Function + +Public Function ComboLoad(ctlAny As Control) + ctlAny.AddItem ("Lath") + ctlAny.AddItem ("Brown") + ctlAny.AddItem ("Scratch") + ctlAny.AddItem ("Texture") + ctlAny.AddItem ("CMU") + ctlAny.AddItem ("PreOrder") + ctlAny.AddItem ("Veneer-Stone") + ctlAny.AddItem ("Wrap Typar") + ctlAny.AddItem ("Z-PreCast") + ctlAny.AddItem ("E-Synthetic") + ctlAny.AddItem ("J-PaintPrep") + ctlAny.AddItem ("K-P-Interior") + ctlAny.AddItem ("N-P-Exterior") + ctlAny.AddItem ("M-PaintFinal") + ctlAny.AddItem ("D-Coated PO") +End Function + +Public Function MTypeLoad2(ctlAny As Control) + + ctlAny.AddItem 1 & vbTab & "Lath" + ctlAny.AddItem 2 & vbTab & "Brown" + ctlAny.AddItem 3 & vbTab & "Scratch" +' ctlAny.AddItem ("Texture") +' ctlAny.AddItem ("CMU") +' ctlAny.AddItem ("PreOrder") +' ctlAny.AddItem ("Veneer-Stone") +' ctlAny.AddItem ("Wrap Typar") +' ctlAny.AddItem ("Z-PreCast") +' ctlAny.AddItem ("E-Synthetic") + +End Function + +Public Function MTypeLoad(ctlAny As Control) + ctlAny.AddItem ("Lath") + ctlAny.AddItem ("Brown") + ctlAny.AddItem ("Scratch") + ctlAny.AddItem ("Texture") + ctlAny.AddItem ("CMU") + ctlAny.AddItem ("PreOrder") + ctlAny.AddItem ("Veneer-Stone") + ctlAny.AddItem ("Wrap Typar") + ctlAny.AddItem ("Z-PreCast") + ctlAny.AddItem ("E-Synthetic") + ctlAny.AddItem ("J-PaintPrep") + ctlAny.AddItem ("K-P-Interior") + ctlAny.AddItem ("N-P-Exterior") + ctlAny.AddItem ("M-PaintFinal") + ctlAny.AddItem ("D-Coated PO") +End Function + +Public Function FindType3(strINDEX As Long, strTYPE As String) + + If strTYPE = "L" Then + strINDEX = 1 +' ctlAny.Text = "Lath" +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Brown" + ElseIf strTYPE = "S" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Scratch" + ElseIf strTYPE = "T" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Texture" + ElseIf strTYPE = "C" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "CMU" + ElseIf strTYPE = "P" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "PreOrder" + ElseIf strTYPE = "V" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then + ElseIf strTYPE = "D" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "E-Synthetic" + Else +' ctlAny.ListIndex = -1 + End If + +End Function + +Public Function FindType(ctlAny As Control, strTYPE As String) + + If strTYPE = "L" Then + ctlAny.Text = "Lath" +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then + ctlAny.Text = "Brown" + ElseIf strTYPE = "S" Then + ctlAny.Text = "Scratch" + ElseIf strTYPE = "T" Then + ctlAny.Text = "Texture" + ElseIf strTYPE = "C" Then + ctlAny.Text = "CMU" + ElseIf strTYPE = "P" Then + ctlAny.Text = "PreOrder" + ElseIf strTYPE = "V" Then + ctlAny.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then + ctlAny.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then + ctlAny.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then + ctlAny.Text = "E-Synthetic" + ElseIf strTYPE = "J" Then + ctlAny.Text = "J-PaintPrep" + ElseIf strTYPE = "K" Then + ctlAny.Text = "K-P-Interior" + ElseIf strTYPE = "N" Then + ctlAny.Text = "N-P-Exterior" + ElseIf strTYPE = "M" Then + ctlAny.Text = "M-PaintFinal" + ElseIf strTYPE = "D" Then + ctlAny.Text = "D-Coated PO" + Else + ctlAny.ListIndex = -1 + End If + +End Function + +Public Function SetType(strTYPE As String, strDESC As String) + + If strTYPE = "L" Then + strDESC = "Lath" + ElseIf strTYPE = "B" Then + strDESC = "Brown" + ElseIf strTYPE = "S" Then + strDESC = "Scratch" + ElseIf strTYPE = "T" Then + strDESC = "Texture" + ElseIf strTYPE = "C" Then + strDESC = "CMU" + ElseIf strTYPE = "P" Then + strDESC = "PreOrder" + ElseIf strTYPE = "V" Then + strDESC = "Veneer-Stone" + ElseIf strTYPE = "W" Then + strDESC = "Wrap Typar" + ElseIf strTYPE = "Z" Then + strDESC = "Z-PreCast" + ElseIf strTYPE = "A" Then + strDESC = "A-Sand" + ElseIf strTYPE = "R" Then + strDESC = "R-Special PO" + ElseIf strTYPE = "E" Then + strDESC = "E-Synthetic" + ElseIf strTYPE = "D" Then + strDESC = "D-Coated PO" + ElseIf strTYPE = "Q" Then + strDESC = "Q-Misc_Crew" + Else + strDESC = "UNKNOWN" + End If + +End Function + +Public Function FindTexture(strName As String, strTYPE As String) +Dim oRF As Recordset +Dim strSQL As String + + strSQL = "SELECT * FROM tblFINISH WHERE Desc = '" & strName & "'" + Set oRF = New Recordset + oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRF.EOF Then + strTYPE = Field2Str(oRF!id) + Else + strTYPE = "" + End If + +End Function + +Public Function FindTexture2(strName As String, strTYPE As String) +Dim oRF As Recordset +Dim strSQL As String + + strSQL = "SELECT * FROM tblFINISH WHERE ID = '" & strName & "'" + Set oRF = New Recordset + oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRF.EOF Then + strTYPE = Field2Str(oRF!Desc) + Else + strTYPE = "" + End If + +End Function + +Public Function CheckTime(txtTime As String) +Dim intHR As Integer, intMN As Integer + If Len(txtTime) = 2 Then + intHR = Val(txtTime) + intMN = 0 + End If + + If Len(txtTime) = 3 Then + intHR = 0 + intMN = Val(Mid(txtTime, 2, 2)) + End If + + If Len(txtTime) = 4 Then + intHR = Val(Mid(txtTime, 1, 2)) + intMN = Val(Mid(txtTime, 3, 2)) + End If + + If intHR > 24 Then + CheckTime = False + ElseIf intMN > 59 Then + CheckTime = False + Else + CheckTime = True + End If +End Function + +Public Function ShowTime(strSTime) +Dim intHR As Integer, intMN As Integer + + intHR = Val(Mid(strSTime, 1, 2)) + If intHR > 12 Then + intHR = intHR - 12 + End If + intMN = Val(Mid(strSTime, 3, 2)) + ShowTime = Format(intHR, "##") & ":" & Format(intMN, "00") + If ShowTime = ":00" Then + ShowTime = "" + End If +End Function + +Public Function TimeCalc(strCTime) +Dim intHR As Integer, intMN As Integer, intTIME As Integer + + intHR = Val(Mid(strCTime, 1, 2)) + intMN = Val(Mid(strCTime, 4, 2)) + intTIME = intMN + (intHR * 60) + TimeCalc = intTIME / 60 + +End Function + +Public Function MinuteCalc(strCTime) +Dim intHR As Integer, intMN As Integer, intTIME As Integer + + intHR = Val(Mid(strCTime, 1, 2)) + intMN = Val(Mid(strCTime, 4, 2)) + intTIME = intMN + (intHR * 60) + MinuteCalc = intTIME ' / 60 + +End Function + +Public Function TimeFormat(tField As String, tName As String) +Dim intHour As Integer, intMIN As Integer +' If Mid(tName, 3, 1) = ":" Then + If Mid(tField, 3, 1) = ":" Then + tField = tField + Else +' If Val(tField) < 7 Then +' tField = Val(tField) + 12 +' End If + If Len(tField) = 1 Then +'' If Val(tField) < 7 Or Val(tField) < 0 Then +' tField = Val(tField) + 12 + tField = tField & "00" +'' Else +'' tField = "0" & tField & "00" +'' End If + End If + If Len(tField) = 2 Then +'' If Val(tField) < 7 Or Val(tField) < 0 Then +' tField = Val(tField) + 12 + tField = tField & "00" +'' Else +' tField = "0" & tField & "00" +'' tField = tField & "00" +'' End If + End If + If Len(tField) = 3 Then +'' If Val(Mid(tField, 1, 1)) < 7 Or Val(tField) < 0 Then + intHour = Val(Mid(tField, 1, 1)) + intMIN = Val(Mid(tField, 2, 2)) +' intHour = intHour + 12 + tField = Format(intHour, "00") & Format(intMIN, "00") +'' Else +'' tField = "0" & tField ' & "0" +'' End If +' tField = "0" & tField ' & "0" + End If + tField = Format(tField, "00:00") +' If Mid(tField, 1, 2) < "07" Then +' intHour = Val(Mid(tField, 1, 2)) + +' End If + End If + TimeFormat = tField +End Function + +Public Function TimeFormat2(tField As String, tName As String) +Dim intHour As Integer, intMIN As Integer +' If Mid(tName, 3, 1) = ":" Then + If Mid(tField, 3, 1) = ":" Then + tField = tField + Else +' If Val(tField) < 7 Then +' tField = Val(tField) + 12 +' End If + If Len(tField) = 1 Then + If Val(tField) < 7 Or Val(tField) < 0 Then + tField = Val(tField) + 12 + tField = tField & "00" + Else + tField = "0" & tField & "00" + End If + End If + If Len(tField) = 2 Then + If Val(tField) < 7 Or Val(tField) < 0 Then + tField = Val(tField) + 12 + tField = tField & "00" + Else +' tField = "0" & tField & "00" + tField = tField & "00" + End If + End If + If Len(tField) = 3 Then + If Val(Mid(tField, 1, 1)) < 7 Or Val(tField) < 0 Then + intHour = Val(Mid(tField, 1, 1)) + intMIN = Val(Mid(tField, 2, 2)) + intHour = intHour + 12 + tField = Format(intHour, "00") & Format(intMIN, "00") + Else + tField = "0" & tField ' & "0" + End If +' tField = "0" & tField ' & "0" + End If + tField = Format(tField, "00:00") +' If Mid(tField, 1, 2) < "07" Then +' intHour = Val(Mid(tField, 1, 2)) + +' End If + End If + TimeFormat2 = tField +End Function + +Public Sub ListFindItemS1(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 0 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS2(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 1 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS3(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 2 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS4(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 3 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS5(ctlAny As Control, lngValue As String) ', intCOL As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 4 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS6(ctlAny As Control, lngValue As String) ', intCOL As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intCOL As Integer + + intCOL = 5 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intCOL + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO2.bas b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO2.bas new file mode 100644 index 0000000..a5880bb --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ADO2.bas @@ -0,0 +1,1408 @@ +Attribute VB_Name = "modADO2" +Option Explicit + +Public goConn As New Connection +Public goConn2 As New Connection +Public goConn3 As New Connection +Public goConn4 As New Connection +Public gintNTOID As Long ' this is to work with superceded takeoffs +Public gintPONUM As Long, gintPAYID As Long, gboolBAG As Boolean +Public gintTOID As Long, gintPRINT As Long, gbytINV_TYPE As Byte +Public gstrBEGDATE As String, gstrENDDATE As String +Public gintDEST As Integer, gintCOPY As Integer +Public gintLOTID As Long, gintPERCENT As Integer +Public gintPROJID As Long, glngORDERID As Long +Public gintOPTID As Long ', gboolMAS90 As Boolean +Public gintREPAIRID As Long, gintORDER As Long +Public gintESTID As Long, gstrPO As String, gintCOCODE As Integer +Public gstrLOGIN As String, gbytSECURITY As Byte +Public gintCREWID As Integer, gstrCREW As String +Public gstrFLAG As String, gstrPONUM As String, gstrTYPE As String +Public gboolPRINT As Boolean, gboolLOGIN As Boolean, gstrMODULE As String +Public gboolSYN As Boolean, gsngWAGE As Single, gdteUPDATE As Date, gbool2FIN As Boolean +Public gboolPULTE As Boolean, gboolCERTIFIED As Boolean, gboolPSpecialCALC As Boolean + + +Public gconACTION As Byte ' 1 = Add, 2 = Change, 3 = Delete, 5 = Copy + +Public Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long + +Public Const LB_SETTABSTOPS = &H192 +Public Sub DataBase() + +'*** Means that Main Database at VWP has been Updated +'tblTake - rename UPDATE to LSave and LUUser to LSUser *** +'tblTake - Add UPDATE and LUUser to End of Table - same type as renamed fields *** +'tblTake - Add OpenFlg (Yes/No) *** +'tblPlans - Add OpenFlg (Yes/No) *** +'tblPlans - Add Verified (Yes/No) *** +'tblPlans - rename UPDATE to LSave and LUUser to LSUser *** +'tblPlans - Add UPDATE and LUUser to End of Table - same type as renamed fields *** +'tblPlans - Add IMPORT (Date/Time) and IMUser (Text 6) *** +'tblPlans - Add SOURCE (Text 8) *** +'tblProject = add TAPE (Yes/No) *** +'tblLotInfo - Add OpenFlg (Yes/No) *** +'tblLotInfo - Add IMPORT (Date/Time) and IMUser (Text 6) *** +'tblLotInfo - Add CALCDATE (Date/Time) *** +'tblLotInfo - Add MultiPay (Yes/No) +'tblPOPTION - Add Invoice (Yes/No) - This it to indicate if this item should be excluded from the invoice +'tblPOPTION - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblOPTION - Add Invoice (Yes/No) - This it to indicate if this item should be excluded from the invoice +'tblOPTION - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblLotInfo - Add OTSTONE (Yes/No) - To show that the stone is being installed by someone else +'tblLotInfo - Add PAYCOMPLETE (YES/NO) +'tblLotInfo - ADD PAYYSTUCCO INTEGER +'tblLotInfo - ADD PAYYLATH INTEGER +'tblLotInfo - Add PayMetal Integer +'tblLotInfo - Add NoPayIssue (Yes/No) +'tblPaySheet - Create new table +'tblPaySheet - Add PAYID - Autonumber +'tblPaySheet - Add LOTID - Long +'tblPaySheet - Add TYPE Text 1 (L/S/V) +'tblPaySheet - Add PayYdge - Long +'tblPaySheet - Add Metal - Long +'tblPaySheet - Add PAID (Yes./No) +'tblPaySheet - Add Amt Single +'tblPaySheet - Add YRate Single +'tblPaySheet - Add MRage Single +'tblOPTION - Add Invoice Y/N +'tblOPTION - Add OTStone +'tblPaySheet - Add CREWID Long +'tblPaySheet - Add SHEET Integer (to know which pay sheet number) + + +End Sub +Public Sub Main() +Dim boolPerform As Boolean +Dim boolPerform2 As Boolean +Dim boolPerform3 As Boolean +Dim boolPerform4 As Boolean + + On Error GoTo Error_EH + + Screen.MousePointer = vbHourglass + + ' Open the Database Engine + boolPerform = DataOpen(goConn) + boolPerform2 = DataOpen2(goConn2) + boolPerform3 = DataOpen3(goConn3) + boolPerform4 = DataOpen4(goConn4) + + If boolPerform2 Then +' gboolMAS90 = vbFalse +' gboolMAS90 = vbTrue + Else +' gboolMAS90 = vbTrue +' gboolMAS90 = vbFalse + End If + If boolPerform Then + frmSplash.Show 1 + gboolLOGIN = False + frmLogin.Show 1 + If gboolLOGIN Then + frmMain.Show + End If + End If +' End If + + Screen.MousePointer = vbDefault + Exit Sub + +Error_EH: + gstrMODULE = "Module ADO.BAS - Sub Main" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Public Function DataOpen(oConn As Connection) As Boolean + On Error GoTo Open_EH + + oConn.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn.ConnectionString = ConnectString() + + ' Set the mode of the connection + oConn.Mode = adModeReadWrite + + ' Open the Connection + oConn.Open + + DataOpen = True + + Exit Function + +Open_EH: + Call ErrorHandler(goConn) + DataOpen = False + Exit Function +End Function + +Public Function DataOpen2(oConn2 As Connection) As Boolean + On Error GoTo Open_EH + + oConn2.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn2.ConnectionString = ConnectString2() + + ' Set the mode of the connection + oConn2.Mode = adModeReadWrite + + ' Open the Connection + oConn2.Open + + DataOpen2 = True + + Exit Function + +Open_EH: +' Call ErrorHandler(goConn2) + DataOpen2 = False + Exit Function +End Function + +Public Function DataOpen3(oConn3 As Connection) As Boolean + On Error GoTo Open_EH + + oConn3.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn3.ConnectionString = ConnectString3() + + ' Set the mode of the connection + oConn3.Mode = adModeReadWrite + + ' Open the Connection + oConn3.Open + + DataOpen3 = True + + Exit Function + +Open_EH: +' Call ErrorHandler(goConn3) + DataOpen3 = False + Exit Function +End Function + +Public Function DataOpen4(oConn4 As Connection) As Boolean + On Error GoTo Open_EH + + oConn4.CursorLocation = adUseClient + + ' Set the connection string by calling + ' a function. + oConn4.ConnectionString = ConnectString4() + + ' Set the mode of the connection + oConn4.Mode = adModeReadWrite + + ' Open the Connection + oConn4.Open + + DataOpen4 = True + + Exit Function + +Open_EH: + Call ErrorHandler(goConn4) + DataOpen4 = False + Exit Function +End Function + +Public Function ConnectString() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + 'Provider=MSDASQL.1;Password="";Persist Security Info=True;User ID=DWW;Data Source=SOTAMAS90 +' ConnectString = "DSN=VWPMAS90" + + ' "UID=DWW;PWD=;" & _ + ' "DATABASE=Employees" + +' ConnectString = "DSN=SOTAMAS90;" & _ +' "UID=DWW;PWD=;" ' & _ + '"DATABASE=" + + + ' SQL Server using OLE DB Provider + 'ConnectString = "Provider = sqloledb;" & _ + ' "Data Source = (local);" & _ + ' "Initial Catalog = Employees;" & _ + ' "User Id = sa;" & _ + ' "Password = ; " + + ' Jet MDB + strDB = App.Path & "\vwp.mdb" +' ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ +' ";Data Source=" & strDB & _ +' ";User Id=admin;" & _ +' "Password=" ' "; + ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ + ";Data Source=" & strDB +' ";Data Source=vwp\vwp.mdb" +' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vwp\vwp.mdb" +' ";Data Source=vwp\vwp.mdb" +End Function + +Public Function ConnectString4() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + 'Provider=MSDASQL.1;Password="";Persist Security Info=True;User ID=DWW;Data Source=SOTAMAS90 +' ConnectString = "DSN=VWPMAS90" + + ' "UID=DWW;PWD=;" & _ + ' "DATABASE=Employees" + +' ConnectString = "DSN=SOTAMAS90;" & _ +' "UID=DWW;PWD=;" ' & _ + '"DATABASE=" + + + ' SQL Server using OLE DB Provider + 'ConnectString = "Provider = sqloledb;" & _ + ' "Data Source = (local);" & _ + ' "Initial Catalog = Employees;" & _ + ' "User Id = sa;" & _ + ' "Password = ; " + + ' Jet MDB + strDB = App.Path & "\vwp4.mdb" +' ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0" & _ +' ";Data Source=" & strDB & _ +' ";User Id=admin;" & _ +' "Password=" ' "; + ConnectString4 = "Provider=Microsoft.Jet.OLEDB.4.0" & _ + ";Data Source=" & strDB +' ";Data Source=vwp\vwp.mdb" +' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vwp\vwp.mdb" +' ";Data Source=vwp\vwp.mdb" +End Function + +Public Function ConnectString2() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + + ConnectString2 = "DSN=VWPMAS90" + +End Function + +Public Function ConnectString3() As String +Dim strDB As String + ' SQL Server using an ODBC Data Source + + ConnectString3 = "DSN=MSCMAS90" + +End Function + +Public Sub ErrorHandler(oConn As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub ErrorHandler3(oConn2 As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn2.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub ErrorHandler4(oConn4 As Connection) + Dim oErr As Error + Dim strMSG As String + + For Each oErr In oConn4.Errors + strMSG = strMSG & _ + "Error #: " & _ + oErr.Number & vbCrLf + strMSG = strMSG & _ + "Description: " & _ + oErr.Description & vbCrLf + strMSG = strMSG & _ + "Source: " & _ + oErr.Source & vbCrLf + strMSG = strMSG & _ + "SQL State: " & _ + oErr.SQLState & vbCrLf + strMSG = strMSG & _ + "Native Error: " & _ + oErr.NativeError & vbCrLf + strMSG = strMSG & vbCrLf + Next + + MsgBox strMSG +End Sub + +Public Sub AppQuit() + On Error Resume Next + + If goConn.State = adStateOpen Then + goConn.Close + Set goConn = Nothing + End If + If goConn2.State = adStateOpen Then + goConn2.Close + Set goConn2 = Nothing + End If + + + End +End Sub + +Public Function Str2Field(strValue As String) As Variant + If IsNull(strValue) Then + strValue = "" + If Trim$(strValue) = "" Then + Str2Field = Null + Else + Str2Field = strValue + End If + Else + If Trim$(strValue) = "" Then + Str2Field = Null + Else + Str2Field = strValue + End If + End If +End Function +Public Function Integer2Field(strValue As Variant) As Integer +' If strValue = "" Or strValue = " " Then +' If Trim$(strValue) = "" Then +' Integer2Field = 0 +' Else + If IsNull(strValue) Then + Integer2Field = 0 + ElseIf Trim$(strValue) = "" Then + Integer2Field = 0 + Else + Integer2Field = CInt(strValue) + End If +' End If + +End Function + +Public Function Long2Field(strValue As Variant) As Integer +' If Trim$(strValue) = "" Then +' Long2Field = 0 +' Else + If IsNull(strValue) Then + Long2Field = 0 + ElseIf Trim$(strValue) = "" Then + Long2Field = 0 + Else + Long2Field = CLng(strValue) + End If +' End If + +End Function + +Public Function Single2Field(strValue As Variant) As Single +' If Trim$(strValue) = "" Then +' Single2Field = 0 +' Else + If IsNull(strValue) Then + Single2Field = 0 + ElseIf Trim$(strValue) = "" Then + Single2Field = 0 + Else + Single2Field = CSng(strValue) + End If +' End If + +End Function + +Public Function Date2Field(strValue As String) As Variant + If strValue = "" Then + Date2Field = Null + ElseIf strValue = "" Then + Date2Field = Null + Else + If IsDate(strValue) Then + Date2Field = CDate(strValue) + Else + Date2Field = Null + End If + End If +End Function + +Public Function Double2Field(strValue As String) As Variant + If IsNull(strValue) Then + Double2Field = 0 + ElseIf Trim$(strValue) = "" Then + Double2Field = 0 + Else + Double2Field = CDbl(strValue) + End If +' If strValue = "" Then +' Double2Field = Null +' Else +' If IsNumeric(strValue) Then +' Double2Field = CDbl(strValue) +' Else +' Double2Field = Null +' End If +' End If +End Function + +Public Function Field2Str(vntField As Variant) As String + If IsNull(vntField) Then + Field2Str = "" + ElseIf vntField = "" Then + Field2Str = "" + Else + Field2Str = Trim$(CStr(vntField)) + End If +End Function +Public Function Field2Str2(vntField As Variant) As String +' If vntField = "" Then +' Field2Str2 = 0 +' Else + If IsNull(vntField) Then + Field2Str2 = 0 + ElseIf Trim$(vntField) = "" Then + Field2Str2 = 0 + Else + Field2Str2 = Trim$(CStr(vntField)) + End If +' End If +End Function + +Public Function Field2Long(vntField As Variant) As Long + If IsNull(vntField) Then + Field2Long = -1 + ElseIf vntField = "" Then + Field2Long = 0 + Else + Field2Long = CLng(vntField) + End If +End Function + +Public Function Field2Double(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Double = 0 +' Else + If IsNull(vntField) Then + Field2Double = 0 + ElseIf Trim$(vntField) = "" Then + Field2Double = 0 + Else + Field2Double = CDbl(vntField) + End If +' End If +End Function + +Public Function Field2Single(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Double = 0 +' Else + If IsNull(vntField) Then + Field2Single = 0 + ElseIf Trim$(vntField) = "" Then + Field2Single = 0 + Else + Field2Single = CSng(vntField) + End If +' End If +End Function + +Public Function Field2Decimal(vntField As Variant) As Long +' If Trim$(vntField) = "" Then +' Field2Decimal = 0 +' Else + If IsNull(vntField) Then + Field2Decimal = 0 + ElseIf Trim$(vntField) = "" Then + Field2Decimal = 0 + Else + Field2Decimal = CDec(vntField) + End If +' End If +End Function + +Public Function Field2Integer(vntField As Variant) As Long +' If Trim$(vntField) = "" Then + +' Else + If IsNull(vntField) Then + Field2Integer = 0 + ElseIf Trim$(vntField) = "" Then + Field2Integer = 0 + Else + Field2Integer = CInt(vntField) + End If +' End If +End Function + +Public Function Field2CheckBox(vntField As Variant) As Integer + If IsNull(vntField) Then + Field2CheckBox = vbUnchecked + Else + Field2CheckBox = IIf(vntField, vbChecked, vbUnchecked) + End If +End Function + +Public Function Field2TrueFalse(vntField As Variant) As Integer + If IsNull(vntField) Then + Field2TrueFalse = False + Else + Field2TrueFalse = IIf(vntField, vbTrue, vbFalse) +' Field2TrueFalse = IIf(vntField, True, False) + End If +End Function + +Public Sub ListFindItem(ctlAny As Control, lngValue As Long) + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If ctlAny.ItemData(intLoop) = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItem3(ctlAny As Control, lngValue As Long) + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If Field2Long(Left(ctlAny.ItemData(intLoop), 3)) = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItem2(ctlAny As Control, lngValue As String) +' Dim intLoop As String + Dim intLoop As Integer + Dim boolFound As Boolean + + For intLoop = 0 To ctlAny.ListCount - 1 + If ctlAny.ItemData(intLoop) > lngValue Then + ctlAny.ListIndex = intLoop - 1 + boolFound = True + intLoop = ctlAny.ListCount + End If + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Function ListReposition(lstCtrl As Control, _ + intINDEX As Integer) As Integer + If lstCtrl.ListCount = 0 Then + ListReposition = -1 + Else + intINDEX = intINDEX + 1 + + If intINDEX >= lstCtrl.ListCount - 1 Then + ListReposition = lstCtrl.ListCount - 1 + Else + intINDEX = intINDEX - 1 + If intINDEX <= 0 Then + ListReposition = 0 + Else + ListReposition = intINDEX + End If + End If + End If +End Function +Public Sub CBFindString(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Trim$(UCase$(strSTR)) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString3(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Left$(UCase$(strSTR), 2) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString1(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + If Left$(UCase$(strSTR), 1) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount +' ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString4(ctrControlName As Control, strFindStr As String) +'This Routine will find something in the Item Data are of a control. +'This works best when looking for an amount that not just the list index number. + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 + strSTR = ctrControlName.ItemData(intLoop) + If Left$(UCase$(strSTR), 4) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString5(ctrControlName As Control, strFindStr As String) +'This Routine will find something in the Item Data are of a control. +'This works best when looking for an amount that not just the list index number. + +Dim intLoop As Integer, strSTR As String + +For intLoop = 0 To ctrControlName.ListCount - 1 + strSTR = ctrControlName.ItemData(intLoop) + If Left$(UCase$(strSTR), 4) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +Public Sub CBFindString2(ctrControlName As Control, strFindStr As String) + +Dim intLoop As Integer, strSTR As String, strID As String + +For intLoop = 0 To ctrControlName.ListCount - 1 +' strStr = ctrControlName.ItemData(intLoop) + strSTR = ctrControlName.List(intLoop) + strID = Left(Trim$(UCase$(strSTR)), 3) + If Field2Str2(strID) = Trim(UCase$(strFindStr)) Then +' If Left(Trim$(UCase$(strStr)), 3) = Trim(UCase$(strFindStr)) Then + ctrControlName.ListIndex = intLoop + intLoop = ctrControlName.ListCount + ctrControlName.SetFocus + Exit Sub + Else + ctrControlName.ListIndex = -1 + End If +Next intLoop + +End Sub + +'Public Function FindTexture(strTable As String, strField As String, strTYPE As String) +'Dim oRF As Recordset +'Dim strSQL As String + +' strSQL = "SELECT * FROM '" & strtable & "' WHERE '" & strField & "' = '" & strName & "'" +' Set oRF = New Recordset +' oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRF.EOF Then +' strTYPE = Field2Str(oRF!id) +' Else +' strTYPE = "" +' End If + +'End Function + +Public Function FieldSelect(lstCtrl As Control) + lstCtrl.SelStart = 0 + If lstCtrl.MaxLength > 0 Then + lstCtrl.SelLength = lstCtrl.MaxLength + Else + lstCtrl.SelLength = 1000 + End If +End Function + +Public Sub ErrorHandler2() + Set frmError.ErrorObj = Err + frmError.Show vbModal +End Sub + +Public Sub LotChange(strProjLot As String, strAction As String) + + Load frmChange + frmChange.lblProjLot = strProjLot + frmChange.lblAction = strAction + + + frmChange.Show 1 + +End Sub + +Public Sub LotChange2(strProjLot As String, strAction As String, strItem As String, strQTY1 As String, strQTY2 As String) + + Load frmChange + frmChange.lblProjLot = strProjLot + frmChange.lblAction = strAction + frmChange.txtNotes2 = " - " & Trim(strItem) & " - " & strQTY1 & " To " & strQTY2 + + frmChange.Show 1 + +End Sub + +Public Function FindMax(ByVal strFile As String, ByVal strField As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT Max(" & strField & ") as MAXField from " & strFile 'tblOption" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + FindMax = oRSMAX!maxfield + oRSMAX.Close + +End Function + +Public Function FindMax2(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD As String, ByVal lngID As Long) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT Max(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD & " = " & lngID 'tblOption" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + FindMax2 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindMax4(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' FindMax4 = oRSMAX!maxfield + FindMax4 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindMax6(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSMAX As Recordset +'Dim strField As String, strFile As String + + strSQL = "SELECT MAX(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' FindMax4 = oRSMAX!maxfield + FindMax6 = Field2Str2(oRSMAX!maxfield) + oRSMAX.Close + +End Function + +Public Function FindSum(ByVal strFile As String, ByVal strField As String, ByVal strLookFLD1 As String, ByVal lngID1 As Long, ByVal strLookFLD2 As String, ByVal strID2 As String) +Dim strSQL As String, oRSSUM As Recordset +'Dim strField As String, strFile As String + +' strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD & " = " & lngID 'tblOption" + strSQL = "SELECT SUM(" & strField & ") as MAXField FROM " & strFile & " WHERE " & strLookFLD1 & " = " & lngID1 'tblOption" + strSQL = strSQL & " and " & strLookFLD2 & " = '" & strID2 & "'" + Set oRSSUM = New Recordset + oRSSUM.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSSUM.EOF Then + FindSum = Field2Str2(oRSSUM!maxfield) + Else + FindSum = 0 + End If + oRSSUM.Close + +End Function + +Public Function ComboLoad(ctlAny As Control) + ctlAny.AddItem ("Lath") + ctlAny.AddItem ("Brown") + ctlAny.AddItem ("Scratch") + ctlAny.AddItem ("Texture") + ctlAny.AddItem ("CMU") + ctlAny.AddItem ("PreOrder") + ctlAny.AddItem ("Veneer-Stone") + ctlAny.AddItem ("Wrap Typar") + ctlAny.AddItem ("Z-PreCast") + ctlAny.AddItem ("E-Synthetic") + ctlAny.AddItem ("J-PaintPrep") + ctlAny.AddItem ("K-P-Interior") + ctlAny.AddItem ("N-P-Exterior") + ctlAny.AddItem ("M-PaintFinal") + ctlAny.AddItem ("D-Coated PO") +End Function + +Public Function MTypeLoad2(ctlAny As Control) + + ctlAny.AddItem 1 & vbTab & "Lath" + ctlAny.AddItem 2 & vbTab & "Brown" + ctlAny.AddItem 3 & vbTab & "Scratch" +' ctlAny.AddItem ("Texture") +' ctlAny.AddItem ("CMU") +' ctlAny.AddItem ("PreOrder") +' ctlAny.AddItem ("Veneer-Stone") +' ctlAny.AddItem ("Wrap Typar") +' ctlAny.AddItem ("Z-PreCast") +' ctlAny.AddItem ("E-Synthetic") + +End Function + +Public Function MTypeLoad(ctlAny As Control) + ctlAny.AddItem ("Lath") + ctlAny.AddItem ("Brown") + ctlAny.AddItem ("Scratch") + ctlAny.AddItem ("Texture") + ctlAny.AddItem ("CMU") + ctlAny.AddItem ("PreOrder") + ctlAny.AddItem ("Veneer-Stone") + ctlAny.AddItem ("Wrap Typar") + ctlAny.AddItem ("Z-PreCast") + ctlAny.AddItem ("E-Synthetic") + ctlAny.AddItem ("J-PaintPrep") + ctlAny.AddItem ("K-P-Interior") + ctlAny.AddItem ("N-P-Exterior") + ctlAny.AddItem ("M-PaintFinal") + ctlAny.AddItem ("D-Coated PO") +End Function + +Public Function FindType3(strINDEX As Long, strTYPE As String) + + If strTYPE = "L" Then + strINDEX = 1 +' ctlAny.Text = "Lath" +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Brown" + ElseIf strTYPE = "S" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Scratch" + ElseIf strTYPE = "T" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Texture" + ElseIf strTYPE = "C" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "CMU" + ElseIf strTYPE = "P" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "PreOrder" + ElseIf strTYPE = "V" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then + ElseIf strTYPE = "D" Then +' ctlAny.ListIndex = 1 +' ctlAny.Text = "E-Synthetic" + Else +' ctlAny.ListIndex = -1 + End If + +End Function + +Public Function FindType(ctlAny As Control, strTYPE As String) + + If strTYPE = "L" Then + ctlAny.Text = "Lath" +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then + ctlAny.Text = "Brown" + ElseIf strTYPE = "S" Then + ctlAny.Text = "Scratch" + ElseIf strTYPE = "T" Then + ctlAny.Text = "Texture" + ElseIf strTYPE = "C" Then + ctlAny.Text = "CMU" + ElseIf strTYPE = "P" Then + ctlAny.Text = "PreOrder" + ElseIf strTYPE = "V" Then + ctlAny.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then + ctlAny.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then + ctlAny.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then + ctlAny.Text = "E-Synthetic" + ElseIf strTYPE = "J" Then + ctlAny.Text = "J-PaintPrep" + ElseIf strTYPE = "K" Then + ctlAny.Text = "K-P-Interior" + ElseIf strTYPE = "N" Then + ctlAny.Text = "N-P-Exterior" + ElseIf strTYPE = "M" Then + ctlAny.Text = "M-PaintFinal" + ElseIf strTYPE = "D" Then + ctlAny.Text = "D-Coated PO" + Else + ctlAny.ListIndex = -1 + End If + +End Function + +Public Function SetType(strTYPE As String, strDESC As String) + + If strTYPE = "L" Then + strDESC = "Lath" + ElseIf strTYPE = "B" Then + strDESC = "Brown" + ElseIf strTYPE = "S" Then + strDESC = "Scratch" + ElseIf strTYPE = "T" Then + strDESC = "Texture" + ElseIf strTYPE = "C" Then + strDESC = "CMU" + ElseIf strTYPE = "P" Then + strDESC = "PreOrder" + ElseIf strTYPE = "V" Then + strDESC = "Veneer-Stone" + ElseIf strTYPE = "W" Then + strDESC = "Wrap Typar" + ElseIf strTYPE = "Z" Then + strDESC = "Z-PreCast" + ElseIf strTYPE = "A" Then + strDESC = "A-Sand" + ElseIf strTYPE = "R" Then + strDESC = "R-Special PO" + ElseIf strTYPE = "E" Then + strDESC = "E-Synthetic" + ElseIf strTYPE = "D" Then + strDESC = "D-Coated PO" + ElseIf strTYPE = "Q" Then + strDESC = "Q-Misc_Crew" + Else + strDESC = "UNKNOWN" + End If + +End Function + +Public Function FindTexture(strName As String, strTYPE As String) +Dim oRF As Recordset +Dim strSQL As String + + strSQL = "SELECT * FROM tblFINISH WHERE Desc = '" & strName & "'" + Set oRF = New Recordset + oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRF.EOF Then + strTYPE = Field2Str(oRF!id) + Else + strTYPE = "" + End If + +End Function + +Public Function FindTexture2(strName As String, strTYPE As String) +Dim oRF As Recordset +Dim strSQL As String + + strSQL = "SELECT * FROM tblFINISH WHERE ID = '" & strName & "'" + Set oRF = New Recordset + oRF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRF.EOF Then + strTYPE = Field2Str(oRF!Desc) + Else + strTYPE = "" + End If + +End Function + +Public Function CheckTime(txtTime As String) +Dim intHR As Integer, intMN As Integer + If Len(txtTime) = 2 Then + intHR = Val(txtTime) + intMN = 0 + End If + + If Len(txtTime) = 3 Then + intHR = 0 + intMN = Val(Mid(txtTime, 2, 2)) + End If + + If Len(txtTime) = 4 Then + intHR = Val(Mid(txtTime, 1, 2)) + intMN = Val(Mid(txtTime, 3, 2)) + End If + + If intHR > 24 Then + CheckTime = False + ElseIf intMN > 59 Then + CheckTime = False + Else + CheckTime = True + End If +End Function + +Public Function ShowTime(strSTime) +Dim intHR As Integer, intMN As Integer + + intHR = Val(Mid(strSTime, 1, 2)) + If intHR > 12 Then + intHR = intHR - 12 + End If + intMN = Val(Mid(strSTime, 3, 2)) + ShowTime = Format(intHR, "##") & ":" & Format(intMN, "00") + If ShowTime = ":00" Then + ShowTime = "" + End If +End Function + +Public Function TimeCalc(strCTime) +Dim intHR As Integer, intMN As Integer, intTIME As Integer + + intHR = Val(Mid(strCTime, 1, 2)) + intMN = Val(Mid(strCTime, 4, 2)) + intTIME = intMN + (intHR * 60) + TimeCalc = intTIME / 60 + +End Function + +Public Function MinuteCalc(strCTime) +Dim intHR As Integer, intMN As Integer, intTIME As Integer + + intHR = Val(Mid(strCTime, 1, 2)) + intMN = Val(Mid(strCTime, 4, 2)) + intTIME = intMN + (intHR * 60) + MinuteCalc = intTIME ' / 60 + +End Function + +Public Function TimeFormat(tField As String, tName As String) +Dim intHour As Integer, intMIN As Integer +' If Mid(tName, 3, 1) = ":" Then + If Mid(tField, 3, 1) = ":" Then + tField = tField + Else +' If Val(tField) < 7 Then +' tField = Val(tField) + 12 +' End If + If Len(tField) = 1 Then +'' If Val(tField) < 7 Or Val(tField) < 0 Then +' tField = Val(tField) + 12 + tField = tField & "00" +'' Else +'' tField = "0" & tField & "00" +'' End If + End If + If Len(tField) = 2 Then +'' If Val(tField) < 7 Or Val(tField) < 0 Then +' tField = Val(tField) + 12 + tField = tField & "00" +'' Else +' tField = "0" & tField & "00" +'' tField = tField & "00" +'' End If + End If + If Len(tField) = 3 Then +'' If Val(Mid(tField, 1, 1)) < 7 Or Val(tField) < 0 Then + intHour = Val(Mid(tField, 1, 1)) + intMIN = Val(Mid(tField, 2, 2)) +' intHour = intHour + 12 + tField = Format(intHour, "00") & Format(intMIN, "00") +'' Else +'' tField = "0" & tField ' & "0" +'' End If +' tField = "0" & tField ' & "0" + End If + tField = Format(tField, "00:00") +' If Mid(tField, 1, 2) < "07" Then +' intHour = Val(Mid(tField, 1, 2)) + +' End If + End If + TimeFormat = tField +End Function + +Public Function TimeFormat2(tField As String, tName As String) +Dim intHour As Integer, intMIN As Integer +' If Mid(tName, 3, 1) = ":" Then + If Mid(tField, 3, 1) = ":" Then + tField = tField + Else +' If Val(tField) < 7 Then +' tField = Val(tField) + 12 +' End If + If Len(tField) = 1 Then + If Val(tField) < 7 Or Val(tField) < 0 Then + tField = Val(tField) + 12 + tField = tField & "00" + Else + tField = "0" & tField & "00" + End If + End If + If Len(tField) = 2 Then + If Val(tField) < 7 Or Val(tField) < 0 Then + tField = Val(tField) + 12 + tField = tField & "00" + Else +' tField = "0" & tField & "00" + tField = tField & "00" + End If + End If + If Len(tField) = 3 Then + If Val(Mid(tField, 1, 1)) < 7 Or Val(tField) < 0 Then + intHour = Val(Mid(tField, 1, 1)) + intMIN = Val(Mid(tField, 2, 2)) + intHour = intHour + 12 + tField = Format(intHour, "00") & Format(intMIN, "00") + Else + tField = "0" & tField ' & "0" + End If +' tField = "0" & tField ' & "0" + End If + tField = Format(tField, "00:00") +' If Mid(tField, 1, 2) < "07" Then +' intHour = Val(Mid(tField, 1, 2)) + +' End If + End If + TimeFormat2 = tField +End Function + +Public Sub ListFindItemS1(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 0 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS2(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 1 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS3(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 2 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS4(ctlAny As Control, lngValue As String) ', intcol As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 3 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS5(ctlAny As Control, lngValue As String) ', intCOL As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 4 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + +Public Sub ListFindItemS6(ctlAny As Control, lngValue As String) ', intCOL As Integer) '********** + Dim intLoop As Integer, strValue As String + Dim boolFound As Boolean, intcol As Integer + + intcol = 5 +' ctlAny.col = intCOL +' strVALUE = ctlAny.ColText + For intLoop = 0 To ctlAny.ListCount - 1 + ctlAny.ListIndex = intLoop + ctlAny.col = intcol + strValue = ctlAny.ColText +' If ctlAny.ItemData(intLoop) = lngValue Then + If strValue = lngValue Then + ctlAny.ListIndex = intLoop + boolFound = True + intLoop = ctlAny.ListCount + End If + ' intLoop = intLoop + 1 + Next + + If Not boolFound Then + ctlAny.ListIndex = -1 + End If +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/CrystalReport2.Dsr b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/CrystalReport2.Dsr new file mode 100644 index 0000000..2da6ae3 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/CrystalReport2.Dsr @@ -0,0 +1,15 @@ +VERSION 5.00 +Begin {BD4B4E61-F7B8-11D0-964D-00A0C9273C2A} CrystalReport2 + ClientHeight = 7920 + ClientLeft = 0 + ClientTop = 0 + ClientWidth = 10935 + OleObjectBlob = "CrystalReport2.dsx":0000 +End +Attribute VB_Name = "CrystalReport2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/DataReport1.Dsr b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/DataReport1.Dsr new file mode 100644 index 0000000..fa9e2fd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/DataReport1.Dsr @@ -0,0 +1,173 @@ +VERSION 5.00 +Begin {78E93846-85FD-11D0-8487-00A0C90DC8A9} DataReport1 + Bindings = "DataReport1.dsx":0000 + Caption = "DataReport1" + ClientHeight = 8595 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + StartUpPosition = 2 'CenterScreen + WindowState = 2 'Maximized + _ExtentX = 20955 + _ExtentY = 15161 + _Version = 393216 + _DesignerVersion= 100684101 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + GridX = 10 + GridY = 10 + LeftMargin = 1440 + RightMargin = 1440 + TopMargin = 1440 + BottomMargin = 1440 + NumSections = 5 + SectionCode0 = 1 + BeginProperty Section0 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Section4" + Object.Height = 435 + NumControls = 1 + ItemType0 = 3 + BeginProperty Item0 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Label1" + Object.Top = 144 + Object.Width = 7488 + Object.Height = 285 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Object.Caption = "this is a test to see if a header prints" + CanGrow = -1 'True + Alignment = 2 + EndProperty + EndProperty + SectionCode1 = 2 + BeginProperty Section1 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Section2" + Object.Height = 570 + NumControls = 1 + ItemType0 = 3 + BeginProperty Item0 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Label2" + Object.Top = 144 + Object.Width = 7488 + Object.Height = 420 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Object.Caption = "This is a page header and this is how it prints" + Alignment = 2 + EndProperty + EndProperty + SectionCode2 = 4 + BeginProperty Section2 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Section1" + Object.Height = 1440 + NumControls = 2 + ItemType0 = 4 + BeginProperty Item0 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Text1" + Object.Left = 144 + Object.Top = 720 + Object.Width = 1725 + Object.Height = 285 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + DataField = "proj_desc" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + ItemType1 = 3 + BeginProperty Item1 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Label3" + Object.Left = 720 + Object.Top = 144 + Object.Width = 1728 + Object.Height = 288 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Object.Caption = "This is a test" + EndProperty + EndProperty + SectionCode3 = 7 + BeginProperty Section3 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Section3" + Object.Height = 360 + NumControls = 0 + EndProperty + SectionCode4 = 8 + BeginProperty Section4 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} + _Version = 393216 + Name = "Section5" + Object.Height = 360 + NumControls = 0 + EndProperty +End +Attribute VB_Name = "DataReport1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + + + +Private Sub DataReport_Initialize() +Dim strSQL As String + + strSQL = "Select proj_desc from tblProject" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' DataReport1.DataSource = oRS +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/ORDERS_C.vbp b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/ORDERS_C.vbp new file mode 100644 index 0000000..e9ae72c --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/ORDERS_C.vbp @@ -0,0 +1,139 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\Windows\system32\stdole2.tlb#OLE Automation +Reference=*\G{333C7BC1-460F-11D0-BC04-0080C7055A83}#1.1#0#..\..\Windows\System32\tdc.ocx#Tabular Data Control 1.1 Type Library +Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\Windows\system32\MSBIND.DLL#Microsoft Data Binding Collection +Reference=*\G{0A758DFA-C46A-4C1C-8057-C6C18375EE24}#1.0#0#..\..\Windows\system32\tdbg7da.dll#True DBGrid Pro 7.0 Design Assistant +Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\Windows\system32\msstdfmt.dll#Microsoft Data Formatting Object Library +Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\Windows\system32\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0 +Reference=*\G{8C344710-5FEC-11CF-A0BF-00AA0062BE57}#1.0#0#..\..\Program Files\Common Files\designer\MSCDRUN.DLL#Microsoft Connection Designer Instance 1.0 +Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#2.0#0#..\..\Windows\system32\msrdo20.dll#Microsoft Remote Data Object 2.0 +Reference=*\G{B4741C00-45A6-11D1-ABEC-00A0C9274B91}#7.0#0#..\..\Program Files\Seagate Software\Report Designer Component\craxdrt.dll#Crystal Report 7 ActiveX Designer Run Time Library +Reference=*\G{00000600-0000-0010-8000-00AA006D2EA4}#6.0#0#..\..\Program Files\Common Files\System\ado\msadox.dll#Microsoft ADO Ext. 6.0 for DDL and Security +Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\Windows\system32\scrrun.dll#Microsoft Scripting Runtime +Reference=*\G{00000206-0000-0010-8000-00AA006D2EA4}#2.6#0#..\..\Program Files\Common Files\System\ado\msado26.tlb#Microsoft ActiveX Data Objects 2.6 Library +Reference=*\G{F5078F18-C551-11D3-89B9-0000F81FE221}#4.0#0#..\..\Windows\system32\msxml4.dll#Microsoft XML, v4.0 +Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX +Object={DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0; todg7.ocx +Object={00025600-0000-0000-C000-000000000046}#5.2#0; Crystl32.OCX +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx +Object={32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0; EasyP.ocx +Object={8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0; Flp32a30.ocx +Form=frmLotInfo.frm +Form=frmMain.frm +Form=frmPlans.frm +Form=frmViewTake.frm +Module=modADO; ADO.bas +Form=frmError.frm +Form=FrmLabor.FRM +Form=frmBlackPaper.FRM +Form=frmSupplier.frm +Form=frmTexture.frm +Form=frmContractor.frm +Form=frmScaffold.frm +Form=frmPayInput.frm +Form=frmPrint.frm +Form=frmAbout.frm +Form=frmSplash.frm +Form=frmLogin.frm +Form=frmInvTake.frm +Form=frmUser.frm +Form=frmOrderDates.frm +Form=frmChange.frm +Form=frmYardOrder.frm +Form=frmYInventory.frm +Form=frmShowPO.frm +Form=frmScafList.frm +Form=frmLotList2.frm +Form=frmRepairLot.frm +Form=frmShowRepair.frm +Form=frmPayroll.frm +Form=frmPayHead.frm +Form=frmHourList.frm +Form=frmLotChLog.frm +Form=frmPayList.frm +Form=frmReport.frm +Form=frmSCrew.frm +Form=frmPOList.frm +Form=frmInventory.frm +Form=frmRepair.frm +Form=frmRCrew.frm +Form=frmBilling.frm +Form=frmBillingStatus.frm +Form=frmAR.frm +Form=frmFoam.frm +Form=frmProjNotes.frm +Form=frmAck.frm +Form=frmProject.frm +Form=frmOrders.frm +Form=frmPOInfo.frm +Form=frmCrews.frm +Form=frmShowYardMat.frm +Form=frmShowOrderMat.frm +Form=frmJCList.frm +Form=frmRepList.frm +Form=frmInvPrice.frm +Form=frmCrewList.frm +Form=frmSand.FRM +Form=frmPaySheet.frm +Form=frmScafPay.frm +Form=frmGetPaySheet.frm +Form=frmTake.frm +Form=frmTake5.frm +Form=frmLotInfo5.frm +Form=frmLotPrtJobs.frm +Form=frmPaintPrtJobs.frm +Form=frmMANBILL.frm +Form=frmLotInfoE.frm +Form=frmTakeE.frm +Form=frmPosPayS.frm +Form=frmPosPayV.frm +Form=frmAPFix.frm +Form=frmARFix.frm +Form=frmARMaster.frm +Form=frmAPMaster.frm +Form=frmProjList.frm +Form=frmCertified.frm +Form=frmEmployee.frm +Form=frmPOWOLot.frm +Form=frmWOList.frm +Form=frmPosPayC.frm +Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; MSDATGRD.OCX +Form=frmCrewsOLD.frm +Form=frmInvType.frm +IconForm="frmMain" +Startup="Sub Main" +HelpFile="" +Title="ORDERS" +ExeName32="Orders11.exe" +Command32="" +Name="Orders_C" +HelpContextID="0" +CompatibleMode="0" +MajorVer=20 +MinorVer=2 +RevisionVer=11 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Valley Wide Plastering" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=-1 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frm new file mode 100644 index 0000000..a2f61aa --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frm @@ -0,0 +1,21773 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotInfo + BorderStyle = 1 'Fixed Single + Caption = "Lot Information" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtStoneBill + Alignment = 1 'Right Justify + Height = 330 + Left = 8640 + TabIndex = 226 + TabStop = 0 'False + Top = 420 + Visible = 0 'False + Width = 540 + End + Begin VB.CheckBox chkFirst + Caption = "First Time" + Height = 315 + Left = 10680 + TabIndex = 211 + Top = 1500 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtESTID + Height = 375 + Left = 3120 + TabIndex = 207 + Top = 1680 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtOPEN + Height = 285 + Left = 10740 + TabIndex = 206 + Top = 1140 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtJC + Enabled = 0 'False + Height = 315 + Left = 2700 + MaxLength = 7 + TabIndex = 8 + Top = 2220 + Width = 915 + End + Begin VB.Timer tmrPause + Enabled = 0 'False + Interval = 500 + Left = 8700 + Top = 1020 + End + Begin Crystal.CrystalReport crOrder + Left = 120 + Top = 960 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtSand + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5160 + TabIndex = 28 + TabStop = 0 'False + Top = 780 + Width = 420 + End + Begin VB.ListBox lstPlans + Height = 2010 + Left = 9240 + Sorted = -1 'True + TabIndex = 26 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdFindPlan + Height = 435 + Left = 2565 + Picture = "frmLotInfo.frx":0000 + Style = 1 'Graphical + TabIndex = 7 + Top = 1410 + Width = 435 + End + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 24 + TabStop = 0 'False + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 22 + TabStop = 0 'False + Top = 45 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1020 + Left = 3900 + MultiLine = -1 'True + TabIndex = 11 + Top = 1515 + Width = 4635 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 3 + TabIndex = 10 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 20 + TabStop = 0 'False + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 19 + TabStop = 0 'False + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 2 + TabIndex = 9 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 18 + TabStop = 0 'False + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Enabled = 0 'False + Height = 315 + Left = 1440 + MaxLength = 5 + TabIndex = 5 + Top = 1140 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + MaxLength = 8 + TabIndex = 6 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + MaxLength = 15 + TabIndex = 4 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + MaxLength = 30 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 165 + TabIndex = 30 + TabStop = 0 'False + Top = 2850 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + Tab = 6 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "&General Information" + TabPicture(0) = "frmLotInfo.frx":0442 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "chkPaint" + Tab(0).Control(1)= "chkNoPay" + Tab(0).Control(2)= "chkOthers" + Tab(0).Control(3)= "cmdPrint" + Tab(0).Control(4)= "chkStone" + Tab(0).Control(5)= "cmdOrder" + Tab(0).Control(6)= "chkSynthetic" + Tab(0).Control(7)= "chkHoldPO" + Tab(0).Control(8)= "chkHoldOrders" + Tab(0).Control(9)= "cmdJCSetup" + Tab(0).Control(10)= "cmdCalc" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "cmdExit" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "cmdOrders" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cmdSaveLotInfo" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "txtLathO" + Tab(0).Control(14).Enabled= 0 'False + Tab(0).Control(15)= "txtSandO" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "txtScratchO" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "txtBrownO" + Tab(0).Control(17).Enabled= 0 'False + Tab(0).Control(18)= "txtTextureO" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "txtLathBill" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "cmdAddLot" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "cmdDelLot" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "txtMetal" + Tab(0).Control(23)= "cmdSuperRpt" + Tab(0).Control(23).Enabled= 0 'False + Tab(0).Control(24)= "cmdEdit" + Tab(0).Control(24).Enabled= 0 'False + Tab(0).Control(25)= "txtYardMemo" + Tab(0).Control(26)= "cmdUpCMU" + Tab(0).Control(26).Enabled= 0 'False + Tab(0).Control(27)= "cmdPrintCMU" + Tab(0).Control(27).Enabled= 0 'False + Tab(0).Control(28)= "cmdShowChange" + Tab(0).Control(28).Enabled= 0 'False + Tab(0).Control(29)= "txtLotNotes" + Tab(0).Control(30)= "lblOrderDates" + Tab(0).Control(31)= "lblLathO" + Tab(0).Control(32)= "lblSandO" + Tab(0).Control(33)= "lblScratchO" + Tab(0).Control(34)= "lblBrownO" + Tab(0).Control(35)= "lblTextureO" + Tab(0).Control(36)= "lblLathBill" + Tab(0).Control(37)= "lblMetal" + Tab(0).Control(38)= "lblYardMemo" + Tab(0).Control(39)= "lblDiana" + Tab(0).ControlCount= 40 + TabCaption(1) = "&Super's Orders" + TabPicture(1) = "frmLotInfo.frx":045E + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lstPreOrder" + Tab(1).Control(0).Enabled= 0 'False + Tab(1).Control(1)= "cmdPreOrderPrintPC" + Tab(1).Control(2)= "cmdIssue" + Tab(1).Control(3)= "cmdLFlag" + Tab(1).Control(4)= "txtTake138" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "txtSuperBB" + Tab(1).Control(6)= "txtSuper12" + Tab(1).Control(7)= "txtSuper783" + Tab(1).Control(8)= "txtSuper78" + Tab(1).Control(9)= "txtSuper38" + Tab(1).Control(10)= "txtSuper1383" + Tab(1).Control(11)= "txtSuperRL" + Tab(1).Control(12)= "txtSuperML" + Tab(1).Control(13)= "txtSuperDW" + Tab(1).Control(14)= "txtSuperSP" + Tab(1).Control(15)= "txtCalc138" + Tab(1).Control(15).Enabled= 0 'False + Tab(1).Control(16)= "cmdPreOrderPrintY" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cmdPreOrderPrintS" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "txtSuperNotes" + Tab(1).Control(19)= "cmdLathPay" + Tab(1).Control(20)= "cmdStuccoPay" + Tab(1).Control(21)= "cmdRePrintL" + Tab(1).Control(22)= "lblZMetal" + Tab(1).Control(23)= "lblBB" + Tab(1).Control(24)= "lblTake138" + Tab(1).Control(25)= "lblSuperBB" + Tab(1).Control(26)= "linSO" + Tab(1).Control(27)= "lblSuper12" + Tab(1).Control(28)= "lblSuper783" + Tab(1).Control(29)= "lblSuper78" + Tab(1).Control(30)= "lblSuper38" + Tab(1).Control(31)= "lblSuper138" + Tab(1).Control(32)= "lblSuperML" + Tab(1).Control(33)= "lblSuperRL" + Tab(1).Control(34)= "lblSuperDW" + Tab(1).Control(35)= "lblSuperSP" + Tab(1).Control(36)= "lblSupHelp" + Tab(1).Control(37)= "lblPreOrder" + Tab(1).Control(38)= "lblSuperNotes" + Tab(1).ControlCount= 39 + TabCaption(2) = "&Materials" + TabPicture(2) = "frmLotInfo.frx":047A + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lstLMaterial" + Tab(2).Control(1)= "lstInventory" + Tab(2).Control(1).Enabled= 0 'False + Tab(2).Control(2)= "cmdAddMatrl" + Tab(2).Control(2).Enabled= 0 'False + Tab(2).Control(3)= "cmdSaveMatrl" + Tab(2).Control(4)= "cmdDelMatrl" + Tab(2).Control(4).Enabled= 0 'False + Tab(2).Control(5)= "txtLMDesc" + Tab(2).Control(6)= "txtLMInvNo" + Tab(2).Control(7)= "txtLMQty" + Tab(2).Control(8)= "txtLMLength" + Tab(2).Control(9)= "cboLMDFlag" + Tab(2).Control(10)= "cboLMType" + Tab(2).Control(11)= "cboLMMetal" + Tab(2).Control(12)= "txtLMBalance" + Tab(2).Control(12).Enabled= 0 'False + Tab(2).Control(13)= "cmdInventory" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "cmdFindInv" + Tab(2).Control(15)= "chkChange" + Tab(2).Control(16)= "lblLMDesc" + Tab(2).Control(17)= "lblLMInvNo" + Tab(2).Control(18)= "lblQty" + Tab(2).Control(19)= "lblLMDFlag" + Tab(2).Control(20)= "lblLMType" + Tab(2).Control(21)= "lblLMetal" + Tab(2).Control(22)= "lblLMLength" + Tab(2).Control(23)= "lblOrderBalance" + Tab(2).Control(24)= "lblMatInst" + Tab(2).ControlCount= 25 + TabCaption(3) = "Op&tions" + TabPicture(3) = "frmLotInfo.frx":0496 + Tab(3).ControlEnabled= 0 'False + Tab(3).Control(0)= "lblBAmt" + Tab(3).Control(1)= "lblBillingAmt" + Tab(3).Control(2)= "lblSelectOpt" + Tab(3).Control(3)= "lblLOMLength" + Tab(3).Control(4)= "lblLOMetal" + Tab(3).Control(5)= "lblLOMType" + Tab(3).Control(6)= "lblLOMDFlag" + Tab(3).Control(7)= "lblLOMQty" + Tab(3).Control(8)= "lblLOMInvNo" + Tab(3).Control(9)= "lblLOMDesc" + Tab(3).Control(10)= "lblLOTexture" + Tab(3).Control(11)= "lblLOFAdj" + Tab(3).Control(12)= "lblLOFin2" + Tab(3).Control(13)= "lblLOYdge" + Tab(3).Control(14)= "lblLODesc" + Tab(3).Control(15)= "lblLOptions" + Tab(3).Control(16)= "lblPOptions" + Tab(3).Control(17)= "lblOStone" + Tab(3).Control(18)= "lblOptNum" + Tab(3).Control(19)= "txtNote" + Tab(3).Control(20)= "txtNote2" + Tab(3).Control(21)= "cboLOMetal" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "cboLOMType" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "cboLOMDFlag" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "txtLOMLength" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "txtLOMQty" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "txtLOMInvNo" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "txtLOMDesc" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "txtLOTexture" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "txtLOFoam" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "txtLOFin2" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "txtLOYdge" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "txtLODesc" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lstLOptions" + Tab(3).Control(34)= "cmdOptDel" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "cmdOptAdd" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lstPOptions" + Tab(3).Control(37)= "chkOStone" + Tab(3).Control(38)= "txtOSt_SqFt" + Tab(3).Control(39)= "lstOptMatrl" + Tab(3).ControlCount= 40 + TabCaption(4) = "&Lath Orders" + TabPicture(4) = "frmLotInfo.frx":04B2 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lstYard" + Tab(4).Control(0).Enabled= 0 'False + Tab(4).Control(1)= "lstLath" + Tab(4).Control(1).Enabled= 0 'False + Tab(4).Control(2)= "lblYardOrd" + Tab(4).Control(3)= "lblLathOrd" + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco &Orders" + TabPicture(5) = "frmLotInfo.frx":04CE + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lstScratch" + Tab(5).Control(0).Enabled= 0 'False + Tab(5).Control(1)= "lstBrown" + Tab(5).Control(1).Enabled= 0 'False + Tab(5).Control(2)= "lstTexture" + Tab(5).Control(2).Enabled= 0 'False + Tab(5).Control(3)= "lblScrOrd" + Tab(5).Control(4)= "lblBrnOrd" + Tab(5).Control(5)= "lblTexOrd" + Tab(5).ControlCount= 6 + TabCaption(6) = "&Purchase Orders" + TabPicture(6) = "frmLotInfo.frx":04EA + Tab(6).ControlEnabled= -1 'True + Tab(6).Control(0)= "lblPayYds" + Tab(6).Control(0).Enabled= 0 'False + Tab(6).Control(1)= "lblOptMatPrice" + Tab(6).Control(1).Enabled= 0 'False + Tab(6).Control(2)= "lblPODate" + Tab(6).Control(2).Enabled= 0 'False + Tab(6).Control(3)= "lblPOMType" + Tab(6).Control(3).Enabled= 0 'False + Tab(6).Control(4)= "lblPODFlag" + Tab(6).Control(4).Enabled= 0 'False + Tab(6).Control(5)= "lblPOQty" + Tab(6).Control(5).Enabled= 0 'False + Tab(6).Control(6)= "lblDescription" + Tab(6).Control(6).Enabled= 0 'False + Tab(6).Control(7)= "lblInvNo" + Tab(6).Control(7).Enabled= 0 'False + Tab(6).Control(8)= "lblPONum" + Tab(6).Control(8).Enabled= 0 'False + Tab(6).Control(9)= "lblDesc" + Tab(6).Control(9).Enabled= 0 'False + Tab(6).Control(10)= "lblPO" + Tab(6).Control(10).Enabled= 0 'False + Tab(6).Control(11)= "lblPONotes" + Tab(6).Control(11).Enabled= 0 'False + Tab(6).Control(12)= "lblPOMaterials" + Tab(6).Control(12).Enabled= 0 'False + Tab(6).Control(13)= "lblIssueTo" + Tab(6).Control(13).Enabled= 0 'False + Tab(6).Control(14)= "lblPOType" + Tab(6).Control(14).Enabled= 0 'False + Tab(6).Control(15)= "lblPayType" + Tab(6).Control(15).Enabled= 0 'False + Tab(6).Control(16)= "cmdPrintPOPay" + Tab(6).Control(16).Enabled= 0 'False + Tab(6).Control(17)= "txtPay" + Tab(6).Control(17).Enabled= 0 'False + Tab(6).Control(18)= "fraPO" + Tab(6).Control(18).Enabled= 0 'False + Tab(6).Control(19)= "cmdPrintForm" + Tab(6).Control(19).Enabled= 0 'False + Tab(6).Control(20)= "txtPOPrice" + Tab(6).Control(20).Enabled= 0 'False + Tab(6).Control(21)= "txtPODate" + Tab(6).Control(21).Enabled= 0 'False + Tab(6).Control(22)= "txtPODesc" + Tab(6).Control(22).Enabled= 0 'False + Tab(6).Control(23)= "txtPOMatDesc" + Tab(6).Control(23).Enabled= 0 'False + Tab(6).Control(24)= "cmdPrintPO" + Tab(6).Control(24).Enabled= 0 'False + Tab(6).Control(25)= "cmdDelPOMat" + Tab(6).Control(25).Enabled= 0 'False + Tab(6).Control(26)= "cmdSavePOMat" + Tab(6).Control(26).Enabled= 0 'False + Tab(6).Control(27)= "cmdAddPOMat" + Tab(6).Control(27).Enabled= 0 'False + Tab(6).Control(28)= "cmdFindPOMat" + Tab(6).Control(28).Enabled= 0 'False + Tab(6).Control(29)= "cboPOMType" + Tab(6).Control(29).Enabled= 0 'False + Tab(6).Control(30)= "cboPODFlag" + Tab(6).Control(30).Enabled= 0 'False + Tab(6).Control(31)= "txtPOQty" + Tab(6).Control(31).Enabled= 0 'False + Tab(6).Control(32)= "txtPOInvNo" + Tab(6).Control(32).Enabled= 0 'False + Tab(6).Control(33)= "cmdDelPO" + Tab(6).Control(33).Enabled= 0 'False + Tab(6).Control(34)= "cmdSavePO" + Tab(6).Control(34).Enabled= 0 'False + Tab(6).Control(35)= "cmdAddPO" + Tab(6).Control(35).Enabled= 0 'False + Tab(6).Control(36)= "txtIssueTo" + Tab(6).Control(36).Enabled= 0 'False + Tab(6).Control(37)= "txtPONum" + Tab(6).Control(37).Enabled= 0 'False + Tab(6).Control(38)= "txtPONotes" + Tab(6).Control(38).Enabled= 0 'False + Tab(6).Control(39)= "lstPO" + Tab(6).Control(39).Enabled= 0 'False + Tab(6).Control(40)= "cboPOType" + Tab(6).Control(40).Enabled= 0 'False + Tab(6).Control(41)= "txtPOType" + Tab(6).Control(41).Enabled= 0 'False + Tab(6).Control(42)= "txtPayType" + Tab(6).Control(42).Enabled= 0 'False + Tab(6).Control(43)= "lstLOOKUP" + Tab(6).Control(43).Enabled= 0 'False + Tab(6).Control(44)= "lstPOMaterial" + Tab(6).Control(44).Enabled= 0 'False + Tab(6).ControlCount= 45 + Begin LpLib.fpList lstPreOrder + Height = 1425 + Left = -69255 + TabIndex = 249 + Top = 2160 + Width = 5445 + _Version = 196608 + _ExtentX = 9604 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0506 + End + Begin LpLib.fpList lstPOMaterial + Height = 1260 + Left = 1215 + TabIndex = 248 + Top = 4245 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 2222 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 90 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":08F5 + End + Begin LpLib.fpList lstLOOKUP + Height = 2445 + Left = 7800 + TabIndex = 247 + Top = 2700 + Visible = 0 'False + Width = 3555 + _Version = 196608 + _ExtentX = 6271 + _ExtentY = 4313 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0CEE + End + Begin LpLib.fpList lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 246 + Top = 4680 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":1057 + End + Begin LpLib.fpList lstLMaterial + Height = 4590 + Left = -74880 + TabIndex = 245 + Top = 810 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 8096 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":14D6 + End + Begin LpLib.fpList lstInventory + Height = 2070 + Left = -66840 + TabIndex = 244 + Top = 2655 + Visible = 0 'False + Width = 3165 + _Version = 196608 + _ExtentX = 5583 + _ExtentY = 3651 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 225 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":1947 + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 255 + Left = -74460 + TabIndex = 238 + Top = 3345 + Width = 1155 + End + Begin VB.CommandButton cmdPreOrderPrintPC + Caption = "Print PreCast PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 236 + Top = 1380 + Width = 1335 + End + Begin VB.CommandButton cmdIssue + Caption = "RePrint &Yard Ticket" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 233 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkNoPay + Alignment = 1 'Right Justify + BackColor = &H00C0C0C0& + Caption = "No Pay Sheets Issued" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -72780 + TabIndex = 232 + Top = 3420 + Width = 2295 + End + Begin VB.CheckBox chkOthers + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 255 + Left = -72060 + TabIndex = 231 + Top = 3180 + Width = 1575 + End + Begin VB.CommandButton cmdPrint + Caption = "All Orders Printed" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -71985 + TabIndex = 230 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 300 + Left = -64755 + TabIndex = 229 + Top = 675 + Width = 975 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 240 + Left = -68475 + TabIndex = 227 + Top = 735 + Width = 1890 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = -71820 + TabIndex = 224 + Top = 2925 + Width = 1335 + End + Begin VB.TextBox txtPayType + Height = 315 + Left = 3105 + MaxLength = 1 + TabIndex = 55 + Top = 2295 + Width = 375 + End + Begin VB.CommandButton cmdOrder + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69480 + TabIndex = 219 + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtPOType + Height = 285 + Left = 4020 + TabIndex = 218 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 615 + End + Begin VB.ComboBox cboPOType + Height = 315 + ItemData = "frmLotInfo.frx":1CAF + Left = 2700 + List = "frmLotInfo.frx":1CBF + Style = 2 'Dropdown List + TabIndex = 52 + Top = 1200 + Width = 1995 + End + Begin VB.CheckBox chkSynthetic + Alignment = 1 'Right Justify + Caption = "Synthetic" + Height = 195 + Left = -72900 + TabIndex = 214 + Top = 2940 + Width = 975 + End + Begin VB.CommandButton cmdLFlag + Caption = "Set Lath Flags" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 213 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkHoldPO + Alignment = 1 'Right Justify + Caption = "Hold PO's" + Height = 255 + Left = -74460 + TabIndex = 210 + Top = 3120 + Width = 1155 + End + Begin VB.CheckBox chkHoldOrders + Alignment = 1 'Right Justify + Caption = "Hold Orders" + ForeColor = &H00404040& + Height = 255 + Left = -74460 + MaskColor = &H000000FF& + TabIndex = 209 + Top = 2880 + Width = 1155 + End + Begin VB.CommandButton cmdJCSetup + Caption = "Setup JC Record" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69480 + TabIndex = 208 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = -73080 + TabIndex = 134 + TabStop = 0 'False + Top = 1680 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 124 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = -73065 + MaxLength = 4 + TabIndex = 125 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 126 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 127 + Top = 4155 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 128 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 129 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 130 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 131 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 132 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 133 + Top = 4740 + Width = 795 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfo.frx":1CFA + Left = -74760 + List = "frmLotInfo.frx":1D01 + TabIndex = 123 + Top = 1020 + Width = 3095 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + TabIndex = 122 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 121 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 120 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 119 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -67320 + TabIndex = 118 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = 240 + Sorted = -1 'True + TabIndex = 117 + Top = 1080 + Width = 885 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = 1200 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 57 + Top = 2700 + Width = 3915 + End + Begin VB.TextBox txtPONum + BackColor = &H00E0E0E0& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2700 + TabIndex = 116 + TabStop = 0 'False + Top = 840 + Width = 975 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = 2700 + MaxLength = 50 + TabIndex = 53 + Top = 1560 + Width = 3735 + End + Begin VB.CommandButton cmdAddPO + Caption = "&New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 115 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdSavePO + Caption = "S&ave PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7740 + TabIndex = 59 + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdDelPO + Caption = "D&elete PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8880 + TabIndex = 114 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66240 + TabIndex = 113 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -64920 + TabIndex = 112 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 111 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 109 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 110 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68115 + MaxLength = 50 + TabIndex = 100 + Top = 705 + Width = 4275 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 101 + Top = 1065 + Width = 2625 + End + Begin VB.TextBox txtLMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 102 + Top = 1425 + Width = 915 + End + Begin VB.TextBox txtLMLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 2 + TabIndex = 106 + Top = 3060 + Width = 915 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfo.frx":1D12 + Left = -68100 + List = "frmLotInfo.frx":1D1C + Style = 2 'Dropdown List + TabIndex = 103 + Top = 1845 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfo.frx":1D30 + Left = -68100 + List = "frmLotInfo.frx":1D32 + Style = 2 'Dropdown List + TabIndex = 104 + Top = 2265 + Width = 1215 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfo.frx":1D34 + Left = -68100 + List = "frmLotInfo.frx":1D3E + Style = 2 'Dropdown List + TabIndex = 105 + Top = 2655 + Width = 1215 + End + Begin VB.TextBox txtLMBalance + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 107 + TabStop = 0 'False + Top = 3465 + Width = 915 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = -71640 + TabIndex = 99 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLODesc + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 94 + TabStop = 0 'False + Top = 1020 + Width = 2835 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 98 + TabStop = 0 'False + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 97 + TabStop = 0 'False + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 96 + TabStop = 0 'False + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOTexture + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 95 + TabStop = 0 'False + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOMDesc + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 93 + TabStop = 0 'False + Top = 3135 + Width = 4155 + End + Begin VB.TextBox txtLOMInvNo + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 92 + TabStop = 0 'False + Top = 3480 + Width = 2625 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 91 + TabStop = 0 'False + Top = 3810 + Width = 915 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 90 + TabStop = 0 'False + Top = 5160 + Width = 915 + End + Begin VB.ComboBox cboLOMDFlag + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 89 + TabStop = 0 'False + Text = "cboLOMDFlag" + Top = 4155 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmLotInfo.frx":1D4F + Left = -68100 + List = "frmLotInfo.frx":1D51 + TabIndex = 88 + TabStop = 0 'False + Text = "cboLOMType" + Top = 4500 + Width = 1155 + End + Begin VB.ComboBox cboLOMetal + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 87 + TabStop = 0 'False + Text = "cboLOMetal" + Top = 4830 + Width = 1155 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 86 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 85 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 84 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 83 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 82 + TabStop = 0 'False + Top = 4440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtLathO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 81 + TabStop = 0 'False + Top = 1080 + Width = 1335 + End + Begin VB.TextBox txtSandO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 80 + TabStop = 0 'False + Top = 1422 + Width = 1335 + End + Begin VB.TextBox txtScratchO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 79 + TabStop = 0 'False + Top = 1764 + Width = 1335 + End + Begin VB.TextBox txtBrownO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 78 + TabStop = 0 'False + Top = 2106 + Width = 1335 + End + Begin VB.TextBox txtTextureO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 77 + TabStop = 0 'False + Top = 2448 + Width = 1335 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = -65430 + Picture = "frmLotInfo.frx":1D53 + Style = 1 'Graphical + TabIndex = 76 + Top = 1035 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtLathBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + MaxLength = 10 + TabIndex = 75 + TabStop = 0 'False + Top = 2790 + Width = 1335 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add New Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 74 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdDelLot + Caption = "Delete Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 73 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtCalc138 + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -69720 + TabIndex = 72 + TabStop = 0 'False + Top = 2400 + Width = 435 + End + Begin VB.CheckBox chkChange + Alignment = 1 'Right Justify + Caption = "Recalc Flag:" + Height = 255 + Left = -69180 + TabIndex = 108 + Top = 3885 + Width = 1455 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 71 + Top = 3480 + Width = 1335 + End + Begin VB.TextBox txtPOInvNo + Height = 315 + Left = 6240 + MaxLength = 18 + TabIndex = 63 + Top = 2625 + Width = 2625 + End + Begin VB.TextBox txtPOQty + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 4 + TabIndex = 66 + Top = 3360 + Width = 915 + End + Begin VB.ComboBox cboPODFlag + Height = 315 + ItemData = "frmLotInfo.frx":2195 + Left = 6240 + List = "frmLotInfo.frx":219F + Style = 2 'Dropdown List + TabIndex = 67 + Top = 3720 + Width = 1215 + End + Begin VB.ComboBox cboPOMType + Height = 315 + ItemData = "frmLotInfo.frx":21B3 + Left = 6240 + List = "frmLotInfo.frx":21B5 + Style = 2 'Dropdown List + TabIndex = 68 + Top = 4080 + Width = 1215 + End + Begin VB.CommandButton cmdFindPOMat + Height = 435 + Left = 8910 + Picture = "frmLotInfo.frx":21B7 + Style = 1 'Graphical + TabIndex = 64 + Top = 2505 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdAddPOMat + Caption = "&Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 62 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdSavePOMat + Caption = "S&ave Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7740 + TabIndex = 70 + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdDelPOMat + Caption = "D&elete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8880 + TabIndex = 61 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPO + Caption = "P&rint PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10020 + TabIndex = 60 + TabStop = 0 'False + Top = 960 + Width = 1095 + End + Begin VB.TextBox txtPOMatDesc + Height = 315 + Left = 6240 + MaxLength = 50 + TabIndex = 65 + Top = 3000 + Width = 4275 + End + Begin VB.TextBox txtPODesc + Height = 315 + Left = 2700 + MaxLength = 50 + TabIndex = 54 + Top = 1920 + Width = 3735 + End + Begin VB.TextBox txtPODate + Alignment = 1 'Right Justify + Height = 315 + Left = 5400 + MaxLength = 10 + TabIndex = 58 + Top = 1200 + Width = 1035 + End + Begin VB.TextBox txtPOPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + TabIndex = 69 + Top = 4440 + Width = 975 + End + Begin VB.CommandButton cmdPrintForm + Caption = "Print Form" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10020 + TabIndex = 51 + TabStop = 0 'False + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSuperRpt + Caption = "Print Super's Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -72000 + TabIndex = 50 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPreOrderPrintY + Caption = "Print Yard PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 49 + TabStop = 0 'False + Top = 720 + Width = 1335 + End + Begin VB.CommandButton cmdPreOrderPrintS + Caption = "Print Supplier PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 48 + TabStop = 0 'False + Top = 1380 + Width = 1335 + End + Begin VB.Frame fraPO + Height = 390 + Left = 6525 + TabIndex = 43 + Top = 2100 + Width = 4830 + Begin VB.OptionButton optStone + Caption = "Stone" + Height = 255 + Left = 3240 + TabIndex = 235 + Top = 120 + Width = 795 + End + Begin VB.OptionButton optPreOrder + Caption = "PreOrder" + Height = 255 + Left = 2280 + TabIndex = 222 + Top = 120 + Width = 975 + End + Begin VB.OptionButton optLath + Caption = "Lath" + Height = 255 + Left = 60 + TabIndex = 47 + Top = 120 + Width = 675 + End + Begin VB.OptionButton optStucco + Caption = "Stucco" + Height = 255 + Left = 720 + TabIndex = 46 + Top = 120 + Width = 855 + End + Begin VB.OptionButton optSand + Caption = "Sand" + Height = 255 + Left = 1560 + TabIndex = 45 + Top = 120 + Width = 735 + End + Begin VB.OptionButton optNone + Caption = "None" + Height = 255 + Left = 3990 + TabIndex = 44 + Top = 120 + Value = -1 'True + Width = 735 + End + End + Begin VB.TextBox txtSuperNotes + Height = 1275 + Left = -69240 + MaxLength = 255 + MultiLine = -1 'True + TabIndex = 144 + Top = 4200 + Width = 5445 + End + Begin VB.CommandButton cmdEdit + Caption = "Edit Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 42 + TabStop = 0 'False + Top = 2160 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtYardMemo + Height = 1575 + Left = -74520 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 41 + Top = 3900 + Width = 5355 + End + Begin VB.CommandButton cmdUpCMU + Caption = "Update CMU Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 40 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPrintCMU + Caption = "Print CMU Pay Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 39 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtPay + Alignment = 1 'Right Justify + Height = 315 + Left = 4785 + TabIndex = 56 + Top = 2295 + Width = 675 + End + Begin VB.CommandButton cmdPrintPOPay + Caption = "Print Pay Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6240 + TabIndex = 38 + Top = 4785 + Width = 1035 + End + Begin VB.CommandButton cmdLathPay + Caption = "RePrint Lath Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 37 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdStuccoPay + Caption = "RePrint Stucco Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67980 + TabIndex = 36 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdRePrintL + Caption = "ReSet Lath Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67980 + TabIndex = 35 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdShowChange + Caption = "Show Change Log" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69480 + TabIndex = 34 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtNote2 + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 33 + Top = 3060 + Width = 5475 + End + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 32 + Top = 3840 + Width = 5475 + End + Begin VB.TextBox txtLotNotes + Height = 1575 + Left = -69120 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 31 + Top = 3900 + Width = 5355 + End + Begin VB.Label lblOptNum + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -70500 + TabIndex = 237 + Top = 720 + Width = 1680 + End + Begin VB.Label lblZMetal + Alignment = 2 'Center + Caption = "This House Uses Z-Metal" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = -74940 + TabIndex = 234 + Top = 5160 + Visible = 0 'False + Width = 5655 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Opt. SqFt:" + Height = 195 + Left = -66540 + TabIndex = 228 + Top = 750 + Width = 1740 + End + Begin VB.Label lblPayType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Type:" + Height = 195 + Left = 2310 + TabIndex = 223 + Top = 2370 + Width = 720 + End + Begin VB.Label lblPOType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Type:" + Height = 195 + Left = 1995 + TabIndex = 217 + Top = 1260 + Width = 675 + End + Begin VB.Label lblBB + Alignment = 2 'Center + Caption = "This House Uses R-Guard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 675 + Left = -72180 + TabIndex = 216 + Top = 1380 + Width = 2475 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = -74895 + TabIndex = 204 + Top = 1740 + Width = 1590 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard/R-Guard:" + Height = 195 + Left = -74835 + TabIndex = 203 + Top = 2400 + Width = 1530 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = -75000 + X2 = -69660 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = -74040 + TabIndex = 202 + Top = 3000 + Width = 735 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = -74160 + TabIndex = 201 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 200 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 199 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = -71880 + TabIndex = 198 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Enabled = 0 'False + Height = 195 + Left = -71580 + TabIndex = 197 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Enabled = 0 'False + Height = 195 + Left = -71460 + TabIndex = 196 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Enabled = 0 'False + Height = 195 + Left = -71340 + TabIndex = 195 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = -71700 + TabIndex = 194 + Top = 4800 + Width = 915 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = 1260 + TabIndex = 193 + Top = 1620 + Width = 1410 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1200 + TabIndex = 192 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1200 + TabIndex = 191 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 240 + TabIndex = 190 + Top = 720 + Width = 1815 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 189 + Top = 840 + Width = 1200 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 188 + Top = 840 + Width = 1065 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Texture Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67260 + TabIndex = 187 + Top = 840 + Width = 1185 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 186 + Top = 900 + Width = 930 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Supplier Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 185 + Top = 900 + Width = 1665 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfo.frx":25F9 + Height = 750 + Left = -74760 + TabIndex = 184 + Top = 705 + Width = 5115 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -68700 + TabIndex = 183 + Top = 1905 + Width = 2715 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69000 + TabIndex = 182 + Top = 765 + Width = 840 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 181 + Top = 1110 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 180 + Top = 1515 + Width = 630 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 179 + Top = 1905 + Width = 960 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 178 + Top = 2310 + Width = 1005 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 177 + Top = 2715 + Width = 780 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 176 + Top = 3120 + Width = 975 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipped So Far:" + Height = 195 + Left = -69285 + TabIndex = 175 + Top = 3525 + Width = 1140 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 174 + Top = 720 + Width = 1095 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71580 + TabIndex = 173 + Top = 720 + Width = 990 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68100 + TabIndex = 172 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = -68415 + TabIndex = 171 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -68265 + TabIndex = 170 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = -68475 + TabIndex = 169 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = -68415 + TabIndex = 168 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 167 + Top = 3135 + Width = 840 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 166 + Top = 3480 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = -68805 + TabIndex = 165 + Top = 3840 + Width = 660 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 164 + Top = 4185 + Width = 960 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 163 + Top = 4530 + Width = 1005 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68940 + TabIndex = 162 + Top = 4890 + Width = 780 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 161 + Top = 5220 + Width = 975 + End + Begin VB.Label lblMatInst + Caption = $"frmLotInfo.frx":26E5 + Height = 1200 + Left = -66645 + TabIndex = 160 + Top = 1485 + Visible = 0 'False + Width = 2835 + End + Begin VB.Label lblOrderDates + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -65100 + TabIndex = 159 + Top = 780 + Width = 1275 + End + Begin VB.Label lblLathO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath:" + Height = 195 + Left = -65535 + TabIndex = 158 + Top = 1140 + Width = 360 + End + Begin VB.Label lblSandO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = -65595 + TabIndex = 157 + Top = 1482 + Width = 420 + End + Begin VB.Label lblScratchO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch:" + Height = 195 + Left = -65775 + TabIndex = 156 + Top = 1824 + Width = 600 + End + Begin VB.Label lblBrownO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown:" + Height = 195 + Left = -65670 + TabIndex = 155 + Top = 2166 + Width = 495 + End + Begin VB.Label lblTextureO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = -65760 + TabIndex = 154 + Top = 2508 + Width = 585 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone:" + Height = 195 + Left = -65640 + TabIndex = 153 + Top = 2850 + Width = 465 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Feet:" + Height = 195 + Left = -66000 + TabIndex = 152 + Top = 3540 + Width = 795 + End + Begin VB.Label lblSelectOpt + Caption = "Double Click the desired option to selected it for Add or Delete." + Height = 375 + Left = -66060 + TabIndex = 151 + Top = 2100 + Width = 2235 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = 1515 + TabIndex = 150 + Top = 1980 + Width = 1155 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO #:" + Height = 195 + Left = 2250 + TabIndex = 149 + Top = 900 + Width = 420 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = 5640 + TabIndex = 148 + Top = 2700 + Width = 525 + End + Begin VB.Label lblDescription + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 5325 + TabIndex = 147 + Top = 3060 + Width = 840 + End + Begin VB.Label lblPOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = 5535 + TabIndex = 146 + Top = 3420 + Width = 630 + End + Begin VB.Label lblPODFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = 5205 + TabIndex = 145 + Top = 3780 + Width = 1020 + End + Begin VB.Label lblPOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 5220 + TabIndex = 143 + Top = 4140 + Width = 1005 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = 4740 + TabIndex = 142 + Top = 1260 + Width = 660 + End + Begin VB.Label lblBillingAmt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -64980 + TabIndex = 141 + Top = 2700 + Width = 915 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + Caption = "$:" + Height = 255 + Left = -65280 + TabIndex = 140 + Top = 2760 + Width = 195 + End + Begin VB.Label lblSuperNotes + AutoSize = -1 'True + Caption = "Notes to Super:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69240 + TabIndex = 139 + Top = 3960 + Width = 1350 + End + Begin VB.Label lblYardMemo + AutoSize = -1 'True + Caption = "Yard Order Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -74460 + TabIndex = 138 + Top = 3600 + Width = 1830 + End + Begin VB.Label lblOptMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = 5460 + TabIndex = 137 + Top = 4500 + Width = 765 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = 3975 + TabIndex = 136 + Top = 2385 + Width = 765 + End + Begin VB.Label lblDiana + AutoSize = -1 'True + Caption = "Lot Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -69000 + TabIndex = 135 + Top = 3600 + Width = 1065 + End + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Foam Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 243 + Top = 0 + Width = 1980 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Labor Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 242 + Top = 315 + Width = 1980 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Wire Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 241 + Top = 615 + Width = 1980 + End + Begin VB.Label lblStoneSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Stone Sq. Ft.:" + Height = 285 + Left = 6525 + TabIndex = 240 + Top = 915 + Width = 1980 + End + Begin VB.Label lblPaintSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Paint Sq Ft: " + Height = 285 + Left = 6525 + TabIndex = 239 + Top = 1230 + Width = 1980 + End + Begin VB.Label lblStone + Alignment = 2 'Center + Caption = "Stone Veneer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8640 + TabIndex = 225 + Top = 1440 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSandShip + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5580 + TabIndex = 221 + Top = 780 + Width = 420 + End + Begin VB.Label lblSZone + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6060 + TabIndex = 220 + Top = 780 + Width = 315 + End + Begin VB.Label lblSynthetic + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Synthetic Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8970 + TabIndex = 215 + Top = 1440 + Visible = 0 'False + Width = 2475 + End + Begin VB.Label lblFirst + Alignment = 2 'Center + Caption = "First Time This Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 8640 + TabIndex = 212 + Top = 1800 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 4620 + TabIndex = 205 + Top = 840 + Width = 480 + End + Begin VB.Label lblJC + Alignment = 1 'Right Justify + Caption = "Job Cost:" + Height = 375 + Left = 2280 + TabIndex = 29 + Top = 2160 + Width = 375 + End + Begin VB.Label lblPlan + AutoSize = -1 'True + Caption = "Double Click the Desired Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8700 + TabIndex = 27 + Top = 840 + Visible = 0 'False + Width = 2565 + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 9000 + TabIndex = 25 + Top = 2220 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 23 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " Plan Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3900 + TabIndex = 21 + Top = 1245 + Width = 1275 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 17 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 16 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 15 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 14 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 13 + Top = 1560 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 12 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1200 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSPOpt2 As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset +Dim moRSPO As Recordset +Dim moRSPOMAT As Recordset +Dim moRSMemo As Recordset +Dim moRSPay As Recordset +Dim moRSInvINFO As Recordset + +Dim mboolNOPRECAST As Boolean, mboolNOPREORDER As Boolean, mboolORCHARD As Boolean +Dim mboolNOTSUPPLIER As Boolean, mstrMTYPE As String, mstrORDERNUM As String +Dim mboolLATHC As Boolean, mboolSTUCCOC As Boolean, mintPAYCREW As Integer, mboolSTPAY As Boolean +Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String, mstrBEGQTY As String, mstrENDQTY As String +Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean +Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean +Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngARINVID As Long +Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mboolWRAP As Boolean +Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngINVID As Long, mstrTAXCODE As String +Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mintOpenPR As Integer +Dim mlngFind As Long, mintBOOKMARK As Integer, mstrWireAdj As String ', mboolNoPrice As Boolean +Dim mboolST_ADJ As Boolean, mintST_ADJ As Integer, mboolDNU As Boolean +Dim mintTake138 As Integer, mintPONUM As Long, mbool2Dates As Boolean, mboolSTONE3 As Boolean 'For Printing Invoices +Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String, mboolSTONE2 As Boolean +Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolCERTIFIED As Boolean, mboolHLNotes As Boolean +Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolPAINT As Boolean, mboolRPSTUCCO As Byte +Dim mboolADD As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String +Dim msglPAYRT1, msglPAYRT2 As Single, mstrTexture As String, mstrCREWTYPE As String, mstrWORK As String + +Private Sub CalcPayAMT() +Dim oRSPS, oRSL, oRSCR As Recordset +Dim strSQLPS, strSQLL, strSQLCR As String +Dim intPAYYDS As Integer, intMETAL As Integer, intFIN2 As Integer +Dim strFINISH As String, strTYPE As String, strWORK As String + + On Error GoTo Error_EH + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module CalcPayAMT" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub GetPONUM() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT Lot_ID, M_Type, D_Flag, PO_NUM FROM tblORDERS WHERE Lot_ID = " & gintLOTID & " AND D_Flag = 'Y' AND M_Type = '" & mstrMTYPE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrORDERNUM = Field2Str(oRS!po_num) + End If + + Exit Sub +End Sub + +Private Sub GetPayRates() +Dim oRSCR As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblCREWRATE WHERE not INACTIVE AND CREW_ID = " & mintPAYCREW & " AND PROJ_ID = " & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRSCR.EOF Then + strSQL = "SELECT * FROM tblCREWRATE WHERE CREW_ID = " & mintPAYCREW & " AND PROJ_ID = 99999" ' & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If +' Else + If Not oRSCR.EOF Then + If mstrCREWTYPE = "L" Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SK" Or mstrTexture = "RL" Or mstrTexture = "CS" Or mstrTexture = "RS") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SA" Or mstrTexture = "S2" Or mstrTexture = "S3" Or mstrTexture = "RD" Or mstrTexture = "S4") Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "DA" Then + msglPAYRT1 = Field2Str2(oRSCR!dash) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "MN" Or mstrTexture = "RM") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QU" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QS" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SM" Then + msglPAYRT1 = Field2Str2(oRSCR!Smooth) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "DF" Or mstrTexture = "SS" Or mstrTexture = "RF") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SC" Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "M2" Or mstrTexture = "M3" Or mstrTexture = "MF") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + +' If mstrCREWTYPE = "V" Then +' msglPAYRT1 = Field2Str2(oRSCR!Lath_Skip) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + + End If +' Else +' End If + +End Sub + +Private Sub SetStone() +Dim strSQL As String + +' moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbTrue + moRS!c_flg = vbTrue + moRS!t_flg = vbTrue + moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub SetPreOrder() +Dim strSQL As String + +' moRS!l_FLG = "P" + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null +' moRS!a_flg = vbTrue +' moRS!b_flg = vbTrue +' moRS!c_flg = vbTrue +' moRS!t_flg = vbTrue +' moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub PaintFix() +Dim strResponse As String + strResponse = Field2Str2(moRS!PNT_SQFT) + strResponse = Field2Str2(InputBox("Enter The Correct Square Footage For The Paint", "Correct Paint", strResponse)) + If strResponse = "" Or strResponse = 0 Then + Exit Sub + End If + moRS!PNT_SQFT = Field2Str2(strResponse) + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + moRS.Update + Call FormShow + +End Sub + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then + Do Until oRS.EOF + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + Loop +' End If + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub RePrintLath() 'Allows a lath order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint Lath") + + moRS!l_FLG = Null +' moRS!a_FLG = Null +' moRS!b_FLG = Null +' moRS!t_FLG = Null + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null + moRS!lorder = "12/31/2030" + moRS!Border = Null + moRS!TORDER = Null + moRS!forder = Null + moRS!corder = Null + moRS!SORDER = Null + moRS!VOrder = Null + moRS!PRNT_L = Null +' moRS!Prnt_S = Null + moRS!pmetal = 0 + moRS!pylath = 0 + moRS!pystucco = 0 + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!o_qty = 0 +' oRS!d_flag = "X" +' oRS!ar_trans = vbChecked +' oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID + goConn.Execute strSQL + + Call LotRePrinted +End Sub + +Private Sub cboPOType_LostFocus() + If cboPOType.ListIndex = -1 Then + cboPOType.ListIndex = 0 + End If + txtPOType = Left(cboPOType.Text, 1) + gstrPO = txtPOType + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + End Select + +End Sub + +Private Sub chkHoldOrders_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkHoldPO_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkOthers_Click() + cmdSaveLotInfo.Enabled = True + +End Sub + +Private Sub chkSplit_Click() + cmdSaveLotInfo.Enabled = True +' lblSynthetic.Visible = True + If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkPaint_Click() + If mboolFRMLOAD Then + cmdSaveLotInfo.Enabled = True + moRS!PNT_FLG = chkPaint + Call PaintFix + End If + mboolFRMLOAD = True +End Sub + +Private Sub chkStone_Click() + If chkStone Then + cmdSaveLotInfo.Enabled = True + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + lblStone.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblStone.Visible = False + lblStoneSqFt.Caption = "Stone Square Ft.: 0" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + End If + +End Sub + +Private Sub chkSynthetic_Click() + cmdSaveLotInfo.Enabled = True + If chkSynthetic Then + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = False + End If + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + End If + +End Sub + +Private Sub cmdAddPOMat_Click() + Call POMatClear + gconACTION = 0 + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPODate.Enabled = False + txtPODesc.Enabled = False + txtIssueTo.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + mboolAdding = True + txtPOInvNo.SetFocus + +End Sub + +Private Sub cmdBrownPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String, intTCPAY As Integer +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mintPAYCREW = 0 + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!BCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!BCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + '***** Moved to after printing stucco Pay Sheets -- REMOVE TWO ' MARKS TO USE THIS AGAIN +''' If chkSynthetic Then +'' If boolCOMPLETE Then +''' moRS!t_flg = vbTrue +''' moRS.Update +''' If Not moRS!Split Then +'' If Not mboolSPLIT Then +'' If Not moRSProj!bill Then +'' Call PrintStuccoInv +'' Else +'' Call PrintCompleteInv +'' End If +'' boolFPRINT = False +'' End If +'' End If +'' If boolFPRINT Then +''' moRS!t_flg = vbTrue +''' moRS.Update +'' If Not moRSProj!bill Then +'' Call PrintStuccoInv +'' Else +'' Call PrintCompleteInv +'' End If +'' End If +''' End If + + '***************Start of Print Stucco Pay Sheets copied from Lath Order + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +' gintCOPY = 1 + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + ' gintCOPY = 4 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay + End If + crOrder.Reset + gintCOPY = 1 + Else + If moRS!texture <> "SB" Then +' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay + End If + crOrder.Reset + gintCOPY = 1 + ElseIf moRS!texture = "SF" Then + MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 1 +' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 + Call PrintStuccoStone + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 1 +' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 + Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 + End If + End If + Else + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 1 + intTCPAY = gintCOPY * 1 + ' gintCOPY = intCOPY * 2 +' intTCPAY = gintCOPY * 3 + MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 +' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + +' If chkSynthetic Then + If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" + goConn.Execute strSQLUP + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_S = Now() + moRS.Update + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + +' If moRS!PNT_Print Then + If moRS!PNT_Print Then + MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" + cmdExit.Enabled = True + Exit Sub + Else + If mboolPAINT Then + MsgBox "Insert 1 White and The Necessary Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay + frmPaintPrtJobs.Show 1 + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRS!PNT_Print = vbChecked + moRS.Update + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + End If + + + gboolPRINT = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdBrownPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdPaintPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String +'***** If this procedure is activated, it will not print it again + + On Error GoTo Error_EH + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + +' If moRS!Split Then +'' If mboolSPLIT Then +'' strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID +'' Set oRS = New Recordset +'' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +'' intPERCENT = Field2Str2(oRS!SUMPercent) +'' If intPERCENT = 0 Then +'' boolFPRINT = True +'' Else +'' boolFPRINT = False +'' End If +'' gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) +'' If gintPERCENT = 0 Then +'' MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" +'' Exit Sub +'' End If +'' If (intPERCENT + gintPERCENT) > 100 Then +'' MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If +'' Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True +'' End If +' If (intPERCENT + gintPERCENT) = 100 Then +' boolCOMPLETE = True +' End If + + gboolPRINT = True + gstrPO = "L" '***** Need To Make The Next Three Lines Work With Paint + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + + gstrPONUM = Field2Str(oRS!po_num) + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then + +'' If mboolSPLIT Then +'' dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) +'' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) +'' strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf +'' strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf +'' strMSG = strMSG & "Qty For This Order -- " & dblOrder +'' dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) +'' dblCheck = oRS!o_qty + dblOrder +'' If dblCheck > oRS!qty Then +'' dblOrder = oRS!qty - oRS!o_qty + ' Else +'' End If +'' oRS!o_qty = oRS!o_qty + dblOrder +'' oRS.Update +'' Else + dblOrder = oRS!qty +'' End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue + End If + moRS.Update + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' If chkSynthetic Then + If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then ' ********** Deal with Paint PO, Invoice, and Pay Sheets + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + moRS!PRNT_S = Now() + moRS.Update + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + If moRS!PNT_Print Then + MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" + Exit Sub + Else + If mboolPAINT Then + MsgBox "Insert 1 White and 17 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Paint Pay " + + Call PrintPaintPay + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRS!PNT_Print = vbChecked + moRS.Update + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + End If + +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " +' moRS!PNT_Print = vbChecked +' moRS.Update +' moRSMemo!notes = UCase(Field2Str(txtYardMemo)) +' moRSMemo.Update + + gboolPRINT = False +' cmdBrownPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPaintPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdCalc_Click() +Dim strSQL As String + + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRS!texture = "DF" Or moRS!texture = "MF" Or moRS!texture = "QS" Or moRS!texture = "RF" Then + gbool2FIN = True + Else + gbool2FIN = False + End If + + If moRS!texture = "DW" Then + moRS!calcdate = Now +' moRS!calcdate = Date + moRS.Update + Else + If moRSProj!stype <> "T" Then + Call MatCalcOne + Call ConvertSuper + Call MatLoad + Call CalcMetal + Else + Call MatCalcThree + Call ConvertSuper + Call MatLoad + Call CalcMetal + End If + End If + MsgBox "Materials Calculation is Complete" + txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Now() & " BY " & gstrLOGIN & " " +' txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Date & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +End Sub + +Private Sub cmdDelLot_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Lot") + Unload Me + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdDelLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelPO_Click() +Dim strSQL As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPO.ListIndex + cmdDelPO.Enabled = False + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdPrintPO.Enabled = False + cmdAddPOMat.Enabled = True + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM + goConn.Execute strSQL + Call LotChange(mstrPROJLOT, "Delete PO") + Call POLoad + If lstPO.ListCount Then + If lstPO.ListCount > mintBOOKMARK Then + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPO.ListIndex = mintBOOKMARK - 1 + End If + Else + mintBOOKMARK = -1 + Call POMatClear + Call POClear + End If + gconACTION = 0 +End Sub + +Private Sub cmdDelPOMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPOMaterial.ListIndex + moRSPOMAT.Delete + Call LotChange(mstrPROJLOT, "Delete PO Material") + Call POMatLoad + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdAddPOMat.Enabled = True + If lstPOMaterial.ListCount Then + If lstPOMaterial.ListCount > mintBOOKMARK Then + lstPOMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 +End Sub + +Private Sub cmdEdit_Click() + gconACTION = 5 + cmdSaveMatrl.Enabled = True + cmdCalc.Enabled = True + cmdFindPlan.Visible = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdPrintCMU.Enabled = True + cmdUpCMU.Enabled = True + txtAddress.Enabled = True + txtOwner.Enabled = True + lstLOptions.Enabled = True + lstPOptions.Enabled = True +End Sub + +Private Sub cmdFindPOMat_Click() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + Else + lstLOOKUP.Visible = True + Call LoadILookUp + lngFind = Field2Long(txtPOInvNo) + Call ListFindItem2(lstLOOKUP, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub LoadILookUp() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOOKUP.Clear + + Do Until oRS.EOF + With lstLOOKUP + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOOKUP.ListCount Then + lstLOOKUP.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LoadLookUp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdIssue_Click() +Dim lngTIE As Long +Dim strSQL As String + + lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) + + + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Formulas(4) = 1 + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Formulas(4) = 1 + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + cmdIssue.Visible = False +End Sub + +Private Sub cmdJCSetup_Click() + Call JCSetup +End Sub + + +Private Sub cmdLathPay_Click() +Dim strPAY As String +Dim bytINFO As Byte + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) + If bytINFO = 1 Then + gintCOPY = 1 + ElseIf bytINFO = 2 Then + gintCOPY = 3 + ElseIf bytINFO = 3 Then + gintCOPY = 5 + ElseIf bytINFO = 4 Then + gintCOPY = 7 + ElseIf bytINFO = 5 Then + gintCOPY = 9 + End If + + Call LotChange(mstrPROJLOT, "RePrint Lath Pay") + Call PrintLathPay + cmdLathPay.Visible = False +End Sub + +Private Sub cmdLathPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNL As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intYNS As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String, strMSG2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean, intLATHCREW As Integer +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String, intSTUCCOCREW As Integer +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + mboolRPSTUCCO = False + mboolLATHC = False + mboolSTUCCOC = False + mintPAYCREW = 0 + +' If mstrPLANUP > Field2Str(moRS!CalcDate) Then +' strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" +' strMSG = strMSG & Chr(10) & Chr(13) +' strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" +' MsgBox strMSG, vbYesNo, "Recalculate Recommended" +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" +' If intResponse = vbYes Then +' Call cmdFindPlan_Click +' Call cmdCalc_Click +' End If +' Exit Sub +' End If + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If mboolPLANUP Then + If IsNull(moRS!calcdate) Then + MsgBox "Lot Must Be Calculated Before Printing Lath", vbOKOnly, "Calculate Lot" + Exit Sub + End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" + cmdExit.Enabled = True + Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic +' If moRSPay.EOF Then +' End If + gintCOPY = 1 +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + +' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then + MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + If Field2Str2(oRS!s_bill) = 0 Then + MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + + intYNL = MsgBox("Do You Want To Use A Crew Number With The Lath PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNL = vbYes Then + intLATHCREW = InputBox("Enter The Lath Crew Number", "Lath Crew", 0) + strSQLCREW = "SELECT * FROM tblcrew WHERE not INACTIVE AND Crew_ID = " & intLATHCREW +' strSQLCREW = "SELECT * FROM tblcrew WHERE Crew_ID = " & intLATHCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + If intLATHCREW = 0 Or IsNull(intLATHCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Lath Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Lath Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intLATHCREW) + moRS!LCREW = Field2Str2(intLATHCREW) + moRS.Update + mboolLATHC = True + End If + Else + moRS!LCREW = 0 + moRS.Update + End If + +'' intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") +'' If intYNS = vbYes Then +'' intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) +'' If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Then +'' MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +'' Exit Sub +'' Else +'' moRS!BCREW = Field2Str2(intSTUCCOCREW) +'' moRS.Update +'' mboolSTUCCOC = True +'' End If +'' Else +'' moRS!BCREW = 0 +'' moRS.Update +'' End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "L" + gstrTYPE = "Y" + + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) + moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then + '***************** need to move this to Issue and Make a unique identifier + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If +' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Lath PO" + 'glngORDERID + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" +' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + gintCOPY = 1 'Added 8/1/17 to make the report only print 1 copy + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLathM.rpt" + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" + goConn.Execute strSQLUP + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_L = Now() + moRS.Update + + If boolFPRINT Then + gstrMODULE = "Before Print Actual " + Call PrintActual + gintCOPY = 1 + crOrder.Reset + End If +' If boolFPRINT Then + gstrMODULE = "Before Print Issue Ticket " + Call PrintIssue + gintCOPY = 1 + crOrder.Reset +' End If + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " + Call PrintLathMat + crOrder.Reset + ' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then +' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + If mboolCERTIFIED Then + strMSG2 = "Insert " & gintCOPY & " Sheet of BABY BLUE Paper for the Lath Pay Sheets and then Press Enter" + Else + strMSG2 = "Insert " & gintCOPY & " Sheet of YELLOW Paper for the Lath Pay Sheets and then Press Enter" + End If + MsgBox strMSG2, vbOKOnly, "InsertPaper" +' gintCOPY = intCOPY * 2 +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If + '****XXXX Lath Pay + gstrMODULE = "Before Print Lath Pay " + Call PrintLathPay + +' If mboolPAINT Then +' MsgBox "Insert 1 White and 10 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 +' intCOPY = 0 +' crOrder.Reset +' gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay +' End If + + '***********Beginning of print stucco pay - moved to Print Brown Order --- REMOVE TWO TICK MARKS TO START USING AGAIN +'' gintCOPY = 1 +'' intCOPY = 0 +'' crOrder.Reset +'' gstrMODULE = "Before Print Stucco Pay " + +'' If moRSProj!stype <> "T" Then +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +''' gintCOPY = 1 +'' gintCOPY = intCOPY * 2 +'' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' ' gintCOPY = 4 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' If moRS!texture <> "SB" Then +''' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 1 +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' ElseIf moRS!texture = "SF" Then +'' MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 1 +''' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +''' gintCOPY = 2 +'' Call PrintStuccoStone +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 1 +''' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +''' gintCOPY = 2 +'' Call PrintStuccoSyn +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If +'' Else +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 1 +'' intTCPAY = gintCOPY * 1 +'' ' gintCOPY = intCOPY * 2 +''' intTCPAY = gintCOPY * 3 +'' MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 4 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 1 +''' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 2 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If + '****************** End of Print Stucco Pay moved to Print Brown Order + + gintCOPY = 1 + If Field2Integer(moRS!CMU) > 0 Then + intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") + If intYN = vbYes Then + Call cmdPrintCMU_Click + crOrder.Reset + End If + End If + End If + End If + '****** Print Stone Pay Sheet and Invoice + '****** Removed 06/27/05 per Rose +' If Not chkNoPay Then +' If moRS!ostone And Not moRS!otstone Then +' crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" +' gintCOPY = 2 +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' crOrder.ReportFileName = App.Path & "\StonePay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' crOrder.Action = 1 + +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If +' End If + + If moRS!Firsttime Then + MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" + End If + + If boolCOMPLETE Then +' gintCOPY = 1 +' crOrder.Reset +' If Not moRS!Split Then +' If Not moRSProj!bill Then +' Call PrintLathInv +' crOrder.Reset +' End If +' End If + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" +' cmdLathPrint.Enabled = False + End If + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If +' moRS!l_flg = "P" +' moRS!y_flg = "P" +' moRS!S_flg = "P" +' cmdLathPrint.Enabled = False + End If + End If + + If moRSProj!BagSand Then + moRS!Border = Field2Str(moRS!lorder) + moRS!a_flg = True + txtYardMemo = Field2Str(txtYardMemo) & " " & "THIS LOT USED BAG SAND - " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + moRS.Update + + gintCOPY = 1 + gboolPRINT = False +' cmdLathPrint.Enabled = False + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module cmdLathPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintLathPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String +Dim dblTEST1, dblTEST2, dblTEST3 As Double + + dblTEST1 = msglPAYRT1 + dblTEST2 = msglPAYRT2 + msglPAYRT1 = 0 + msglPAYRT2 = 0 + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID ' & " AND {tblLOTINFO.LCREW} = 7" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " AND {tblLOTINFO.LCREW} = 7" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " AND {tblLOTINFO.LCREW} = 7" + If moRSProj!cocode = 0 Then + If mboolLATHC Then +' crOrder.ReportFileName = App.Path & "\lathpay_17C.rpt" + crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpay.rpt" + Else + crOrder.ReportFileName = App.Path & "\lathpay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + End If +' Call GetPayRates + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to set to 1 if still printing multiple copies 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + If gintCOPY > 1 Then + intTOTAL = Int((gintCOPY / 2) + 0.99) + Else + intTOTAL = 1 + End If + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + mstrCREWTYPE = "L" + Call GetPayRates + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & dblGROSSPAY + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + moRSPay!worktype = "P" +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!totalsheet = intTOTAL + moRSPay!texture = mstrTexture + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "Currency") +' dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "$ #,0.00") + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "$ #,0.00") +' crOrder.Formulas(4) = "Z_Gross = " & (CStr(dblGROSSPAY)) ', "$ #,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY ')) ', "$ #,0.00") + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + mstrWORK = "C" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 +' dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCover.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PINT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Int Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PEXT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Ext Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ISL = vbTrue + moRS.Update +'*** End IS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT1L = vbTrue + moRS.Update +'*** End BT1 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT2L = vbTrue + moRS.Update +'*** End BT2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ESL = vbTrue + moRS.Update +'*** End ES Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!TwoTL = vbTrue + moRS.Update +'*** End 2T Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FSL = vbTrue + moRS.Update +'*** End FS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!OHL = vbTrue + moRS.Update +'*** End OH Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG1L = vbTrue + moRS.Update +'*** End FG1 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!F2L = vbTrue + moRS.Update +'*** End F2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CCL = vbTrue + moRS.Update +'*** End CC Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG2L = vbTrue + moRS.Update +'*** End FG2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!POL = vbTrue + moRS.Update +'*** End PO Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CSL = vbTrue + moRS.Update +'*** End CS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!WHL = vbTrue + moRS.Update +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPrep() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPrep" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPINT() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PINT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep INT Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPINT" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPEXT() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PEXT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep EXT Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPEXT" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPIS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End IS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPIS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPES() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +'Need To Complete the ability to print one + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End ES Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPES" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPP2T() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End 2T Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPP2T" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPOH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End OH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPOH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPF2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End F2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPF2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFG1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFG2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End BT1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPBT1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End BT2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPBT2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPO() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End PO Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPCS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPWH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPWH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCC() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CC Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPCC" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay() +Dim strSQL As String, i As Integer, intMETAL As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + +' Call GetPayRates + + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then +' crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' dblGROSSPAY = Round(dblGROSSPAY, 2) +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.CopiesToPrinter = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB2_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" + Exit Sub +' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +'' If gintCOPY > 3 Then +'' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +'' intTOTAL = Int((gintCOPY / 2) + 0.99) +'' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +'' i = 1 +'' Do Until i = ((gintCOPY / 2) + 1) +'' crOrder.Formulas(1) = "PaySheetCount = " & i +'' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +'' crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 +'' crOrder.Action = 1 + +'' moRSPay.AddNew +'' moRSPay!lotid = gintLOTID +'' moRSPay!Type = "S" +'' moRSPay!worktype = "P" +'' moRSPay!pay_ydge = intYDS +'' moRSPay!sheet = i +'' moRSPay!Create = gstrLOGIN +'' moRSPay!printed = vbChecked +'' moRSPay!totalsheet = intTOTAL +'' If moRSProj!cocode = 0 Then +'' moRSPay!cocode = 0 +'' ElseIf moRSProj!cocode = 1 Then +'' moRSPay!cocode = 1 +'' End If +'' moRSPay.Update +'' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +'' moRS!multipay = vbChecked +'' moRS.Update +'' i = i + 1 +'' Loop +'' crOrder.Reset +'' Exit Sub +'' Else +'**** This will Print the Pay Sheet for Brown + + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 +' crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +'This will print the Pay Sheet for Texture + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = (intYDS - mintST_ADJ) + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoThree() +Dim strSQL As String, i As Integer, strPAY As String +Dim intTOTAL As Integer, intYDS As Integer +Dim bytYNSC As Byte, bytYNBR As Byte, bytYNTX As Byte, bytYNALL As Byte + + + On Error GoTo Error_EH + If mboolRPSTUCCO = True Then + bytYNSC = MsgBox("Do You Want To Print A Scratch Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNSC = vbYes Then + + ElseIf bytYNSC = vbNo Then + bytYNBR = MsgBox("Do You Want To Print A Brown Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNBR = vbYes Then + + ElseIf bytYNBR = vbNo Then + bytYNTX = MsgBox("Do You Want To Print A Texture Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNTX = vbYes Then + + Else + bytYNALL = vbYes + End If + End If + End If + Else + bytYNALL = vbYes + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + If moRSPay.EOF Then + End If + + If bytYNSC = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayS_217.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + intTOTAL = (gintCOPY) + ' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + ' crOrder.Action = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + End If + + If bytYNBR = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayB_217.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If + End If + +' crOrder.Action = 1 + If bytYNTX = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayT_217.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If + End If + mboolRPSTUCCO = False +' crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintStuccoSyn() +Dim strSQL As String, strSQLL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = 1 +' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayB_217.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = 1 +' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoStone() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoStone" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssueHold() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!po_num = "ORIGINAL ORDER" + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssueHold" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssue() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean, strMType As String + On Error GoTo Error_EH + mstrMTYPE = "" + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + + If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = dblOrder + oRS!qtyIssue = dblOrder +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + + mstrMTYPE = Field2Str(oRSS!m_type) +' If mstrMTYPE <> "" Or Not IsNull(mstrMTYPE) Then + If mstrMTYPE = "P" Or mstrMTYPE = "Z" Then + Call GetPONUM + oRS!po_num = mstrORDERNUM + mstrORDERNUM = "" + mstrType = "" + End If + + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + + End If + oRSS.MoveNext + Loop + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issue2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issueM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssue" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintLathMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathmat.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) + gintCOPY = 1 'Changed to 1 on 8/1/17 to stop multiple copies + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" + crOrder.ReportFileName = App.Path & "\stuccomat.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to change this to 1 if printing more than 1 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ShowPrint() +Dim oRS As Recordset +Dim strSQL As String, lngPO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngPO = Field2Long(oRS!nextpo) + gstrMODULE = "Line 8" + lngPO = lngPO + 1 + If lngPO > 99999 Then + lngPO = 1 + End If + oRS!nextpo = lngPO + oRS.Update + gstrMODULE = gstrMODULE & " Line 15" + + Load frmPrint + gstrMODULE = gstrMODULE & " Line 18" + frmPrint.txtJobCost = Field2Str(moRS!jobcost) + frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) +' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) + gstrMODULE = gstrMODULE & " Line 20" + frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) +' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) + gstrMODULE = gstrMODULE & " Line 22" + frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "00000") +' gstrPONUM = gstrPONUM & Format(intPO, "0000") + gstrMODULE = gstrMODULE & " Line 24" + frmPrint.txtMFlag = gstrFLAG + gstrMODULE = gstrMODULE & " Line 26" + frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) +' gstrCREW = Left$(Field2Str(txtPODesc), 20) + gstrMODULE = gstrMODULE & gstrFLAG & " " + frmPrint.txtDFlag = gstrTYPE + gstrMODULE = gstrMODULE & " Line 30" + If mintSUPPLIER = 99 Then + frmPrint.txtPO = Field2Str2(moRSPO!ponum) +' gintPONUM = moRSPO!ponum + Else + frmPrint.txtPO = 0 +' gintPONUM = 0 + End If + gstrMODULE = gstrMODULE & " Line 35" + frmPrint.Show 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module ShowPrint" +' gstrMODULE = " Form LotInfo - Module ShowPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdAddPO_Click() + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" + End If + + Call POClear + gconACTION = 0 + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + mboolAdding = True + cboPOType.SetFocus +End Sub + +Private Sub cmdLFlag_Click() + moRS!y_FLG = "P" + moRS!l_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + Call cmdSaveLotInfo_Click + cmdLFlag.Visible = False + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If +End Sub + +Private Sub cmdOrder_Click() + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdPreOrderPrintY_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "Y" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + gboolPRINT = False + Call Form_Load + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPreOrderPrintY" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint_Click() + If cmdPrint.Caption = "Print Lath Order" Then + Call cmdLathPrint_Click + ElseIf cmdPrint.Caption = "Print Sand Order" Then + Call cmdSandPrint_Click + ElseIf cmdPrint.Caption = "Print Brown Order" Then + Call cmdBrownPrint_Click + ElseIf cmdPrint.Caption = "Print Scratch Order" Then + Call cmdScratchPrint_Click + ElseIf cmdPrint.Caption = "Print Texture Order" Then + Call cmdTexturePrint_Click + ElseIf cmdPrint.Caption = "Print Stone Order" Then + Call cmdStonePrint_Click + Else + '***CHeck to see why an invoice had an extra zero 002 instead of 02 + End If +End Sub + +Private Sub cmdPrintCMU_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\cmupay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN + Call FormSave + cmdPrintCMU.Enabled = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintCMU_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPOPay_Click() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + gintPRINT = 1 + frmReport.Show 1 + If gintPRINT Then + Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") + + strSQL = "{tblPOrder.ponum} = " & mintPONUM + crOrder.ReportFileName = App.Path & "\POpay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + ' crOrder.Destination = crptToWindow + ' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS!pay_flag = vbTrue + oRS.Update + cmdPrintPOPay.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPOPay_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPO_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, intResponse As Integer +Dim strSELECT As String + + mintBOOKMARK = lstPO.ListIndex + + On Error GoTo Error_EH + mboolSTONE2 = False + gboolPRINT = True + If optPreOrder Then + gstrFLAG = "P" + Else + gstrFLAG = "R" + End If + gintCOPY = 1 + If optLath Then + gstrTYPE = "Y" + ElseIf optStucco Then + gstrTYPE = "S" + ElseIf optSand Then + gstrTYPE = "A" + ElseIf optPreOrder Then + gstrTYPE = "Y" + ElseIf optStone Then + mboolSTONE2 = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + ElseIf optNone Then + gstrTYPE = "" + End If + mintSUPPLIER = 99 + Call ShowPrint + mintSUPPLIER = 0 + + If gboolPRINT And mboolSTONE2 Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) +' moRS!st_flg = vbTrue + moRS.Update + End If + End If + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS!p_flg = "P" Then + MsgBox "This PO has already been printed" + Exit Sub + End If + If Not oRS.EOF Then + crOrder.Reset + strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + If gstrPO <> "L" Then + crOrder.ReportFileName = App.Path & "\POMisc.rpt" + Else + Call POSetup + crOrder.ReportFileName = App.Path & "\purchase.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + oRS!p_flg = "P" + oRS.Update + End If + gboolPRINT = False + If gstrPO = "L" Then + intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") + If intResponse = vbOK Then + Call POInvoice + End If + End If + Call Form_Load + SSTLotInfo.Tab = 6 + Else + Call Form_Load + SSTLotInfo.Tab = 6 + End If + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub POSetup() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblOrder As Double + + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + dblOrder = Field2Str2(oRS!qty) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + +End Sub + +Private Sub cmdPreOrderPrintS_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintS_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPreOrderPrintPC_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + gintCOPY = 1 + gboolPRINT = True + gstrFLAG = "Z" + gstrTYPE = "Y" +' gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'Z'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" + crOrder.ReportFileName = App.Path & "\preorderPC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintPC_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintForm_Click() + Me.PrintForm +End Sub + + +Private Sub cmdRePrintL_Click() + Call RePrintLath + cmdRePrintL.Visible = False + Call FormShow +End Sub + +Private Sub cmdSandPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single +Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Field2Str2(moRS!zone) = 0 Then + MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" + Exit Sub + End If + + If chkHoldOrders Then + MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + cmdExit.Enabled = False +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If +' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "A" + gstrTYPE = "A" + gintCOPY = 1 + Call ShowPrint + gstrMODULE = "After SHOWPRINT " + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- Plaster Sand " & vbCrLf + strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf + If boolCOMPLETE Then + dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) + End If + strMSG = strMSG & "Tons For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = moRS!ORD_NO + dblOrder + If dblCheck > moRS!sand_ton Then + dblOrder = moRS!sand_ton - moRS!ORD_NO +' Else + End If + moRS!ORD_NO = moRS!ORD_NO + dblOrder + moRS.Update + Else + dblOrder = moRS!sand_ton + End If + + moRS!Border = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!a_flg = vbTrue + End If + moRS.Update + gstrMODULE = "After Update Delivery Date " +' glngORDERID = Field2Long(oRS!order_id) + + strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & field2str(moRS!zone) + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + If oRSSS.EOF Then + Else + oRSSS.MoveFirst + strFIND = "zone = " & Field2Str2(moRS!zone) + oRSSS.Find strFIND + sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") + End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Before Setup Materials " + With oRSS + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9999" + !Desc = "ICBO RIVER PLASTER SAND" + !x_flag = vbChecked + !o_qty = dblOrder + !a_qty = dblOrder + !price = sglSAND + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9994" + !Desc = "SPLIT CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 15 + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9993" + !Desc = "MINIMUM ORDER CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 40 + .Update + End With + crOrder.Reset + strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\sand.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\sandM.rpt" + End If + crOrder.Formulas(1) = "Sand = " & dblOrder + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + gboolPRINT = False +' cmdSandPrint.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module cmdSandPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdSavePO_Click() +Dim lngID As Long + If Not IsDate(txtPODate) Then + MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" + txtPODate.SetFocus + Exit Sub + End If + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - Talk to TERESA", vbOKOnly, "Plan Verified" + Call LotChange(mstrPROJLOT, "Chnge After Verified") + End If + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Chnge PO Information") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPO.ListIndex + If mboolAdding Then + If mintBOOKMARK = -1 Then + mintBOOKMARK = 0 + End If + End If + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + lstLOOKUP.Visible = False + Call POSave + Call POLoad + + If mboolAdding Then + mboolAdding = False + lngID = FindMax("tblPOrder", "PONum") + Call CBFindString(lstPO, CStr(lngID)) + cmdAddPOMat.SetFocus + mintBOOKMARK = lstPO.ListIndex + End If + + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePOMat_Click() +Dim intINVNO As Integer, lngID As Long + + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Change PO Material") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPOMaterial.ListIndex + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + lstLOOKUP.Visible = False + intINVNO = txtPOInvNo + Call POMatSave + Call POMatLoad + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + If mboolAdding Then + mboolAdding = False + Call CBFindString4(lstPOMaterial, CStr(intINVNO)) + cmdAddPOMat.SetFocus + mintBOOKMARK = 0 + Exit Sub + End If + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = CLng(mintBOOKMARK) +' lstPOMaterial.ListIndex = 5 + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = -1 + End If + mintBOOKMARK = 0 +End Sub + +Private Sub cmdScratchPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gboolPRINT = True + gintCOPY = 1 + + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!SCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!SCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + + gstrPO = "L" + gstrFLAG = "S" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!TORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!c_flg = vbTrue + End If + moRS.Update + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" + crOrder.ReportFileName = App.Path & "\NewScratch.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" + goConn.Execute strSQLUP + + gboolPRINT = False +' cmdScratchPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdScratchPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintActual() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actual.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintActual" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintActualJG() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, intYN As Integer +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actualJG.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + intYN = MsgBox("Do You Want To Print To The Printer", vbYesNo + vbDefaultButton2, "Printer or Screen") + If intYN = vbYes Then + crOrder.Destination = crptToPrinter + Else + crOrder.Destination = crptToWindow + End If + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintActualJG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdShowChange_Click() + frmLotChLog.Show 1 +End Sub + +Private Sub cmdStonePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean + + On Error GoTo Error_EH + boolNOSTONE = False + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!st_flg = vbTrue + End If + moRS.Update + End If + + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + boolNOSTONE = True + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' If oRSS.State = adStateOpen Then +' oRSS.Close +' End If + If Not boolNOSTONE Then + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + + crOrder.Reset + MsgBox "Insert 1 Sheet of Purple/Lavendar Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" + gintCOPY = 1 + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + crOrder.ReportFileName = App.Path & "\StonePay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + If boolCOMPLETE Then + Call PrintStoneInv '******* Print Invoice + crOrder.Reset + End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + Call Form_Load + End If +' cmdStonePrint.Enabled = False + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdStonePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub + +End Sub + + +Private Sub cmdStuccoPay_Click() +Dim strPAY As String + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") + + If chkSynthetic = vbChecked And moRSProj!stype <> "T" Then + MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 1 + Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 + ElseIf moRSProj!stype <> "T" Then + gintCOPY = 1 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay + End If + Else + gintCOPY = 1 + Call PrintStuccoThree + End If + cmdStuccoPay.Visible = False +End Sub + +Private Sub cmdSuperRpt_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer + On Error GoTo Error_EH + + cmdExit.Enabled = False + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 0 + End If + + If (moRS!lorder) = #12/31/2030# Then +' If Not IsDate(moRS!SOrder) Then + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + Exit Sub + End If + End If + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + gintCOPY = 1 + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update + gintPRINT = 9 + frmReport.Show 1 + If gintPRINT = 0 Then + cmdExit.Enabled = True + Exit Sub + End If + strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + + crOrder.ReportFileName = App.Path & "\super.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdSuperRpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" + goConn.Execute strSQLUP + + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdUpCMU_Click() +Dim intCMU As Integer + + intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") + If intCMU > 0 Then + moRS!CMU = intCMU + moRS.Update + Call FormShow + End If +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer, lngLOTID As Long, lngPROJID As Long +Dim strSQL As String + + On Error GoTo Error_EH + + mboolADD = False + mboolBAD = False + +' mboolENTER = False + + If gintLOTID = 0 Then + intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") + If intResponse = vbYes Then + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAddLot_Click + If mboolBAD Then + Unload Me + End If + Else + Unload Me + End If +''' Else +''' lngLOTID = gintLOTID +''' lngPROJID = gintPROJID +''' Call GetPlanInfo +''' strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID +''' Set moRS = New Recordset +''' moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic +''' If moRS.EOF Then +' lngLOTID = gintLOTID +''' End If + ' If mboolPLANUP Then +''' If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then +''' MsgBox "Plan Information Has Been Updated - Plan will be ReLoaded and Lot Will Exit", vbOKOnly, "Must Update" +''' Call cmdFindPlan_Click +''' gintLOTID = lngLOTID +''' gintPROJID = lngPROJID +' Call cmdCalc_Click +''' Call cmdSaveLotInfo_Click +''' Call cmdExit_Click +''' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String +Dim strPAY As String, intYN As Integer, strMSG As String, lngOPTID As Long +Dim strSQLST As String, oRSST As Recordset, strSQLPST As String, oRSPST As Recordset + + mboolSTPAY = False +' E Print Stone Order +' L Allow Reprint of Lath Pay Sheets +' A Allow update of Address and Owner information on after Lot has been completed +' X Update Paint Square Footage +' T Print Paint Pay Sheets if not already done. +' S Reprint Stucco Pay Sheets +' M Resets the PO Flag to true +' W Update cost on the highlighted item in the Materials List +' Y Allow the reprint of the Lath Yard Order +' I Allow Lath Material Order to be reprinted +' F Turn On The Lath material +' R Turn on the RePrint Lath Button +' H ReSet The PreOrder info & Turn On The Print PreOrder Button +' D Turn on the Reprint PreorderY button +' G Print the Actual Report for Jesse +' N Turn on the Save Lot Info BUtton +' U Set flag for Stucco Cert +' Q Mark a lot option for Stone +' A Print a Stone Invoice +' Ctrl-1 Set The PO Type to Stone +' Ctrl-2 Turn The Add Option Button for Orchard Heights + + + If Shift = 4 Then + Exit Sub + End If + + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyE And gbytSECURITY < 3 Then ' Allow Print of Stone + If chkStone And moRS!st_flg Then + strMSG = "Either Stone Has Already Been Printed OR " & vbCrLf + strMSG = strMSG & "There Is No Stone Required On This Lot" + MsgBox strMSG, vbOKOnly, "No Stone" +' Exit Sub + Else + cmdPrint.Caption = "Print Stone Order" + cmdPrint.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Allow RePrint of Lath Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyA And gbytSECURITY < 3 Then ' Allow RePrint of Stone Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 6 Then + mboolSTPAY = True + Call POInvoice + ' cmdLathPay.Visible = True + End If + Exit Sub + End If + +'' If KeyCode = vbKeyQ And gbytSECURITY < 7 Then ' Allow setting up the Stone in options - Orders or less +'' If CtrlDown And SSTLotInfo.Tab = 3 Then +'' If lstLOptions.ListCount = 0 Then +'' MsgBox "No Lot Options - Stone Update Not Allowed", vbOKOnly, "Select A Stone Option" +'' Exit Sub +'' End If +'' If lstLOptions.ListIndex = -1 Then +'' MsgBox "No Lot Options Selected", vbOKOnly, "Select A Stone Option" +'' Exit Sub +'' End If +'' lngOPTID = Val(lstLOptions. +'' strSQLST = "SELECT * FROM tblLOption WHERE OPT_ID = " & lngOPTID +'' Set oRSST = New Recordset +'' oRSST.Open strSQLST, goConn, adOpenForwardOnly, adLockOptimistic +'' oRSST!ostone = True +'' oRSST.Update +'' End If +'' Exit Sub +'' End If + +''' If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Allow Update of Address, and Owner information +''' If CtrlDown And SSTLotInfo.Tab = 0 Then +''' txtAddress.Enabled = True +''' txtOwner.Enabled = True +''' cmdSaveLotInfo.Enabled = True +''' End If +''' Exit Sub +''' End If + + If KeyCode = vbKeyX Then ' Update the Paint Square Footage + If CtrlDown Then + Call PaintFix + End If + Exit Sub + End If + + If KeyCode = vbKey1 Then ' Update the Paint Square Footage + If CtrlDown Then + optStone.Value = True + Call POSave + End If + Exit Sub + End If + + If KeyCode = vbKey2 And gintPROJID = 6534 Then ' Turn On the ADD OPTION button + If CtrlDown Then + If SSTLotInfo.Tab = 3 And lstPOptions.ListIndex <> -1 Then + cmdOptAdd.Enabled = True + Else + MsgBox "Must Have Plan Option Available and Selected", vbOKOnly + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyU Then ' Make the Flag that Shows Stucco Cert Done - True + If CtrlDown Then + moRS!SCert = vbTrue + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyT And gbytSECURITY <= 6 Then ' Print Paint Pay Sheets +' If KeyCode = vbKeyT And gbytSECURITY <= 3 Then ' Print Paint Pay Sheets + If CtrlDown Then + If Not mboolPAINT Then + MsgBox "This Lot Does Not Have Paint - PaySheets Will Not Be Printed", vbOKOnly, "Not A Paint Lot" + Exit Sub + End If +' ElseIf moRS!PNT_Print Then +' ElseIf moRS!PNT_FLG Or moRS!PNT_Print Then +' MsgBox "Paint Pay Has Already Been Printed", vbOKOnly, "Print Denied" +' Exit Sub +' Else + intYN = MsgBox("Are You Sure You Want To Print Paint PaySheets?", vbYesNo, "Print Paint PaySheets") + + If intYN = vbYes Then + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + frmPaintPrtJobs.Show 1 +' Call LotChange(mstrPROJLOT, "Print Paint Pay") +' Call PrintPaintPay ' **** need to watch this + End If + intYN = MsgBox("Do You Want To Print Paint Invoices?", vbYesNo, "Print Paint Invoices") + If intYN = vbYes Then + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + moRS!PNT_Print = vbChecked + moRS.Update + End If +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If +' End If + Exit Sub + End If + + If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' Allow REprint of Stucco Pay SHeets + If CtrlDown And SSTLotInfo.Tab = 1 Then + MsgBox "The RePrint Stucco Paysheet does not work - Use CTRL-T on the Main Screen", vbOKOnly, "Not Functioning" +' mboolRPSTUCCO = True +' cmdStuccoPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyM And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 6 Then + moRSPO!POFlag = vbTrue + moRSPO.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm + If CtrlDown And SSTLotInfo.Tab = 2 Then + strINVNO = lstLMaterial.ItemData(lstLMaterial.ListIndex) + strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & strINVNO + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) + oRS!price = Field2Str2(strCOST) + oRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call PrintLathMat + gintCOPY = 1 + End If + Exit Sub + End If + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLFlag.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Turn on the Reprint Lath Button + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdRePrintL.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' ReSet The PreOrder info & Turn On The Print PreOrder Button + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call RePrintPreCast + cmdPreOrderPrintPC.Enabled = True 'eVisible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyD And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintY.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "TLB" Or gstrLOGIN = "TB") Then ' Print Special Report for Jesse +' Dim intYN As Integer + If CtrlDown And SSTLotInfo.Tab = 1 Then + intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") + If intYN = vbNo Then + Exit Sub + End If + Call PrintActualJG + End If + Exit Sub + End If +' If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6 Or gbytSECURITY = 7) Then ' Display key combinations. + If KeyCode = vbKeyN And (gbytSECURITY < 8) Then ' Display key combinations. + If CtrlDown Then + cmdSaveLotInfo.Enabled = True + cmdSaveLotInfo.SetFocus + End If + Exit Sub + End If + + If Field2Str(moRS!l_FLG) <> "P" Then + If Not cmdSaveLotInfo.Enabled Then + Call DataHasChanged + End If + End If +End Sub + +Private Sub DataHasChanged() + + cmdSaveLotInfo.Enabled = True + cmdAddLot.Enabled = False + +End Sub + +Private Sub RePrintPreCast() 'Allows a PreCast order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint PreCast") + + moRS!z_FLG = Null + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - PRECAST PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'Z' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + +' Call LotRePrinted +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtLMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + txtLMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtLMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindInv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFindPlan_Click() +Dim strSTARTDATE As String, lngPOS As Long +Dim oRS As Recordset, oRSSS As Recordset +Dim strSQL As String, lngFind As Long, strTEST As String +Dim strSql2 As String + On Error GoTo Error_EH + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If (mstrPLNELEV = "HOLD" And txtModel <> "HOLD") And Not mboolPLNCHANGE Then + mboolPLNCHANGE = True + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub + ' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + + End If + + Call SetPreOrder + + If Not mboolAdding Then + txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + + If oRS.RecordCount > 0 Then + + With oRS + +' txtTtlYdge = Field2Integer(!TO_TTLYDS) 'This May have to be changed to be Mat_YDS + Openings + txtTtlYdge = Field2Integer(!mat_yds) ' Changed back per Jesse 07/09/2018 + txtModel = Field2Str(!Mod_Elv) + txtCMUYdge = Field2Integer(!CMUYDS) + If !HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If +' chkHLNotes = Field2CheckBox(!HLNotes) + txtNotes = Field2Str(!notes) +' txtFoamAdj = Field2Integer(!f_adj) + mstrFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Integer(!opening) + chkStone = Field2CheckBox(!stone) +' chkPaint = Field2CheckBox(!Paint) +' txtStone = Field2Str2(!ST_SQFT) + mstrStone = Field2Str2(!ST_SQFT) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) ' & "'" + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) ' & "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) ' & "'" + mintST_ADJ = Field2Integer(!st_adj) + If mintST_ADJ > 0 Then + mboolST_ADJ = True + Else + mboolST_ADJ = False + End If + txtStoneBill = Field2Str2(!st_bill) + moRS!Scaf6 = Field2Str2(!Scaf6) + moRS!scaf10 = Field2Str2(!scaf10) + moRS!TWOSTORY = !TWOSTORY + moRS!UPDTPLAN = Now + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + If Not !Firsttime Then + !Firsttime = vbChecked + chkFirst = vbChecked + .Update + End If + + gintESTID = !est_id + If Not mboolAdding Then + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + End If + Call FieldsSave + End With + ' oRS.Update + 'clear materials and get correct for model + 'update materials and yardage for options + Else + Call PlanLoad + cmdFindPlan.Visible = False + If lstPlans.ListCount = 0 Then + MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" + cmdSaveLotInfo.Enabled = False + gstrFLAG = "P" + Unload Me + Exit Sub + Else + lstPlans.ListIndex = 0 + lstPlans.SetFocus + oRS.Close + Exit Sub + End If + End If + oRS.Close + If mboolAdding Then + Call ElevLoad + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad + mboolAdding = False + Else + Call ElevLoad + Call DelLotMat + Call PlanMatLoad + Call ReloadOptMat + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call cmdSaveLotInfo_Click + Call cmdExit_Click + End If + Exit Sub + +Error_EH: + Call ErrorHandler(oRSSS.ActiveConnection) +' gstrMODULE = "Form LotInfo - Module cmdFindPlan_Click" +' Call ErrorHandler2 +' gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DelLotMat() +Dim strSQL As String + + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked + goConn.Execute strSQL + +End Sub + +Private Sub ReloadOptMat() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + mintOPTID = Field2Long(oRS!Opt_ID) + Call UpLotInfo + Call UpLMat + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: +' Call ErrorHandler(oRSS.ActiveConnection) + gstrMODULE = "Form LotInfo - Module ReloadOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdAddLot_Click() +Dim strSTARTDATE As String, lngPOS As Long + + mboolADD = True + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub +' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + mboolAdding = True + gconACTION = 0 + gintLOTID = 0 + txtJC.Enabled = True + cmdCalc.Enabled = False + cmdDelLot.Enabled = False + cmdAddLot.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptAdd.Enabled = False + cmdOptDel.Enabled = False + txtLotNo.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + Call LotNew + Call FormClear + Call MatClear + + If Not mboolADD Then + txtAddress.SetFocus + End If +End Sub + +Private Sub cmdAddMatrl_Click() +' lstLMaterial.ListIndex = -1 + lstLMaterial.Enabled = False +' moRSMat.Update +' moRSMat.Close + Call MatClear + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdInventory.Visible = True + lblMatInst.Visible = True + txtLMDesc.SetFocus + mboolAdding = True + +End Sub + +Private Sub cmdDelMatrl_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstLMaterial.ListIndex + moRSMat.Delete + Call LotChange(mstrPROJLOT, "Delete Material") + Call MatLoad + If lstLMaterial.ListCount Then + If lstLMaterial.ListCount > mintBOOKMARK Then + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstLMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False +End Sub + +Private Sub cmdInventory_Click() + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub cmdOptAdd_Click() +Dim strSQL As String +Dim strSql2 As String, oRS As Recordset + + On Error GoTo Error_EH + + If moRSLOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblLOption" +' strSQL = "SELECT * FROM tblLOption where opt_id = 1" + Set moRSLOpt = New Recordset + moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + End If + + If moRSLOpt.EOF Then + + End If + + strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!Lot_ID = gintLOTID + moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) + mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt!C_USER = gstrLOGIN + If oRS!ostone Then + moRSLOpt!ostone = vbChecked +' moRSLOpt.Update + End If + moRSLOpt.Update + lstPOptions.Enabled = True + Call UpLotInfo + Call UpLMat + Call LOptLoad + Call FieldsSave + Call MatSave + Call MatLoad + lstPOptions.ListIndex = -1 + cmdOptAdd.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdOptAdd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOptDel_Click() +Dim strSQL As String + gconACTION = 3 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Call LotChange(mstrPROJLOT, "Delete Lot Option") + Call UpdateLotInfo + Call UpdateLMat + Call MatSave + Call MatLoad + Call FieldsSave + strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call LOptLoad + cmdOptDel.Enabled = False + gconACTION = 0 +End Sub + +Private Sub UpLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + oRSSS.AddNew + oRSSS!Lot_ID = gintLOTID + oRSSS!inv_no = Field2Str(oRSS!inv_no) + oRSSS!Desc = Field2Str(oRSS!Desc) + oRSSS!d_flag = Field2Str(oRSS!d_flag) + oRSSS!m_type = Field2Str(oRSS!m_type) + oRSSS!calc_flag = Field2Str(oRSS!calc_flag) + oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) + oRSSS!qty = Field2Str(oRSS!qty) + oRSSS.Update +' oRSSS.Close + Else + oRSSS!qty = (oRSSS!qty + oRSS!qty) + oRSSS.Update + ' oRSSS.Close + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + + oRS.Close + oRSS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = " & oRSS!inv_no & " and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + Else + oRSSS!qty = (oRSSS!qty - oRSS!qty) + If oRSSS!qty <= 0 Then + oRSSS.Delete + Else + oRSSS.Update + End If + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + If Err = -2147217885 Then + Resume Next + Else + gstrMODULE = "Form LotInfo - Module UpdateLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub +Private Sub UpdateLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String +Dim strSQL As String, strSql2 As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + moRS!sq_yd = moRS!sq_yd - oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 - oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj - oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + strSQL = "SELECT Texture " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + moRS!texture = Field2Str(oRSS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + + If moRS!texture <> "SB" Then + chkSynthetic = vbUnchecked + lblSynthetic.Visible = False + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + + strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID + Set oRSSE = New Recordset + oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSE.EOF Then + oRSE!FileName = oRSSE!FileName + oRSE.Update + oRSE.Close + End If + oRSSE.Close + End If + If oRS!ostone Then +' moRS!stone = vbUnchecked + chkStone = vbUnchecked + moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt + txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(moRS!ST_SQFT) + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(moRS!PNT_SQFT) +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbUnchecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpdateLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub UpLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim strSQL As String, strMSG As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If oRS.RecordCount = 0 Then + strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" + Exit Sub + End If + moRS!sq_yd = moRS!sq_yd + oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 + oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj + oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + moRS!texture = Field2Str(oRS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + If moRS!texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSE.EOF Then + oRSE!FileName = oRS!FileName + oRSE.Update + oRSE.Close + End If + End If + If oRS!ostone Then +' moRS!stone = vbChecked + chkStone = vbChecked + moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt +' = Val(txtStoneBill) + Field2Double(oRS!amt) + txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & "'" & Field2Str2(moRS!ST_SQFT) & "'" +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbChecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If mboolCRITICAL Then + Exit Sub + End If + If gstrFLAG <> "D" Then + If gstrFLAG <> "P" Then + If cmdSaveLotInfo.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + End If + End If + + If moRS.State = adStateOpen Then + moRS.Update + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If +' gintLOTID = 0 'This May Need To Be Turned Back On if LotID is wrong + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cmdSaveLotInfo_Click() + + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSaveMatrl_Click() + + If gconACTION = 6 Then + Call LotChange2(mstrPROJLOT, "Change Lot Material", txtLMDesc, mstrBEGQTY, mstrENDQTY) +' Call LotChange(mstrPROJLOT, "Change Lot Material") + gconACTION = 0 +' End If + ElseIf gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + On Error GoTo Error_EH + mintBOOKMARK = lstLMaterial.ListIndex + + + ' Store the controls to the recordset + Call MatSave + + Call MatLoad + +' mintINVNO = Field2Str2(moRSMat!inv_no) + If mboolAdding Then + mboolAdding = False + Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) +' Call ListFindItem(lstLMaterial, CLng(mintINVNO)) + mintBOOKMARK = lstLMaterial.ListIndex + End If + + cmdInventory.Visible = False + lblMatInst.Visible = False + If gconACTION <> 5 Then + If moRS!l_FLG <> "P" Then + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + Else + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + End If + End If + + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + lstLMaterial.SetFocus + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() +Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long +Dim strSQLS As String, oRSST As Recordset + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + Set moRSPO = New Recordset + Set moRSPOMAT = New Recordset + Set moRSMemo = New Recordset + mboolSTONE3 = False + mboolST_ADJ = False + mintST_ADJ = 0 + mboolORCHARD = False + + On Error GoTo Error_EH + + mboolHLNotes = False + mboolPLNCHANGE = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + +' strSQLS = "SELECT * FROM tblP" + + 'Need to set a flag that tells when a lot is marked for stone but has not stone setup in the billing grid + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 20 + + strSQLL = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + + lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) + mlngINVID = lngINVID + lngINVID = lngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID + moRSInvINFO.Update + + mboolFRMLOAD = False + mboolSPLIT = False + mboolStone = False + gstrFLAG = "" + gstrPO = "L" +' gbytSECURITY = 1 + SSTLotInfo.Tab = 0 + mboolCRITICAL = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + ' if + Call MTypeLoad(cboPOMType) + Call MTypeLoad(cboLMType) + Call MTypeLoad(cboLOMType) + Call ProjLoad + + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + + If FormFind() Then + Call PlanFind +' Call SetPreOrder + If mboolCRITICAL Then + Unload Me + Exit Sub + End If + If mboolStone Then + Call SetStone + End If + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad +' Call POMatLoad + End If + If mboolNOTSUPPLIER Then + moRS!s_FLG = "P" + moRS.Update + End If + If mboolNOPREORDER Then + moRS!y_FLG = "P" + moRS.Update + End If + If mboolNOPRECAST Then + moRS!z_FLG = "P" + moRS.Update + End If + If gintLOTID <> 0 Then + If IsNull(moRS!y_FLG) Or moRS!y_FLG = "" Then + cmdPreOrderPrintY.Enabled = True + End If + If IsNull(moRS!s_FLG) Or (moRS!s_FLG) = "" Then + cmdPreOrderPrintS.Enabled = True + End If + If IsNull(moRS!z_FLG) Or (moRS!z_FLG) = "" Then + cmdPreOrderPrintPC.Enabled = True + End If + +' If IsNull(moRS!l_flg) Then +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then +' cmdSandPrint.Enabled = True +' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!b_flg Then +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdStonePrint.Enabled = True +' End If + + If moRS!t_flg And chkStone And Not moRS!st_flg Then + cmdPrint.Caption = "Print Stone Order" + cmdPrint.Enabled = True +' cmdStonePrint.Enabled = True + ElseIf IsNull(moRS!l_FLG) Then + cmdPrint.Caption = "Print Lath Order" + cmdPrint.Enabled = True +' cmdLathPrint.Enabled = True + ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then + cmdPrint.Caption = "Print Sand Order" + cmdPrint.Enabled = True +' cmdSandPrint.Enabled = True + ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +' ElseIf moRS!a_flg And Not moRS!b_flg Then + cmdPrint.Caption = "Print Scratch Order" +' cmdPrint.Caption = "Print Brown Order" + cmdPrint.Enabled = True +' cmdScratchPrint.Enabled = True + ElseIf moRS!a_flg And Not moRS!b_flg Then +' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then + cmdPrint.Caption = "Print Brown Order" +' cmdPrint.Caption = "Print Scratch Order" + cmdPrint.Enabled = True +' cmdBrownPrint.Enabled = True + ElseIf moRS!b_flg And Not moRS!t_flg Then + cmdPrint.Caption = "Print Texture Order" + cmdPrint.Enabled = True +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdPrint.Caption = "Print Stone Order" +' cmdPrint.Enabled = True +' cmdStonePrint.Enabled = True + Else + cmdPrint.Caption = "All Orders Printed" + cmdPrint.Enabled = False + End If + + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If + End If + If gbytSECURITY <= 6 Then + cmdEdit.Visible = True + cmdEdit.Enabled = True + End If + If chkHoldOrders Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + Else + chkHoldOrders.Enabled = True + chkHoldOrders.BackColor = &H80FFFF + End If + Else + chkHoldOrders.Enabled = True + End If +' If chkSplit Then +' cmdSaveLotInfo.Enabled = False +' If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF +' Else +' chkSplit.Enabled = True +' chkSplit.BackColor = &H80FFFF +' End If +' Else +' chkSplit.Enabled = True +' End If + If chkHoldPO Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + Else + chkHoldPO.Enabled = True + chkHoldPO.BackColor = &H80FFFF + End If + Else + chkHoldPO.Enabled = True + End If + If chkSynthetic Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + Else + chkSynthetic.Enabled = True + chkSynthetic.BackColor = &H80FFFF + End If + + End If + If chkStone Then + cmdSaveLotInfo.Enabled = False + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + Else + chkStone.Enabled = True + chkStone.BackColor = &H80FFFF + End If + + End If +' If gbytSECURITY = 6 And lstPO.ListCount > 4 Then + If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdAddPOMat.Enabled = False + End If + mboolFRMLOAD = True +' Call ListChanges + +' cmdExit.Enabled = True + Exit Sub + + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSProj!stone Then + mboolStone = True + End If + mstrWIRE = Field2Str(moRSProj!wire) + If moRSProj!twodates Then + mbool2Dates = True + + End If + If moRSProj!certpr Then + mboolCERTIFIED = True + Else + mboolCERTIFIED = False + End If + + If moRSProj!Apt Then + mboolCOMM = True + Else + mboolCOMM = False + End If + mstrTAXCODE = Field2Str(moRSProj!taxcode) + + gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PlanLoad() +Dim oRS As Recordset +Dim strSQL As String, strTEST As String + On Error GoTo Error_EH + + strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPlans.Clear + + Do Until oRS.EOF + With lstPlans + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS!est_id + End With + lstPlans.Visible = True + lblPlan.Visible = True + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PlanLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + If moRSProj!bb Then + lblBB.Caption = "This House Uses Blackboard" + Else + lblBB.Caption = "This House Uses R-Guard" + End If + If moRSProj!zmetal Then + lblZMetal.Visible = True + Else + lblZMetal.Visible = False + End If + + With moRS + lblSZone = Field2Str2(!zone) + lblSandShip = Field2Str2(!ORD_NO) + txtTake138 = Field2Integer(!jmb138) + txtCalc138 = Field2Integer(!jmb138) + txtTtlYdge = Field2Integer(!sq_yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!Owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Integer(!CMU) + txtNotes = Field2Str(!notes) + If !HLNotes And Len(txtNotes) > 0 Then + txtNotes.ForeColor = &HFF& + txtNotes.BackColor = &H80FFFF + Else + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + End If + txtSuperNotes = Field2Str(!supernotes) + txtLotNotes = Field2Str(!lotnotes) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) '& "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) '& "'" + mstrFoamAdj = Field2Integer(!f_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrStone = Field2Str2(!ST_SQFT) +' txtFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) +' txtStone = Field2Str2(!ST_SQFT) + mintST_ADJ = Field2Integer(!st_adj) + If mintST_ADJ > 0 Then + mboolST_ADJ = True + Else + mboolST_ADJ = False + End If + txtFin2 = Field2Integer(!fin2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Str2(!opening) + chkFirst = Field2CheckBox(!Firsttime) + txtMetal = Field2Double(!METAL) + txtSand = Field2Integer(!sand_ton) + txtSuperBB = Field2Integer(!SUP_BB) + txtSuper12 = Field2Integer(!SUP_FD12) + txtSuper1383 = Field2Integer(!SUP_138) + If CInt(txtSuper1383) < 0 Then + txtSuper1383 = 0 + End If +' txtSuper1383 = 0 + txtSuper783 = Field2Integer(!SUP_783) + txtSuper78 = Field2Integer(!SUP_78) + txtSuper38 = Field2Integer(!SUP_38) + txtSuperRL = Field2Integer(!SUP_RL) + txtSuperML = Field2Integer(!SUP_ML) + txtSuperDW = Field2Integer(!SUP_DW) + txtSuperSP = Field2Integer(!SUP_SP) + txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + If txtLathO = "" Then + txtLathO = "12/31/2030" + End If + txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) + txtStoneBill = Field2Str2(!st_bill) + txtJC = Field2Str(!jobcost) + chkHoldOrders = Field2CheckBox(!hold_stucco) + chkHoldPO = Field2CheckBox(!hold_po) + chkPaint = Field2CheckBox(!PNT_FLG) + chkSynthetic = Field2CheckBox(!syn_flag) + chkStone = Field2CheckBox(!stone) + chkOthers = Field2CheckBox(!otstone) + chkNoPay = Field2CheckBox(!nopayissue) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + End With + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "C" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "San Man" + End If + + If moRS!l_FLG = "P" Then + txtTtlYdge.Enabled = False + txtCMUYdge.Enabled = False +' txtStone.Enabled = False + txtLotNo.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptDel.Enabled = False + cmdDelLot.Enabled = False + cmdSaveLotInfo.Enabled = False + cmdFindPlan.Enabled = False + cmdOrders.Enabled = False + cmdCalc.Enabled = False +' txtYardMemo.Enabled = False + txtYardMemo.Enabled = True + txtYardMemo.Locked = True + cmdUpCMU.Enabled = False + cmdPrintCMU.Enabled = False + Call LotPrinted + End If + If moRS!Firsttime Then + lblFirst.Visible = True + End If + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotPrinted() + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtNotes.Enabled = False +' txtFoamAdj.Enabled = False +' txtLaborAdj.Enabled = False +' txtWireAdj.Enabled = False +' txtFin2.Enabled = False + txt28Foam.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False + lblLathPrint.Visible = True + cmdPreOrderPrintY.Enabled = False + cmdPreOrderPrintS.Enabled = False + +End Sub + +Private Sub LotRePrinted() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True +' txtFin2.Enabled = True + txt28Foam.Enabled = True +' txtSuperBB.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + lblLathPrint.Visible = False + cmdPreOrderPrintY.Enabled = True + cmdPreOrderPrintS.Enabled = True + cmdPrint.Enabled = True +End Sub + +Private Sub LotNew() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True +' txtSuperBB.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + lblLathPrint.Visible = False + lblFirst.Visible = False + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!qty) + If CInt(txtLMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLMQty.ForeColor = &HFF& + txtLMQty.FontBold = True + Else + txtLMQty.ForeColor = &H0& + txtLMQty.FontBold = False + End If + txtLMLength = Field2Integer(!calc_amt) + txtLMBalance = Field2Str(!o_qty) + chkChange = Field2CheckBox(!ch_flag) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + Call FindType(cboLMType, strTYPE) + + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt + txtLOYdge = Field2Integer(!Yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Integer(!fin2) + txtLOFoam = Field2Integer(!f_adj) + lblBillingAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOSt_SqFt = Field2Str2(!OSt_SqFt) + Call FindTexture2(Field2Str(!texture), strTYPE) + txtLOTexture = strTYPE +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt2 + txtNote2 = Field2Str(!notes) + If Left(Field2Str(!Desc), 3) = "DNU" Then + mboolDNU = True + Else + mboolDNU = False + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPO() +Dim bytPOType As Byte + + On Error GoTo Error_EH + + + mboolSHOW = True + + With moRSPO + gintPONUM = Field2Long(!ponum) + txtPONum = Field2Long(!ponum) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + txtPODate = Field2Str(!Date) + txtPay = Field2Str2(!yards) + txtPayType = Field2Str(!payflag) + txtPOType = Field2Str(!potype) + gstrPO = txtPOType + bytPOType = Field2Str2(!Opt_Type) + End With + + If bytPOType = 1 Then + optLath = True + ElseIf bytPOType = 2 Then + optStucco = True + ElseIf bytPOType = 3 Then + optSand = True + ElseIf bytPOType = 4 Then + optPreOrder = True + ElseIf bytPOType = 5 Then + optStone = True + ElseIf bytPOType = 6 Or bytPOType = 0 Then + optNone = True + End If + If moRSPO!p_flg = "P" Then + cmdPrintPO.Enabled = False + Else + cmdPrintPO.Enabled = True + End If + mboolSHOW = False + If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then + cmdPrintPOPay.Enabled = True + Else + cmdPrintPOPay.Enabled = False + End If + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + End Select + + Call CBFindString1(cboPOType, txtPOType) + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!qty) + txtLOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboLOMType, strTYPE) + + If !calc_flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOQty = Field2Str(!qty) + txtPOPrice = Format(Field2Str2(!price), "#,#.00") + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If IsNull(txtModel) Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + ElseIf Trim$(txtModel) = "" Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + End If + +' If mboolAdding Then +' moRS.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled +' cmdAddLot.Enabled = Not cmdAddLot.Enabled + cmdDelLot.Enabled = Not cmdDelLot.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSaveLotInfo.Enabled Then + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String +Dim strSQLB As String, oRSB As Recordset + + On Error GoTo Error_EH + + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount > 0 Then + txtYardMemo = Field2Str(moRSMemo!notes) + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = "" + moRSMemo.Update + txtYardMemo = "" + End If + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + + mstrTexture = moRS!texture + If moRS!HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If + mboolSTONE3 = False + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + mstrPLNELEV = Field2Str(moRS!model) + If moRS!Split Then + mboolSPLIT = False '*** Changed from True to False 7/21/2017 because no longer processing Split Qty + Else + mboolSPLIT = False + End If + strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!PROJ_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSB = New Recordset + oRSB.Open strSQLB, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSB.EOF Then + If IsNull(oRSB!st_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False + End If + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub PlanFind() +Dim oRS As Recordset +Dim strSQL As String, strPlan As String, strTEST As String + On Error GoTo Open_EH + mintOpenPR = 0 + +' strSQL = "SELECT * " + strSQL = "SELECT est_id, verified, update, OpenPR " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If Not moRSPlan.EOF Then + mintOpenPR = Field2Integer(moRSPlan!openpr) + mboolVERIFIED = moRSPlan!verified + gintESTID = moRSPlan!est_id + If moRSProj!FHA Then + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" + Else + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" + End If + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + If oRS.EOF Then + mintTake138 = 0 + Else + moRS!jmb138 = oRS!qty +' mintTake138 = oRS!qty + End If + oRS.Close + Else + MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" + mboolCRITICAL = True + End If + Exit Sub + +Open_EH: + gstrMODULE = "Form LotInfo - Module PlanFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindPOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOpt2() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT notes, optid, desc " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) + + Set moRSPOpt2 = New Recordset + + moRSPOpt2.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt2.EOF Then + FormFindPOpt2 = False + Else + FormFindPOpt2 = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) + + If moRSPO.State = adStateOpen Then + + moRSPO.Close + End If + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindLOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + Set moRSLOpt = New Recordset + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!Opt_ID + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindLOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = '" & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) & "'" + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + If moRSPOMAT.State = adStateOpen Then + moRSPOMAT.Close + End If + + moRSPOMAT.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstLMaterial.col = 4 + strINVNO = lstLMaterial.ColText + + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' intTest = moRSMat.RecordCount + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub cmdExit_Click() + + Unload Me +End Sub +Private Sub FieldsSave() +Dim strLOT As String, strTYPE As String, int1383 As Integer +Dim dblOPEN As Double, intDELETE As Integer + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS!startdate = Str2Field(mstrSTARTDATE) + End If + + If mboolPLNCHANGE Then + moRS!startdate = Str2Field(mstrSTARTDATE) + mboolPLNCHANGE = False + End If + +'***COMMENTING THIS OUT BECAUSE I DO NOT THINK IT NEEDS IT - Messes up the labor calcuations +'****** If there are problems remove the single comments +' If Field2Integer(moRS!sq_yd) > 1 Then +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) +' If moRSProj!use_open Then +' If Field2Integer(moRS!sq_yd) > 500 Then +'' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 +' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - intDELETE +' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE +' Else +'' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 15 'Change per Jesse 08/22/05 +''' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +' End If +' Else +' If Field2Integer(moRS!sq_yd) > 500 Then +'' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 +' moRS!l_yds = Field2Integer(moRS!sq_yd) - intDELETE +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE +' Else +'' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 +' moRS!l_yds = Field2Integer(moRS!sq_yd) - 10 +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 15 +'' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +' End If +' End If +' End If + + With moRS + If mboolHLNotes Then + !HLNotes = vbChecked + Else + !HLNotes = vbUnchecked + End If + !zone = Integer2Field(moRSProj!zone) + !sq_yd = Integer2Field(txtTtlYdge) + !address = Str2Field(txtAddress) + !Owner = Str2Field(txtOwner) + !model = Str2Field(txtModel) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtNotes) + !supernotes = Str2Field(txtSuperNotes) + !lotnotes = Str2Field(txtLotNotes) + !st_adj = mintST_ADJ +' !f_adj = Integer2Field(txtFoamAdj) +' !l_adj = Integer2Field(txtLaborAdj) + !f_adj = Field2Str2(mstrFoamAdj) + !l_adj = Field2Str2(mstrLaborAdj) + !w_adj = Field2Str2(mstrWireAdj) + !fin2 = Integer2Field(txtFin2) + !lot_no = Str2Field(txtLotNo) + !foam = Integer2Field(txt28Foam) + !lorder = Date2Field(txtLathO) + !SUP_BB = Integer2Field(txtSuperBB) + !SUP_FD12 = Integer2Field(txtSuper12) + !SUP_783 = Integer2Field(txtSuper783) + !SUP_78 = Integer2Field(txtSuper78) + !SUP_38 = Integer2Field(txtSuper38) + int1383 = Integer2Field(txtSuper1383) + If int1383 < 0 Then + !SUP_138 = 0 + Else + !SUP_138 = Integer2Field(txtSuper1383) + End If + !SUP_RL = Integer2Field(txtSuperRL) + !SUP_ML = Integer2Field(txtSuperML) + !SUP_DW = Integer2Field(txtSuperDW) + !SUP_SP = Integer2Field(txtSuperSP) + !opening = Integer2Field(txtOPEN) + !openpr = mintOpenPR + !sand_ton = Integer2Field(txtSand) + !SORDER = Str2Field(txtTextureO) + !Border = Str2Field(txtSandO) + !TORDER = Str2Field(txtScratchO) + !forder = Str2Field(txtBrownO) + !VOrder = Str2Field(txtLathBill) + !st_bill = Integer2Field(txtStoneBill) + !jobcost = Str2Field(txtJC) + !hold_stucco = chkHoldOrders + !hold_po = chkHoldPO + !PNT_FLG = chkPaint + !LUUser = gstrLOGIN + !Update = Date '*** This is just using the current date for updating + !Firsttime = chkFirst + !syn_flag = chkSynthetic + !stone = chkStone + !otstone = chkOthers +' !ST_SQFT = Integer2Field(txtStone) + + Call FindTexture(txtFinish, strTYPE) + !texture = strTYPE + + End With + moRS.Update + + If mboolAdding Then + Call GetLotID + Call PlanMatLoad + Call POptLoad + Call JCSetup + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If + mboolAdding = False + End If + moRSMemo!notes = Field2Str(txtYardMemo) + moRSMemo.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") + If Len(strLOT) > 0 Then + moRS!lot_no = Field2Str(strLOT) + txtLotNo = Field2Str(strLOT) + txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") + moRS!jobcost = Field2Str(txtJC) + moRS.Update + End If + Resume Next + End If + gstrMODULE = "Form LotInfo - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetLotID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintLOTID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPlanInfo() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + mboolPLANUP = False + + strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrPLANUP = Field2Str(oRS!Update) +' mboolVERIFIED = oRS!verified + If mstrPLANUP > Field2Str(moRS!import) Then + mboolPLANUP = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetPlanInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POSave() +Dim strSQL As String, strMAX As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset ', oRSI As Recordset +Dim bytPOType As Byte + + On Error GoTo Error_EH + If optLath Then + bytPOType = 1 + ElseIf optStucco Then + bytPOType = 2 + ElseIf optSand Then + bytPOType = 3 + ElseIf optPreOrder Then + bytPOType = 4 + ElseIf optStone Then + bytPOType = 5 + Else + bytPOType = 6 + End If + + If moRSPO.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRS.EOF Then + + End If + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Opt_Type = bytPOType + !Date = Str2Field(txtPODate) + !User = gstrLOGIN + !Up_User = gstrLOGIN + !Update = Date + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + oRS.Update + + strMAX = FindMax("tblPOrder", "PONum") + glngPO_NUM = Val(strMAX) + + strSQLL = "" + oRS.Close + Call POLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPO.AddNew + moRSPO!User = gstrLOGIN + End If + + With moRSPO + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !Opt_Type = bytPOType + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Update = Date + !Up_User = gstrLOGIN + !Date = Str2Field(txtPODate) + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + moRSPO.Update + + strMAX = FindMax("tblPOrder", "PONum") + glngPO_NUM = Val(strMAX) + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPO.ActiveConnection) + Exit Sub +End Sub + +Private Sub POMatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSPOMAT.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) +' !price = Str2Field(txtPOPrice) + + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + oRS.Update + + oRS.Close + Call OptMatLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPOMAT.AddNew + End If + + With moRSPOMAT + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + moRSPOMAT.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPOMAT.ActiveConnection) + Exit Sub + + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + Exit Sub + End If + + + With moRSMat + + If mboolAdding Then + .AddNew + !Lot_ID = gintLOTID + End If + !inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !qty = Str2Field(txtLMQty.Text) + !calc_amt = Integer2Field(txtLMLength.Text) + !o_qty = Integer2Field(txtLMBalance.Text) + !ch_flag = chkChange + !m_type = Left$(cboLMType.Text, 1) + + If cboLMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + .Update + End With + mintINVNO = Field2Str(txtLMInvNo) + moRSMat.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + moRSMemo.Close + txtLotNotes = "" + txtYardMemo = "" + txtSuperNotes = "" + txtTtlYdge = 0 + txtAddress = "" + txtOwner = "" + txtModel = "" + txtCMUYdge = 0 + chkFirst = vbUnchecked + txtNotes = "" + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + mboolPAINT = False + lblFoamAdj.Caption = "Form Adj. Yardage: " + lblLaborAdj.Caption = "Labor Adj. Yardage: " + lblWireAdj.Caption = "Wire Adj. Yardage: " + lblPaintSqFt.Caption = "Paint Square Ft.: " + lblStoneSqFt.Caption = "Stone Square Ft.: " + txtFin2 = 0 + txtLotNo = "" + txt28Foam = 0 + txtLathO = "12/31/2030" + txtMetal = 0 + txtOPEN = 0 + txtSuperBB = 0 + txtSuper12 = 0 + txtSuper783 = 0 + txtSuper78 = 0 + txtSuper38 = 0 + txtSuper1383 = 0 + txtSuperRL = 0 + txtSuperML = 0 + txtSuperDW = 0 + txtSuperSP = 0 +' txtLathO = "" + txtSandO = "" + txtScratchO = "" + txtBrownO = "" + txtTextureO = "" + txtLathBill = "" + txtStoneBill = 0 + txtFinish.Text = "" + txtTake138 = 0 + txtOneKote.Text = "" + lstLath.Clear + lstYard.Clear + lstPreOrder.Clear + lstLMaterial.Clear + lstInventory.Clear + lstPOptions.Clear + lstLOptions.Clear + lstOptMatrl.Clear + lstPO.Clear + lstPOMaterial.Clear + lstBrown.Clear + lstScratch.Clear + lstTexture.Clear + txtLOYdge = 0 + txtLODesc = "" + txtLOFin2 = 0 + txtLOFoam = 0 + txtLOMInvNo = 0 + txtLOMDesc = "" + txtLOMQty = "" + txtSand = 0 + txtLOMLength = 0 + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + gintOPTID = 0 +' txtLODate.Enabled = False + chkHoldOrders = vbUnchecked + chkHoldOrders.Enabled = True + chkHoldPO = vbUnchecked + chkHoldPO.Enabled = True + chkPaint = vbUnchecked + chkSynthetic = vbUnchecked + chkSynthetic.Enabled = True + chkStone = vbUnchecked + chkOthers = vbUnchecked + chkNoPay = vbUnchecked + chkStone.Enabled = True + lblFirst.Visible = False + lblSZone = "" + lblSandShip = "" + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = Field2Str(oRS("inv_no")) + + If mboolAdding Then +' intINVNO = Field2Integer(txtPOInvNo) + If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then + mintBOOKMARK = .ListIndex + End If + End If + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, intCOUNT As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + intCOUNT = oRS.RecordCount + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + intCOUNT = oRSS.RecordCount + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str2(oRS!qty) +' oRSS!price = 0 + oRSS!price = Field2Str2(oRS!price) + oRSS.Update + If moRSProj!FHA Then + If Field2Str(oRS!inv_no) = "1570" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + Else + If Field2Str(oRS!inv_no) = "1130" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If +' Resume Next + +End Sub +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String, strSELECT As String +Dim strLine As String + + On Error GoTo Error_EH + If lstLOptions.ListIndex = -1 Then + lstOptMatrl.ListIndex = -1 + Exit Sub + End If + strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + lstOptMatrl.ListIndex = -1 + End If + Exit Sub + +Error_EH: + If Err = 381 Then + strSELECT = 0 + cmdOptDel.Enabled = False + Resume Next + End If + +End Sub +Private Sub POptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + + .AddItem oRS!ponum + .ItemData(.NewIndex) = oRS!ponum + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPO.ListCount Then + lstPO.ListIndex = 0 + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LOptLoad() +Dim oRS As Recordset +Dim strSQL As String, intLoop As Integer, intPos As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!Opt_ID + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Else + lstLOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LOptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboLMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_DblClick() + mboolAdding = False + cmdAddMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdDelMatrl.Enabled = True +End Sub + +Private Sub lstLookup_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstLOOKUP.col = 0 + strINVNO = lstLOOKUP.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = " & lstLOOKUP.ItemData(lstLOOKUP.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLookup_dblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_Click() + On Error GoTo Error_EH + + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "0" + txtLODesc = "" + txtLOFin2 = "0" + txtLOFoam = "0" + txtLOTexture = "" + End If + If FormFindLOpt() Then +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + + End If + Else + cmdOptDel.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptDel.Enabled = True + cmdOptAdd.Enabled = False + End If + +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_Click() + On Error GoTo Error_EH + + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" +' cboLMDFlag.Text = "" +' cboLMType.Text = "" + cboLMMetal.ListIndex = -1 + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + txtLMBalance = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + End If +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_Click() + On Error GoTo Error_EH + + If lstPO.ListIndex <> -1 Then + If FormFindPO() Then + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + Else + lstPO.Clear + txtPONum = "0" + txtPODesc = "" + txtIssueTo = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OrderLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strSELECT As String + On Error Resume Next + + mboolNOTSUPPLIER = True + mboolNOPREORDER = True + mboolNOPRECAST = True + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'S' and M_Type = 'P'" + + oRS.Filter = strSELECT + lstPreOrder.Clear + lstPreOrder.Redraw = True + + Do Until oRS.EOF + With lstPreOrder + mboolNOTSUPPLIER = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "D_Flag = 'Y' and M_Type = 'P'" + oRS.Filter = strSELECT + If oRS.EOF Then + End If + + Do Until oRS.EOF + With lstPreOrder + mboolNOPREORDER = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "M_Type = 'Z'" + oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + mboolNOPRECAST = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSELECT + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSELECT + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSELECT + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSELECT + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSELECT + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPlans_DblClick() + txtModel = lstPlans.List(lstPlans.ListIndex) + lstPlans.Visible = False + lblPlan.Visible = False + Call cmdFindPlan_Click +End Sub + +Private Sub lstPOMaterial_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + End If +End Sub + +Private Sub lstPOptions_Click() + On Error GoTo Error_EH + + If lstPOptions.ListIndex <> -1 Then + If FormFindPOpt2() Then + Call FormShowPOpt + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + txtLMBalance = "0" + chkChange = vbUnchecked + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +End Sub + +Private Sub POClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPONotes = "" + txtIssueTo = "" + txtPONum = "0" + txtPODesc = "" + txtPODate = "" + txtPay = 0 + txtPayType = "" + lstLOOKUP.Clear + lstPOMaterial.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cboPOType.ListIndex = -1 + +End Sub + +Private Sub POMatClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPOPrice = "0.00" + lstLOOKUP.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cmdFindPOMat.Visible = True + +End Sub + +Private Sub lstPOptions_DblClick() + If mboolDNU Then + MsgBox "A DNU Option Cannot Be Used - Select Another Option", vbOKOnly, "Select Again" + Exit Sub + Else + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + lstPOptions.Enabled = False + cmdOptAdd.Enabled = True + cmdOptDel.Enabled = False + End If + End If + +End Sub + +Private Sub SSTLotInfo_GotFocus() + If SSTLotInfo.Tab = 1 Then + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + End If + If SSTLotInfo.Tab = 6 Then + If chkHoldPO Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdAddPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + txtPONum.Enabled = False + txtPODate.Enabled = False + txtIssueTo.Enabled = False + txtPODesc.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + txtPOPrice.Enabled = False + cmdPrintPOPay.Enabled = False + cmdFindPOMat.Enabled = False + lstLOOKUP.Visible = False + Else +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = True + End If + End If + End If +End Sub + +Private Sub txt28Foam_GotFocus() + Call FieldSelect(txt28Foam) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtIssueTo_GotFocus() + Call FieldSelect(txtIssueTo) +End Sub + +Private Sub txtIssueTo_LostFocus() + txtIssueTo = UCase(txtIssueTo) +End Sub + +Private Sub txtJC_GotFocus() + Call FieldSelect(txtJC) +End Sub + +Private Sub txtJC_LostFocus() + txtJC = UCase(txtJC) +End Sub + +Private Sub txtLMDesc_LostFocus() + txtLMDesc = UCase(txtLMDesc) +End Sub + +Private Sub txtLMInvNo_GotFocus() + Call FieldSelect(txtLMInvNo) +End Sub + +Private Sub txtLMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If + mstrENDQTY = txtLMQty +End Sub + +Private Sub txtLOMQty_GotFocus() + mdblQTY = Field2Str2(txtLOMQty) +End Sub + +Private Sub txtLOMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLOMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLotNotes_GotFocus() + txtLotNotes.SelStart = 1000 +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtModel_LostFocus() + txtModel = UCase(txtModel) +End Sub + +Private Sub txtPay_GotFocus() + Call FieldSelect(txtPay) +End Sub + +Private Sub txtPayType_GotFocus() + Call FieldSelect(txtPayType) +End Sub + +Private Sub txtPayType_LostFocus() + txtPayType = UCase(txtPayType) + If txtPayType = "D" Or txtPayType = "R" Then + lblPayYds.Caption = "Pay Dollars:" + Else + lblPayYds.Caption = "Pay Yards:" + End If +End Sub + +Private Sub txtPODate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtPODate, "/", 1) + If Not IsDate(txtPODate) Then + If lngPOS = 0 Then + If Len(txtPODate) > 0 Then + txtPODate = Format(txtPODate, "00/00/####") + If Not IsDate(txtPODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtPODate.SetFocus + End If + End If +End Sub + +Private Sub txtPOPrice_GotFocus() + Call FieldSelect(txtPOPrice) +End Sub + +Private Sub txtPOPrice_LostFocus() + txtPOPrice = Format(txtPOPrice, "#,#.00") +End Sub + +Private Sub txtPOQty_LostFocus() + If mdblQTY <> Field2Str2(txtPOQty) Then + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If + End If + +End Sub + +Private Sub txtLMDesc_GotFocus() + Call FieldSelect(txtLMDesc) +End Sub + +Private Sub txtLMLength_GotFocus() + Call FieldSelect(txtLMLength) +End Sub + +Private Sub txtLMQty_GotFocus() + mdblQTY = Field2Str2(txtLMQty) + mstrBEGQTY = Field2Str(txtLMQty) + Call FieldSelect(txtLMQty) +End Sub + +Private Sub txtLotNo_LostFocus() + txtLotNo = UCase(txtLotNo) + Call GETJC +' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") +End Sub +Private Sub GETJC() +Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + intJC = Field2Integer(oRS!nextjc) + txtALPHA = Field2Str(oRS!jcalpha) + txtJC = txtALPHA & Format(Field2Str(intJC), "000000") + intJC = intJC + 1 + + If intJC > 999999 Then + intJC = 1 + intASCII = Asc(txtALPHA) + intASCII = intASCII + 1 + txtALPHA = Chr(intASCII) + oRS!jcalpha = Field2Str(txtALPHA) + End If + + oRS!nextjc = intJC + oRS.Update + +End Sub +Private Sub txtModel_GotFocus() + Call FieldSelect(txtModel) +End Sub + +Private Sub txtOwner_GotFocus() + Call FieldSelect(txtOwner) +End Sub + +Private Sub txtOwner_LostFocus() + txtOwner.Text = UCase(txtOwner.Text) +End Sub +Private Sub txtAddress_LostFocus() + txtAddress.Text = UCase(txtAddress.Text) +End Sub +Private Sub txtAddress_GotFocus() + Call FieldSelect(txtAddress) +End Sub +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub txtPODate_GotFocus() + Call FieldSelect(txtPODate) +End Sub + +Private Sub txtPODesc_GotFocus() + Call FieldSelect(txtPODesc) +End Sub + +Private Sub txtPODesc_LostFocus() + txtPODesc = UCase(txtPODesc) +End Sub + +Private Sub txtPOInvNo_GotFocus() + Call FieldSelect(txtPOInvNo) +End Sub + +Private Sub txtPOMatDesc_GotFocus() + Call FieldSelect(txtPOMatDesc) +End Sub + +Private Sub txtPOMatDesc_LostFocus() + txtPOMatDesc = UCase(txtPOMatDesc) +End Sub + +Private Sub txtPONotes_GotFocus() + Call FieldSelect(txtPONotes) +End Sub + +Private Sub txtPONotes_LostFocus() + txtPONotes = UCase(txtPONotes) +End Sub + +Private Sub txtPOQty_GotFocus() + mdblQTY = Field2Str2(txtPOQty) + Call FieldSelect(txtPOQty) +End Sub + +Private Sub txtSuper12_GotFocus() + Call FieldSelect(txtSuper12) +End Sub + +Private Sub txtSuper12_LostFocus() + txtSuper12 = Integer2Field(txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub txtSuper1383_LostFocus() +Dim intResponse As Integer + txtSuper1383 = Integer2Field(txtSuper1383) + If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then + intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") + If intResponse = vbYes Then + Exit Sub + Else + txtSuper1383.SetFocus + End If + End If +End Sub + +Private Sub txtSuper38_GotFocus() + Call FieldSelect(txtSuper38) +End Sub + +Private Sub txtSuper78_GotFocus() + Call FieldSelect(txtSuper78) +End Sub + +Private Sub txtSuper1383_GotFocus() + Call FieldSelect(txtSuper1383) +End Sub + +Private Sub txtSuper783_GotFocus() + Call FieldSelect(txtSuper783) +End Sub + +Private Sub txtSuper783_LostFocus() + txtSuper783 = Integer2Field(txtSuper783) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper78_LostFocus() + txtSuper78 = Integer2Field(txtSuper78) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper38_LostFocus() + txtSuper38 = Integer2Field(txtSuper38) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuperBB_GotFocus() + If mboolCOMM Then + Call FieldSelect(txtSuperBB) + End If +End Sub + +Private Sub txtSuperBB_LostFocus() + If mboolCOMM Then + txtSuperBB = Integer2Field(txtSuperBB) + End If +End Sub + +Private Sub txtSuperDW_GotFocus() + Call FieldSelect(txtSuperDW) +End Sub + +Private Sub txtSuperDW_LostFocus() + txtSuperDW = Integer2Field(txtSuperDW) +End Sub + +Private Sub txtSuperML_GotFocus() + Call FieldSelect(txtSuperML) +End Sub + +Private Sub txtSuperML_LostFocus() + txtSuperML = Integer2Field(txtSuperML) +End Sub + +Private Sub txtSuperNotes_GotFocus() + Call FieldSelect(txtSuperNotes) +End Sub + +Private Sub txtSuperNotes_LostFocus() + txtSuperNotes.Text = UCase(txtSuperNotes.Text) +End Sub + +'Private Sub txtSuperRL_GotFocus() +' Call FieldSelect(txtSuperRL) +'End Sub + +'Private Sub txtSuperRL_LostFocus() +' txtSuperRL = Integer2Field(txtSuperRL) +'End Sub + +Private Sub txtSuperSP_GotFocus() + Call FieldSelect(txtSuperSP) +End Sub + +Private Sub MatCalcOne() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double, dblDW2 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double, dblPYRO As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, intCaulkQty As Integer +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblCMNT2 As Double +Dim dblML2 As Double, dblRL2 As Double, dblMLC As Double, dblL_ADJ As Double, dblS_ADJ As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double, dblRL3 As Double +Dim oRS As Recordset +Dim intMATOpen As Integer, dblMATYDS As Double, dblMOPEN As Double + + On Error GoTo Error_EH + + dblL_ADJ = Field2Str2(moRS!l_adj) + dblS_ADJ = Field2Str2(moRS!l_adj) + + + mboolBAG100 = False +' mboolSilica = False + mboolBADD = False + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If moRSProj!BagSand Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Integer(moRSProj!bagdollars) + Else + mboolBAG100 = False + End If + + intOpenPR = Field2Integer(moRS!openpr) + If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 +' If intOpenPR > 75 Then + + Else + intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 + intMATOpen = 50 - intOpenPR ' 02/08/2020 This is a new variable to take only 40% if openings for material yardage +' intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage +' intUSEOpen = 75 - intOpenPR +' intUSEOpen = 100 - intOpenPR + End If + + dblOPEN = (Field2Double(moRS!opening) * intUSEOpen) + dblOPEN = (dblOPEN / 100) ' + 0.99) + dblOPEN = Int(dblOPEN + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) + dblMOPEN = Int(((Field2Double(moRS!opening) * intMATOpen) / 100) + 0.99) +' dblOPEN = 0 +'' Removed per Jesse 02/11/2020 If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 -- Changed back to 500 on 7/9/2018 +' If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 -- Changed back to 500 on 7/9/2018 +' If Field2Integer(moRS!sq_yd) > 400 Then +'' boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN ' + Field2Integer(moRS!opening) + dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) +'' Else +'' boolDEDUCT = False +'' dblNEWYDS = Field2Integer(moRS!sq_yd) +'' dblMATYDS = Field2Integer(moRS!sq_yd) '- dblMOPEN '10/04/2018 changed by Jesse to give more material +'' End If + dblPYRO = 1 + +'' If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings +'' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) +' dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +'' Else +'' dblOPEN = Int((Field2Double(moRS!opening)) + 0.99) +'' End If + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 +''' REMOVE 02/11/2020 PER JESSE If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 'Stop Taking This Per Jesse 7/9/2018 +''' intDELETE = 0 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE + dblL_ADJ 'Changed 7/9/18 per Jesse +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 + dblL_ADJ +''' moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 + dblS_ADJ 'Changed 12/11/17 per Jesse +''' Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 7/9/18 +''' moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 7/9/18 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 + dblL_ADJ 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 + dblS_ADJ 'Change per Jesse 10/13/12 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 04/12/18 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 + dblS_ADJ 'Change per Jesse 04/12/18 +''' End If +''' Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' intDELETE = 0 +''' moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblL_ADJ +''' moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblS_ADJ +''' Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 10/13/12 +''' End If +''' End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + 'Setup Drywall For Black Paper Calculations + strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!Lot_ID) & " AND Inv_No = '4034'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) +' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) + End If + oRS.Close + + strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!Lot_ID) & " AND Inv_No = '4035'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) +' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) + End If + oRS.Close + +'******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + dblMLC = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblMLC = Field2Integer(moRSCMat!qty) + dblMLC = Int((dblMLC * 1.77) + 0.99) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + dblMLC = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + dblMLC = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 And dblML = 0 Then +' If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + +' If Not dblML > 0 Then +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1375'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblML = 0 +' Else +' dblML = Field2Integer(moRSCMat!qty) +' End If +' End If +' If Not dblML > 0 Then +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1371'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblML = 0 +' Else +' dblML = Field2Integer(moRSCMat!qty) +' End If +' End If +' If txtSuperML > 5 Then' +' dblML = Field2Integer(txtSuperML) +' End If + +' If txtSuperRL = -2 Then ' Takeoff RL to always be used per Jesse on 5/14/18 + ' also make sure that foam and wire is adjusted + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If + +' Else +' If txtSuperRL = -1 Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > 0 Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +' moRSCMat!qty = Field2Str(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +' moRSCMat!qty = Field2Str(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If +' Else +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblRL = 0 +' Else +' dblRL = Field2Integer(moRSCMat!qty) +' End If +' End If +' End If + +'**** Black Board/R-Guard Calcuations + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then +' txtSuperBB = Field2Str2(moRSCMat!Qty) + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then +' txtSuperBB = Field2Str2(moRSCMat!Qty) + moRSCMat.Delete + End If + + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbUnchecked +' moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) +' End If + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + + '*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once + dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblMATYDS < 325 Then +' If dblNEWYDS < 325 Then '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + If moRSProj!bb Then + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + End If + Else + If moRSProj!bb Then + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house +' If dblNEWYDS > 325 Then + If dblMATYDS > 325 Then '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + Else +' dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation +' dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + dblBP = Int(((CDbl(dblMATYDS)) / 100) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If +'********************FINISH DEALING WITH BP TYPE BR*********** +' If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland +' dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) +' End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 16)) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) ' Changed 10/12/15 per Jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = 1817 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = 1817" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockPessimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(mstrWireAdj) +' If dblRL > 5 Then 'CHanged 1/9/2018 per Jesse - Remove all RL from Wire Calculation + dblARL = Int(((dblRL) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + If CDbl(txtTtlYdge) < 350 Then + dblCALC = Int((((CDbl(dblMATYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int((((CDbl(dblNEWYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'CHANGED on 2/11/2020 per Jesse +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'Changed per jesse 11/14/19 +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'Changed per jesse 11/14/19 +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) + Else + dblCALC = Int(((CDbl(dblMATYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'CHANGED on 2/11/2020 per Jesse +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 700) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 700) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + moRSCMat.Update + oRC.Close + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '9000' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '9000'" 'Green Floats + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 8) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Magnawall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This calculates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + '**** takes extra yardage from dblNEWYDS for Cement/Lime/Silica Sand + dblBatch = Int((((Field2Integer(dblMATYDS))) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10)) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + dblCMNT2 = dblCMNT + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 And Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + Else + oRC!qty = dblCMNT + oRC.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + Else + oRC!qty = dblLime + oRC.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + Else + oRC!qty = dblS16 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + Else + oRC!qty = dblS16 + oRC.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRC!qty = dblS20 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRC!qty = dblS20 + oRC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + Else + oRC!qty = dblS30 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + Else + oRC!qty = dblS30 + oRC.Update + End If + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + Else + oRC!qty = dblSYNP + oRC.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + Else + oRC!qty = dblSYN + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + oRC.Update + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + If mboolBAG100 Then + dblBAGSAND = Int(((dblCMNT2 + dblKote1) * dblCalcBAGSAND) + 0.99) + End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If + + If dblRL < 5 Then + dblRL3 = 5 + Else + dblRL3 = dblRL + End If + + If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblMATYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL3 * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + 'Changed 2/11/2020 to use MATYDS +' dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL3 * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else +' dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + Else + oRC!qty = dblFD28 + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + Else + oRC!qty = dblFD48 + oRC.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + Else + oRC!qty = dblFD28 + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + Else + oRC!qty = dblFD48 + oRC.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + Else + oRC!qty = dblFD1 + oRC.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((dblFD1 / 2) + 0.99) + oRC.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = 1610" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed on 11/1/17 Per Rose - Jesse told after the fact +' If Field2Integer(dblNEWYDS) <= 550 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 550 And Field2Integer(dblNEWYDS) <= 1250 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1250 And Field2Integer(dblNEWYDS) <= 2200 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 2200 Then +' moRSCMat!qty = 4 +'CHanged on 7/12/2017 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) ''Changed on 9/19/2019 to automate the rounding to full boxes +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.99), 0) 'Changed on 11/13/2019 to 240 per Jesse +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.49), 0) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 240) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) 'Changed to make integer value 1/31/2020 + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed on 9/19/2019 to automate the rounding to full boxes +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.99), 0) 'Changed on 11/13/2019 to 240 per Jesse +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.49), 0) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 240) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) 'Changed to make integer Value 1/31/2020 + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else 'Changed use MATYDS 2/11/2020 + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 280) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.49)) ' to make it the same as Pulte - when standardizing calculations 2/3/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) Per ROse 7/12/2017 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 2) + 0.99) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 100) * 2) + 0.99) 'Changed to use MATYDS 2/11/2020 + moRSCMat.Update + End If + End If + + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcThree() +Dim dblRL As Double, dblDW As Double, dblSP As Double +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String +Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer +Dim strFIN2 As String, strFIN1 As String, dblWire As Double, intUSEOpen As Integer +Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double, intOpenPR As Integer + + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE = "O" Then + MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + + intOpenPR = Field2Integer(moRS!openpr) + If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 + + Else + intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 +' intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage + End If + + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) ' changed to match one kote 10/12/2018 + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 + moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) ' - 24 'Changed per Jesse 10/12/2018 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 +' intDELETE = 19 ' changed to zero per Jesse 7/13/18 + intDELETE = 0 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) 'Change per Jesse 08/01/18 + End If + Else + moRS!s_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 5 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 +' intDELETE = 19 ' changed to zero per Jesse 7/13/18 + intDELETE = 0 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + Else + moRS!l_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 +' moRS!l_yds = Field2Integer(dblNEWYDS) - 5 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + +'Black Board + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'Stucco Wire + 'Paperback wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(mstrWireAdj) + If txtSuperSP > 0 Then + dblSP = Field2Str(txtSuperSP) + Else + dblSP = 0 + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + If dblRL > 10 Then + dblARL = Int(((dblRL - 10) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) ' Changed per Jesse 12/11/17 + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + + 'Self Furing wire + If mstrWIRE = "F" Then +' If dblSP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) +' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) 'CHanged per Jesse 12/11/17 + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + +'Black Paper + If txtSuperSP > 0 Then + dblSP = CDbl(txtSuperSP) + Else + dblSP = 0 + End If + +' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) +' End If +' End If + +' If dblSP > 0 Then + If moRSProj!bp_type = "B6" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) + dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) + End If + ElseIf moRSProj!bp_type = "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) + dblBP = dblBP + (((dblSP * 3.5) / 16)) +' dblBP = dblBP + (((dblSP * 3.5) / 16) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) + End If + ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) + dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strGET = "SELECT * FROM tblTCInfo" + Set oRST = New Recordset + oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + +'Scratch Coat + dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) + dblSCmnt = (dblBatch * oRST!scr_cmnt) + dblSLime = (dblBatch * oRST!scr_lime) + dblRS = (dblBatch * oRST!scr_rs) + +'Brown Coat + dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) + dblCMNT = (dblBatch * oRST!brn_cmnt) + dblLime = (dblBatch * oRST!brn_lime) + dblRS = dblRS + (dblBatch * oRST!brn_rs) + +'Texture Coat + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str(oRSC!id) = "SB" Then + dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) + +' dblSYN = Int(dblBatch + 0.5) + End If + + If Field2Integer(oRSC!cmnt) > 0 Then + dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblTCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) +' Else +' dblRS = 0 + End If + +'This calculates the additional materials needed for the second texture + If moRS!fin2 > 0 Then + + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + ' Else + ' dblTCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) +' Else +' dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) +' Else +' dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) +' Else +' dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) +' Else +' dblS30 = 0 + End If + End If + + dblRS = Int((dblRS / 2000) + 0.99) + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblSYN / 10) + 0.5) + moRSCMat.Update + End If + End If + + If moRSProj!plcmnt Then 'Calculate Plastic Cement + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2415' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2415'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + + Else + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblSLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSLime + moRSCMat.Update + End If + End If + + If dblTLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + +'Calculate 4d Nails + + strSELECT = "inv_no = 1616" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) + moRSCMat.Update + End If + End If + +'Calculate Staples + + strSELECT = "inv_no = 1705" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 400 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then + moRSCMat!qty = 4 + ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then + moRSCMat!qty = 5 + ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then + moRSCMat!qty = 6 + ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 7 + ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then + moRSCMat!qty = 8 + ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then + moRSCMat!qty = 9 + ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then + moRSCMat!qty = 10 + End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ConvertSuper() +Dim strGET As String, strSQL As String +Dim oRSC As Recordset + On Error GoTo Error_EH + + If txtSuper78 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + End If + End If + + If txtSuper38 <> 0 Then + strSQL = "inv_no = 1150" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + End If + End If + + If txtSuper783 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = 1145" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = 1565" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + Else + strSQL = "inv_no = 1140" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + End If + + If txtSuperML <> 0 Then + strSQL = "inv_no = 1370" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + End If + End If + + If txtSuperDW <> 0 Then + strSQL = "inv_no = 1320" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + End If + End If + +' If Field2Str2(txtSuper1383) <> 0 Then + If (txtSuper1383) <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = 1135" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module ConvertSuper" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcMetal() +Dim oRS As Recordset +Dim strSQL As String, dblMETAL As Double + On Error GoTo Error_EH + + moRS!METAL = 0 + + strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!summetal) + moRS!METAL = dblMETAL + moRS!calcdate = Now +' moRS!calcdate = Date + moRS.Update + txtMetal = dblMETAL + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module CalcMetal" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSuperSP_LostFocus() + txtSuperSP = Integer2Field(txtSuperSP) +End Sub + +Private Sub txtYardMemo_LostFocus() + txtYardMemo = UCase(txtYardMemo) +End Sub + +Private Sub PrintLathInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, intNMonth As Integer +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim intDUE1 As Integer, intDUE2 As Integer +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + +' If moRSProj!Wrap Then +' mboolWRAP = True +' Else +' mboolWRAP = False +' End If + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + If Not oRS.EOF Then + + + End If + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSE.EOF Then + + If oRSE!Wrap Then + mboolWRAP = True 'Check this logic in other Print Invoice areas + Else + mboolWRAP = False + End If + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !customer_no = Field2Str(moRSProj!ar) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str2(moRS!lot_no), "000") & "L" +' mstrINV = Field2Str(moRSProj!inv) & Format(CSng(Field2Str2(moRS!lot_no)), "###") & "L" + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" + mstrINV = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intNMonth = Month(Date) + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) +' If mbool2Dates Then +' intDUE1 = Integer2Field(moRSProj!duedate) +' intDUE2 = Integer2Field(moRSProj!duedate2) +' Else +' intDUE1 = Integer2Field(moRSProj!duedate) +' End If + If intCDay > moRSProj!inv_due Then + If mbool2Dates Then +' If intCDay > intDUE1 And intCDay < intDUE2 Then + + If intCDay > intDUE1 And intNMonth = intCMonth Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + + ElseIf intCDay > intDUE2 Or intCDay < intDUE1 Then +'' ElseIf intCDay > intDUE1 And intCDay > intDUE2 Then + + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + End If '***May Be An Extra End If + Else + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear +' !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update + !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Day(moRS!lorder) +' intDay = intDay + 30 +' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2017 to try to simplify dates on invoices +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + dblBillAmt = Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !invoice_no = mstrINV + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "After Main Lath Information " + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + gstrMODULE = "After Trans ID Update Information " + + '*****Project not marked to bill options with Stucco + '*****Options will be billed with Lath + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Day(moRS!lorder) +' intDay = intDay + 30 +' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2018 to try and simplify dates +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !customer_no = Field2Str(moRSProj!ar) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + + !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!lorder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INS CREDIT " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !invoice_no = mstrINV + !header = vbUnchecked +' !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "After Main Lath Information " + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module PrintLathInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintCompleteInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double, strSQLINFO As String +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSC.EOF Then + If Field2Str(oRSC!Address2) = "" Then + strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + strADD3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + strADD4 = "" + Else + strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + If oRS.EOF Then + + End If + + + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Val(Field2Str2(moRS!forder)) +' !ship_date = Val(Field2Str2(moRS!SORDER)) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + End If + + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Val(oRSE!s_bill) + + !sales_code = Field2Str(oRSE!s_code) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + End If + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!forder) +' !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSP!Amt)) + dblBillAmt = dblBillAmt + Val(Field2Str2(oRSP!Amt)) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + oRSO.MoveNext + End If + Loop + +'********************************************************************************************************* + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + End If + +'********************************************************************************************************* + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintCompleteInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strTEST As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double ', mboolWRAP As Boolean +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String, strModELEV As String + + On Error GoTo Error_EH + +' If moRSProj!Wrap Then +' mboolWRAP = True +' Else +' mboolWRAP = False +' End If + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly +' If oRSE.EOF Then +' End If +' Else + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If +' End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +'' intCMonth = Month(moRS!SORDER) +'' intCDay = Day(moRS!SORDER) +'' intCYear = Year(moRS!SORDER) +' intCMonth = Month(moRS!forder) +' intCDay = Day(moRS!forder) +' intCYear = Year(moRS!forder) +' If intCDay > moRSProj!inv_due Then +' intCMonth = intCMonth + 1 +' If intCMonth > 12 Then +' intCMonth = intCMonth - 12 +' intCYear = intCYear + 1 +' End If +' End If + intCDay = Field2Integer(moRSProj!inv_due) ' Invoice Date + If intCDay = 0 Then + intCDay = Day(moRS!forder) + End If + + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Val(oRSE!s_bill) + + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + strModELEV = Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With +' End If + + gstrMODULE = "Before Option Setup" + + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "Before Update mlngINVID second time" + +'********************************************************************************************************** + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Round((dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1), 2) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + End If +' End If +'*********************************************************************************************************** + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double, boolHEADER As Boolean, txtSALECD As String + + On Error GoTo Error_EH + + gintCOPY = 1 + boolHEADER = False + txtSALECD = "" + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' or B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + +' This has been changed to always pickup the Option Billing Info + + If Not mboolSTONE3 Then ' CHANGED 01/10/2020 +' If mboolSTONE3 Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) + ' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + !sales_code = Field2Str(oRSE!st_code) + txtSALECD = Field2Str(oRSE!st_code) + If txtSALECD <> "" Then + !header = vbChecked + boolHEADER = True + Else + !header = vbUnchecked + boolHEADER = False + End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!st_bill) + !amount = Field2Str2(oRSE!st_bill) + +' !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) +' !inv_type = "S" + !inv_type = "V" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + + If boolHEADER Then + !header = vbUnchecked + boolHEADER = False + Else + !header = vbChecked + boolHEADER = True + End If + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSO!Amt) +' !non_tax_amt = Field2Str2(oRSE!st_bill) +'' dblINVTOTAL = dblINVTOTAL + Val(oRSO!Amt) +'' dblBillAmt = Val(oRSO!Amt) +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +' dblBillAmt = Val(oRSE!st_bill) + +'' !sales_code = Field2Str(oRSO!b_code) +' !sales_code = Field2Str(oRSE!st_code) + + + ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + ' !inv_due_date = Field2Str(strDate) + ' !disc_due_date = DateAdd("d", 3, moRS!Vorder) + ' !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + ' !sales_code = Field2Str(oRSE!st_code) + +'' If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +'' !taxcode = "AZ" +'' Else +'' !taxcode = Field2Str(moRSProj!taxcode) +'' End If +'' !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +'' !price = Field2Str2(oRSO!Amt) +'' !amount = Field2Str2(oRSO!Amt) +' !price = Field2Str2(oRSE!st_bill) +' !amount = Field2Str2(oRSE!st_bill) +'' !header = vbChecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +' !po_num = 57961 +'' .Update + + '**** +'' gstrMODULE = "Before mlngINVID update" +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update + +'' End With +'' End If +'************************************************************************************************ + '********** Print Options that are stone + +'' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +'' strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID +'' Set oRSO = New Recordset +'' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +'' Do Until oRSO.EOF +'' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +'' Set oRSP = New Recordset +'' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSP.EOF Then +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_id = gintLOTID +'' !Proj_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) +'' !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) +'' !customer_no = Field2Str(moRSProj!ar) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' Else +''''' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' End If +'' gstrMODULE = "During Option Setup for ARINVOICE" +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !job_number = Field2Str(moRS!jobcost) +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSP!amt) +'' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!amt) +'' dblBillAmt = dblBillAmt + Val(oRSP!amt) +'' !sales_code = Field2Str(oRSP!b_code) +'' !Description = Field2Str(oRSP!Desc) & " - " & strModELEV +'' !Quantity = 1 +'' !price = Field2Str2(oRSP!amt) +'' !amount = Field2Str2(oRSP!amt) +'' !header = vbUnchecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update + +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If +'' oRSO.MoveNext +'' Loop +'' End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv_20200111() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' or B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + +' This has been changed to always pickup the Option Billing Info + + If Not mboolSTONE3 Then ' CHANGED 01/10/2020 +' If mboolSTONE3 Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) + ' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + !invoice_no = strTEST2 + ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + Else +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 + ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + End If + ' intCMonth = Month(moRS!VOrder) + ' intCDay = Day(moRS!VOrder) + ' intCYear = Year(moRS!VOrder) + ' If intCDay > moRSProj!inv_due Then + ' intCMonth = intCMonth + 1 + ' If intCMonth > 12 Then + ' intCMonth = intCMonth - 12 + ' intCYear = intCYear + 1 + ' End If + ' End If + ' intCDay = Field2Integer(moRSProj!inv_due) + ' If intCDay = 0 Then + ' Select Case intCMonth + ' Case 2 + ' intCDay = 28 + ' Case 1, 3, 5, 7, 8, 10, 12 + ' intCDay = 31 + ' Case 4, 6, 9, 11 + ' intCDay = 30 + ' End Select + ' End If + + ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSO!Amt) +' !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSO!Amt) + dblBillAmt = Val(oRSO!Amt) +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +' dblBillAmt = Val(oRSE!st_bill) + + !sales_code = Field2Str(oRSO!b_code) +' !sales_code = Field2Str(oRSE!st_code) + + + ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + ' !inv_due_date = Field2Str(strDate) + ' !disc_due_date = DateAdd("d", 3, moRS!Vorder) + ' !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + ' !sales_code = Field2Str(oRSE!st_code) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSO!Amt) + !amount = Field2Str2(oRSO!Amt) +' !price = Field2Str2(oRSE!st_bill) +' !amount = Field2Str2(oRSE!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM +' !po_num = 57961 + .Update + + '**** + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + + End With + End If +'************************************************************************************************ + '********** Print Options that are stone + +'' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +'' strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID +'' Set oRSO = New Recordset +'' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +'' Do Until oRSO.EOF +'' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +'' Set oRSP = New Recordset +'' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSP.EOF Then +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_id = gintLOTID +'' !Proj_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) +'' !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) +'' !customer_no = Field2Str(moRSProj!ar) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' Else +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' End If +'' gstrMODULE = "During Option Setup for ARINVOICE" +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !job_number = Field2Str(moRS!jobcost) +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSP!amt) +'' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!amt) +'' dblBillAmt = dblBillAmt + Val(oRSP!amt) +'' !sales_code = Field2Str(oRSP!b_code) +'' !Description = Field2Str(oRSP!Desc) & " - " & strModELEV +'' !Quantity = 1 +'' !price = Field2Str2(oRSP!amt) +'' !amount = Field2Str2(oRSP!amt) +'' !header = vbUnchecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update + +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If +'' oRSO.MoveNext +'' Loop +'' End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then +' strSELECT = "{tblARInvoice.po_num} = '57961'" ' & gstrPONUM & "'" + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintInvxx() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'xx + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + oRS.Close + oRSS.Close + oRSC.Close + 'End of Interior Paint Invoice PI + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'yy + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'zz + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub JCSetup() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblJCTrans" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblJCTransM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If IsNull(moRSProj!ar) Then + MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" + Exit Sub + End If + With oRS + .AddNew + !Lot_ID = gintLOTID + !job_number = Field2Str(moRS!jobcost) + !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no + !address = Field2Str(moRS!address) + !customer_no = Field2Str(moRSProj!ar) + !retention_pct = Field2Str2(moRSProj!retention) + !setup_date = Date + !status_date = Date + .Update + End With + MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module JCSetup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POInvoice() +Dim strSELECT As String + + On Error GoTo Error_EH + + If Not mboolSTPAY Then + If moRS!st_flg Then + MsgBox "This Lot Has Already Had A Stone Invoice Printed", vbOKOnly, "Invoice Not Available" + Exit Sub + End If + End If + + gintCOPY = 1 + strSELECT = "{tblPOrder.PONum} = " & lstPO.ItemData(lstPO.ListIndex) + If gstrPONUM = "" Then + gstrPONUM = lstPO.ItemData(lstPO.ListIndex) + End If +'************************************************************************************* testing Stone Invoice + If optStone Then +' If optStucco Then + Call PrintStoneInv + Exit Sub + End If + +'************************************************************************************* + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POInvoice" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ElevLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!Folder = oRS!Folder + oRSS!FileName = oRS!FileName + oRSS!Primary = oRS!Primary + oRSS.Update + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ElevLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintIInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PI" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_IDate = Date + 21 + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_bill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_bill)) + !sales_code = Field2Str(oRSE!PNT_CODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_bill) + !amount = Field2Str2(oRSE!pnt_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PI" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + +' gstrMODULE = "Before Option Setup" + +' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +' Set oRSO = New Recordset +' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +' Do Until oRSO.EOF +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +'' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +' Set oRSP = New Recordset +' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSP.EOF Then +' With oRS +' .AddNew +' !Trans_ID = mlngINVID +' !Lot_id = gintLOTID +' !proj_id = gintPROJID +' !project = Field2Str(moRSProj!proj_desc) +' !lot_no = Field2Str(moRS!lot_no) +' !address = Field2Str(moRS!address) +' !inv_type = "S" +' !ship_date = Field2Str(moRS!forder) +'' !ship_date = Field2Str(moRS!SORDER) +' !customer_no = Field2Str(moRSProj!ar) +' !projcode = Field2Str(moRSProj!proj_code) +' !CodeDesc = Trim(Field2Str(moRSProj!proj_code)) & "-" & Trim(Field2Str(moRSProj!proj_desc)) +' !ProjLot = Trim(Field2Str(moRSProj!proj_desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then +'' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' Else +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' End If +' intCMonth = Month(moRS!forder) +' intCDay = Day(moRS!forder) +' intCYear = Year(moRS!forder) +'' intCMonth = Month(moRS!SORDER) +'' intCDay = Day(moRS!SORDER) +'' intCYear = Year(moRS!SORDER) +' If intCDay > moRSProj!inv_due Then +' intCMonth = intCMonth + 1 +' If intCMonth > 12 Then +' intCMonth = intCMonth - 12 +' intCYear = intCYear + 1 +' End If +' End If +' intCDay = Field2Integer(moRSProj!inv_due) +' If intCDay = 0 Then +' Select Case intCMonth +' Case 2 +' intCDay = 28 +' Case 1, 3, 5, 7, 8, 10, 12 +' intCDay = 31 +' Case 4, 6, 9, 11 +' intCDay = 30 +' End Select +' End If +' gstrMODULE = "During Option Setup for ARINVOICE" +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear +' !invoice_date = Field2Str(strCDate) +'' moRS!PRNT_S = Field2Str(strCDate) +'' moRS.Update +'' !invoice_date = DateAdd("d", 3, moRS!sorder) +' !disc_due_date = DateAdd("d", 3, moRS!forder) +'' !disc_due_date = DateAdd("d", 3, moRS!SORDER) +' !job_number = Field2Str(moRS!jobcost) +' intYear = Year(!invoice_date) +' intMonth = Month(!invoice_date) + 1 +' If intMonth > 12 Then +' intMonth = intMonth - 12 +' intYear = intYear + 1 +' End If +' intDay = Field2Integer(moRSProj!duedate) +'' If intDay = 0 Then +'' intDay = 1 +'' End If +' Select Case intMonth +' Case 2 +' If intDay = 0 Then +' intDay = 28 +' End If +' If intDay > 28 Then +' intDay = 28 +' End If +' Case 1, 3, 5, 7, 8, 10, 12 +' If intDay = 0 Then +' intDay = 31 +' End If +' If intDay > 31 Then +' intDay = 31 +' End If + +' Case 4, 6, 9, 11 +' If intDay = 0 Then +' intDay = 30 +' End If +' If intDay > 30 Then +' intDay = 30 +' End If +' End Select + +' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) +' !non_tax_amt = Field2Str2(oRSP!Amt) +' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) +' !sales_code = Field2Str(oRSP!b_code) +' !Description = Field2Str(oRSP!Desc) +' !Quantity = 1 +' !price = Field2Str2(oRSP!Amt) +' !amount = Field2Str2(oRSP!Amt) +' !header = vbUnchecked +' If Not oRSC.EOF Then +' !c_add1 = Field2Str(oRSC!Name) +' !c_add2 = Field2Str(oRSC!address1) +' If Field2Str(oRSC!address2) = "" Then +' !c_add3 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) +' Else +' !c_add3 = Field2Str(oRSC!address2) +' End If +' If Field2Str(oRSC!address2) = "" Then +' !c_add4 = "" +' Else +' !c_add4 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) +' End If +' Else +' !c_add1 = "" +' !c_add2 = "" +' !c_add3 = "" +' !c_add4 = "" +' End If +' !po_num = gstrPONUM +' .Update +' mlngINVID = mlngINVID + 1 +' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +' Set moRSInvINFO = New Recordset +' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +' moRSInvINFO.Update +' End With +' End If +' oRSO.MoveNext +' Loop +' End If + +' gstrMODULE = "Before Update mlngINVID second time" +' If Field2Integer(moRSProj!retention) > 0 Then +' dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") +' Else +' dblRETENTION = 0 +' End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PI' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PI' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" +' strSELECT = "{tblARInvoice.Lot_ID} = '" & gintLOTID & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintInteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintPaintEInvxx() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + If oRSE.EOF Then + + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PE" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) +' moRS!PNT_EDate = Field2Str(strCDate) + moRS!PNT_EDate = Date + 21 + moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & Format(intYear, "0000") + !inv_due_date = strDate +' !inv_due_date = DateAdd("d", 3, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_ebill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) + !sales_code = Field2Str(oRSE!PNT_ECODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_ebill) + !amount = Field2Str2(oRSE!pnt_ebill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PE" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintFInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PF" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_FDate = Date + 21 +' moRS!PNT_FDate = Field2Str(strCDate) + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_fbill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_fbill)) + !sales_code = Field2Str(oRSE!PNT_FCODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT FINAL - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_fbill) + !amount = Field2Str2(oRSE!pnt_fbill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PF" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + gstrMODULE = "Before Update mlngINVID second time" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PF' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PF' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PF'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PF'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintFinalInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintEInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PE" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_EDate = Date + 21 +' moRS!PNT_FDate = Field2Str(strCDate) + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_ebill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) + !sales_code = Field2Str(oRSE!PNT_ECODE) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_ebill) + !amount = Field2Str2(oRSE!pnt_ebill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PE" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + gstrMODULE = "Before Update mlngINVID second time" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frx new file mode 100644 index 0000000..4541437 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frm new file mode 100644 index 0000000..cc52b02 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frm @@ -0,0 +1,20624 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotInfo5 + BorderStyle = 1 'Fixed Single + Caption = "Lot Information - Pre-Mix / Typar Lots" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + TabIndex = 13 + Top = 780 + Width = 600 + End + Begin VB.TextBox txtStoneBill + Alignment = 1 'Right Justify + Height = 330 + Left = 8640 + TabIndex = 227 + TabStop = 0 'False + Top = 420 + Visible = 0 'False + Width = 540 + End + Begin VB.CheckBox chkFirst + Caption = "First Time" + Height = 315 + Left = 10680 + TabIndex = 212 + Top = 1500 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtESTID + Height = 375 + Left = 3120 + TabIndex = 210 + Top = 1680 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtOPEN + Height = 285 + Left = 10740 + TabIndex = 209 + Top = 1140 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtJC + Enabled = 0 'False + Height = 315 + Left = 2700 + MaxLength = 7 + TabIndex = 8 + Top = 2220 + Width = 915 + End + Begin VB.Timer tmrPause + Enabled = 0 'False + Interval = 500 + Left = 8700 + Top = 1020 + End + Begin Crystal.CrystalReport crOrder + Left = 120 + Top = 960 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtSand + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5160 + TabIndex = 33 + TabStop = 0 'False + Top = 780 + Width = 420 + End + Begin VB.ListBox lstPlans + Height = 2205 + Left = 9240 + Sorted = -1 'True + TabIndex = 31 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdFindPlan + Height = 435 + Left = 2580 + Picture = "frmLotInfo5.frx":0000 + Style = 1 'Graphical + TabIndex = 7 + Top = 1440 + Width = 435 + End + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 29 + TabStop = 0 'False + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 27 + TabStop = 0 'False + Top = 60 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1020 + Left = 3900 + MultiLine = -1 'True + TabIndex = 15 + Top = 1515 + Width = 4635 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + MaxLength = 3 + TabIndex = 12 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 3 + TabIndex = 10 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + TabIndex = 14 + TabStop = 0 'False + Top = 1155 + Width = 615 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + MaxLength = 3 + TabIndex = 11 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 25 + TabStop = 0 'False + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 24 + TabStop = 0 'False + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 2 + TabIndex = 9 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 23 + TabStop = 0 'False + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Enabled = 0 'False + Height = 315 + Left = 1440 + MaxLength = 5 + TabIndex = 5 + Top = 1125 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + MaxLength = 8 + TabIndex = 6 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + MaxLength = 15 + TabIndex = 4 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + MaxLength = 30 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 150 + TabIndex = 35 + TabStop = 0 'False + Top = 2910 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "&General Information" + TabPicture(0) = "frmLotInfo5.frx":0442 + Tab(0).ControlEnabled= -1 'True + Tab(0).Control(0)= "lblDiana" + Tab(0).Control(0).Enabled= 0 'False + Tab(0).Control(1)= "lblYardMemo" + Tab(0).Control(1).Enabled= 0 'False + Tab(0).Control(2)= "lblMetal" + Tab(0).Control(2).Enabled= 0 'False + Tab(0).Control(3)= "lblLathBill" + Tab(0).Control(3).Enabled= 0 'False + Tab(0).Control(4)= "lblTextureO" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "lblBrownO" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "lblScratchO" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "lblSandO" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "lblLathO" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lblOrderDates" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtLotNotes" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "cmdShowChange" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "txtYardMemo" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cmdEdit" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "cmdSetupRpt" + Tab(0).Control(14).Enabled= 0 'False + Tab(0).Control(15)= "txtMetal" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "cmdDelLot" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "cmdAddLot" + Tab(0).Control(17).Enabled= 0 'False + Tab(0).Control(18)= "txtLathBill" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "txtTextureO" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "txtBrownO" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "txtScratchO" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "txtSandO" + Tab(0).Control(22).Enabled= 0 'False + Tab(0).Control(23)= "txtLathO" + Tab(0).Control(23).Enabled= 0 'False + Tab(0).Control(24)= "cmdSaveLotInfo" + Tab(0).Control(24).Enabled= 0 'False + Tab(0).Control(25)= "cmdOrders" + Tab(0).Control(25).Enabled= 0 'False + Tab(0).Control(26)= "cmdExit" + Tab(0).Control(26).Enabled= 0 'False + Tab(0).Control(27)= "cmdCalc" + Tab(0).Control(27).Enabled= 0 'False + Tab(0).Control(28)= "cmdJCSetup" + Tab(0).Control(28).Enabled= 0 'False + Tab(0).Control(29)= "chkSynthetic" + Tab(0).Control(29).Enabled= 0 'False + Tab(0).Control(30)= "cmdOrder" + Tab(0).Control(30).Enabled= 0 'False + Tab(0).Control(31)= "chkStone" + Tab(0).Control(31).Enabled= 0 'False + Tab(0).Control(32)= "cmdPrintR" + Tab(0).Control(32).Enabled= 0 'False + Tab(0).Control(33)= "chkOthers" + Tab(0).Control(33).Enabled= 0 'False + Tab(0).Control(34)= "chkNoPay" + Tab(0).Control(34).Enabled= 0 'False + Tab(0).Control(35)= "chkPaint" + Tab(0).Control(35).Enabled= 0 'False + Tab(0).ControlCount= 36 + TabCaption(1) = "&Super's Orders" + TabPicture(1) = "frmLotInfo5.frx":045E + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblSuperNotes" + Tab(1).Control(1)= "lblPreOrder" + Tab(1).Control(2)= "lblSupHelp" + Tab(1).Control(3)= "lblSuperSP" + Tab(1).Control(4)= "lblSuperDW" + Tab(1).Control(5)= "lblSuperRL" + Tab(1).Control(6)= "lblSuperML" + Tab(1).Control(7)= "lblSuper138" + Tab(1).Control(8)= "lblSuper38" + Tab(1).Control(9)= "lblSuper78" + Tab(1).Control(10)= "lblSuper783" + Tab(1).Control(11)= "lblSuper12" + Tab(1).Control(12)= "linSO" + Tab(1).Control(13)= "lblSuperBB" + Tab(1).Control(14)= "lblTake138" + Tab(1).Control(15)= "lblBB" + Tab(1).Control(16)= "lblZMetal" + Tab(1).Control(17)= "lstPreOrder" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdRePrintL" + Tab(1).Control(19)= "cmdStuccoPay" + Tab(1).Control(20)= "cmdLathPay" + Tab(1).Control(21)= "txtSuperNotes" + Tab(1).Control(22)= "cmdPreOrderPrintS" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "cmdPreOrderPrintY" + Tab(1).Control(23).Enabled= 0 'False + Tab(1).Control(24)= "txtCalc138" + Tab(1).Control(24).Enabled= 0 'False + Tab(1).Control(25)= "txtSuperSP" + Tab(1).Control(26)= "txtSuperDW" + Tab(1).Control(27)= "txtSuperML" + Tab(1).Control(28)= "txtSuperRL" + Tab(1).Control(29)= "txtSuper1383" + Tab(1).Control(30)= "txtSuper38" + Tab(1).Control(31)= "txtSuper78" + Tab(1).Control(32)= "txtSuper783" + Tab(1).Control(33)= "txtSuper12" + Tab(1).Control(34)= "txtSuperBB" + Tab(1).Control(35)= "txtTake138" + Tab(1).Control(35).Enabled= 0 'False + Tab(1).Control(36)= "cmdLFlag" + Tab(1).Control(37)= "cmdIssue" + Tab(1).Control(38)= "cmdPreOrderPrintPC" + Tab(1).ControlCount= 39 + TabCaption(2) = "&Materials" + TabPicture(2) = "frmLotInfo5.frx":047A + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblMatInst" + Tab(2).Control(1)= "lblOrderBalance" + Tab(2).Control(2)= "lblLMLength" + Tab(2).Control(3)= "lblLMetal" + Tab(2).Control(4)= "lblLMType" + Tab(2).Control(5)= "lblLMDFlag" + Tab(2).Control(6)= "lblQty" + Tab(2).Control(7)= "lblLMInvNo" + Tab(2).Control(8)= "lblLMDesc" + Tab(2).Control(9)= "lstLMaterial" + Tab(2).Control(10)= "lstInventory" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "chkChange" + Tab(2).Control(12)= "cmdFindInv" + Tab(2).Control(13)= "cmdInventory" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "txtLMBalance" + Tab(2).Control(14).Enabled= 0 'False + Tab(2).Control(15)= "cboLMMetal" + Tab(2).Control(16)= "cboLMType" + Tab(2).Control(17)= "cboLMDFlag" + Tab(2).Control(18)= "txtLMLength" + Tab(2).Control(19)= "txtLMQty" + Tab(2).Control(20)= "txtLMInvNo" + Tab(2).Control(21)= "txtLMDesc" + Tab(2).Control(22)= "cmdDelMatrl" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdSaveMatrl" + Tab(2).Control(24)= "cmdAddMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).ControlCount= 25 + TabCaption(3) = "Op&tions" + TabPicture(3) = "frmLotInfo5.frx":0496 + Tab(3).ControlEnabled= 0 'False + Tab(3).Control(0)= "txtOSt_SqFt" + Tab(3).Control(1)= "chkOStone" + Tab(3).Control(2)= "lstPOptions" + Tab(3).Control(3)= "cmdOptAdd" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "cmdOptDel" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lstLOptions" + Tab(3).Control(6)= "txtLODesc" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "txtLOYdge" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "txtLOFin2" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "txtLOFoam" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "txtLOTexture" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "txtLOMDesc" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "txtLOMInvNo" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "txtLOMQty" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "txtLOMLength" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "cboLOMDFlag" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "cboLOMType" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "cboLOMetal" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "txtNote2" + Tab(3).Control(19)= "txtNote" + Tab(3).Control(20)= "lstOptMatrl" + Tab(3).Control(21)= "lblOptNum" + Tab(3).Control(22)= "lblOStone" + Tab(3).Control(23)= "lblPOptions" + Tab(3).Control(24)= "lblLOptions" + Tab(3).Control(25)= "lblLODesc" + Tab(3).Control(26)= "lblLOYdge" + Tab(3).Control(27)= "lblLOFin2" + Tab(3).Control(28)= "lblLOFAdj" + Tab(3).Control(29)= "lblLOTexture" + Tab(3).Control(30)= "lblLOMDesc" + Tab(3).Control(31)= "lblLOMInvNo" + Tab(3).Control(32)= "lblLOMQty" + Tab(3).Control(33)= "lblLOMDFlag" + Tab(3).Control(34)= "lblLOMType" + Tab(3).Control(35)= "lblLOMetal" + Tab(3).Control(36)= "lblLOMLength" + Tab(3).Control(37)= "lblSelectOpt" + Tab(3).Control(38)= "lblBillingAmt" + Tab(3).Control(39)= "lblBAmt" + Tab(3).ControlCount= 40 + TabCaption(4) = "&Lath Orders" + TabPicture(4) = "frmLotInfo5.frx":04B2 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lblLathOrd" + Tab(4).Control(1)= "lblYardOrd" + Tab(4).Control(2)= "lstLath" + Tab(4).Control(2).Enabled= 0 'False + Tab(4).Control(3)= "lstYard" + Tab(4).Control(3).Enabled= 0 'False + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco &Orders" + TabPicture(5) = "frmLotInfo5.frx":04CE + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lblTexOrd" + Tab(5).Control(1)= "lblBrnOrd" + Tab(5).Control(2)= "lblScrOrd" + Tab(5).Control(3)= "lstTexture" + Tab(5).Control(3).Enabled= 0 'False + Tab(5).Control(4)= "lstBrown" + Tab(5).Control(4).Enabled= 0 'False + Tab(5).Control(5)= "lstScratch" + Tab(5).Control(5).Enabled= 0 'False + Tab(5).ControlCount= 6 + TabCaption(6) = "&Purchase Orders" + TabPicture(6) = "frmLotInfo5.frx":04EA + Tab(6).ControlEnabled= 0 'False + Tab(6).Control(0)= "lblPayYds" + Tab(6).Control(1)= "lblOptMatPrice" + Tab(6).Control(2)= "lblPODate" + Tab(6).Control(3)= "lblPOMType" + Tab(6).Control(4)= "lblPODFlag" + Tab(6).Control(5)= "lblPOQty" + Tab(6).Control(6)= "lblDescription" + Tab(6).Control(7)= "lblInvNo" + Tab(6).Control(8)= "lblPONum" + Tab(6).Control(9)= "lblDesc" + Tab(6).Control(10)= "lblPO" + Tab(6).Control(11)= "lblPONotes" + Tab(6).Control(12)= "lblPOMaterials" + Tab(6).Control(13)= "lblIssueTo" + Tab(6).Control(14)= "lblPOType" + Tab(6).Control(15)= "lblPayType" + Tab(6).Control(16)= "lstPOMaterial" + Tab(6).Control(17)= "cmdPrintPOPay" + Tab(6).Control(18)= "txtPay" + Tab(6).Control(19)= "fraPO" + Tab(6).Control(20)= "cmdPrintForm" + Tab(6).Control(20).Enabled= 0 'False + Tab(6).Control(21)= "txtPOPrice" + Tab(6).Control(22)= "txtPODate" + Tab(6).Control(23)= "txtPODesc" + Tab(6).Control(24)= "txtPOMatDesc" + Tab(6).Control(25)= "cmdPrintPO" + Tab(6).Control(25).Enabled= 0 'False + Tab(6).Control(26)= "cmdDelPOMat" + Tab(6).Control(26).Enabled= 0 'False + Tab(6).Control(27)= "cmdSavePOMat" + Tab(6).Control(28)= "cmdAddPOMat" + Tab(6).Control(28).Enabled= 0 'False + Tab(6).Control(29)= "cmdFindPOMat" + Tab(6).Control(30)= "cboPOMType" + Tab(6).Control(31)= "cboPODFlag" + Tab(6).Control(32)= "txtPOQty" + Tab(6).Control(33)= "txtPOInvNo" + Tab(6).Control(34)= "cmdDelPO" + Tab(6).Control(34).Enabled= 0 'False + Tab(6).Control(35)= "cmdSavePO" + Tab(6).Control(36)= "cmdAddPO" + Tab(6).Control(36).Enabled= 0 'False + Tab(6).Control(37)= "txtIssueTo" + Tab(6).Control(38)= "txtPONum" + Tab(6).Control(38).Enabled= 0 'False + Tab(6).Control(39)= "txtPONotes" + Tab(6).Control(40)= "lstPO" + Tab(6).Control(41)= "cboPOType" + Tab(6).Control(42)= "txtPOType" + Tab(6).Control(42).Enabled= 0 'False + Tab(6).Control(43)= "txtPayType" + Tab(6).Control(44)= "lstLOOKUP" + Tab(6).Control(44).Enabled= 0 'False + Tab(6).ControlCount= 45 + Begin LpLib.fpList lstLOOKUP + Height = 2820 + Left = -67275 + TabIndex = 241 + Top = 2760 + Visible = 0 'False + Width = 3555 + _Version = 196608 + _ExtentX = 6271 + _ExtentY = 4974 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":0506 + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 285 + Left = 1005 + TabIndex = 239 + Top = 2940 + Width = 675 + End + Begin VB.CommandButton cmdPreOrderPrintPC + Caption = "Print PreCast PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 237 + Top = 1380 + Width = 1335 + End + Begin VB.CommandButton cmdIssue + Caption = "RePrint &Yard Ticket" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 234 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkNoPay + Alignment = 1 'Right Justify + BackColor = &H00C0C0C0& + Caption = "No Pay Sheets Issued" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 2220 + TabIndex = 233 + Top = 3420 + Width = 2295 + End + Begin VB.CheckBox chkOthers + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 255 + Left = 2940 + TabIndex = 232 + Top = 3180 + Width = 1575 + End + Begin VB.CommandButton cmdPrintR + Caption = "Process Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 231 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 300 + Left = -64755 + TabIndex = 230 + Top = 675 + Width = 975 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 240 + Left = -68475 + TabIndex = 228 + Top = 735 + Width = 1890 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 3180 + TabIndex = 225 + Top = 2940 + Width = 1335 + End + Begin VB.TextBox txtPayType + Height = 315 + Left = -70920 + MaxLength = 1 + TabIndex = 58 + Top = 2280 + Width = 375 + End + Begin VB.CommandButton cmdOrder + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 220 + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtPOType + Height = 285 + Left = -70980 + TabIndex = 219 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 615 + End + Begin VB.ComboBox cboPOType + Height = 315 + ItemData = "frmLotInfo5.frx":086F + Left = -72300 + List = "frmLotInfo5.frx":087F + Style = 2 'Dropdown List + TabIndex = 55 + Top = 1200 + Width = 1995 + End + Begin VB.CheckBox chkSynthetic + Alignment = 1 'Right Justify + Caption = "Synthetic" + Height = 195 + Left = 2100 + TabIndex = 215 + Top = 2940 + Width = 975 + End + Begin VB.CommandButton cmdLFlag + Caption = "Set Lath Flags" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69435 + TabIndex = 214 + Top = 705 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdJCSetup + Caption = "Setup JC Record" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 211 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = -73080 + TabIndex = 137 + TabStop = 0 'False + Top = 1680 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 127 + Top = 2325 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 128 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 129 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 130 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 131 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 132 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 133 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 134 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 135 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 136 + Top = 4740 + Width = 795 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfo5.frx":08BA + Left = -74760 + List = "frmLotInfo5.frx":08C1 + TabIndex = 126 + Top = 1020 + Width = 3095 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + TabIndex = 125 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 124 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 123 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 122 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -67320 + TabIndex = 121 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = -74760 + Sorted = -1 'True + TabIndex = 120 + Top = 1080 + Width = 885 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = -73800 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 60 + Top = 2700 + Width = 3915 + End + Begin VB.TextBox txtPONum + BackColor = &H00E0E0E0& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -72300 + TabIndex = 119 + TabStop = 0 'False + Top = 840 + Width = 975 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 56 + Top = 1560 + Width = 3735 + End + Begin VB.CommandButton cmdAddPO + Caption = "&New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 118 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdSavePO + Caption = "S&ave PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 62 + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdDelPO + Caption = "D&elete PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 117 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66240 + TabIndex = 116 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -64920 + TabIndex = 115 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 114 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 112 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 113 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 103 + Top = 780 + Width = 4275 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 104 + Top = 1200 + Width = 2625 + End + Begin VB.TextBox txtLMQty + Alignment = 1 'Right Justify + ForeColor = &H00000000& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 105 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtLMLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 2 + TabIndex = 109 + Top = 3192 + Width = 915 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfo5.frx":08D2 + Left = -68100 + List = "frmLotInfo5.frx":08DC + Style = 2 'Dropdown List + TabIndex = 106 + Top = 1980 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfo5.frx":08F0 + Left = -68085 + List = "frmLotInfo5.frx":08F2 + Style = 2 'Dropdown List + TabIndex = 107 + Top = 2388 + Width = 1215 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfo5.frx":08F4 + Left = -68100 + List = "frmLotInfo5.frx":08FE + Style = 2 'Dropdown List + TabIndex = 108 + Top = 2790 + Width = 1215 + End + Begin VB.TextBox txtLMBalance + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 110 + TabStop = 0 'False + Top = 3600 + Width = 915 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = -71640 + TabIndex = 102 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLODesc + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 97 + TabStop = 0 'False + Top = 1020 + Width = 2835 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 101 + TabStop = 0 'False + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 100 + TabStop = 0 'False + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 99 + TabStop = 0 'False + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOTexture + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 98 + TabStop = 0 'False + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOMDesc + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 96 + TabStop = 0 'False + Top = 3135 + Width = 4155 + End + Begin VB.TextBox txtLOMInvNo + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 95 + TabStop = 0 'False + Top = 3480 + Width = 2625 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 94 + TabStop = 0 'False + Top = 3810 + Width = 915 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 93 + TabStop = 0 'False + Top = 5160 + Width = 915 + End + Begin VB.ComboBox cboLOMDFlag + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 92 + TabStop = 0 'False + Text = "cboLOMDFlag" + Top = 4155 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmLotInfo5.frx":090F + Left = -68100 + List = "frmLotInfo5.frx":0911 + TabIndex = 91 + TabStop = 0 'False + Text = "cboLOMType" + Top = 4500 + Width = 1155 + End + Begin VB.ComboBox cboLOMetal + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 90 + TabStop = 0 'False + Text = "cboLOMetal" + Top = 4830 + Width = 1155 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 89 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 88 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 87 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 86 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 85 + TabStop = 0 'False + Top = 4440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtLathO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 84 + TabStop = 0 'False + Top = 1080 + Width = 1335 + End + Begin VB.TextBox txtSandO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 83 + TabStop = 0 'False + Top = 1422 + Width = 1335 + End + Begin VB.TextBox txtScratchO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 82 + TabStop = 0 'False + Top = 1764 + Width = 1335 + End + Begin VB.TextBox txtBrownO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 81 + TabStop = 0 'False + Top = 2106 + Width = 1335 + End + Begin VB.TextBox txtTextureO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 80 + TabStop = 0 'False + Top = 2448 + Width = 1335 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = -65445 + Picture = "frmLotInfo5.frx":0913 + Style = 1 'Graphical + TabIndex = 79 + Top = 1140 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtLathBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + MaxLength = 10 + TabIndex = 78 + TabStop = 0 'False + Top = 2790 + Width = 1335 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add New Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 77 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdDelLot + Caption = "Delete Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 76 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtCalc138 + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -69720 + TabIndex = 75 + TabStop = 0 'False + Top = 2400 + Width = 435 + End + Begin VB.CheckBox chkChange + Alignment = 1 'Right Justify + Caption = "Recalc Flag:" + Height = 255 + Left = -69180 + TabIndex = 111 + Top = 4020 + Width = 1455 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 74 + Top = 3480 + Width = 1335 + End + Begin VB.TextBox txtPOInvNo + Height = 315 + Left = -68760 + MaxLength = 18 + TabIndex = 66 + Top = 2640 + Width = 2625 + End + Begin VB.TextBox txtPOQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + MaxLength = 4 + TabIndex = 69 + Top = 3360 + Width = 915 + End + Begin VB.ComboBox cboPODFlag + Height = 315 + ItemData = "frmLotInfo5.frx":0D55 + Left = -68760 + List = "frmLotInfo5.frx":0D5F + Style = 2 'Dropdown List + TabIndex = 70 + Top = 3720 + Width = 1215 + End + Begin VB.ComboBox cboPOMType + Height = 315 + ItemData = "frmLotInfo5.frx":0D73 + Left = -68760 + List = "frmLotInfo5.frx":0D75 + Style = 2 'Dropdown List + TabIndex = 71 + Top = 4080 + Width = 1215 + End + Begin VB.CommandButton cmdFindPOMat + Height = 435 + Left = -66105 + Picture = "frmLotInfo5.frx":0D77 + Style = 1 'Graphical + TabIndex = 67 + Top = 2550 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdAddPOMat + Caption = "&Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 65 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdSavePOMat + Caption = "S&ave Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 73 + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdDelPOMat + Caption = "D&elete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 64 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPO + Caption = "P&rint PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 63 + TabStop = 0 'False + Top = 960 + Width = 1095 + End + Begin VB.TextBox txtPOMatDesc + Height = 315 + Left = -68760 + MaxLength = 50 + TabIndex = 68 + Top = 3000 + Width = 4275 + End + Begin VB.TextBox txtPODesc + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 57 + Top = 1920 + Width = 3735 + End + Begin VB.TextBox txtPODate + Alignment = 1 'Right Justify + Height = 315 + Left = -69600 + MaxLength = 10 + TabIndex = 61 + Top = 1200 + Width = 1035 + End + Begin VB.TextBox txtPOPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + TabIndex = 72 + Top = 4440 + Width = 975 + End + Begin VB.CommandButton cmdPrintForm + Caption = "Print Form" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 54 + TabStop = 0 'False + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSetupRpt + Caption = "Setup Processing" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 53 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPreOrderPrintY + Caption = "Print Yard PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 52 + TabStop = 0 'False + Top = 720 + Width = 1335 + End + Begin VB.CommandButton cmdPreOrderPrintS + Caption = "Print Supplier PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 51 + TabStop = 0 'False + Top = 1380 + Width = 1335 + End + Begin VB.Frame fraPO + Height = 435 + Left = -68520 + TabIndex = 46 + Top = 2040 + Width = 4875 + Begin VB.OptionButton optStone + Caption = "Stone" + Height = 255 + Left = 3240 + TabIndex = 236 + Top = 120 + Width = 795 + End + Begin VB.OptionButton optPreOrder + Caption = "PreOrder" + Height = 255 + Left = 2280 + TabIndex = 223 + Top = 120 + Width = 975 + End + Begin VB.OptionButton optLath + Caption = "Lath" + Height = 255 + Left = 60 + TabIndex = 50 + Top = 120 + Width = 675 + End + Begin VB.OptionButton optStucco + Caption = "Stucco" + Height = 255 + Left = 720 + TabIndex = 49 + Top = 120 + Width = 855 + End + Begin VB.OptionButton optSand + Caption = "Sand" + Height = 255 + Left = 1560 + TabIndex = 48 + Top = 120 + Width = 735 + End + Begin VB.OptionButton optNone + Caption = "None" + Height = 255 + Left = 4080 + TabIndex = 47 + Top = 120 + Value = -1 'True + Width = 735 + End + End + Begin VB.TextBox txtSuperNotes + Height = 1275 + Left = -69240 + MaxLength = 255 + MultiLine = -1 'True + TabIndex = 147 + Top = 4200 + Width = 5445 + End + Begin VB.CommandButton cmdEdit + Caption = "Edit Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 45 + TabStop = 0 'False + Top = 2160 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtYardMemo + Height = 1755 + Left = 525 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 44 + Top = 3825 + Width = 5355 + End + Begin VB.TextBox txtPay + Alignment = 1 'Right Justify + Height = 315 + Left = -69240 + TabIndex = 59 + Top = 2280 + Width = 675 + End + Begin VB.CommandButton cmdPrintPOPay + Caption = "Print Pay Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68760 + TabIndex = 43 + Top = 4920 + Width = 1035 + End + Begin VB.CommandButton cmdLathPay + Caption = "RePrint Lath Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66525 + TabIndex = 42 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdStuccoPay + Caption = "RePrint Stucco Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67980 + TabIndex = 41 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdRePrintL + Caption = "ReSet Lath Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67980 + TabIndex = 40 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdShowChange + Caption = "Show Change Log" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 39 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtNote2 + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 38 + Top = 3060 + Width = 5475 + End + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 795 + Left = -74775 + MultiLine = -1 'True + TabIndex = 37 + Top = 3855 + Width = 5475 + End + Begin VB.TextBox txtLotNotes + Height = 1785 + Left = 5880 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 36 + Top = 3825 + Width = 5355 + End + Begin LpLib.fpList lstPOMaterial + Height = 1260 + Left = -73800 + TabIndex = 240 + Top = 4230 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 2222 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 90 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":11B9 + End + Begin LpLib.fpList lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 243 + Top = 4725 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":15B2 + End + Begin LpLib.fpList lstInventory + Height = 2070 + Left = -66825 + TabIndex = 244 + Top = 2790 + Visible = 0 'False + Width = 3165 + _Version = 196608 + _ExtentX = 5583 + _ExtentY = 3651 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 225 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":1A31 + End + Begin LpLib.fpList lstLMaterial + Height = 4590 + Left = -74880 + TabIndex = 242 + Top = 825 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 8096 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":1D99 + End + Begin LpLib.fpList lstPreOrder + Height = 1425 + Left = -69255 + TabIndex = 245 + Top = 2190 + Width = 5445 + _Version = 196608 + _ExtentX = 9604 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":220A + End + Begin VB.Label lblOptNum + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -70560 + TabIndex = 238 + Top = 720 + Width = 1890 + End + Begin VB.Label lblZMetal + Alignment = 2 'Center + Caption = "This House Uses Z-Metal" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = -74940 + TabIndex = 235 + Top = 5160 + Visible = 0 'False + Width = 5655 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Opt. SqFt:" + Height = 195 + Left = -66540 + TabIndex = 229 + Top = 750 + Width = 1740 + End + Begin VB.Label lblPayType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Type:" + Height = 195 + Left = -71805 + TabIndex = 224 + Top = 2340 + Width = 720 + End + Begin VB.Label lblPOType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Type:" + Height = 195 + Left = -73005 + TabIndex = 218 + Top = 1260 + Width = 675 + End + Begin VB.Label lblBB + Alignment = 2 'Center + Caption = "This House Uses R-Guard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 675 + Left = -72180 + TabIndex = 217 + Top = 1380 + Width = 2475 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = -74895 + TabIndex = 207 + Top = 1740 + Width = 1590 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard/R-Guard:" + Height = 195 + Left = -74835 + TabIndex = 206 + Top = 2400 + Width = 1530 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = -75000 + X2 = -69660 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = -74040 + TabIndex = 205 + Top = 3000 + Width = 735 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = -74160 + TabIndex = 204 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 203 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 202 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = -71880 + TabIndex = 201 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Enabled = 0 'False + Height = 195 + Left = -71580 + TabIndex = 200 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Enabled = 0 'False + Height = 195 + Left = -71460 + TabIndex = 199 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Enabled = 0 'False + Height = 195 + Left = -71340 + TabIndex = 198 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = -71700 + TabIndex = 197 + Top = 4800 + Width = 915 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = -73740 + TabIndex = 196 + Top = 1620 + Width = 1410 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -73800 + TabIndex = 195 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -73800 + TabIndex = 194 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -74760 + TabIndex = 193 + Top = 720 + Width = 1815 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 192 + Top = 840 + Width = 1200 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 191 + Top = 840 + Width = 1065 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Texture Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67260 + TabIndex = 190 + Top = 840 + Width = 1185 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 189 + Top = 900 + Width = 930 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Supplier Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 188 + Top = 900 + Width = 1665 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfo5.frx":25FD + Height = 855 + Left = -74760 + TabIndex = 187 + Top = 735 + Width = 5115 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -68700 + TabIndex = 186 + Top = 1905 + Width = 2715 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 185 + Top = 840 + Width = 840 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 184 + Top = 1242 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 183 + Top = 1644 + Width = 630 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 182 + Top = 2046 + Width = 960 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 181 + Top = 2448 + Width = 1005 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 180 + Top = 2850 + Width = 780 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 179 + Top = 3252 + Width = 975 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipped So Far:" + Height = 195 + Left = -69285 + TabIndex = 178 + Top = 3660 + Width = 1140 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 177 + Top = 720 + Width = 1095 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71580 + TabIndex = 176 + Top = 720 + Width = 990 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68100 + TabIndex = 175 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = -68415 + TabIndex = 174 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -68265 + TabIndex = 173 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = -68475 + TabIndex = 172 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = -68415 + TabIndex = 171 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 170 + Top = 3135 + Width = 840 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 169 + Top = 3480 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = -68805 + TabIndex = 168 + Top = 3840 + Width = 660 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 167 + Top = 4185 + Width = 960 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 166 + Top = 4530 + Width = 1005 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68940 + TabIndex = 165 + Top = 4890 + Width = 780 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 164 + Top = 5220 + Width = 975 + End + Begin VB.Label lblMatInst + Caption = $"frmLotInfo5.frx":26E7 + Height = 1155 + Left = -66630 + TabIndex = 163 + Top = 1560 + Visible = 0 'False + Width = 2835 + End + Begin VB.Label lblOrderDates + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 9900 + TabIndex = 162 + Top = 780 + Width = 1275 + End + Begin VB.Label lblLathO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath:" + Height = 195 + Left = 9465 + TabIndex = 161 + Top = 1140 + Width = 360 + End + Begin VB.Label lblSandO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 9405 + TabIndex = 160 + Top = 1482 + Width = 420 + End + Begin VB.Label lblScratchO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch:" + Height = 195 + Left = 9225 + TabIndex = 159 + Top = 1824 + Width = 600 + End + Begin VB.Label lblBrownO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown:" + Height = 195 + Left = 9330 + TabIndex = 158 + Top = 2166 + Width = 495 + End + Begin VB.Label lblTextureO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 9240 + TabIndex = 157 + Top = 2508 + Width = 585 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone:" + Height = 195 + Left = 9360 + TabIndex = 156 + Top = 2850 + Width = 465 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Feet:" + Height = 195 + Left = 9000 + TabIndex = 155 + Top = 3540 + Width = 795 + End + Begin VB.Label lblSelectOpt + Caption = "Double Click the desired option to selected it for Add or Delete." + Height = 375 + Left = -66060 + TabIndex = 154 + Top = 2100 + Width = 2235 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = -73485 + TabIndex = 153 + Top = 1980 + Width = 1155 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO #:" + Height = 195 + Left = -72750 + TabIndex = 152 + Top = 900 + Width = 420 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = -69360 + TabIndex = 151 + Top = 2700 + Width = 525 + End + Begin VB.Label lblDescription + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69675 + TabIndex = 150 + Top = 3060 + Width = 840 + End + Begin VB.Label lblPOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -69465 + TabIndex = 149 + Top = 3420 + Width = 630 + End + Begin VB.Label lblPODFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69795 + TabIndex = 148 + Top = 3780 + Width = 1020 + End + Begin VB.Label lblPOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69780 + TabIndex = 146 + Top = 4140 + Width = 1005 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = -70260 + TabIndex = 145 + Top = 1260 + Width = 660 + End + Begin VB.Label lblBillingAmt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -64980 + TabIndex = 144 + Top = 2700 + Width = 915 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + Caption = "$:" + Height = 255 + Left = -65280 + TabIndex = 143 + Top = 2760 + Width = 195 + End + Begin VB.Label lblSuperNotes + AutoSize = -1 'True + Caption = "Notes to Super:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69240 + TabIndex = 142 + Top = 3960 + Width = 1350 + End + Begin VB.Label lblYardMemo + AutoSize = -1 'True + Caption = "Yard Order Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 540 + TabIndex = 141 + Top = 3600 + Width = 1830 + End + Begin VB.Label lblOptMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = -69540 + TabIndex = 140 + Top = 4500 + Width = 765 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = -70140 + TabIndex = 139 + Top = 2340 + Width = 765 + End + Begin VB.Label lblDiana + AutoSize = -1 'True + Caption = "Lot Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6000 + TabIndex = 138 + Top = 3600 + Width = 1065 + End + End + Begin VB.Label lblStone + Alignment = 2 'Center + Caption = "Stone Veneer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8640 + TabIndex = 226 + Top = 1440 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSandShip + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5580 + TabIndex = 222 + Top = 780 + Width = 420 + End + Begin VB.Label lblSZone + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6060 + TabIndex = 221 + Top = 780 + Width = 315 + End + Begin VB.Label lblSynthetic + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Synthetic Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8970 + TabIndex = 216 + Top = 1440 + Visible = 0 'False + Width = 2475 + End + Begin VB.Label lblFirst + Alignment = 2 'Center + Caption = "First Time This Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 8640 + TabIndex = 213 + Top = 1800 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 4620 + TabIndex = 208 + Top = 840 + Width = 480 + End + Begin VB.Label lblJC + Alignment = 1 'Right Justify + Caption = "Job Cost:" + Height = 375 + Left = 2280 + TabIndex = 34 + Top = 2160 + Width = 375 + End + Begin VB.Label lblPlan + AutoSize = -1 'True + Caption = "Double Click the Desired Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8700 + TabIndex = 32 + Top = 840 + Visible = 0 'False + Width = 2565 + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 9000 + TabIndex = 30 + Top = 2220 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 28 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " Plan Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3900 + TabIndex = 26 + Top = 1245 + Width = 1275 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 22 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + Caption = $"frmLotInfo5.frx":27D8 + Height = 1350 + Left = 6450 + TabIndex = 21 + Top = 90 + Width = 1425 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 20 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 19 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 18 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 17 + Top = 1560 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 16 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1200 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfo5" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSPOpt2 As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset +Dim moRSPO As Recordset +Dim moRSPOMAT As Recordset +Dim moRSMemo As Recordset +Dim moRSPay As Recordset +Dim moRSInvINFO As Recordset + +Dim mboolNOTSUPPLIER As Boolean, mstrMTYPE As String, mstrORDERNUM As String, mintOPENPR2 As Integer +Dim mboolLATHC As Boolean, mboolSTUCCOC As Boolean, mboolWRAPC As Boolean, mboolPULTE As Boolean, mboolSTPAY As Boolean +Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String, mstrBEGQTY As String, mstrENDQTY As String +Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean +Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean, mboolWRAP As Boolean +Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngARINVID As Long, mintPAYCREW As Integer +Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mboolPSpecialCALC As Boolean +Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngINVID As Long, mboolDNU As Boolean +Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mboolPSW As Boolean ', mintOpenPR As Integer +Dim mlngFind As Long, mintBOOKMARK As Integer ', mlngARINVID As Long +Dim mintTake138 As Integer, mintPONUM As Long, mintOpenPR As Integer, mbool2Dates As Boolean, mboolSTONE3 As Boolean 'For Printing Invoices +Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String, mboolSTONE2 As Boolean +Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolCERTIFIED As Boolean, mstrTAXCODE As String +Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolNoPrint As Boolean, mboolPAINT As Boolean, mboolRPSTUCCO As Byte +Dim mboolSupP, mboolWrapP, mboolLathP, mboolNescoP, mboolPopOutP As Boolean, mboolADD As Boolean +Dim mboolBrownP, mboolTexP, mboolCMUP, mboolEX1P, mboolEX2P, mboolEX3P As Boolean, mboolHLNotes As Boolean +Dim mboolStoneP As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String +Dim msglPAYRT1, msglPAYRT2 As Single, mstrTexture As String, mstrCREWTYPE As String, mstrWORK As String +'Dim mboolADD As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If Not oRS.EOF Then + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + End If + Loop + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub SetStone() +Dim strSQL As String + + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbTrue + moRS!c_flg = vbTrue + moRS!t_flg = vbTrue + moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub GetPayRates() +Dim oRSCR As Recordset, strSQL As String + + msglPAYRT1 = 0 + msglPAYRT2 = 0 + + strSQL = "SELECT * FROM tblCREWRATE WHERE not inactive and CREW_ID = " & mintPAYCREW & " AND PROJ_ID = " & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRSCR.EOF Then + strSQL = "SELECT * FROM tblCREWRATE WHERE not inactive and CREW_ID = " & mintPAYCREW & " AND PROJ_ID = 99999" ' & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If +' Else + If Not oRSCR.EOF Then + If mstrCREWTYPE = "L" Then ' Or mstrCREWTYPE = "W" Then + If mboolPULTE Then +' msglPAYRT1 = Field2Str2(oRSCR!Sand) ' Wrap Rate + msglPAYRT1 = Field2Str2(oRSCR!Smooth) ' Wrap/Lath Rate Commented this out on 05/19/2019 -- may need to be changed back + msglPAYRT2 = Field2Str2(oRSCR!METAL) +' msglPAYRT1 = Field2Str2(oRSCR!lath_skip) ' Change it back of it is not correct + Else + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + End If + + If (mstrCREWTYPE = "L" Or mstrCREWTYPE = "W") And mboolWRAPC Then ' Or mstrCREWTYPE = "W" Then +' If mstrCREWTYPE = "L" And mboolWRAPC Then ' Or mstrCREWTYPE = "W" Then + If mboolPULTE Then + msglPAYRT1 = Field2Str2(oRSCR!sand) ' Wrap Rate +' msglPAYRT1 = Field2Str2(oRSCR!Smooth) ' Wrap/Lath Rate + Else + msglPAYRT1 = 0 + msglPAYRT2 = 0 +' msglPAYRT1 = Field2Str2(oRSCR!lath_skip) +' msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SK" Or mstrTexture = "RL" Or mstrTexture = "CS" Or mstrTexture = "RS") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SA" Or mstrTexture = "S2" Or mstrTexture = "S3" Or mstrTexture = "RD" Or mstrTexture = "S4") Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "DA" Then + msglPAYRT1 = Field2Str2(oRSCR!dash) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "MN" Or mstrTexture = "RM") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QU" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QS" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SM" Then + msglPAYRT1 = Field2Str2(oRSCR!Smooth) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "DF" Or mstrTexture = "SS" Or mstrTexture = "RF") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SC" Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "M2" Or mstrTexture = "M3" Or mstrTexture = "MF") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + +' If mstrCREWTYPE = "V" Then +' msglPAYRT1 = Field2Str2(oRSCR!Lath_Skip) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + + End If +' Else +' End If + +End Sub + +Private Sub RePrintLath() 'Allows a lath order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint Lath") + + moRS!l_FLG = Null + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null + moRS!lorder = "12/31/2030" + moRS!Border = Null + moRS!TORDER = Null + moRS!forder = Null + moRS!corder = Null + moRS!SORDER = Null + moRS!VOrder = Null + moRS!WrapP = vbFalse + moRS!WrapD = vbFalse + moRS!LathP = vbFalse + moRS!LathD = vbFalse +'May need to add more items to be reset so that other things can be printed. + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!o_qty = 0 +' oRS!d_flag = "X" +' oRS!ar_trans = vbChecked +' oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID + goConn.Execute strSQL + + Call LotRePrinted +End Sub + +Private Sub cboPOType_LostFocus() + If cboPOType.ListIndex = -1 Then + cboPOType.ListIndex = 0 + End If + txtPOType = Left(cboPOType.Text, 1) + gstrPO = txtPOType + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + End Select + +End Sub + +''Private Sub chkHoldOrders_Click() +'' cmdSaveLotInfo.Enabled = True +'' If gbytSECURITY > 3 Then +'' chkHoldOrders.Enabled = False +'' chkHoldOrders.BackColor = &H80FFFF +'' End If +''End Sub + +''Private Sub chkHoldPO_Click() +'' cmdSaveLotInfo.Enabled = True +'' If gbytSECURITY > 3 Then +'' chkHoldPO.Enabled = False +'' chkHoldPO.BackColor = &H80FFFF +'' End If +''End Sub + +Private Sub chkOthers_Click() + cmdSaveLotInfo.Enabled = True + +End Sub + +Private Sub chkSplit_Click() + cmdSaveLotInfo.Enabled = True +' lblSynthetic.Visible = True + If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkStone_Click() + If chkStone Then + cmdSaveLotInfo.Enabled = True + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + lblStone.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblStone.Visible = False + txtStone = 0 + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + End If + +End Sub + +Private Sub chkSynthetic_Click() + If chkSynthetic Then + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = False + End If + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + End If + +End Sub + +Private Sub cmdAddPOMat_Click() + Call POMatClear + gconACTION = 0 + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPODate.Enabled = False + txtPODesc.Enabled = False + txtIssueTo.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + mboolAdding = True + txtPOInvNo.SetFocus + +End Sub + +Private Sub cmdBrownPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + strCrewType = "" + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!BCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!BCREW = 0 + moRS.Update + End If + + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue +' moRS!BrownD = vbTrue + End If + moRS.Update 'Mark Complete? + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + '***************Start of Print Stucco Pay Sheets copied from Lath Order + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + ' gintCOPY = 4 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 + Else + If moRS!texture <> "SB" Then + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 + ElseIf moRS!texture = "SF" Then + MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 2 + Call PrintStuccoStone + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 2 + Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 + End If + End If + Else + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + intTCPAY = gintCOPY * 3 + MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + + + If boolCOMPLETE Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'B')" + goConn.Execute strSQLUP + + moRS!PRNT_S = Now() + moRS.Update + +' If mboolPAINT Then +' MsgBox "Insert 1 White and 13 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 +' intCOPY = 0 +' crOrder.Reset +' gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay +' End If + +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " +' moRSMemo!notes = UCase(Field2Str(txtYardMemo)) +' moRSMemo.Update + + gboolPRINT = False + If Not moRSProj!bill Then + moRS!BrownD = vbTrue +' moRS!TexP = vbTrue +' moRS!TexD = vbTrue + Else + moRS!BrownD = vbTrue +' moRS!TexP = vbTrue +' moRS!TexD = vbTrue + End If + moRS.Update +' cmdBrownPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdBrownPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdCalc_Click() + If moRS!texture = "DF" Or moRS!texture = "MF" Or moRS!texture = "QS" Or moRS!texture = "RF" Then + gbool2FIN = True + Else + gbool2FIN = False + End If + + If moRS!texture = "DW" Then + moRS!calcdate = Date + moRS.Update + Else + If moRSProj!stype <> "T" Then + Call MatCalcOne + Call ConvertSuper + Call MatLoad + Call CalcMetal + Else + Call MatCalcThree + Call ConvertSuper + Call MatLoad + Call CalcMetal + End If + End If + MsgBox "Materials Calculation is Complete" + txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +End Sub + +Private Sub cmdDelLot_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Lot") +' Call LotChange(mstrPROJLOT, "Delete Lot", ) + Unload Me + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdDelLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelPO_Click() +Dim strSQL As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPO.ListIndex + cmdDelPO.Enabled = False + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdPrintPO.Enabled = False + cmdAddPOMat.Enabled = True + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM + goConn.Execute strSQL + Call LotChange(mstrPROJLOT, "Delete PO") + Call POLoad + If lstPO.ListCount Then + If lstPO.ListCount > mintBOOKMARK Then + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPO.ListIndex = mintBOOKMARK - 1 + End If + Else + mintBOOKMARK = -1 + Call POMatClear + Call POClear + End If + gconACTION = 0 +End Sub + +Private Sub cmdDelPOMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPOMaterial.ListIndex + moRSPOMAT.Delete + Call LotChange(mstrPROJLOT, "Delete PO Material") + Call POMatLoad + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdAddPOMat.Enabled = True + If lstPOMaterial.ListCount Then + If lstPOMaterial.ListCount > mintBOOKMARK Then + lstPOMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 +End Sub + +Private Sub cmdEdit_Click() + gconACTION = 5 + cmdSaveMatrl.Enabled = True + cmdCalc.Enabled = True + cmdFindPlan.Visible = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + cmdSaveLotInfo.Enabled = True +' cmdPrintCMU.Enabled = True +' cmdUpCMU.Enabled = True + txtAddress.Enabled = True + txtOwner.Enabled = True + lstLOptions.Enabled = True + lstPOptions.Enabled = True +End Sub + +Private Sub cmdFindPOMat_Click() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + Else + lstLOOKUP.Visible = True + Call LoadILookUp + lngFind = Field2Long(txtPOInvNo) + Call ListFindItem2(lstLOOKUP, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub LoadILookUp() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOOKUP.Clear + + Do Until oRS.EOF + With lstLOOKUP + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOOKUP.ListCount Then + lstLOOKUP.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module LoadLookUp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdIssue_Click() + If cmdIssue.Caption = "RePrint &Yard Ticket" Then + gintCOPY = 1 + Call PrintIssueA + End If + + If cmdIssue.Caption = "RePrint Actual Rpt" Then + gintCOPY = 1 + Call PrintActual + End If + + cmdIssue.Visible = False +End Sub + +Private Sub PrintIssueA() +Dim lngTIE As Long +Dim strSQL As String + + lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) + + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Formulas(4) = 1 + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Formulas(4) = 1 + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If +' cmdIssue.Visible = False +End Sub + +Private Sub cmdJCSetup_Click() + Call JCSetup +End Sub + +Private Sub cmdLathPay_Click() +Dim strPAY As String +Dim bytINFO As Byte + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) + If bytINFO = 1 Then + gintCOPY = 1 + ElseIf bytINFO = 2 Then + gintCOPY = 3 + ElseIf bytINFO = 3 Then + gintCOPY = 5 + ElseIf bytINFO = 4 Then + gintCOPY = 7 + ElseIf bytINFO = 5 Then + gintCOPY = 9 + End If + + Call LotChange(mstrPROJLOT, "RePrint Lath Pay") + Call PrintLathPay + cmdLathPay.Visible = False +End Sub + +Private Sub cmdLathPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNL As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intYNS As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean, intLATHCREW As Integer +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String, intSTUCCOCREW As Integer +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim strSQLC As String, oRSCPO As Recordset +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mboolLATHC = False + mboolSTUCCOC = False + mboolWRAPC = False + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If mboolPLANUP Then + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" + cmdExit.Enabled = True + Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic +' If moRSPay.EOF Then +' End If + gintCOPY = 1 +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + +' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then + MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + If Field2Str2(oRS!s_bill) = 0 Then + MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + + intYNL = MsgBox("Do You Want To Use A Crew Number With The Lath PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNL = vbYes Then + intLATHCREW = InputBox("Enter The Lath Crew Number", "Lath Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intLATHCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intLATHCREW = 0 Or IsNull(intLATHCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Lath Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Lath Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intLATHCREW) + moRS!LCREW = Field2Str2(intLATHCREW) + moRS.Update + mboolLATHC = True + End If + Else + moRS!LCREW = 0 + moRS.Update + End If + +'' intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") +'' If intYNS = vbYes Then +'' intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) +'' If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Then +'' MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +'' Exit Sub +'' Else +'' moRS!BCREW = Field2Str2(intSTUCCOCREW) +'' moRS.Update +'' mboolSTUCCOC = True +'' End If +'' Else +'' moRS!BCREW = 0 +'' moRS.Update +'' End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "L" + gstrTYPE = "Y" + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) + moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then + '***************** need to move this to Issue and Make a unique identifier + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If +' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Lath PO" + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" +' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLathM.rpt" + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_L = Now() + moRS.Update + + If boolFPRINT Then + gstrMODULE = "Before Print Actual " + Call PrintActual + gintCOPY = 1 + crOrder.Reset + End If +' If boolFPRINT Then + gstrMODULE = "Before Print Issue Ticket " + Call PrintIssue + gintCOPY = 1 + crOrder.Reset + + strSQLC = "SELECT Lot_ID, M_Type FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " AND M_Type = 'D'" + Set oRSCPO = New Recordset + oRSCPO.Open strSQLC, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSCPO.EOF Then + gstrMODULE = "Before Print Coated Popout Issue Ticket " + Call PrintCoated + gintCOPY = 1 + crOrder.Reset + End If + +' End If + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " + Call PrintLathMat + crOrder.Reset + ' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then +' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If + If Field2Str2(txtTtlYdge) - 19 > 1200 Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Else + MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + End If + gstrMODULE = "Before Print Lath Pay " + Call PrintLathPay + + '***********Beginning of print stucco pay - moved to Print Brown Order --- REMOVE TWO TICK MARKS TO START USING AGAIN +'' gintCOPY = 1 +'' intCOPY = 0 +'' crOrder.Reset +'' gstrMODULE = "Before Print Stucco Pay " + +'' If moRSProj!stype <> "T" Then +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 2 +'' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' ' gintCOPY = 4 +'' Call PrintStuccoPay +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' If moRS!texture <> "SB" Then +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' Call PrintStuccoPay +'' crOrder.Reset +'' gintCOPY = 1 +'' ElseIf moRS!texture = "SF" Then +'' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 2 +'' Call PrintStuccoStone +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 2 +'' Call PrintStuccoSyn +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If +'' Else +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 2 +'' intTCPAY = gintCOPY * 3 +'' MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 4 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If + '****************** End of Print Stucco Pay moved to Print Brown Order + + gintCOPY = 1 +' If Field2Integer(moRS!CMU) > 0 Then +' intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") +' If intYN = vbYes Then +' Call cmdPrintCMU_Click +' crOrder.Reset +' End If +' End If + End If + End If + '****** Print Stone Pay Sheet and Invoice + '****** Removed 06/27/05 per Rose +' If Not chkNoPay Then +' If moRS!ostone And Not moRS!otstone Then +' crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" +' gintCOPY = 2 +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' crOrder.ReportFileName = App.Path & "\StonePay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' crOrder.Action = 1 + +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If +' End If + + If moRS!Firsttime Then + MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" + End If + + If boolCOMPLETE Then +' gintCOPY = 1 +' crOrder.Reset +' If Not moRS!Split Then +' If Not moRSProj!bill Then +' Call PrintLathInv +' crOrder.Reset +' End If +' End If + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!LathD = vbTrue +' cmdLathPrint.Enabled = False + End If + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If +' moRS!l_flg = "P" +' moRS!y_flg = "P" +' moRS!S_flg = "P" +' cmdLathPrint.Enabled = False + End If + End If + moRS.Update + gintCOPY = 1 + gboolPRINT = False +' cmdLathPrint.Enabled = False + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module cmdLathPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdWrapPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNW As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intWRAPCREW As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mboolWRAPC = False + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If IsNull(Date2Field(moRS!calcdate)) Or (Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate)) Then +' If Date2Field(moRSPlan!Update) > Field2Str2(moRS!calcdate) Then +' If Field2Str(moRSPlan!Update) > Field2Str(moRS!calcdate) Then +' MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" +' cmdExit.Enabled = True +' Exit Sub +' End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + gintCOPY = 1 + If mboolSPLIT Then + 'look at the next line and decide if it needs to be deleted + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Wrap Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + + intYNW = MsgBox("Do You Want To Use A Crew Number With The Wrap PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNW = vbYes Then + intWRAPCREW = InputBox("Enter The Wrap Crew Number", "Wrap Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intWRAPCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intWRAPCREW = 0 Or IsNull(intWRAPCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Wrap Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Wrap Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intWRAPCREW) + moRS!WCREW = Field2Str2(intWRAPCREW) + moRS.Update + mboolWRAPC = True + End If + Else + moRS!WCREW = 0 + moRS.Update + End If + + gboolPRINT = True + gstrPO = "W" 'Wrap + gstrFLAG = "W" 'Wrap + gstrTYPE = "S" +' gstrTYPE = "Y" + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'W'" +' strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) +' moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'W')" +' strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then + + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Wrap PO" + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewWrap2.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewWrap.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewLathM.rpt" + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER WRAP ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and M_Type = 'W'" + goConn.Execute strSQLUP + + gintCOPY = 1 + crOrder.Reset + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " +' Call PrintWrapMat +' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Wrap Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gstrMODULE = "Before Print Lath Pay " + + Call PrintWrapPay + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + End If + End If + End If ''''**** may need to remove this + + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update + gintCOPY = 1 + gboolPRINT = False + + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module cmdWrapPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintLathPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + If mboolLATHC Then + crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpay.rpt" + Else + crOrder.ReportFileName = App.Path & "\lathpay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + mstrCREWTYPE = "L" + Call GetPayRates + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + mstrCREWTYPE = "L" + moRSPay!Type = "L" + moRSPay!worktype = "P" + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + crOrder.CopiesToPrinter = gintCOPY + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintLathPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + +' gintCOPY = 2 + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + + If moRSProj!cocode = 0 Then + If mboolWRAPC Then + crOrder.ReportFileName = App.Path & "\wrappay_17.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + Else + crOrder.ReportFileName = App.Path & "\wrappay_171.rpt" + End If + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) +' intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + mstrCREWTYPE = "L" + Call GetPayRates + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) +' intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "W" + mstrCREWTYPE = "W" + moRSPay!worktype = "P" + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!WrapAmt = Field2Integer(moRS!pylath) + intYDS +' moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY ')) ', "$ #,0.00") + + crOrder.CopiesToPrinter = 1 +' crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "W" + mstrCREWTYPE = "W" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!WrapAmt = Field2Integer(moRS!pylath) + intYDS +' moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintWrapPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, intMETAL As Integer, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then + crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.CopiesToPrinter = gintCOPY + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoThree() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +' crOrder.Action = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + + crOrder.ReportFileName = App.Path & "\stuccopayB_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayt.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintStuccoSyn() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoStone() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoStone" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssueHold() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!po_num = "ORIGINAL ORDER" + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintIssueHold" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssue() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean, strMType As String + On Error GoTo Error_EH +' gintCOPY = 2 + mstrMTYPE = "" + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + +' strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + + If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Round(dblOrder, 2) + oRS!qtyIssue = Round(dblOrder, 2) +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + + mstrMTYPE = Field2Str(oRSS!m_type) +' If mstrMTYPE <> "" Or Not IsNull(mstrMTYPE) Then + If mstrMTYPE = "P" Or mstrMTYPE = "Z" Then + Call GetPONUM + oRS!po_num = mstrORDERNUM + mstrORDERNUM = "" + mstrType = "" + End If + + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) +' lngSHIPPED = Round(Field2Str2(oRSS!o_qty), 2) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + + End If + oRSS.MoveNext + Loop + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" +' strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issue2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P' or {tblLOTMATRL.M_Type} = 'Z') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issueM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If +' gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintIssue" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPONUM() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT Lot_ID, M_Type, D_Flag, PO_NUM FROM tblORDERS WHERE Lot_ID = " & gintLOTID & " AND D_Flag = 'Y' AND M_Type = '" & mstrMTYPE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrORDERNUM = Field2Str(oRS!po_num) + End If + + Exit Sub +End Sub + +Private Sub PrintCoated() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean + On Error GoTo Error_EH + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'D' )" 'or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " And Split >= " & lngTIE +' strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D') And Split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + +' If oRS.RecordCount > 0 Then +' strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D') And Split >= " & lngTIE +' goConn.Execute strYARD +' End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D')" 'or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + +' If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = dblOrder + oRS!qtyIssue = dblOrder +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + +' End If + oRSS.MoveNext + Loop + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL COATED POPOUT ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " COATED POPOUT ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'D')" 'or M_Type = 'P')" + goConn.Execute strSQLUP + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\Coated2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\Coated2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE +' strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblYARDORDER.D_Flag} = 'Y' and {tblYARDORDER.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\Coated.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\CoatedM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintCoated" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintLathMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathmat.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintLathMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'W' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\wrapmat.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) 'May need to removed the or {tblLOTMATRL.M_Type} = 'P' from the strSQL + crOrder.CopiesToPrinter = gintCOPY 'Find out from Ryan how to make this report process faster. +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintWrapMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" + crOrder.ReportFileName = App.Path & "\stuccomat.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ShowPrint() +Dim oRS As Recordset +Dim strSQL As String, lngPO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngPO = Field2Long(oRS!nextpo) + gstrMODULE = "Line 8" + lngPO = lngPO + 1 + If lngPO > 99999 Then + lngPO = 1 + End If + oRS!nextpo = lngPO + oRS.Update + gstrMODULE = gstrMODULE & " Line 15" + + Load frmPrint + gstrMODULE = gstrMODULE & " Line 18" + frmPrint.txtJobCost = Field2Str(moRS!jobcost) + frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) +' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) + gstrMODULE = gstrMODULE & " Line 20" + frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) +' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) + gstrMODULE = gstrMODULE & " Line 22" + frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "0000") +' gstrPONUM = gstrPONUM & Format(intPO, "0000") + gstrMODULE = gstrMODULE & " Line 24" + frmPrint.txtMFlag = gstrFLAG + gstrMODULE = gstrMODULE & " Line 26" + frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) +' gstrCREW = Left$(Field2Str(txtPODesc), 20) + gstrMODULE = gstrMODULE & gstrFLAG & " " + frmPrint.txtDFlag = gstrTYPE + gstrMODULE = gstrMODULE & " Line 30" + If mintSUPPLIER = 99 Then + frmPrint.txtPO = Field2Str2(moRSPO!ponum) +' gintPONUM = moRSPO!ponum + Else + frmPrint.txtPO = 0 +' gintPONUM = 0 + End If + gstrMODULE = gstrMODULE & " Line 35" + frmPrint.Show 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module ShowPrint" +' gstrMODULE = " Form LotInfo5 - Module ShowPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdAddPO_Click() + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" + End If + + Call POClear + gconACTION = 0 + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + mboolAdding = True + cboPOType.SetFocus +End Sub + +Private Sub cmdLFlag_Click() + moRS!y_FLG = "P" + moRS!l_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + Call cmdSaveLotInfo_Click + cmdLFlag.Visible = False + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If +End Sub + +Private Sub cmdOrder_Click() + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdPreOrderPrintY_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "Y" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & " ' and {tblORDERS.m_type} = '" & oRS!m_type & "'" + + strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + gboolPRINT = False + Call Form_Load + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPreOrderPrintY" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +'''Private Sub cmdPrint_Click() +''' If cmdPrint.Caption = "Print Lath Order" Then +''' Call cmdLathPrint_Click +''' ElseIf cmdPrint.Caption = "Print Sand Order" Then +''' Call cmdSandPrint_Click +''' ElseIf cmdPrint.Caption = "Print Brown Order" Then +''' Call cmdBrownPrint_Click +''' ElseIf cmdPrint.Caption = "Print Scratch Order" Then +''' Call cmdScratchPrint_Click +''' ElseIf cmdPrint.Caption = "Print Texture Order" Then +''' Call cmdTexturePrint_Click +''' ElseIf cmdPrint.Caption = "Print Stone Order" Then +''' Call cmdStonePrint_Click +''' Else + +''' End If +'''End Sub + +Private Sub cmdPrintCMU_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\cmupay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN + Call FormSave +' cmdPrintCMU.Enabled = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintCMU_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() + Call ProcessRpt +End Sub + +Private Sub cmdPrintPOPay_Click() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + gintPRINT = 1 + frmReport.Show 1 + If gintPRINT Then + Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") + + strSQL = "{tblPOrder.ponum} = " & mintPONUM + crOrder.ReportFileName = App.Path & "\POpay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + ' crOrder.Destination = crptToWindow + ' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS!pay_flag = vbTrue + oRS.Update + cmdPrintPOPay.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintPOPay_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPO_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, intResponse As Integer +Dim strSELECT As String + + mintBOOKMARK = lstPO.ListIndex + + On Error GoTo Error_EH + + gboolPRINT = True + If optPreOrder Then + gstrFLAG = "P" + Else + gstrFLAG = "R" + End If + gintCOPY = 1 + If optLath Then + gstrTYPE = "Y" + ElseIf optStucco Then + gstrTYPE = "S" + ElseIf optSand Then + gstrTYPE = "A" + ElseIf optPreOrder Then + gstrTYPE = "Y" + ElseIf optStone Then + mboolSTONE2 = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + ElseIf optNone Then + gstrTYPE = "" + End If + mintSUPPLIER = 99 + Call ShowPrint + mintSUPPLIER = 0 + + If gboolPRINT And mboolSTONE2 Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) +' moRS!st_flg = vbTrue + moRS.Update + End If + End If + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS!p_flg = "P" Then + MsgBox "This PO has already been printed" + Exit Sub + End If + If Not oRS.EOF Then + crOrder.Reset + strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + If gstrPO <> "L" Then + crOrder.ReportFileName = App.Path & "\POMisc.rpt" + Else + Call POSetup + crOrder.ReportFileName = App.Path & "\purchase.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + oRS!p_flg = "P" + oRS.Update + End If + gboolPRINT = False + If gstrPO = "L" Then + intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") + If intResponse = vbOK Then + Call POInvoice + End If + End If + Call Form_Load + SSTLotInfo.Tab = 6 + Else + Call Form_Load + SSTLotInfo.Tab = 6 + End If + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub POSetup() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblOrder As Double + + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + dblOrder = Field2Str2(oRS!qty) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + +End Sub + +Private Sub cmdPreOrderPrintS_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + + End If + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" ' + +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblLOTMATRL.d_flag} = 'S' and {tblLOTMATRL.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PreOrderPrintS_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPreOrderPrintPC_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "Z" + gstrTYPE = "Y" +' gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'Z'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" + crOrder.ReportFileName = App.Path & "\preorderPC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PreOrderPrintPC_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintForm_Click() + Me.PrintForm +End Sub + +Private Sub cmdPrintR_Click() + Call ProcessRpt +' Call LotLoad + If mboolNoPrint Then + MsgBox "No Processing Selected Yet - Exiting", vbOKOnly + Exit Sub + End If + If mboolSupP Then + Call cmdSuperRpt_Click + End If + If mboolStoneP Then + MsgBox "Stone Not Setup", vbOKOnly, "Not Enabled" + moRS!StoneP = vbFalse + moRS.Update + Call cmdStonePrint_Click + End If + If mboolWrapP Then + Call cmdWrapPrint_Click + End If + If mboolLathP Then + Call cmdLathPrint_Click + End If + If mboolNescoP Then + MsgBox "Nesco Not Setup", vbOKOnly, "Not Enabled" + moRS!NescoP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolPopOutP Then + MsgBox "PopOut Not Setup", vbOKOnly, "Not Enabled" + moRS!PopoutP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolBrownP Then + Call cmdBrownPrint_Click + End If + If mboolTexP Then + Call cmdTexturePrint_Click + End If + If mboolCMUP Then + MsgBox "CMU Not Setup", vbOKOnly, "Not Enabled" + moRS!CMUP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX1P Then + MsgBox "Extra 1 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX1P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX2P Then + MsgBox "Extra 2 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX2P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX3P Then + MsgBox "Extra 3 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX3P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + + mboolSupP = False + mboolLathP = False + mboolWrapP = False + mboolStoneP = False + mboolNescoP = False + mboolPopOutP = False + mboolCMUP = False + mboolBrownP = False + mboolTexP = False + mboolEX1P = False + mboolEX2P = False + mboolEX3P = False +End Sub + +'''Private Sub cmdPrint_Click() +''' If cmdPrint.Caption = "Print Lath Order" Then +''' Call cmdLathPrint_Click +''' ElseIf cmdPrint.Caption = "Print Sand Order" Then +''' Call cmdSandPrint_Click +''' ElseIf cmdPrint.Caption = "Print Brown Order" Then +''' Call cmdBrownPrint_Click +''' ElseIf cmdPrint.Caption = "Print Scratch Order" Then +''' Call cmdScratchPrint_Click +''' ElseIf cmdPrint.Caption = "Print Texture Order" Then +''' Call cmdTexturePrint_Click +''' ElseIf cmdPrint.Caption = "Print Stone Order" Then +''' Call cmdStonePrint_Click +''' Else + +''' End If +'''End Sub + + +Private Sub cmdRePrintL_Click() + Call RePrintLath + cmdRePrintL.Visible = False + Call FormShow +End Sub + +Private Sub cmdSandPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single +Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Field2Str2(moRS!zone) = 0 Then + MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" + Exit Sub + End If + +'' If chkHoldOrders Then +'' MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + cmdExit.Enabled = False +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If +' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "A" + gstrTYPE = "A" + gintCOPY = 1 + Call ShowPrint + gstrMODULE = "After SHOWPRINT " + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- Plaster Sand " & vbCrLf + strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf + If boolCOMPLETE Then + dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) + End If + strMSG = strMSG & "Tons For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = moRS!ORD_NO + dblOrder + If dblCheck > moRS!sand_ton Then + dblOrder = moRS!sand_ton - moRS!ORD_NO +' Else + End If + moRS!ORD_NO = moRS!ORD_NO + dblOrder + moRS.Update + Else + dblOrder = moRS!sand_ton + End If + + moRS!Border = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!a_flg = vbTrue + End If + moRS.Update + gstrMODULE = "After Update Delivery Date " +' glngORDERID = Field2Long(oRS!order_id) + + strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & Field2Integer(moRS!zone) + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + If oRSSS.EOF Then + Else + oRSSS.MoveFirst + strFIND = "zone = " & Field2Str2(moRS!zone) + oRSSS.Find strFIND + sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") + End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Before Setup Materials " + With oRSS + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9999" + !Desc = "ICBO RIVER PLASTER SAND" + !x_flag = vbChecked + !o_qty = dblOrder + !a_qty = dblOrder + !price = sglSAND + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9994" + !Desc = "SPLIT CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 15 + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9993" + !Desc = "MINIMUM ORDER CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 40 + .Update + End With + crOrder.Reset + strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\sand.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\sandM.rpt" + End If + crOrder.Formulas(1) = "Sand = " & dblOrder + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + gboolPRINT = False +' cmdSandPrint.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5 - Module cmdSandPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdSaveLotInfo_ClickOLD() + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSavePO_Click() +Dim lngID As Long + If Not IsDate(txtPODate) Then + MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" + txtPODate.SetFocus + Exit Sub + End If + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - Talk to Angel", vbOKOnly, "Plan Verified" + Call LotChange(mstrPROJLOT, "Chnge After Verified") + End If + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Chnge PO Information") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPO.ListIndex + If mboolAdding Then + If mintBOOKMARK = -1 Then + mintBOOKMARK = 0 + End If + End If + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + lstLOOKUP.Visible = False + Call POSave + Call POLoad + + If mboolAdding Then + mboolAdding = False + lngID = FindMax("tblPOrder", "PONum") + Call CBFindString(lstPO, CStr(lngID)) + cmdAddPOMat.SetFocus + mintBOOKMARK = lstPO.ListIndex + End If + + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePOMat_Click() +Dim intINVNO As Integer, lngID As Long + + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Change PO Material") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPOMaterial.ListIndex + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + lstLOOKUP.Visible = False + intINVNO = txtPOInvNo + Call POMatSave + Call POMatLoad + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + If mboolAdding Then + mboolAdding = False + Call CBFindString4(lstPOMaterial, CStr(intINVNO)) + cmdAddPOMat.SetFocus + mintBOOKMARK = 0 + Exit Sub + End If + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = CLng(mintBOOKMARK) +' lstPOMaterial.ListIndex = 5 + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = -1 + End If + mintBOOKMARK = 0 +End Sub + +Private Sub cmdScratchPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gboolPRINT = True + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gstrPO = "L" + gstrFLAG = "S" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!TORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!c_flg = vbTrue + End If + moRS.Update + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" + crOrder.ReportFileName = App.Path & "\NewScratch.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'S')" + goConn.Execute strSQLUP + +' cmdScratchPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdScratchPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub +Private Sub PrintActual() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actual.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintActual" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSetupRpt_Click() + frmLotPrtJobs.Show 1 + Call LotLoad +End Sub + +Private Sub cmdShowChange_Click() + frmLotChLog.Show 1 +End Sub + +Private Sub cmdStonePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean + + On Error GoTo Error_EH + boolNOSTONE = False + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gintCOPY = 1 + + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) + If boolCOMPLETE Then +' moRS!st_flg = vbTrue + End If + moRS.Update + End If + + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + boolNOSTONE = True + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' If oRSS.State = adStateOpen Then +' oRSS.Close +' End If + If Not boolNOSTONE Then + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + + crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" + gintCOPY = 1 + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + crOrder.ReportFileName = App.Path & "\StonePay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + If boolCOMPLETE Then + Call PrintStoneInv + crOrder.Reset + End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + Call Form_Load + End If +' cmdStonePrint.Enabled = False + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdStonePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub + +End Sub + + +Private Sub cmdStuccoPay_Click() +Dim strPAY As String + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") + If moRSProj!stype <> "T" Then + gintCOPY = 1 + Call PrintStuccoPay + Else + gintCOPY = 1 + Call PrintStuccoThree + End If + cmdStuccoPay.Visible = False +End Sub + +Private Sub cmdSuperRpt_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer + + On Error GoTo Error_EH + + cmdExit.Enabled = False + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + Exit Sub + End If + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + gintCOPY = 1 + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update + gintPRINT = 9 + frmReport.Show 1 + If gintPRINT = 0 Then + cmdExit.Enabled = True + Exit Sub + End If + strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + + crOrder.ReportFileName = App.Path & "\super.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + cmdExit.Enabled = True + + strSELECT = moRS!model +' moRS!superd = vbTrue + moRS!superp = vbFalse + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdSuperRpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean, strSQLUP As String +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + moRS!TexD = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and M_Type = 'T'" + goConn.Execute strSQLUP + + gboolPRINT = False + '**** Stone Print moved back to it own button on 06/27/05 + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdUpCMU_Click() +Dim intCMU As Integer + + intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") + If intCMU > 0 Then + moRS!CMU = intCMU + moRS.Update + Call FormShow + End If +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + mboolBAD = False +' mboolENTER = False + + If gintLOTID = 0 Then + intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") + If intResponse = vbYes Then + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAddLot_Click + If mboolBAD Then + Unload Me + End If + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String, intYN As Integer +Dim strPAY As String, strMSG As String, lngOPTID As Long +Dim strSQLST As String, oRSST As Recordset, strSQLPST As String, oRSPST As Recordset +Dim intYNW As Integer, intWRAPCREW As Integer + + mboolSTPAY = False + +' E Print Stone Order +' L Allow Reprint of Lath Pay Sheets +' This is turned off *** A Allow update of Address and Owner information on after Lot has been completed +' X Update Paint Square Footage +' T Print Paint Pay Sheets if not already done. +' J RePrint Wrap Pay Sheets +' S Reprint Stucco Pay Sheets +' M Resets the PO Flag to true +' W Update cost on the highlighted item in the Materials List +' Y Allow the reprint of the Lath Yard Order +' I Allow Lath Material Order to be reprinted +' F Turn On The Lath material +' R Turn on the RePrint Lath Button +' H ReSet The PreOrder info & Turn On The Print PreOrder Button +' D Turn on the Reprint PreorderY button +' G Print the Actual Report for Jesse +' N Turn on the Save Lot Info BUtton +' U Set flag for Stucco Cert +' Q Mark a lot option for Stone +' A Print a Stucco Invoice + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Lath Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyA And gbytSECURITY < 3 Then ' Allow RePrint of Stone? Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 6 Then + mboolSTPAY = True + Call POInvoice + ' cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyJ And gbytSECURITY < 3 Then ' Wrap Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + intYNW = MsgBox("Do You Want To Use A Crew Number With The Wrap PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNW = vbYes Then + intWRAPCREW = InputBox("Enter The Wrap Crew Number", "Wrap Crew", 0) + If intWRAPCREW = 0 Or IsNull(intWRAPCREW) Then + MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intWRAPCREW) + moRS!WCREW = Field2Str2(intWRAPCREW) + moRS.Update + mboolWRAPC = True + End If + Else + moRS!WCREW = 0 + moRS.Update + End If + gintCOPY = 1 + Call PrintWrapPay + End If + Exit Sub + End If + +' If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Turn the address & owner field on & the SAVE Button +' If CtrlDown And SSTLotInfo.Tab = 0 Then +' txtAddress.Enabled = True +' txtOwner.Enabled = True +' cmdSaveLotInfo.Enabled = True +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "VHJ") Then ' Print Special Report for Jesse +' Dim intYN As Integer + If CtrlDown And SSTLotInfo.Tab = 1 Then + intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") + If intYN = vbNo Then + Exit Sub + End If + Call PrintActualJG + End If + Exit Sub + End If + + If KeyCode = vbKeyU Then ' Make the Flag that Shows Stucco Cert Done - True + If CtrlDown Then + moRS!SCert = vbTrue + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' REPrint Stucco Pay. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdStuccoPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm + If CtrlDown And SSTLotInfo.Tab = 2 Then + strINVNO = lstLMaterial.ItemData(lstLMaterial.ListIndex) + strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & strINVNO + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) + oRS!price = Field2Str2(strCOST) + oRS.Update + + End If + Exit Sub + End If + If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' RePrint Yard Ticket. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Caption = "RePrint &Yard Ticket" + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyZ And gbytSECURITY < 3 Then ' RePrint Actual REport. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Caption = "RePrint Actual Rpt" + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Reprint Lath Material. + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call PrintLathMat + gintCOPY = 1 + End If + Exit Sub + End If + + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLFlag.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdRePrintL.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' Reprint Preorder PreCut + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintPC.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyD And gbytSECURITY < 3 Then 'RePrint Yard Pre Order + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintY.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyE And gbytSECURITY < 3 Then ' Reprint Wrap + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call cmdWrapPrint_Click + End If + Exit Sub + End If + + If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If CtrlDown Then + cmdSaveLotInfo.Enabled = True + cmdSaveLotInfo.SetFocus + End If + Exit Sub + End If + + If Field2Str(moRS!l_FLG) <> "P" Then + If Not cmdSaveLotInfo.Enabled Then + Call DataHasChanged + End If + End If +End Sub + +Private Sub DataHasChanged() + + cmdSaveLotInfo.Enabled = True + cmdAddLot.Enabled = False + +End Sub + +Private Sub PrintActualJG() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, intYN As Integer +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actualJG.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + intYN = MsgBox("Do You Want To Print To The Printer", vbYesNo + vbDefaultButton2, "Printer or Screen") + If intYN = vbYes Then + crOrder.Destination = crptToPrinter + Else + crOrder.Destination = crptToWindow + End If +' crOrder.Destination = crptToWindow + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintActualJG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtLMInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + txtLMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtLMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdFindInv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFindPlan_Click() +Dim oRS As Recordset, oRSSS As Recordset +Dim strSQL As String, lngFind As Long, strTEST As String +Dim strSql2 As String + On Error GoTo Error_EH + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not mboolAdding Then + txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + + If oRS.RecordCount > 0 Then + + With oRS + +' txtTtlYdge = Field2Integer(!TO_TTLYDS) + txtTtlYdge = Field2Integer(!mat_yds) 'Changed back per Jesse on 07/09/2018 + txtModel = Field2Str(!Mod_Elv) + txtCMUYdge = Field2Integer(!CMUYDS) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + If !HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If +' chkHLNote = Field2CheckBox(!HLNotes) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Integer(!opening) + chkStone = Field2CheckBox(!stone) + '*** Do We Need To Add Paint Here??? + txtStone = Field2Str2(!ST_SQFT) + txtStoneBill = Field2Str2(!st_bill) + moRS!Scaf6 = Field2Str2(!Scaf6) + moRS!scaf10 = Field2Str2(!scaf10) + moRS!TWOSTORY = !TWOSTORY + moRS!openpr = Field2Str2(!openpr) + moRS!P_RL = Field2CheckBox(!P_RL) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Pre Mix Stucco" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + If Not !Firsttime Then + !Firsttime = vbChecked + chkFirst = vbChecked + .Update + End If + + gintESTID = !est_id + If Not mboolAdding Then + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + End If + Call FieldsSave + End With + ' oRS.Update + 'clear materials and get correct for model + 'update materials and yardage for options + Else + Call PlanLoad + cmdFindPlan.Visible = False + If lstPlans.ListCount = 0 Then + MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" + cmdSaveLotInfo.Enabled = False + gstrFLAG = "P" + Unload Me + Exit Sub + Else + lstPlans.ListIndex = 0 + lstPlans.SetFocus + oRS.Close + Exit Sub + End If + End If + oRS.Close + If mboolAdding Then + Call ElevLoad + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad + mboolAdding = False + Else + Call ElevLoad + Call DelLotMat + Call PlanMatLoad + Call ReloadOptMat + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call cmdSaveLotInfo_Click + Call cmdExit_Click + End If + Exit Sub + +Error_EH: + Call ErrorHandler(oRSSS.ActiveConnection) +' gstrMODULE = "Form LotInfo5 - Module cmdFindPlan_Click" +' Call ErrorHandler2 +' gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DelLotMat() +Dim strSQL As String + + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked + goConn.Execute strSQL + +End Sub + +Private Sub ReloadOptMat() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + mintOPTID = Field2Long(oRS!Opt_ID) + Call UpLotInfo + Call UpLMat + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: +' Call ErrorHandler(oRSS.ActiveConnection) + gstrMODULE = "Form LotInfo5 - Module ReloadOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdAddLot_Click() +Dim strSTARTDATE As String, lngPOS As Long + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub + ' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + mboolAdding = True + gconACTION = 0 + gintLOTID = 0 + txtJC.Enabled = True + cmdCalc.Enabled = False + cmdDelLot.Enabled = False + cmdAddLot.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptAdd.Enabled = False + cmdOptDel.Enabled = False + txtLotNo.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + Call LotNew + Call FormClear + Call MatClear + + txtAddress.SetFocus +End Sub + +Private Sub cmdAddMatrl_Click() +' lstLMaterial.ListIndex = -1 + lstLMaterial.Enabled = False +' moRSMat.Update +' moRSMat.Close + Call MatClear + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdInventory.Visible = True + lblMatInst.Visible = True + txtLMDesc.SetFocus + mboolAdding = True + +End Sub + +Private Sub cmdDelMatrl_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstLMaterial.ListIndex + moRSMat.Delete + Call LotChange(mstrPROJLOT, "Delete Material") + Call MatLoad + If lstLMaterial.ListCount Then + If lstLMaterial.ListCount > mintBOOKMARK Then + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstLMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False +End Sub + +Private Sub cmdInventory_Click() + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub cmdOptAdd_Click() +Dim strSQL As String +Dim strSql2 As String, oRS As Recordset + + On Error GoTo Error_EH + + If moRSLOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblLOption where opt_id = 1" + Set moRSLOpt = New Recordset + moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + End If + + strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!Lot_ID = gintLOTID + moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) + mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt!C_USER = gstrLOGIN + If oRS!ostone Then + moRSLOpt!ostone = vbChecked +' moRSLOpt.Update + End If + moRSLOpt.Update + If oRS!ostone Then + moRSLOpt!ostone = vbChecked + End If + lstPOptions.Enabled = True + Call UpLotInfo + Call UpLMat + Call LOptLoad + Call FieldsSave + Call MatSave + Call MatLoad + lstPOptions.ListIndex = -1 + cmdOptAdd.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdOptAdd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOptDel_Click() +Dim strSQL As String + gconACTION = 3 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Call LotChange(mstrPROJLOT, "Delete Lot Option") + Call UpdateLotInfo + Call UpdateLMat + Call MatSave + Call MatLoad + Call FieldsSave + strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call LOptLoad + cmdOptDel.Enabled = False + gconACTION = 0 + If lstOptMatrl.ListCount > 0 Then + lstOptMatrl.Clear + If lstLOptions.ListCount > 0 Then + lstLOptions.ListIndex = 0 + Call lstLOptions_Click + End If + End If +End Sub + +Private Sub UpLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + oRSSS.AddNew + oRSSS!Lot_ID = gintLOTID + oRSSS!inv_no = Field2Str(oRSS!inv_no) + oRSSS!Desc = Field2Str(oRSS!Desc) + oRSSS!d_flag = Field2Str(oRSS!d_flag) + oRSSS!m_type = Field2Str(oRSS!m_type) + oRSSS!calc_flag = Field2Str(oRSS!calc_flag) + oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) + oRSSS!qty = Field2Str(oRSS!qty) + oRSSS.Update +' oRSSS.Close + Else + oRSSS!qty = (oRSSS!qty + oRSS!qty) + oRSSS.Update + ' oRSSS.Close + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + + oRS.Close + oRSS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset, intTEST As Integer +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + intTEST = oRSS.RecordCount + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + Else + oRSSS!qty = (oRSSS!qty - oRSS!qty) + If oRSSS!qty <= 0 Then + oRSSS.Delete + Else + oRSSS.Update + End If + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + If Err = -2147217885 Then + Resume Next + Else + gstrMODULE = "Form LotInfo5 - Module UpdateLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub +Private Sub UpdateLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String +Dim strSQL As String, strSql2 As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + moRS!sq_yd = moRS!sq_yd - oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 - oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj - oRS!f_adj + txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + strSQL = "SELECT Texture " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + moRS!texture = Field2Str(oRSS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + + If moRS!texture <> "SB" Then + chkSynthetic = vbUnchecked + lblSynthetic.Visible = False + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + + strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID + Set oRSSE = New Recordset + oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSE.EOF Then + oRSE!FileName = oRSSE!FileName + oRSE.Update + oRSE.Close + End If + oRSSE.Close + End If + If oRS!ostone Then +' moRS!stone = vbUnchecked + chkStone = vbUnchecked + moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt + txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) + txtStone = moRS!ST_SQFT + moRS!ostone = vbUnchecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpdateLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub UpLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim strSQL As String, strMSG As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If oRS.RecordCount = 0 Then + strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" + Exit Sub + End If + moRS!sq_yd = moRS!sq_yd + oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 + oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj + oRS!f_adj + txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + moRS!texture = Field2Str(oRS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + If moRS!texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSE.EOF Then + oRSE!FileName = oRS!FileName + oRSE.Update + oRSE.Close + End If + End If + If oRS!ostone Then +' moRS!stone = vbChecked + chkStone = vbChecked + moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt +' = Val(txtStoneBill) + Field2Double(oRS!amt) + txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) + txtStone = moRS!ST_SQFT + moRS!ostone = vbChecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If mboolCRITICAL Then + Exit Sub + End If + If gstrFLAG <> "D" Then + If gstrFLAG <> "P" Then + If cmdSaveLotInfo.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + End If + End If + + If moRS.State = adStateOpen Then + moRS.Update + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + gintLOTID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cmdSaveLotInfo_Click() + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If +' cmdAddLot.Enabled = True + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSaveMatrl_Click() + + + If gconACTION = 6 Then + Call LotChange2(mstrPROJLOT, "Change Lot Material", txtLMDesc, mstrBEGQTY, mstrENDQTY) +' Call LotChange(mstrPROJLOT, "Change Lot Material") + gconACTION = 0 +' End If + ElseIf gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + On Error GoTo Error_EH + mintBOOKMARK = lstLMaterial.ListIndex + + + ' Store the controls to the recordset + Call MatSave + + Call MatLoad + +' mintINVNO = Field2Str2(moRSMat!inv_no) + If mboolAdding Then + mboolAdding = False + Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) +' Call ListFindItem(lstLMaterial, CLng(mintINVNO)) + mintBOOKMARK = lstLMaterial.ListIndex + End If + + cmdInventory.Visible = False + lblMatInst.Visible = False + If gconACTION <> 5 Then + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + End If + + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + lstLMaterial.SetFocus + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() +Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + Set moRSPO = New Recordset + Set moRSPOMAT = New Recordset + Set moRSMemo = New Recordset + + On Error GoTo Error_EH + + mboolHLNotes = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + + gboolPSpecialCALC = False + gboolPULTE = False + +' If moRS!P_RL Then +' gboolPSpecialCALC = True +' End If + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 30 +' gdteUPDATE = oRS!LastUP - 45 + + strSQLL = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + + lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) + mlngINVID = lngINVID + lngINVID = lngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID + moRSInvINFO.Update + + mboolSPLIT = False + mboolStone = False + gstrFLAG = "" + gstrPO = "L" +' gbytSECURITY = 1 + SSTLotInfo.Tab = 0 + mboolCRITICAL = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + ' if + Call MTypeLoad(cboPOMType) + Call MTypeLoad(cboLMType) + Call MTypeLoad(cboLOMType) + Call ProjLoad + + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + + If FormFind() Then + Call PlanFind + If mboolCRITICAL Then + Unload Me + Exit Sub + End If + If mboolStone Then + Call SetStone + End If + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad +' Call POMatLoad + End If + If gintLOTID <> 0 Then + If IsNull(moRS!y_FLG) Then + cmdPreOrderPrintY.Enabled = True + End If + If mboolNOTSUPPLIER Then + moRS!s_FLG = "P" + moRS.Update + End If + If IsNull(moRS!s_FLG) Then + cmdPreOrderPrintS.Enabled = True + End If + If IsNull(moRS!z_FLG) Then + cmdPreOrderPrintPC.Enabled = True + End If + +' If IsNull(moRS!l_flg) Then +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then +' cmdSandPrint.Enabled = True +' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!b_flg Then +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdStonePrint.Enabled = True +' End If + +''' If IsNull(moRS!l_FLG) Then +''' cmdPrint.Caption = "Print Lath Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then +''' cmdPrint.Caption = "Print Sand Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!b_flg Then +''' cmdPrint.Caption = "Print Brown Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +''' cmdPrint.Caption = "Print Scratch Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!b_flg And Not moRS!t_flg Then +''' cmdPrint.Caption = "Print Texture Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +''' cmdPrint.Caption = "Print Stone Order" +''' cmdPrint.Enabled = True +''' Else +''' cmdPrint.Caption = "All Orders Printed" +''' cmdPrint.Enabled = False +''' End If + + If IsNull(moRS!l_FLG) Then +''' cmdPrint.Caption = "Print Lath Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then +''' cmdPrint.Caption = "Print Sand Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!b_flg Then + ElseIf moRS!l_FLG = "P" And Not moRS!b_flg Then + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' cmdPrint.Caption = "Print Brown Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +''' cmdPrint.Caption = "Print Scratch Order" +''' cmdPrint.Enabled = True + ElseIf moRS!b_flg And Not moRS!t_flg Then + moRS!BrownP = vbTrue + moRS!BrownD = vbTrue + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' ElseIf moRS!t_flg Then +''' cmdPrint.Caption = "Print Texture Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +''' cmdPrint.Caption = "Print Stone Order" +''' cmdPrint.Enabled = True + Else + moRS!TexP = vbTrue + moRS!TexD = vbTrue + moRS!BrownP = vbTrue + moRS!BrownD = vbTrue + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' cmdPrint.Caption = "All Orders Printed" +''' cmdPrint.Enabled = False + End If + + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If + End If + If gbytSECURITY <= 6 Then + cmdEdit.Visible = True + cmdEdit.Enabled = True + End If +'' If chkHoldOrders Then +'' cmdSaveLotInfo.Enabled = False +'' If gbytSECURITY > 3 Then +'' chkHoldOrders.Enabled = False +'' chkHoldOrders.BackColor = &H80FFFF +'' Else +'' chkHoldOrders.Enabled = True +'' chkHoldOrders.BackColor = &H80FFFF +'' End If +'' Else +'' chkHoldOrders.Enabled = True +'' End If +' If chkSplit Then +' cmdSaveLotInfo.Enabled = False +' If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF +' Else +' chkSplit.Enabled = True +' chkSplit.BackColor = &H80FFFF +' End If +' Else +' chkSplit.Enabled = True +' End If +'' If chkHoldPO Then +'' cmdSaveLotInfo.Enabled = False +'' If gbytSECURITY > 3 Then +'' chkHoldPO.Enabled = False +'' chkHoldPO.BackColor = &H80FFFF +'' Else +'' chkHoldPO.Enabled = True +'' chkHoldPO.BackColor = &H80FFFF +'' End If +'' Else +'' chkHoldPO.Enabled = True +'' End If + If chkSynthetic Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + Else + chkSynthetic.Enabled = True + chkSynthetic.BackColor = &H80FFFF + End If + + End If + If chkStone Then + cmdSaveLotInfo.Enabled = False + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + Else + chkStone.Enabled = True + chkStone.BackColor = &H80FFFF + End If + + End If + If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdAddPOMat.Enabled = False + End If + +' Call ListChanges + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + If moRSProj!cont_id = 864 Or moRSProj!cont_id = 146 Then + mboolPULTE = True + Else + mboolPULTE = False + End If + + If moRSProj!stone Then + mboolStone = True + End If + + If moRSProj!Pulte Then + gboolPULTE = True + End If + + If moRSProj!Apt Then + mboolCOMM = True + Else + mboolCOMM = False + End If + + If moRSProj!P_SW Then + mboolPSW = True + Else + mboolPSW = False + End If + + mstrWIRE = Field2Str(moRSProj!wire) + mstrTAXCODE = Field2Str(moRSProj!taxcode) + + gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PlanLoad() +Dim oRS As Recordset +Dim strSQL As String, strTEST As String + On Error GoTo Error_EH + + strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPlans.Clear + + Do Until oRS.EOF + With lstPlans + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS!est_id + End With + lstPlans.Visible = True + lblPlan.Visible = True + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PlanLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + If moRSProj!bb Then + lblBB.Caption = "This House Uses Blackboard" + Else + lblBB.Caption = "This House Uses R-Guard" + End If + If moRSProj!zmetal Then + lblZMetal.Visible = True + Else + lblZMetal.Visible = False + End If + + With moRS + lblSZone = Field2Str2(!zone) + lblSandShip = Field2Str2(!ORD_NO) + txtTake138 = Field2Integer(!jmb138) + txtCalc138 = Field2Integer(!jmb138) + txtTtlYdge = Field2Integer(!sq_yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!Owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Integer(!CMU) + txtNotes = Field2Str(!notes) + If !HLNotes And Len(txtNotes) > 0 Then + txtNotes.ForeColor = &HFF& + txtNotes.BackColor = &H80FFFF + Else + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + End If + txtSuperNotes = Field2Str(!supernotes) + txtLotNotes = Field2Str(!lotnotes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Integer(!foam) + txtStone = Field2Str2(!ST_SQFT) + txtOPEN = Field2Str2(!opening) + chkFirst = Field2CheckBox(!Firsttime) + txtMetal = Field2Double(!METAL) + txtSand = Field2Integer(!sand_ton) + txtSuperBB = Field2Integer(!SUP_BB) + txtSuper12 = Field2Integer(!SUP_FD12) + txtSuper1383 = Field2Integer(!SUP_138) + If CInt(txtSuper1383) < 0 Then + txtSuper1383 = 0 + End If + txtSuper783 = Field2Integer(!SUP_783) + txtSuper78 = Field2Integer(!SUP_78) + txtSuper38 = Field2Integer(!SUP_38) +' txtSuperRL = Field2Integer(!SUP_RL) + txtSuperML = Field2Integer(!SUP_ML) + txtSuperDW = Field2Integer(!SUP_DW) + txtSuperSP = Field2Integer(!SUP_SP) + txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + If txtLathO = "" Then + txtLathO = "12/31/2030" + End If + txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) + txtStoneBill = Field2Str2(!st_bill) + txtJC = Field2Str(!jobcost) +' chkHoldOrders = Field2CheckBox(!hold_stucco) +' chkHoldPO = Field2CheckBox(!hold_po) + chkPaint = Field2CheckBox(!PNT_FLG) + chkSynthetic = Field2CheckBox(!syn_flag) + chkStone = Field2CheckBox(!stone) + chkOthers = Field2CheckBox(!otstone) + chkNoPay = Field2CheckBox(!nopayissue) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + End With + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Pre Mix Stucco" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "C" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "San Man" + End If + + If moRS!l_FLG = "P" Then + txtTtlYdge.Enabled = False + txtCMUYdge.Enabled = False + txtStone.Enabled = False + txtLotNo.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptDel.Enabled = False + cmdDelLot.Enabled = False + cmdSaveLotInfo.Enabled = False + cmdFindPlan.Enabled = False + cmdOrders.Enabled = False + cmdCalc.Enabled = False + txtYardMemo.Enabled = True + txtYardMemo.Locked = True +' txtYardMemo.Enabled = False +' cmdUpCMU.Enabled = False +' cmdPrintCMU.Enabled = False + Call LotPrinted + End If + If moRS!Firsttime Then + lblFirst.Visible = True + End If + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotPrinted() + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtNotes.Enabled = False + txtFoamAdj.Enabled = False + txtLaborAdj.Enabled = False + txtWireAdj.Enabled = False + txtFin2.Enabled = False + txt28Foam.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False + lblLathPrint.Visible = True + cmdPreOrderPrintY.Enabled = False + cmdPreOrderPrintS.Enabled = False + +End Sub + +Private Sub LotRePrinted() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True + txtFoamAdj.Enabled = True + txtLaborAdj.Enabled = True + txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + lblLathPrint.Visible = False + cmdPreOrderPrintY.Enabled = True + cmdPreOrderPrintS.Enabled = True +''' cmdPrint.Enabled = True +End Sub + +Private Sub LotNew() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True + txtFoamAdj.Enabled = True + txtLaborAdj.Enabled = True + txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If +' txtSuperBB.Enabled = True + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) +' txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + lblLathPrint.Visible = False + lblFirst.Visible = False + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!qty) + + If CInt(txtLMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLMQty.ForeColor = &HFF& + txtLMQty.FontBold = True + Else + txtLMQty.ForeColor = &H0& + txtLMQty.FontBold = False + End If + txtLMLength = Field2Integer(!calc_amt) + txtLMBalance = Field2Str(!o_qty) + chkChange = Field2CheckBox(!ch_flag) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + Call FindType(cboLMType, strTYPE) + + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt + txtLOYdge = Field2Integer(!Yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Integer(!fin2) + txtLOFoam = Field2Integer(!f_adj) + lblBillingAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOSt_SqFt = Field2Str2(!OSt_SqFt) + Call FindTexture2(Field2Str(!texture), strTYPE) + txtLOTexture = strTYPE +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) +' lblOptNum = "# " & Trim(Field2Str(!Opt_ID)) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOpt() +Dim strDNU As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt2 + txtNote2 = Field2Str(!notes) + If Left(Field2Str(!Desc), 3) = "DNU" Then + mboolDNU = True + Else + mboolDNU = False + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPO() +Dim bytPOType As Byte + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPO + gintPONUM = Field2Long(!ponum) + txtPONum = Field2Long(!ponum) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + txtPODate = Field2Str(!Date) + txtPay = Field2Str2(!yards) + txtPayType = Field2Str(!payflag) + txtPOType = Field2Str(!potype) + gstrPO = txtPOType + bytPOType = Field2Str2(!Opt_Type) + End With + + If bytPOType = 1 Then + optLath = True + ElseIf bytPOType = 2 Then + optStucco = True + ElseIf bytPOType = 3 Then + optSand = True + ElseIf bytPOType = 4 Then + optPreOrder = True + ElseIf bytPOType = 5 Then + optStone = True + ElseIf bytPOType = 6 Or bytPOType = 0 Then + optNone = True + End If + + If moRSPO!p_flg = "P" Then + cmdPrintPO.Enabled = False + Else + cmdPrintPO.Enabled = True + End If + mboolSHOW = False + If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then + cmdPrintPOPay.Enabled = True + Else + cmdPrintPOPay.Enabled = False + End If + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + End Select + + Call CBFindString1(cboPOType, txtPOType) + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!qty) + If CInt(txtLOMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLOMQty.ForeColor = &HFF& + txtLOMQty.FontBold = True + Else + txtLOMQty.ForeColor = &H0& + txtLOMQty.FontBold = False + End If + txtLOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboLOMType, strTYPE) + + If !calc_flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOQty = Field2Str(!qty) + txtPOPrice = Format(Field2Str2(!price), "#,#.00") + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If IsNull(txtModel) Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + ElseIf Trim$(txtModel) = "" Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + End If + +' If mboolAdding Then +' moRS.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled +' cmdAddLot.Enabled = Not cmdAddLot.Enabled + cmdDelLot.Enabled = Not cmdDelLot.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSaveLotInfo.Enabled Then + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String +Dim strSQLB As String, oRSB As Recordset + + On Error GoTo Error_EH + + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount > 0 Then + txtYardMemo = Field2Str(moRSMemo!notes) + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = "" + moRSMemo.Update + txtYardMemo = "" + End If + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + mstrTexture = moRS!texture + + If moRS!HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If + mboolSTONE3 = False + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + mstrPLNELEV = Field2Str(moRS!model) + + If moRS!P_RL Then + gboolPSpecialCALC = True + End If + + If moRS!Split Then + mboolSPLIT = False '*** Changed from true to false on 7/21/2017 because discontinued split orders + Else + mboolSPLIT = False + End If + strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!PROJ_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSB = New Recordset + oRSB.Open strSQLB, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSB.EOF Then + If IsNull(oRSB!st_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False + End If + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LotLoad() +Dim strSQL As String + + strSQL = "SELECT * " & "FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + +End Sub + +Private Sub PlanFind() +Dim oRS As Recordset +Dim strSQL As String, strPlan As String, strTEST As String + On Error GoTo Open_EH + mintOpenPR = 0 + +' strSQL = "SELECT * " + strSQL = "SELECT est_id, verified, update, OpenPR FROM tblPlans WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + If Not moRSPlan.EOF Then + mboolVERIFIED = moRSPlan!verified + mintOpenPR = Field2Integer(moRSPlan!openpr) + gintESTID = moRSPlan!est_id + If moRSProj!FHA Then + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" + Else + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" + End If + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + If oRS.EOF Then + mintTake138 = 0 + Else + moRS!jmb138 = oRS!qty +' mintTake138 = oRS!qty + End If + oRS.Close + Else + MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" + mboolCRITICAL = True + End If + Exit Sub + +Open_EH: + gstrMODULE = "Form LotInfo5 - Module PlanFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindPOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOpt2() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT notes, optid, desc " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) + + Set moRSPOpt2 = New Recordset + + moRSPOpt2.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt2.EOF Then + FormFindPOpt2 = False + Else + FormFindPOpt2 = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOpt2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) + + If moRSPO.State = adStateOpen Then + + moRSPO.Close + End If + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindLOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + Set moRSLOpt = New Recordset + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!Opt_ID +' lblOptNum = "# " & lstLOptions.ItemData(Index) +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindLOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstOptMatrl.col = 4 + strINVNO = lstOptMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + + On Error GoTo Error_EH + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + If moRSPOMAT.State = adStateOpen Then + moRSPOMAT.Close + End If + + moRSPOMAT.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstLMaterial.col = 4 + strINVNO = lstLMaterial.ColText + + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' intTest = moRSMat.RecordCount + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub cmdExit_Click() + + Unload Me +End Sub +Private Sub FieldsSave() +Dim strLOT As String, strTYPE As String, intOpenPR As Integer, intUSEOpen As Integer +Dim dblOPEN As Double, intDELETE As Integer, int1383 As Integer + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS!startdate = Str2Field(mstrSTARTDATE) + moRS!openpr = mintOpenPR + End If + + If Field2Integer(moRS!sq_yd) > 1 Then + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 90 - intOpenPR + +' dblWRAP = Int(Field2Double(moRS!opening)) + ' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + If moRSProj!use_open Then + If Field2Integer(moRS!sq_yd) > 500 Then +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 ' Changed by Jesse 07/13/18 + intDELETE = 0 + moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE + moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE + Else +' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 + moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 5 'Change per Jesse 08/22/05 + moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 5 'Change per Jesse 08/22/05 +'' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 + End If + Else + If Field2Integer(moRS!sq_yd) > 500 Then +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 ' Changed by Jesse 07/13/18 + intDELETE = 0 + moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE + moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE + Else +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 + moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 + moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 +' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 + End If + End If + End If + + With moRS + If mboolHLNotes Then + !HLNotes = vbChecked + Else + !HLNotes = vbUnchecked + End If + !zone = Integer2Field(moRSProj!zone) + !sq_yd = Integer2Field(txtTtlYdge) + !address = Str2Field(txtAddress) + !Owner = Str2Field(txtOwner) + !model = Str2Field(txtModel) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtNotes) + !supernotes = Str2Field(txtSuperNotes) + !lotnotes = Str2Field(txtLotNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !lot_no = Str2Field(txtLotNo) + !foam = Integer2Field(txt28Foam) + !lorder = Date2Field(txtLathO) + !SUP_BB = Integer2Field(txtSuperBB) + !SUP_FD12 = Integer2Field(txtSuper12) + !SUP_783 = Integer2Field(txtSuper783) + !SUP_78 = Integer2Field(txtSuper78) + !SUP_38 = Integer2Field(txtSuper38) +' !SUP_138 = Integer2Field(txtSuper1383) + int1383 = Integer2Field(txtSuper1383) + If int1383 < 0 Then + !SUP_138 = 0 + Else + !SUP_138 = Integer2Field(txtSuper1383) + End If +' !SUP_RL = Integer2Field(txtSuperRL) + !SUP_ML = Integer2Field(txtSuperML) + !SUP_DW = Integer2Field(txtSuperDW) + !SUP_SP = Integer2Field(txtSuperSP) + !opening = Integer2Field(txtOPEN) + !sand_ton = Integer2Field(txtSand) + !SORDER = Str2Field(txtTextureO) + !Border = Str2Field(txtSandO) + !TORDER = Str2Field(txtScratchO) + !forder = Str2Field(txtBrownO) + !VOrder = Str2Field(txtLathBill) + !st_bill = Double2Field(txtStoneBill) + !jobcost = Str2Field(txtJC) +'' !hold_stucco = chkHoldOrders +'' !hold_po = chkHoldPO + !PNT_FLG = chkPaint + !LUUser = gstrLOGIN + !Update = Date + !Firsttime = chkFirst + !syn_flag = chkSynthetic + !stone = chkStone + !otstone = chkOthers + !ST_SQFT = Integer2Field(txtStone) + + Call FindTexture(txtFinish, strTYPE) + !texture = strTYPE + + End With + moRS.Update + + If mboolAdding Then + Call GetLotID + Call PlanMatLoad + Call POptLoad + Call JCSetup + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If + mboolAdding = False + End If + moRSMemo!notes = Field2Str(txtYardMemo) + moRSMemo.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") + If Len(strLOT) > 0 Then + moRS!lot_no = Field2Str(strLOT) + txtLotNo = Field2Str(strLOT) + txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") + moRS!jobcost = Field2Str(txtJC) + moRS.Update + End If + Resume Next + End If + gstrMODULE = "Form LotInfo5 - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetLotID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintLOTID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPlanInfo() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + mboolPLANUP = False + strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrPLANUP = Field2Str(oRS!Update) +' mboolVERIFIED = oRS!verified + If mstrPLANUP > Field2Str(moRS!import) Then + mboolPLANUP = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module GetPlanInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POSave() +Dim strSQL As String, strMAX As String +Dim oRS As Recordset, oRSS As Recordset +Dim bytPOType As Byte + + On Error GoTo Error_EH + + If optLath Then + bytPOType = 1 + ElseIf optStucco Then + bytPOType = 2 + ElseIf optSand Then + bytPOType = 3 + ElseIf optPreOrder Then + bytPOType = 4 + ElseIf optStone Then + bytPOType = 5 + Else + bytPOType = 6 + End If + + If moRSPO.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Opt_Type = bytPOType + !Date = Str2Field(txtPODate) + !User = gstrLOGIN + !Up_User = gstrLOGIN + !Update = Date + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + oRS.Update + + oRS.Close + Call POLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPO.AddNew + moRSPO!User = gstrLOGIN + End If + + With moRSPO + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Update = Date + !Up_User = gstrLOGIN + !Date = Str2Field(txtPODate) + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + moRSPO.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPO.ActiveConnection) + Exit Sub +End Sub + +Private Sub POMatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSPOMAT.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + oRS.Update + + oRS.Close + Call OptMatLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPOMAT.AddNew + End If + + With moRSPOMAT + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + moRSPOMAT.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPOMAT.ActiveConnection) + Exit Sub + + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH +' If moRSMat.State = adStateOpen Then + If moRSMat.State = adStateClosed Then + Exit Sub + End If + + strSQL = moRSMat.RecordCount + With moRSMat + If moRSMat.EOF Then + End If + If mboolAdding Then + .AddNew + !Lot_ID = gintLOTID + End If + !inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !qty = Str2Field(txtLMQty.Text) + !calc_amt = Integer2Field(txtLMLength.Text) + !o_qty = Integer2Field(txtLMBalance.Text) + !ch_flag = chkChange + !m_type = Left$(cboLMType.Text, 1) + + If cboLMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + End With + mintINVNO = Field2Str2(txtLMInvNo) + moRSMat.Update + Exit Sub + +Error_EH: +' If Err = -2147217885 Then + If Err = -2147217864 Then + Resume Next + Else + gstrMODULE = "Form LotInfo5 - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub + +Private Sub FormClear() + moRSMemo.Close + txtLotNotes = "" + txtYardMemo = "" + txtSuperNotes = "" + txtTtlYdge = 0 + txtAddress = "" + txtOwner = "" + txtModel = "" + txtCMUYdge = 0 + chkFirst = vbUnchecked + txtNotes = "" + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = 0 + txtLotNo = "" + txt28Foam = 0 + txtLathO = "12/31/2030" + txtMetal = 0 + txtOPEN = 0 + txtSuperBB = 0 + txtSuper12 = 0 + txtSuper783 = 0 + txtSuper78 = 0 + txtSuper38 = 0 + txtSuper1383 = 0 + txtSuperRL = 0 + txtSuperML = 0 + txtSuperDW = 0 + txtSuperSP = 0 +' txtLathO = "" + txtSandO = "" + txtScratchO = "" + txtBrownO = "" + txtTextureO = "" + txtLathBill = "" + txtStoneBill = 0 + txtFinish.Text = "" + txtTake138 = 0 + txtOneKote.Text = "" + lstLath.Clear + lstYard.Clear + lstPreOrder.Clear + lstLMaterial.Clear + lstInventory.Clear + lstPOptions.Clear + lstLOptions.Clear + lstOptMatrl.Clear + lstPO.Clear + lstPOMaterial.Clear + lstBrown.Clear + lstScratch.Clear + lstTexture.Clear + txtLOYdge = 0 + txtLODesc = "" + txtLOFin2 = 0 + txtLOFoam = 0 + txtLOMInvNo = 0 + txtLOMDesc = "" + txtLOMQty = "" + txtSand = 0 + txtLOMLength = 0 + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + gintOPTID = 0 +' txtLODate.Enabled = False +' chkHoldOrders = vbUnchecked +' chkHoldOrders.Enabled = True +' chkHoldPO = vbUnchecked +' chkHoldPO.Enabled = True + chkPaint = vbUnchecked + chkSynthetic = vbUnchecked + chkSynthetic.Enabled = True + chkStone = vbUnchecked + chkOthers = vbUnchecked + chkNoPay = vbUnchecked + chkStone.Enabled = True + txtStone = 0 + lblFirst.Visible = False + lblSZone = "" + lblSandShip = "" + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FIXTypar() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, strINVNO As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + +' lstLMaterial.Clear + + Do Until oRS.EOF + strINVNO = Field2Str(oRS!inv_no) + If strINVNO = "3331" Or strINVNO = "1809" Or strINVNO = "1570" Or strINVNO = "1565" Or strINVNO = "1730" Or strINVNO = "1904" Or strINVNO = "1906" Or strINVNO = "7104" Or strINVNO = "7106" Or strINVNO = "1831" Then + oRS!d_flag = "S" + oRS!m_type = "W" + oRS.Update + End If + oRS.MoveNext + Loop + oRS.Close + +' If lstLMaterial.ListCount Then +' lstLMaterial.ListIndex = 0 +' Else +' txtLMInvNo = "0" +' txtLMDesc = "" +' txtLMQty = "0" +' txtLMLength = "0" +' cboLMDFlag.ListIndex = -1 +' cboLMType.ListIndex = -1 +' cboLMMetal.ListIndex = -1 +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FIXTypar" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProcessRpt() +Dim strSELECT As String + + With moRS + +' strSELECT = !model + If !superp And Not !superd Then + mboolSupP = True + mboolNoPrint = False +' Else +' mboolSupP = False +' mboolNoPrint = True +' End If + ElseIf !WrapP And Not !WrapD Then + mboolWrapP = True + mboolNoPrint = False +' Else +' mboolWrapP = False +' mboolNoPrint = True +' End If + ElseIf !LathP And Not !LathD Then + mboolLathP = True + mboolNoPrint = False +' Else +' mboolLathP = False +' mboolNoPrint = True +' End If + ElseIf !StoneP And Not !StoneD Then + mboolStoneP = True + mboolNoPrint = False + ElseIf !NescoP And Not !NescoD Then + mboolNescoP = True + mboolNoPrint = False +' Else +' mboolNescoP = False +' mboolNoPrint = True +' End If + ElseIf !PopoutP And Not !PopOutD Then + mboolPopOutP = True + mboolNoPrint = False +' Else +' mboolPopOutP = False +' mboolNoPrint = True +' End If + ElseIf !BrownP And Not !BrownD Then + mboolBrownP = True + mboolNoPrint = False +' Else +' mboolBrownP = False +' mboolNoPrint = True +' End If + ElseIf !TexP And Not !TexD Then + mboolTexP = True + mboolNoPrint = False +' Else +' mboolTexP = False +' mboolNoPrint = True +' End If + ElseIf !CMUP And Not !CMUD Then + mboolCMUP = True + mboolNoPrint = False +' Else +' mboolCMUP = False +' mboolNoPrint = True +' End If + ElseIf !EX1P And Not !EX1D Then + mboolEX1P = True + mboolNoPrint = False +' Else +' mboolEX1P = False +' mboolNoPrint = True +' End If + ElseIf !EX2P And Not !EX2D Then + mboolEX2P = True + mboolNoPrint = False +' Else +' mboolEX2P = False +' mboolNoPrint = True +' End If + ElseIf !EX3P And Not !EX3D Then + mboolEX3P = True + mboolNoPrint = False + Else +' mboolEX3P = False + mboolNoPrint = True + End If + + End With + +End Sub +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") +' strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = Field2Str(oRS("inv_no")) + + If mboolAdding Then +' intINVNO = Field2Integer(txtPOInvNo) + If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then + mintBOOKMARK = .ListIndex + End If + End If + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, intCOUNT As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + intCOUNT = oRSS.RecordCount + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str2(oRS!qty) +' oRSS!price = 0 + oRSS!price = Field2Str2(oRS!price) + oRSS.Update + If moRSProj!FHA Then + If Field2Str(oRS!inv_no) = "1570" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + Else + If Field2Str(oRS!inv_no) = "1130" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If +' Resume Next + +End Sub +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String, strINVNO As String +Dim strLine As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String, strSELECT As String +Dim strLine As String + + On Error GoTo Error_EH + If lstLOptions.ListIndex = -1 Then + lstOptMatrl.ListIndex = -1 + Exit Sub + End If + strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + lstOptMatrl.ListIndex = -1 + End If + Exit Sub + +Error_EH: + If Err = 381 Then + strSELECT = 0 + cmdOptDel.Enabled = False + Resume Next + End If + +End Sub +Private Sub POptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + + .AddItem oRS!ponum + .ItemData(.NewIndex) = oRS!ponum + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPO.ListCount Then + lstPO.ListIndex = 0 + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LOptLoad() +Dim oRS As Recordset +Dim strSQL As String, intLoop As Integer, intPos As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!Opt_ID + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Else + lstLOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module LOptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboLMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_DblClick() + cmdAddMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdDelMatrl.Enabled = True +End Sub + +Private Sub lstLookup_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstLOOKUP.col = 0 + strINVNO = lstLOOKUP.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = " & lstLOOKUP.ItemData(lstLOOKUP.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstLookup_dblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_Click() + On Error GoTo Error_EH + + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "0" + txtLODesc = "" + txtLOFin2 = "0" + txtLOFoam = "0" + txtLOTexture = "" + End If + If FormFindLOpt() Then +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End If + Else + cmdOptDel.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstLOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptDel.Enabled = True + cmdOptAdd.Enabled = False + End If + +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_Click() + On Error GoTo Error_EH + + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +' cboLMDFlag.Text = "" +' cboLMType.Text = "" +' cboLMMetal.Text = "" + txtLMBalance = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstLMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_DblClick() +'' If chkHoldPO Then +'' MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" +'' Exit Sub +'' End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + End If +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_Click() + On Error GoTo Error_EH + + If lstPO.ListIndex <> -1 Then + If FormFindPO() Then + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + Else + lstPO.Clear + txtPONum = "0" + txtPODesc = "" + txtIssueTo = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OrderLoad() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strLine As String, strSELECT As String + On Error Resume Next + + mboolNOTSUPPLIER = True + +' lstLMaterial.col = 0 +' strINVNO = lstLMaterial.ColText + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'S' and M_Type = 'P'" + oRS.Filter = strSELECT + lstPreOrder.Clear + If oRS.EOF Then + End If +' strSELECT = "M_Type = 'Z'" +' oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + mboolNOTSUPPLIER = False + + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'Y' and M_Type = 'P'" + oRS.Filter = strSELECT +' lstPreOrder.Clear + If oRS.EOF Then + End If +' strSELECT = "M_Type = 'Z'" +' oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "M_Type = 'Z'" + oRS.Filter = strSELECT + lstPreOrder.Redraw = True + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSELECT + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSELECT + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'D'" + oRS.Filter = strSELECT +' lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSELECT + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSELECT + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSELECT + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPlans_DblClick() + txtModel = lstPlans.List(lstPlans.ListIndex) + lstPlans.Visible = False + lblPlan.Visible = False + Call cmdFindPlan_Click +End Sub + +Private Sub lstPOMaterial_DblClick() +'' If chkHoldPO Then +'' MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" +'' Exit Sub +'' End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + End If +End Sub + +Private Sub lstPOptions_Click() + On Error GoTo Error_EH + + If lstPOptions.ListIndex <> -1 Then + If FormFindPOpt2() Then + Call FormShowPOpt + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + txtLMBalance = "0" + chkChange = vbUnchecked + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +End Sub + +Private Sub POClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPONotes = "" + txtIssueTo = "" + txtPONum = "0" + txtPODesc = "" + txtPODate = "" + txtPay = 0 + txtPayType = "" + lstLOOKUP.Clear + lstPOMaterial.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cboPOType.ListIndex = -1 + +End Sub + +Private Sub POMatClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPOPrice = "0" + lstLOOKUP.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cmdFindPOMat.Visible = True + +End Sub + +Private Sub lstPOptions_DblClick() + If mboolDNU Then + MsgBox "A DNU Option Cannot Be Used - Select Another Option", vbOKOnly, "Select Again" + Exit Sub + Else + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + lstPOptions.Enabled = False + cmdOptAdd.Enabled = True + cmdOptDel.Enabled = False + End If + End If +End Sub + +Private Sub SSTLotInfo_GotFocus() + If SSTLotInfo.Tab = 1 Then + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) +' txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + End If + If SSTLotInfo.Tab = 6 Then +'' If chkHoldPO Then +'' cmdAddPO.Enabled = False +'' cmdSavePO.Enabled = False +'' cmdDelPO.Enabled = False +'' cmdPrintPO.Enabled = False +'' cmdPrintForm.Enabled = False +'' cmdAddPOMat.Enabled = False +'' cmdSavePOMat.Enabled = False +'' cmdDelPOMat.Enabled = False +'' txtPONum.Enabled = False +'' txtPODate.Enabled = False +'' txtIssueTo.Enabled = False +'' txtPODesc.Enabled = False +'' txtPay.Enabled = False +'' txtPayType.Enabled = False +'' txtPONotes.Enabled = False +'' txtPOInvNo.Enabled = False +'' txtPOMatDesc.Enabled = False +'' txtPOQty.Enabled = False +'' cboPODFlag.Enabled = False +'' cboPOMType.Enabled = False +'' txtPOPrice.Enabled = False +'' cmdPrintPOPay.Enabled = False +'' cmdFindPOMat.Enabled = False +'' lstLookup.Visible = False +'' Else +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then +'' If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then +'' cmdAddPO.Enabled = True +'' End If +'' End If + End If +End Sub + +Private Sub txt28Foam_GotFocus() + Call FieldSelect(txt28Foam) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtIssueTo_GotFocus() + Call FieldSelect(txtIssueTo) +End Sub + +Private Sub txtIssueTo_LostFocus() + txtIssueTo = UCase(txtIssueTo) +End Sub + +Private Sub txtJC_GotFocus() + Call FieldSelect(txtJC) +End Sub + +Private Sub txtJC_LostFocus() + txtJC = UCase(txtJC) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtLMDesc_LostFocus() + txtLMDesc = UCase(txtLMDesc) +End Sub + +Private Sub txtLMInvNo_GotFocus() + Call FieldSelect(txtLMInvNo) +End Sub + +Private Sub txtLMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If + mstrENDQTY = txtLMQty +End Sub + +Private Sub txtLOMQty_GotFocus() + mdblQTY = Field2Str2(txtLOMQty) +End Sub + +Private Sub txtLOMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLOMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLotNotes_GotFocus() + txtLotNotes.SelStart = 1000 +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtModel_LostFocus() + txtModel = UCase(txtModel) +End Sub + +Private Sub txtPay_GotFocus() + Call FieldSelect(txtPay) +End Sub + +Private Sub txtPayType_GotFocus() + Call FieldSelect(txtPayType) +End Sub + +Private Sub txtPayType_LostFocus() + txtPayType = UCase(txtPayType) + If txtPayType = "D" Or txtPayType = "R" Then + lblPayYds.Caption = "Pay Dollars:" + Else + lblPayYds.Caption = "Pay Yards:" + End If +End Sub + +Private Sub txtPODate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtPODate, "/", 1) + If Not IsDate(txtPODate) Then + If lngPOS = 0 Then + If Len(txtPODate) > 0 Then + txtPODate = Format(txtPODate, "00/00/####") + If Not IsDate(txtPODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtPODate.SetFocus + End If + End If +End Sub + +Private Sub txtPOPrice_GotFocus() + Call FieldSelect(txtPOPrice) +End Sub + +Private Sub txtPOPrice_LostFocus() + txtPOPrice = Format(txtPOPrice, "#,#.00") +End Sub + +Private Sub txtPOQty_LostFocus() + If mdblQTY <> Field2Str2(txtPOQty) Then + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If + End If + +End Sub + +Private Sub txtLMDesc_GotFocus() + Call FieldSelect(txtLMDesc) +End Sub + +Private Sub txtLMLength_GotFocus() + Call FieldSelect(txtLMLength) +End Sub + +Private Sub txtLMQty_GotFocus() + mdblQTY = Field2Str2(txtLMQty) + mstrBEGQTY = Field2Str(txtLMQty) + Call FieldSelect(txtLMQty) +End Sub + +Private Sub txtLotNo_LostFocus() + txtLotNo = UCase(txtLotNo) + + Call GETJC +' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") +End Sub +Private Sub GETJC() +Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + intJC = Field2Integer(oRS!nextjc) + txtALPHA = Field2Str(oRS!jcalpha) + txtJC = txtALPHA & Format(Field2Str(intJC), "000000") + intJC = intJC + 1 + + If intJC > 999999 Then + intJC = 1 + intASCII = Asc(txtALPHA) + intASCII = intASCII + 1 + txtALPHA = Chr(intASCII) + oRS!jcalpha = Field2Str(txtALPHA) + End If + + oRS!nextjc = intJC + oRS.Update + +End Sub +Private Sub txtModel_GotFocus() + Call FieldSelect(txtModel) +End Sub + +Private Sub txtOwner_GotFocus() + Call FieldSelect(txtOwner) +End Sub + +Private Sub txtOwner_LostFocus() + txtOwner.Text = UCase(txtOwner.Text) +End Sub +Private Sub txtAddress_LostFocus() + txtAddress.Text = UCase(txtAddress.Text) +End Sub +Private Sub txtAddress_GotFocus() + Call FieldSelect(txtAddress) +End Sub +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub txtPODate_GotFocus() + Call FieldSelect(txtPODate) +End Sub + +Private Sub txtPODesc_GotFocus() + Call FieldSelect(txtPODesc) +End Sub + +Private Sub txtPODesc_LostFocus() + txtPODesc = UCase(txtPODesc) +End Sub + +Private Sub txtPOInvNo_GotFocus() + Call FieldSelect(txtPOInvNo) +End Sub + +Private Sub txtPOMatDesc_GotFocus() + Call FieldSelect(txtPOMatDesc) +End Sub + +Private Sub txtPOMatDesc_LostFocus() + txtPOMatDesc = UCase(txtPOMatDesc) +End Sub + +Private Sub txtPONotes_GotFocus() + Call FieldSelect(txtPONotes) +End Sub + +Private Sub txtPONotes_LostFocus() + txtPONotes = UCase(txtPONotes) +End Sub + +Private Sub txtPOQty_GotFocus() + mdblQTY = Field2Str2(txtPOQty) + Call FieldSelect(txtPOQty) +End Sub + +Private Sub txtSuper12_GotFocus() + Call FieldSelect(txtSuper12) +End Sub + +Private Sub txtSuper12_LostFocus() + txtSuper12 = Integer2Field(txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub txtSuper1383_LostFocus() +Dim intResponse As Integer + txtSuper1383 = Integer2Field(txtSuper1383) + If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then + intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") + If intResponse = vbYes Then + Exit Sub + Else + txtSuper1383.SetFocus + End If + End If +End Sub + +Private Sub txtSuper38_GotFocus() + Call FieldSelect(txtSuper38) +End Sub + +Private Sub txtSuper78_GotFocus() + Call FieldSelect(txtSuper78) +End Sub + +Private Sub txtSuper1383_GotFocus() + Call FieldSelect(txtSuper1383) +End Sub + +Private Sub txtSuper783_GotFocus() + Call FieldSelect(txtSuper783) +End Sub + +Private Sub txtSuper783_LostFocus() + txtSuper783 = Integer2Field(txtSuper783) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper78_LostFocus() + txtSuper78 = Integer2Field(txtSuper78) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper38_LostFocus() + txtSuper38 = Integer2Field(txtSuper38) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuperBB_GotFocus() + If mboolCOMM Then + Call FieldSelect(txtSuperBB) + End If +End Sub + +Private Sub txtSuperBB_LostFocus() + If mboolCOMM Then + txtSuperBB = Integer2Field(txtSuperBB) + End If +End Sub + +Private Sub txtSuperDW_GotFocus() + Call FieldSelect(txtSuperDW) +End Sub + +Private Sub txtSuperDW_LostFocus() + txtSuperDW = Integer2Field(txtSuperDW) +End Sub + +Private Sub txtSuperML_GotFocus() + Call FieldSelect(txtSuperML) +End Sub + +Private Sub txtSuperML_LostFocus() + txtSuperML = Integer2Field(txtSuperML) +End Sub + +Private Sub txtSuperNotes_GotFocus() + Call FieldSelect(txtSuperNotes) +End Sub + +Private Sub txtSuperNotes_LostFocus() + txtSuperNotes.Text = UCase(txtSuperNotes.Text) +End Sub + +'Private Sub txtSuperRL_GotFocus() +' Call FieldSelect(txtSuperRL) +'End Sub + +'Private Sub txtSuperRL_LostFocus() +' txtSuperRL = Integer2Field(txtSuperRL) +'End Sub + +Private Sub txtSuperSP_GotFocus() + Call FieldSelect(txtSuperSP) +End Sub + +Private Sub MatCalcOne() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, dblPYRO As Double +Dim dblTP4, dblTP6, dblTP9, dblTPNail, dblTPCTape As Double, dblML2 As Double, dblRL2 As Double +Dim intTP9 As Integer, dblTYPAR As Double, strCHECK As String, mboolSilica As Boolean +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblSUB As Double +Dim dblBB3, dblDW3, dblRL3, dblF12_3, dblRL8 As Double, dblWRAP As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double +Dim intMATOpen As Integer, dblMATYDS As Double, dblMOPEN As Double + + On Error GoTo Error_EH + +' ****** If errors are reported where quantities are being changed in material +' ****** when not wanted look at this -- oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' Else +' oRC!QTY = dblBB +' oRC.Update + + mboolBADD = False + mboolBAG100 = False + mboolSilica = False + dblRL8 = 0 + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + dblPYRO = 1 + + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 90 - intOpenPR ' This is primarly for labor +' intMATOpen = Abs(50 - intOpenPR) ' 10/4/2018 This is a new variable to take only 50% of openings for material yardage +' intMATOpen = Abs(40 - intOpenPR) ' 02/08/2020 Changed to 40% to give more materials yardage + intMATOpen = Int(40 - intOpenPR) ' 02/08/2020 Changed to 40% to give more materials yardage + + dblWRAP = Int(Field2Double(moRS!opening)) 'This is to make wrap calculate on 100% of yardage - 10/04/2018 +' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) + dblMOPEN = Int(((Field2Double(moRS!opening) * intMATOpen) / 100) + 0.99) + 'REMOVED TO MAKE ALL CALCULATIONS THE SAME PER JESSE 2/11/2020 To fix remove triple ''' +''' If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 Changed back to 500 on 7/9/18 +' If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 Changed back to 500 on 7/9/18 +' If Field2Integer(moRS!sq_yd) > 400 Then +''' boolDEDUCT = True +''' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +''' dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) ' 01/04/2018 per Jesse removed all openings from calculations. +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) +''' Else +''' boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN + dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) '' 01/04/2018 per Jesse removed all openings from calculations. +''' End If + +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + + 'REMOVED TO MAKE ALL CALCULATIONS THE SAME PER JESSE 2/11/2020 To fix remove triple ''' +''' If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' intDELETE = 0 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 'Changed 12/11/17 per Jesse +''' moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 'Changed 12/11/17 per Jesse +''' Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 +''' End If +''' Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +''' intDELETE = 0 +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 +''' moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 +''' Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 +''' End If +''' End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + '******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + + '********** Need to determine correct RL +' If txtSuperRL = "-2" Then ' Use Takeoff RL always per Jesse 05/15/18 + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If +' Else +' If txtSuperRL = "-1" Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > "0" Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If + +' End If +' End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1331'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL2 = 0 + Else + dblRL2 = Field2Integer(moRSCMat!qty) + dblRL = dblRL + dblRL2 + dblRL2 = 0 + End If + If gboolPSpecialCALC Then + dblRL8 = dblRL + End If +'** Black Board and R Guard + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once +' dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + dblBP = Int((CDbl(dblMATYDS) / 33) + 0.99) '10/04/2018 changed by Jesse to give more material + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblNEWYDS < 325 Then + If moRSProj!bb Then + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + ' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS + End If + Else + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house + If dblNEWYDS > 325 Then + dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) +' dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) '10/04/2018 did not use this because openings added over 325 + Else + dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) +' dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) '10/04/2018 did not use this because openings added over 325 + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation + dblBP = Int(((CDbl(dblMATYDS)) / 100) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + End If + + If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + 'For 60 minute, use 1/2 foam divided by 16 +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) +' End If + dblBP = Int(((((dblFD12 + dblRL8) * 1.77)) / 16) + 0.99) '60 Min uses 1/2 foam for yardage + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 16)) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) 'Changed 10/12/15 per jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID 'Material is TYVEK STRAIT FLASH + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "BR" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(txtWireAdj) 'RL reducing Wire calculation +' If dblRL > 5 Then + dblARL = Int(((dblRL) * 1.77) + 0.99) +' dblARL = Int(((dblRL - 5) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 +'CHANGED THIS ON 2/11/2020 to get more yardage to houses per JESSE To remove take out the ''' +''' If CDbl(txtTtlYdge) < 350 Then +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) +''' dblCALC = Int((((CDbl(dblNEWYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'Changed Per Jesse 11/14/2019 +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'Changed Per Jesse 11/14/2019 +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) +''' Else '10/04/2018 Did not change this to dblMATYDS because openings are already added back in + dblCALC = Int(((CDbl(dblMATYDS) - (dblAML + dblARL + dblWire)))) ' / 45) + 0.49) + dblCALC = Int(((dblCALC) / 45) + 0.49) +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)))) ' / 45) + 0.49) +' dblCALC = Int(((dblCALC) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) +''' End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate Typar Stucco Wrap '10/04/2018 Not changed for dblMATYDS because using txtTTLYDGE + If moRSProj!TYPAR Then +' dblTYPAR = Int((Field2Integer(txtTTLYds) / 90) + 0.99) +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.79) ' CHanged on 10/4/2018 per Jesse -- Tangerine Ridge discussion + dblTYPAR = Int((Field2Integer(dblMATYDS) / 80) + 0.79) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +''' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 80) + 0.79) ' CHanged on 11/16/2018 per Jesse -- Fermin Discussion' 18104 dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 70) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to take into consideration overlap +' dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 90) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.99) 'Changed 7/22/2015 after discussion with BBart/JR +' intTP45 = 1 'combined all typar into 1 calcuation + intTP9 = dblTYPAR '- intTP45 + + dblTP4 = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 100) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +' dblTP4 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 100) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP6 = Int((Field2Integer(txtTtlYdge) / 100) + 0.99) 'Changed 10/17/17 No Longer using 6 in tape + dblTP9 = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 500) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS + dblTPNail = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 250) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +' dblTP9 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 500) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTPNail = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 250) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP9 = Int((Field2Integer(txtTtlYdge) / 500) + 0.99) +' dblTPNail = Int((Field2Integer(txtTtlYdge) / 250) + 0.99) + dblTPCTape = intTP9 + +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3310 and lot_id = " & gintLOTID + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3300' and lot_id = " & gintLOTID ' To Delete + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + + Else + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3310' and lot_id = " & gintLOTID +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3300 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3310' and Inv_Type = " & gbytINV_TYPE +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3300 and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = intTP9 + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = intTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3324' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3324' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + moRSCMat!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + oRC!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3326' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3329' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then '********** + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = 1 +' moRSCMat!qty = dblTP9 ' May need to use this if coming up short. Super should hang on to extra butyl + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +'' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = 1 +' oRC!qty = dblTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '1831' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1831' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPNail + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPNail + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3320' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPCTape + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPCTape + oRC.Update + End If + + End If + + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material + ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material + ' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'Now PREMIX Western One KOTE Not MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int(CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int(CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 8) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Western PREMIX + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This caluclates the materials needed for the primary texture + 'mboolbag100 + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + If Not ((Field2Str2(oRSC!s16) > 0) Or (Field2Str2(oRSC!s20) > 0) Or (Field2Str2(oRSC!s30) > 0)) Then + If moRSProj!bag100 Or mboolPSW Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Str2(moRSProj!bagdollars) + Else + mboolSilica = True + End If + Else + mboolSilica = True + End If + End If + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblMATYDS))) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS))) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 Then + If Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + End If + + If mboolBAG100 And Not mboolPSW Then + dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) + ElseIf mboolPSW Then + dblBAGSAND = Int(((dblKote1 + dblCMNT) * dblCalcBAGSAND) + 0.99) + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + '********** + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRSC!qty = dblS20 + oRSC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + +' If mboolBAG100 Then +' dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) +' End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + End If + End If + + 'Calculate the Bag Sand + If dblRS > 0 And Not mboolSilica Then + txtSand = dblRS + Else + txtSand = 0 + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If +'CHanged all dblNEWYDS in foam calculations to dblmatyds 02/18/2020 + + If Field2Integer(dblMATYDS) < 325 Then +' If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblMATYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) +' dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else + dblBB3 = (dblBB * 3.5) + dblDW3 = (dblDW * 3.5) + dblRL3 = (dblRL * 1.77) + dblF12_3 = (dblFD12 * 1.77) + dblSUB = (((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77)) / 1.77) +' dblFD1 = Int((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - dblSUB + 0.99) +' dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = '1610'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed 11/1/17 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed to help with the rounding to full boxes + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed to help with the rounding to full boxes + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.49)) +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If gboolPULTE Then + moRSCMat.Delete +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 25) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + End If + + strSELECT = "inv_no = '1822'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1822'" 'XTRA 9500 Caulk + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 75)) + 0.99) + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 75)) + 0.99) + moRSCMat.Update + End If + +' If Not moRSCMat.EOF Then +' If Not moRSCMat!ch_flag Then +' If gboolPULTE Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update +' Else +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) +' moRSCMat.Update +' End If +' End If +' End If + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + If moRSProj!cont_id = 146 Or moRSProj!cont_id = 864 Then +' If moRSProj!Cont_ID = "146" Or moRSProj!Cont_ID = 864 Then + Call FIXTypar + End If + Call WrapMatPrices + + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo5- Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub WrapMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module WrapMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module OrderMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcOne_20180629() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, dblPYRO As Double +Dim dblTP4, dblTP6, dblTP9, dblTPNail, dblTPCTape As Double, dblML2 As Double, dblRL2 As Double +Dim intTP9 As Integer, dblTYPAR As Double, strCHECK As String, mboolSilica As Boolean +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblSUB As Double +Dim dblBB3, dblDW3, dblRL3, dblF12_3 As Double, dblWRAP As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double + + On Error GoTo Error_EH + +' ****** If errors are reported where quantities are being changed in material +' ****** when not wanted look at this -- oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' Else +' oRC!QTY = dblBB +' oRC.Update + + mboolBADD = False + mboolBAG100 = False + mboolSilica = False + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + dblPYRO = 1 + + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 100 - intOpenPR + + dblWRAP = Int(Field2Double(moRS!opening)) +' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 + If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 +' If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) ' 01/04/2018 per Jesse removed all openings from calculations. +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) '- dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) '' 01/04/2018 per Jesse removed all openings from calculations. + End If + +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse + moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE 'Changed 12/11/17 per Jesse + moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 'Changed 12/11/17 per Jesse + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 10/13/12 + End If + Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) + intDELETE = 19 +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 10/13/12 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + '******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + + '********** Need to determine correct RL +' If txtSuperRL = "-2" Then ' Use Takeoff RL always per Jesse 05/15/18 + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If +' Else +' If txtSuperRL = "-1" Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > "0" Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If + +' End If +' End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1331'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL2 = 0 + Else + dblRL2 = Field2Integer(moRSCMat!qty) + dblRL = dblRL + dblRL2 + dblRL2 = 0 + End If +'** Black Board and R Guard + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If +'*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once + dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblNEWYDS < 325 Then + If moRSProj!bb Then + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + Else + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house + If dblNEWYDS > 325 Then + dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation + dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + End If + + If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + 'For 60 minute, use 1/2 foam divided by 16 +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) +' End If + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) 'Changed 10/12/15 per jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID 'Material is TYVEK STRAIT FLASH + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "BR" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(txtWireAdj) 'RL reducing Wire calculation +' If dblRL > 5 Then + dblARL = Int(((dblRL) * 1.77) + 0.99) +' dblARL = Int(((dblRL - 5) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + If CDbl(txtTtlYdge) < 350 Then +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) + dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) + Else + dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate Typar Stucco Wrap + If moRSProj!TYPAR Then +' dblTYPAR = Int((Field2Integer(txtTTLYds) / 90) + 0.99) + dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 70) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to take into consideration overlap +' dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 90) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.99) 'Changed 7/22/2015 after discussion with BBart/JR +' intTP45 = 1 'combined all typar into 1 calcuation + intTP9 = dblTYPAR '- intTP45 + + dblTP4 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 100) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP6 = Int((Field2Integer(txtTtlYdge) / 100) + 0.99) 'Changed 10/17/17 No Longer using 6 in tape + dblTP9 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 500) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house + dblTPNail = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 250) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP9 = Int((Field2Integer(txtTtlYdge) / 500) + 0.99) +' dblTPNail = Int((Field2Integer(txtTtlYdge) / 250) + 0.99) + dblTPCTape = intTP9 + +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3310 and lot_id = " & gintLOTID + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3300' and lot_id = " & gintLOTID ' To Delete + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + + Else + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3310' and lot_id = " & gintLOTID +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3300 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3310' and Inv_Type = " & gbytINV_TYPE +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3300 and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = intTP9 + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = intTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3324' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3324' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + moRSCMat!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + oRC!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3326' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3329' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then '********** + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = 1 +' moRSCMat!qty = dblTP9 ' May need to use this if coming up short. Super should hang on to extra butyl + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +'' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '1831' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1831' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPNail + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPNail + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3320' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPCTape + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPCTape + oRC.Update + End If + + End If + + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'Now PREMIX Western One KOTE Not MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int(CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Western PREMIX + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This caluclates the materials needed for the primary texture + 'mboolbag100 + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + If Not ((Field2Str2(oRSC!s16) > 0) Or (Field2Str2(oRSC!s20) > 0) Or (Field2Str2(oRSC!s30) > 0)) Then + If moRSProj!bag100 Or mboolPSW Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Str2(moRSProj!bagdollars) + Else + mboolSilica = True + End If + Else + mboolSilica = True + End If + End If + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS))) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 Then + If Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + End If + + If mboolBAG100 And Not mboolPSW Then + dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) + ElseIf mboolPSW Then + dblBAGSAND = Int(((dblKote1 + dblCMNT) * dblCalcBAGSAND) + 0.99) + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRSC!qty = dblS20 + oRSC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + +' If mboolBAG100 Then +' dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) +' End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + End If + End If + + 'Calculate the Bag Sand + If dblRS > 0 And Not mboolSilica Then + txtSand = dblRS + Else + txtSand = 0 + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If + + If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else + dblBB3 = (dblBB * 3.5) + dblDW3 = (dblDW * 3.5) + dblRL3 = (dblRL * 1.77) + dblF12_3 = (dblFD12 * 1.77) + dblSUB = (((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77)) / 1.77) +' dblFD1 = Int((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - dblSUB + 0.99) + dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = '1610'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed 11/1/17 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 230 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If gboolPULTE Then + moRSCMat.Delete +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + End If + + strSELECT = "inv_no = '1822'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = 1822" 'XTRA 9500 Caulk + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 75)) + 0.99) + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 75)) + 0.99) + moRSCMat.Update + End If + +' If Not moRSCMat.EOF Then +' If Not moRSCMat!ch_flag Then +' If gboolPULTE Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update +' Else +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) +' moRSCMat.Update +' End If +' End If +' End If + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + If moRSProj!cont_id = 146 Or moRSProj!cont_id = 864 Then +' If moRSProj!Cont_ID = "146" Or moRSProj!Cont_ID = 864 Then + Call FIXTypar + End If + + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo5- Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcThree() +Dim dblRL As Double, dblDW As Double, dblSP As Double +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String +Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer +Dim strFIN2 As String, strFIN1 As String, dblWire As Double +Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double + + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE = "O" Then + MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + + dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then + moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 ' changed from 19 to 0 per Jesse 01/13/18 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) 'Change per Jesse 08/01/18 + End If + Else + moRS!s_yds = Field2Integer(dblNEWYDS) - 5 'Change per Jesse 08/01/18 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 5 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 ' changed from 19 to 0 per Jesse 01/13/18 +' intDELETE = 19 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + Else + moRS!l_yds = Field2Integer(dblNEWYDS) ' Change for Jesse 08/01/2018 +' moRS!l_yds = Field2Integer(dblNEWYDS) - 5 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str2(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str2(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + +'Black Board + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'Stucco Wire + 'Paperback wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(txtWireAdj) + If txtSuperSP > 0 Then + dblSP = Field2Str(txtSuperSP) + Else + dblSP = 0 + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + If dblRL > 10 Then + dblARL = Int(((dblRL - 10) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + + 'Self Furing wire + If mstrWIRE = "F" Then +' If dblSP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) +' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + +'Black Paper + If txtSuperSP > 0 Then + dblSP = CDbl(txtSuperSP) + Else + dblSP = 0 + End If + +' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) +' End If +' End If + +' If dblSP > 0 Then + If moRSProj!bp_type = "B6" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) + dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) + End If + ElseIf moRSProj!bp_type = "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) + dblBP = dblBP + (((dblSP * 3.5) / 16)) ' Changed 10/12/15 per Jesse +' dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) + End If + ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) + dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strGET = "SELECT * FROM tblTCInfo" + Set oRST = New Recordset + oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + +'Scratch Coat + dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) + dblSCmnt = (dblBatch * oRST!scr_cmnt) + dblSLime = (dblBatch * oRST!scr_lime) + dblRS = (dblBatch * oRST!scr_rs) + +'Brown Coat + dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) + dblCMNT = (dblBatch * oRST!brn_cmnt) + dblLime = (dblBatch * oRST!brn_lime) + dblRS = dblRS + (dblBatch * oRST!brn_rs) + +'Texture Coat + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str(oRSC!id) = "SB" Then + dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) + +' dblSYN = Int(dblBatch + 0.5) + End If + + If Field2Integer(oRSC!cmnt) > 0 Then + dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblTCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) +' Else +' dblRS = 0 + End If + +'This calculates the additional materials needed for the second texture + If moRS!fin2 > 0 Then + + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + ' Else + ' dblTCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) +' Else +' dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) +' Else +' dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) +' Else +' dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) +' Else +' dblS30 = 0 + End If + End If + + dblRS = Int((dblRS / 2000) + 0.99) + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblSYN / 10) + 0.5) + moRSCMat.Update + End If + End If + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblSLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSLime + moRSCMat.Update + End If + End If + + If dblTLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + +'Calculate 4d Nails + + strSELECT = "inv_no = '1616'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) + moRSCMat.Update + End If + End If + +'Calculate Staples + + strSELECT = "inv_no = '1705'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 400 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then + moRSCMat!qty = 4 + ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then + moRSCMat!qty = 5 + ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then + moRSCMat!qty = 6 + ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 7 + ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then + moRSCMat!qty = 8 + ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then + moRSCMat!qty = 9 + ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then + moRSCMat!qty = 10 + End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module MatCalcThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ConvertSuper() +Dim strGET As String, strSQL As String +Dim oRSC As Recordset + On Error GoTo Error_EH + + If txtSuper78 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + End If + End If + + If txtSuper38 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + End If + End If + + If txtSuper783 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = '1145'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1565'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1140'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + End If + + If txtSuperML <> 0 Then + strSQL = "inv_no = '1370'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + End If + End If + + If txtSuperDW <> 0 Then + strSQL = "inv_no = '1320'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + End If + End If + + If txtSuper1383 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = '1135'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module ConvertSuper" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcMetal() +Dim oRS As Recordset +Dim strSQL As String, dblMETAL As Double + On Error GoTo Error_EH + + moRS!METAL = 0 + + strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!summetal) + moRS!METAL = dblMETAL +' moRS!calcdate = Now + moRS!calcdate = Date + moRS.Update + txtMetal = dblMETAL + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module CalcMetal" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSuperSP_LostFocus() + txtSuperSP = Integer2Field(txtSuperSP) +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub txtWireAdj_LostFocus() + txtWireAdj = Integer2Field(txtWireAdj) +End Sub + +Private Sub txtYardMemo_LostFocus() + txtYardMemo = UCase(txtYardMemo) +End Sub + +Private Sub PrintLathInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If oRSE.EOF Then + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "L" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = DateAdd("d", 3, moRS!lorder) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) +' !disc_due_date = DateAdd("d", 3, moRS!lorder) + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "Before mlngINVID update" + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "After Main Lath Information " + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintLathInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" +' ElseIf moRSProj!cocode = 1 Then +' strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If oRSE.EOF Then + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" +' ElseIf moRSProj!cocode = 1 Then +' strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "W" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "W" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "W" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!lorder) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "After Main Lath Information " + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "W" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "W" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!lorder) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Winvoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintWrapInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintCompleteInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSC.EOF Then + If Field2Str(oRSC!Address2) = "" Then + strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + strADD3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + strADD4 = "" + Else + strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + End If + + dblINVTOTAL = 0 + dblRETENTION = 0 + If oRS.EOF Then + End If + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSS!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!s_bill) + !sales_code = Field2Str(oRSS!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(oRSS!s_bill) + !amount = Field2Str2(oRSS!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSO.MoveNext + End If + Loop + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintCompleteInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" '*** This may be causing the extra zeros on the front of the invoice numbers + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" '*** This may be causing the extra zeros on the front of the invoice numbers +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !inv_due_date = Field2Str(strDate) +' !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + !taxcode = "AZ" +' !TAXCODE = mstrTAXCODE + Else +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + !taxcode = mstrTAXCODE + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "Before mlngINVID update" + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "Before Option Setup" + + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + gstrMODULE = "Before Update mlngINVID second time" + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + gstrMODULE = "Before Print Invoice" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID +' ElseIf moRSProj!cocode = 1 Then +' strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintStuccoInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset ', oRSE As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer ' , strSQLE As String +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double, boolHEADER As Boolean, txtSALECD As String + + On Error GoTo Error_EH + + gintCOPY = 1 + boolHEADER = False + txtSALECD = "" + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' OR B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + +' 02/11/2020 commenting this out to prevent printing a blank stone items remove double marks to start using this again +'' If Not mboolSTONE3 Then + +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_ID = gintLOTID +'' !PROJ_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "V" +'' !customer_no = Field2Str(moRSProj!ar) +' !ship_date = Field2Str(moRS!VOrder) +'' !ship_date = (moRS!VOrder) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' Else +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' End If +'' intCMonth = Month(moRS!VOrder) +'' intCDay = Day(moRS!VOrder) +'' intCYear = Year(moRS!VOrder) +'' If intCDay > moRSProj!inv_due Then +'' intCMonth = intCMonth + 1 +'' If intCMonth > 12 Then +'' intCMonth = intCMonth - 12 +'' intCYear = intCYear + 1 +'' End If +'' End If +'' intCDay = Field2Integer(moRSProj!inv_due) +'' If intCDay = 0 Then +'' Select Case intCMonth +'' Case 2 +'' intCDay = 28 +'' Case 1, 3, 5, 7, 8, 10, 12 +'' intCDay = 31 +'' Case 4, 6, 9, 11 +'' intCDay = 30 +'' End Select +'' End If + +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !job_number = Field2Str(moRS!jobcost) + +'' intYear = Year(!invoice_date) +'' intMonth = Month(!invoice_date) + 1 +'' intDay = Field2Integer(moRSProj!DueDate) +'' If intMonth > 12 Then +'' intMonth = intMonth - 12 +'' intYear = intYear + 1 +'' End If +'' Select Case intMonth +'' Case 2 +'' If intDay = 0 Then +'' intDay = 28 +'' End If +'' If intDay > 28 Then +'' intDay = 28 +'' End If +'' Case 1, 3, 5, 7, 8, 10, 12 +'' If intDay = 0 Then +'' intDay = 31 +'' End If +'' If intDay > 31 Then +'' intDay = 31 +'' End If + +'' Case 4, 6, 9, 11 +'' If intDay = 0 Then +'' intDay = 30 +'' End If +'' If intDay > 30 Then +'' intDay = 30 +'' End If +'' End Select + +'' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSE!st_bill) +'' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +'' !sales_code = Field2Str(oRSE!st_code) +'' If txtSALECD <> "" Then +'' !header = vbChecked +'' boolHEADER = True +'' Else +'' !header = vbUnchecked +'' boolHEADER = False +'' End If +'' If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +'' !taxcode = "AZ" +'' Else +'' !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) +'' End If +'' !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +'' !price = Field2Str2(oRSE!st_bill) +'' !amount = Field2Str2(oRSE!st_bill) +' !header = vbChecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) +' !inv_type = "S" + !inv_type = "V" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + + If boolHEADER Then + !header = vbUnchecked + boolHEADER = False + Else + !header = vbChecked + boolHEADER = True + End If + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub JCSetup() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblJCTrans" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblJCTransM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If IsNull(moRSProj!ar) Then + MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" + Exit Sub + End If + With oRS + .AddNew + !Lot_ID = gintLOTID + !job_number = Field2Str(moRS!jobcost) + !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no + !address = Field2Str(moRS!address) + !customer_no = Field2Str(moRSProj!ar) + !retention_pct = Field2Str2(moRSProj!retention) + !setup_date = Date + !status_date = Date + .Update + End With + MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5- Module JCSetup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv_20200111() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset ', oRSE As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer ' , strSQLE As String +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' OR B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + + + If Not mboolSTONE3 Then + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) +' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + ' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!st_bill) + !amount = Field2Str2(oRSE!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbChecked +' !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POInvoice() +Dim strSELECT As String + + On Error GoTo Error_EH + + If Not mboolSTPAY Then + If moRS!st_flg Then + MsgBox "This Lot Has Already Had A Stone Invoice Printed", vbOKOnly, "Invoice Not Available" + Exit Sub + End If + End If + + gintCOPY = 1 + strSELECT = "{tblOrders.PONum} = " & lstPO.ItemData(lstPO.ListIndex) + If gstrPONUM = "" Then + gstrPONUM = lstPO.ItemData(lstPO.ListIndex) + End If +'************************************************************************************* testing Stone Invoice + If optStone Then +' If optStucco Then + Call PrintStoneInv + Exit Sub + End If + +'************************************************************************************* + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module POInvoice" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ElevLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!Folder = oRS!Folder + oRSS!FileName = oRS!FileName + oRSS!Primary = oRS!Primary + oRSS.Update + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Form LotInfo5 - Module ElevLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frx new file mode 100644 index 0000000..bdf1141 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FIX 20200212/frmLotInfo5.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMABOUT.FRX b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMABOUT.FRX new file mode 100644 index 0000000..51517f9 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMABOUT.FRX differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.FRM new file mode 100644 index 0000000..8374938 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.FRM @@ -0,0 +1,434 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmLabor + Caption = "Labor Rates" + ClientHeight = 3660 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 3660 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 555 + Left = 5250 + TabIndex = 9 + Top = 2640 + Width = 1395 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 10320 + TabIndex = 8 + Top = 2640 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 555 + Left = 7785 + TabIndex = 7 + Top = 2640 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Height = 555 + Left = 2715 + TabIndex = 6 + Top = 2640 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Height = 555 + Left = 180 + TabIndex = 5 + Top = 2640 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 5280 + Picture = "FRMLABOR.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 3300 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 5640 + Picture = "FRMLABOR.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 3300 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5985 + Picture = "FRMLABOR.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 3300 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 6345 + Picture = "FRMLABOR.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 3300 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 2535 + Left = 180 + TabIndex = 0 + Top = 60 + Width = 11580 + _ExtentX = 20426 + _ExtentY = 4471 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Texture" + Columns(0).DataField= "texture" + Columns(0).DataWidth= 2 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Stucco Labor" + Columns(1).DataField= "S_Rate" + Columns(1).DataWidth= 5 + Columns(1).DefaultValue= "0" + Columns(1).DefaultValue.vt= 8 + Columns(1).NumberFormat= "Fixed" + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Lath Labor" + Columns(2).DataField= "L_Rate" + Columns(2).DataWidth= 5 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2).NumberFormat= "Fixed" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Metal Labor" + Columns(3).DataField= "M_Rate" + Columns(3).DataWidth= 5 + Columns(3).DefaultValue= "0" + Columns(3).DefaultValue.vt= 8 + Columns(3).NumberFormat= "Fixed" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "CMU Rate" + Columns(4).DataField= "CMU" + Columns(4).DataWidth= 5 + Columns(4).DefaultValue= "0" + Columns(4).DefaultValue.vt= 8 + Columns(4).NumberFormat= "Fixed" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "Mat. MarkUp" + Columns(5).DataField= "matmu" + Columns(5).DataWidth= 5 + Columns(5).DefaultValue= "0" + Columns(5).DefaultValue.vt= 8 + Columns(5).NumberFormat= "Percent" + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Scaffold" + Columns(6).DataField= "scr" + Columns(6).DataWidth= 5 + Columns(6).DefaultValue= "0" + Columns(6).DefaultValue.vt= 8 + Columns(6).NumberFormat= "Fixed" + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 0 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "OH Percent" + Columns(7).DataField= "ohp" + Columns(7).DataWidth= 5 + Columns(7).DefaultValue= "0" + Columns(7).DefaultValue.vt= 8 + Columns(7).NumberFormat= "Fixed" + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "Tape/Plastic" + Columns(8).DataField= "tp" + Columns(8).DataWidth= 5 + Columns(8).DefaultValue= "0" + Columns(8).DefaultValue.vt= 8 + Columns(8).NumberFormat= "Fixed" + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(9)._VlistStyle= 0 + Columns(9)._MaxComboItems= 5 + Columns(9).Caption= "MarkUp" + Columns(9).DataField= "mu" + Columns(9).DataWidth= 5 + Columns(9).DefaultValue= "0" + Columns(9).DefaultValue.vt= 8 + Columns(9).NumberFormat= "Percent" + Columns(9)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(10)._VlistStyle= 0 + Columns(10)._MaxComboItems= 5 + Columns(10).Caption= "Cmnt/Lime Adj." + Columns(10).DataField= "cladj" + Columns(10).DataWidth= 2 + Columns(10).DefaultValue= "0" + Columns(10).DefaultValue.vt= 8 + Columns(10).NumberFormat= "Fixed" + Columns(10)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 11 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=11" + Splits(0)._ColumnProps(1)= "Column(0).Width=1958" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1879" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=1958" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=1879" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1667" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1588" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=1799" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=1720" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=1799" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=1720" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=1931" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=1852" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1402" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1323" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1931" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1852" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1931" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1852" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits(0)._ColumnProps(37)= "Column(9).Width=1402" + Splits(0)._ColumnProps(38)= "Column(9).DividerColor=0" + Splits(0)._ColumnProps(39)= "Column(9)._WidthInPix=1323" + Splits(0)._ColumnProps(40)= "Column(9).Order=10" + Splits(0)._ColumnProps(41)= "Column(10).Width=2064" + Splits(0)._ColumnProps(42)= "Column(10).DividerColor=0" + Splits(0)._ColumnProps(43)= "Column(10)._WidthInPix=1984" + Splits(0)._ColumnProps(44)= "Column(10).Order=11" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(50) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(51) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(52) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(53) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(54) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(55) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(56) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(57) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(58) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(59) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(60) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(61) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(62) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(63) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(64) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(65) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(66) = "Splits(0).Columns(9).Style:id=74,.parent=13" + _StyleDefs(67) = "Splits(0).Columns(9).HeadingStyle:id=71,.parent=14" + _StyleDefs(68) = "Splits(0).Columns(9).FooterStyle:id=72,.parent=15" + _StyleDefs(69) = "Splits(0).Columns(9).EditorStyle:id=73,.parent=17" + _StyleDefs(70) = "Splits(0).Columns(10).Style:id=78,.parent=13" + _StyleDefs(71) = "Splits(0).Columns(10).HeadingStyle:id=75,.parent=14" + _StyleDefs(72) = "Splits(0).Columns(10).FooterStyle:id=76,.parent=15" + _StyleDefs(73) = "Splits(0).Columns(10).EditorStyle:id=77,.parent=17" + _StyleDefs(74) = "Named:id=33:Normal" + _StyleDefs(75) = ":id=33,.parent=0" + _StyleDefs(76) = "Named:id=34:Heading" + _StyleDefs(77) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(78) = ":id=34,.wraptext=-1" + _StyleDefs(79) = "Named:id=35:Footing" + _StyleDefs(80) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(81) = "Named:id=36:Selected" + _StyleDefs(82) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(83) = "Named:id=37:Caption" + _StyleDefs(84) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(85) = "Named:id=38:HighlightRow" + _StyleDefs(86) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(87) = "Named:id=39:EvenRow" + _StyleDefs(88) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(89) = "Named:id=40:OddRow" + _StyleDefs(90) = ":id=40,.parent=33" + _StyleDefs(91) = "Named:id=41:RecordSelector" + _StyleDefs(92) = ":id=41,.parent=34" + _StyleDefs(93) = "Named:id=42:FilterBar" + _StyleDefs(94) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmLabor" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdCancel_Click() + moRS.CancelUpdate +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update + TDBGLabor.ReBind +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblPrgInfo" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRM new file mode 100644 index 0000000..55a2aad --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRM @@ -0,0 +1,284 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmRCrew + Caption = "Repair Crew" + ClientHeight = 6420 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9060 + LinkTopic = "Form1" + ScaleHeight = 6420 + ScaleWidth = 9060 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 7560 + TabIndex = 8 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5400 + TabIndex = 7 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 2280 + TabIndex = 6 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 120 + TabIndex = 5 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 3840 + Picture = "FRMLABOR1.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4200 + Picture = "FRMLABOR1.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4545 + Picture = "FRMLABOR1.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 4905 + Picture = "FRMLABOR1.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5535 + Left = -60 + TabIndex = 0 + Top = 240 + Width = 8940 + _ExtentX = 15769 + _ExtentY = 9763 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Repair Person" + Columns(0).DataField= "Name" + Columns(0).DataWidth= 25 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Phone Number" + Columns(1).DataField= "Phone" + Columns(1).DataWidth= 12 + Columns(1).EditMask= "(###) ###-####" + Columns(1).EditMaskUpdate= -1 'True + Columns(1).EditMaskRight= -1 'True + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Radio ID" + Columns(2).DataField= "Radio" + Columns(2).DataWidth= 10 + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 3 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=3" + Splits(0)._ColumnProps(1)= "Column(0).Width=7646" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=7567" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=3731" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=3651" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=3387" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=3307" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Named:id=33:Normal" + _StyleDefs(43) = ":id=33,.parent=0" + _StyleDefs(44) = "Named:id=34:Heading" + _StyleDefs(45) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(46) = ":id=34,.wraptext=-1,.bold=-1,.fontsize=975,.italic=0,.underline=0" + _StyleDefs(47) = ":id=34,.strikethrough=0,.charset=0" + _StyleDefs(48) = ":id=34,.fontname=MS Sans Serif" + _StyleDefs(49) = "Named:id=35:Footing" + _StyleDefs(50) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(51) = "Named:id=36:Selected" + _StyleDefs(52) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(53) = "Named:id=37:Caption" + _StyleDefs(54) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(55) = "Named:id=38:HighlightRow" + _StyleDefs(56) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(57) = "Named:id=39:EvenRow" + _StyleDefs(58) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(59) = "Named:id=40:OddRow" + _StyleDefs(60) = ":id=40,.parent=33" + _StyleDefs(61) = "Named:id=41:RecordSelector" + _StyleDefs(62) = ":id=41,.parent=34" + _StyleDefs(63) = "Named:id=42:FilterBar" + _StyleDefs(64) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmRCrew" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblRCrew ORDER by RC_ID" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRX b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRX new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLABOR1.FRX differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLOGIN1.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLOGIN1.FRM new file mode 100644 index 0000000..a56e697 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMLOGIN1.FRM @@ -0,0 +1,99 @@ +VERSION 5.00 +Begin VB.Form frmLogin1 + BorderStyle = 3 'Fixed Dialog + Caption = "Login" + ClientHeight = 1545 + ClientLeft = 2835 + ClientTop = 3480 + ClientWidth = 3750 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 912.837 + ScaleMode = 0 'User + ScaleWidth = 3521.047 + ShowInTaskbar = 0 'False + StartUpPosition = 2 'CenterScreen + Begin VB.TextBox txtUserName + Height = 345 + Left = 1290 + TabIndex = 1 + Top = 135 + Width = 2325 + End + Begin VB.CommandButton cmdOK + Caption = "OK" + Default = -1 'True + Height = 390 + Left = 495 + TabIndex = 4 + Top = 1020 + Width = 1140 + End + Begin VB.CommandButton cmdCancel + Cancel = -1 'True + Caption = "Cancel" + Height = 390 + Left = 2100 + TabIndex = 5 + Top = 1020 + Width = 1140 + End + Begin VB.TextBox txtPassword + Height = 345 + IMEMode = 3 'DISABLE + Left = 1290 + PasswordChar = "*" + TabIndex = 3 + Top = 525 + Width = 2325 + End + Begin VB.Label lblLabels + Caption = "&User Name:" + Height = 270 + Index = 0 + Left = 105 + TabIndex = 0 + Top = 150 + Width = 1080 + End + Begin VB.Label lblLabels + Caption = "&Password:" + Height = 270 + Index = 1 + Left = 105 + TabIndex = 2 + Top = 540 + Width = 1080 + End +End +Attribute VB_Name = "frmLogin1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Public gboolLoginSucceeded As Boolean + +Private Sub cmdCancel_Click() + 'set the global var to false + 'to denote a failed login + gboolLoginSucceeded = False + Me.Hide +End Sub + +Private Sub cmdOK_Click() + 'check for correct password + If txtPassword = "password" Then + 'place code to here to pass the + 'success to the calling sub + 'setting a global var is the easiest + gboolLoginSucceeded = True + Me.Hide + Else + MsgBox "Invalid Password, try again!", , "Login" + txtPassword.SetFocus + SendKeys "{Home}+{End}" + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSCAFFOLD1.FRX b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSCAFFOLD1.FRX new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSCAFFOLD1.FRX differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSPLASH.FRX b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSPLASH.FRX new file mode 100644 index 0000000..ccbb7d0 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMSPLASH.FRX differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER.FRX b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER.FRX new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER.FRX differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER1.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER1.FRM new file mode 100644 index 0000000..5898e1b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FRMUSER1.FRM @@ -0,0 +1,19 @@ +VERSION 5.00 +Begin VB.Form frmUser1 + Caption = "User Information" + ClientHeight = 5655 + ClientLeft = 60 + ClientTop = 405 + ClientWidth = 7230 + LinkTopic = "Form1" + ScaleHeight = 5655 + ScaleWidth = 7230 + StartUpPosition = 3 'Windows Default +End +Attribute VB_Name = "frmUser1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frm new file mode 100644 index 0000000..fbe87dc --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frm @@ -0,0 +1,371 @@ +VERSION 5.00 +Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" +Begin VB.Form frmFlexGrid + Caption = "The Flex Grid Control" + ClientHeight = 4215 + ClientLeft = 45 + ClientTop = 510 + ClientWidth = 8010 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + LinkTopic = "Form1" + ScaleHeight = 4215 + ScaleWidth = 8010 + Begin VB.CommandButton cmdDown + Height = 495 + Left = 7500 + Picture = "FlexGrid.frx":0000 + Style = 1 'Graphical + TabIndex = 8 + Top = 1500 + Width = 435 + End + Begin VB.CommandButton cmdUp + Height = 495 + Left = 7500 + Picture = "FlexGrid.frx":0442 + Style = 1 'Graphical + TabIndex = 7 + Top = 960 + Width = 435 + End + Begin VB.CommandButton cmdClip + Caption = "Clip Example" + Height = 912 + Left = 6660 + TabIndex = 6 + Top = 3240 + Width = 1272 + End + Begin MSFlexGridLib.MSFlexGrid grdEmps + Height = 3072 + Left = 60 + TabIndex = 5 + Top = 60 + Width = 7332 + _ExtentX = 12938 + _ExtentY = 5424 + _Version = 393216 + SelectionMode = 1 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + End + Begin VB.CommandButton cmdColumn2 + Caption = "Retrieve Column 2" + Height = 912 + Left = 5340 + TabIndex = 4 + Top = 3240 + Width = 1272 + End + Begin VB.CommandButton cmdColumn1 + Caption = "Retrieve Column 1" + Height = 912 + Left = 4020 + TabIndex = 3 + Top = 3240 + Width = 1272 + End + Begin VB.CommandButton cmdDataLoad + Caption = "Load Data From Table" + Height = 912 + Left = 2700 + TabIndex = 2 + Top = 3240 + Width = 1272 + End + Begin VB.CommandButton cmdLoad + Caption = "Load Data" + Height = 912 + Left = 1380 + TabIndex = 1 + Top = 3240 + Width = 1272 + End + Begin VB.CommandButton cmdInit + Caption = "Initialize Grid" + Height = 912 + Left = 60 + TabIndex = 0 + Top = 3240 + Width = 1272 + End + Begin VB.Image imgCheck + Height = 144 + Left = 7500 + Picture = "FlexGrid.frx":0884 + Stretch = -1 'True + Top = 180 + Visible = 0 'False + Width = 144 + End +End +Attribute VB_Name = "frmFlexGrid" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mlngColPos As Long + +Const COL_ID As Integer = 0 +Const COL_TYPE As Integer = 1 +Const COL_NAME As Integer = 2 +Const COL_START As Integer = 3 +Const COL_SALARY As Integer = 4 +Const COL_ACTIVE As Integer = 5 + +Private Sub cmdClip_Click() + MsgBox grdEmps.Clip +End Sub + +Private Sub cmdColumn1_Click() + grdEmps.Col = COL_NAME + MsgBox "The Employee's Name is " & grdEmps.Text +End Sub + +Private Sub cmdColumn2_Click() + MsgBox "The Employee's Name is " & grdEmps.TextMatrix(grdEmps.Row, COL_NAME) +End Sub + +Private Sub cmdDataLoad_Click() + Call GridInit + + Call GridDataLoad +End Sub + +Private Sub cmdDown_Click() + Dim intRow As Integer + + intRow = grdEmps.Row + + If intRow < grdEmps.Rows - 1 Then + grdEmps.RowPosition(intRow) = intRow + 1 + grdEmps.Row = intRow + 1 + If Not grdEmps.RowIsVisible(grdEmps.Row) Then + grdEmps.TopRow = grdEmps.Row + End If + grdEmps.Col = COL_ID + grdEmps.ColSel = COL_ACTIVE + End If +End Sub + +Private Sub cmdInit_Click() + Call GridInit +End Sub + +Private Sub cmdLoad_Click() + Call GridInit + + Call GridLoad +End Sub + +Private Sub GridInit() + With grdEmps + ' Get rid of any fixed rows and columns + .FixedRows = 0 + .FixedCols = 0 + + ' Clear the Grid + .Clear + + ' Set the initial number of rows and columns + .Rows = 1 + .Cols = 6 + + ' Setup Headers + Call GridHeader + + ' Set Column Widths + .ColWidth(COL_ID) = 0 + .ColWidth(COL_TYPE) = 2000 + .ColWidth(COL_NAME) = 2000 + .ColWidth(COL_START) = 1000 + .ColWidth(COL_SALARY) = 1000 + .ColWidth(COL_ACTIVE) = 800 + + ' Set Column Alignments + .ColAlignment(COL_START) = flexAlignCenterCenter + .ColAlignment(COL_SALARY) = flexAlignRightCenter + End With +End Sub + +Private Sub GridHeader() + With grdEmps + .Row = 0 + .Col = COL_ID + .Text = "Emp ID" + + .Col = COL_TYPE + .Text = "Type" + + .Col = COL_NAME + .Text = "Name" + + .Col = COL_START + .Text = "Start Date" + + .Col = COL_SALARY + .Text = "Salary" + + .Col = COL_ACTIVE + .Text = "Active" + End With +End Sub + +Private Sub GridLoad() + With grdEmps + ' Add a row + .AddItem "1" & vbTab & _ + "Manager" & vbTab & _ + "Sheriff, Paul" & vbTab & _ + "3/1/91" & vbTab & _ + Format$("70000", "Currency") + .Row = 1 + .Col = COL_ACTIVE + Set .CellPicture = imgCheck.Picture + .CellFontBold = False + .CellPictureAlignment = flexAlignCenterCenter + + ' Set the fixed rows + .FixedRows = 1 + End With +End Sub + +Private Sub GridDataLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + ' Build the SQL String + strSQL = "SELECT lEmp_id, " + strSQL = strSQL & "szLast_nm, " + strSQL = strSQL & "sFirst_nm, " + strSQL = strSQL & "szEmployee_type, " + strSQL = strSQL & "dtStart_dt, " + strSQL = strSQL & "cSalary_amt, " + strSQL = strSQL & "boolActive_fl " + strSQL = strSQL & "FROM tblEmployees, tblEmpTypes " + strSQL = strSQL & "WHERE tblEmployees.lEmpType_id = tblEmpTypes.lEmpType_id " + strSQL = strSQL & "ORDER BY szEmployee_type " + + ' Open the Database + Call DataOpen + ' Open the Recordset + Set oRS = gdb.OpenRecordset(strSQL) + + ' Set this to speed up loading + grdEmps.Redraw = False + + ' Set these for Merging of Cells + 'grdEmps.MergeCells = flexMergeRestrictColumns + 'grdEmps.MergeCol(COL_TYPE) = True + + + ' Loop through each record + Do Until oRS.EOF + ' Build string to put into grid + ' Separate each column with tabs + strLine = oRS!lEmp_id & vbTab & _ + oRS!szEmployee_type & "" & vbTab & _ + oRS!szLast_nm & ", " & oRS!sFirst_nm & vbTab & _ + oRS!dtStart_dt & vbTab & _ + Format$(oRS!cSalary_amt, "Currency") + + ' Add the row to the grid + grdEmps.AddItem strLine + If Field2Bool(oRS!boolActive_fl) Then + grdEmps.Row = grdEmps.Rows - 1 + grdEmps.Col = COL_ACTIVE + Call PictureSet + End If + + ' Move to the next record + oRS.MoveNext + Loop + ' Set the Fixed Rows if Grid has data + If grdEmps.Rows > 1 Then + grdEmps.FixedRows = 1 + End If + + ' Now redraw the grid + grdEmps.Redraw = True + + ' Close the Recordset and Database + oRS.Close + gdb.Close +End Sub + +Private Sub cmdUp_Click() + Dim intRow As Integer + + intRow = grdEmps.Row + + If intRow > 1 Then + grdEmps.RowPosition(intRow) = intRow - 1 + grdEmps.Row = intRow - 1 + If Not grdEmps.RowIsVisible(grdEmps.Row) Then + grdEmps.TopRow = grdEmps.Row + End If + grdEmps.Col = COL_ID + grdEmps.ColSel = COL_ACTIVE + End If +End Sub + +Private Sub grdEmps_DblClick() + If mlngColPos >= grdEmps.ColPos(COL_ACTIVE) And mlngColPos < grdEmps.Width Then + grdEmps.Col = COL_ACTIVE + If grdEmps.CellPicture = 0 Then + Call PictureSet + Else + Set grdEmps.CellPicture = Nothing + End If + grdEmps.Col = COL_ID + grdEmps.ColSel = COL_ACTIVE + End If +End Sub + +Private Sub grdEmps_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) + If Button = vbLeftButton Then + mlngColPos = x + If y >= grdEmps.RowPos(0) And y < grdEmps.RowPos(1) Then + If x >= grdEmps.ColPos(COL_TYPE) And x < grdEmps.ColPos(COL_NAME) Then + grdEmps.Col = COL_TYPE + grdEmps.Sort = flexSortStringNoCaseAscending + ElseIf x >= grdEmps.ColPos(COL_NAME) And x < grdEmps.ColPos(COL_START) Then + grdEmps.Col = COL_NAME + grdEmps.Sort = flexSortStringNoCaseAscending + grdEmps.Col = COL_ID + grdEmps.ColSel = COL_ACTIVE + End If + End If + End If +End Sub + +Private Function Field2Bool(vntValue As Variant) As Boolean + If IsNull(vntValue) Then + Field2Bool = False + Else + Field2Bool = CBool(vntValue) + End If +End Function + +Private Sub PictureSet() + grdEmps.CellPictureAlignment = flexAlignCenterCenter + Set grdEmps.CellPicture = imgCheck.Picture +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frx new file mode 100644 index 0000000..115eb0d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FlexGrid.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frm new file mode 100644 index 0000000..b4607b5 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frm @@ -0,0 +1,232 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form Form1 + Caption = "Form1" + ClientHeight = 6120 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7605 + LinkTopic = "Form1" + ScaleHeight = 6120 + ScaleWidth = 7605 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdLast + Caption = "Last Record" + Height = 615 + Left = 5820 + TabIndex = 5 + Top = 5400 + Width = 1275 + End + Begin VB.CommandButton cmdFirst + Caption = "First Record" + Height = 495 + Left = 4620 + TabIndex = 4 + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdNext + Caption = "Next Record" + Height = 675 + Left = 3120 + TabIndex = 3 + Top = 5340 + Width = 1155 + End + Begin VB.CommandButton cmdPrevious + Caption = "Previous Record" + Height = 615 + Left = 1500 + TabIndex = 2 + Top = 5340 + Width = 1335 + End + Begin VB.CommandButton cmdRebind + Caption = "Rebind" + Height = 615 + Left = 300 + TabIndex = 1 + Top = 5340 + Width = 1095 + End + Begin TrueOleDBGrid70.TDBGrid TDBGrid1 + Bindings = "Form1.frx":0000 + Height = 4995 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 7515 + _ExtentX = 13256 + _ExtentY = 8811 + _LayoutType = 0 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).DataField= "" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).DataField= "" + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 2 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=2" + Splits(0)._ColumnProps(1)= "Column(0).Width=2725" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=2646" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=2725" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=2646" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Named:id=33:Normal" + _StyleDefs(39) = ":id=33,.parent=0" + _StyleDefs(40) = "Named:id=34:Heading" + _StyleDefs(41) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(42) = ":id=34,.wraptext=-1" + _StyleDefs(43) = "Named:id=35:Footing" + _StyleDefs(44) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(45) = "Named:id=36:Selected" + _StyleDefs(46) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(47) = "Named:id=37:Caption" + _StyleDefs(48) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(49) = "Named:id=38:HighlightRow" + _StyleDefs(50) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(51) = "Named:id=39:EvenRow" + _StyleDefs(52) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(53) = "Named:id=40:OddRow" + _StyleDefs(54) = ":id=40,.parent=33" + _StyleDefs(55) = "Named:id=41:RecordSelector" + _StyleDefs(56) = ":id=41,.parent=34" + _StyleDefs(57) = "Named:id=42:FilterBar" + _StyleDefs(58) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "Form1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRS As Recordset + + +Private Sub cmdFindInv_Click() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblInvtry" ' WHERE Inv_no = " & txtLMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' TDBGrid1.DataSource = oRS + Set TDBGrid1.DataSource = oRS + TDBGrid1.ReBind + +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdRebind_Click() +' Set TDBGrid1.DataSource = rs + TDBGrid1.ReBind + +End Sub + +Private Sub Form_Load() +' Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblInvtry" ' WHERE Inv_no = " & txtLMInvNo.Text + + Set moRS = New Recordset + +' moRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' TDBGrid1.DataSource = oRS + Set TDBGrid1.DataSource = moRS +' TDBGrid1.ReBind + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frx new file mode 100644 index 0000000..7efd61d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Form1.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frm new file mode 100644 index 0000000..5c8c86e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frm @@ -0,0 +1,865 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmMANBILL + Caption = "Accounts Receivable" + ClientHeight = 4950 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7530 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4950 + ScaleWidth = 7530 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstHeader + Height = 3000 + Left = 180 + TabIndex = 17 + Top = 585 + Width = 4470 + _Version = 196608 + _ExtentX = 7885 + _ExtentY = 5292 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmMANBILL.frx":0000 + End + Begin VB.TextBox txtTax + Height = 315 + Left = 5580 + TabIndex = 16 + Top = 3000 + Width = 495 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "RePrint Invoice" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 14 + Top = 3675 + Width = 1275 + End + Begin VB.ComboBox cboARCode + Height = 315 + Left = 2955 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 1 + Top = 195 + Width = 4515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 13 + Top = 4395 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 12 + Top = 2955 + Width = 1275 + End + Begin VB.CheckBox chkReady + Alignment = 1 'Right Justify + Caption = "Ready to Transfer to CMS:" + Height = 315 + Left = 5190 + TabIndex = 7 + Top = 2415 + Width = 2205 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 6 + Top = 1935 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 6240 + MaxLength = 7 + TabIndex = 5 + Top = 1515 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 4 + Top = 1095 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 3 + Top = 675 + Width = 1200 + End + Begin VB.ListBox lstDetail + Height = 1230 + Left = 180 + TabIndex = 2 + Top = 3660 + Width = 5895 + End + Begin VB.Label lblTax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code" + Height = 195 + Left = 4830 + TabIndex = 15 + Top = 3090 + Width = 690 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Sales Code:" + Height = 195 + Left = 4920 + TabIndex = 11 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 5235 + TabIndex = 10 + Top = 2040 + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payment Due Date:" + Height = 195 + Left = 4770 + TabIndex = 9 + Top = 1200 + Width = 1395 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Date:" + Height = 195 + Left = 5190 + TabIndex = 8 + Top = 780 + Width = 960 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Builder's MAS90 AR Code:" + Height = 195 + Left = 1020 + TabIndex = 0 + Top = 240 + Width = 1890 + End +End +Attribute VB_Name = "frmMANBILL" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSDetail As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Lot_id) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & vbTab & Format(Field2Str2(oRS!Lot_id), "000000") +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + lstHeader.col = 1 + mstrINVNO = lstHeader.ColText +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and Invoice_no = '" & mstrINVNO & "' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + lstDetail.Clear + + Do Until oRS.EOF + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) + If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) + Else + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & vbTab & Field2Str(oRS!Description) + End If + lstDetail.AddItem strLine + lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module DetailLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboARCode_Change() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub chkReady_Click() + cmdSave.Enabled = True +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gstrPONUM = Field2Str(oRS!po_num) + mstrPROJLOT = Field2Str(oRS!ProjLot) + Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\invoice.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSDetail.State = adStateOpen Then + moRSDetail.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + lstDetail.Enabled = True + lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call ARCodeLoad + +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str(oRS!cust_no) & " - " & Field2Str(oRS!Name) + cboARCode.AddItem strLine + cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!Bill_Id) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ARCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSDetail + txtInvDate = Field2Str(!invoice_date) + txtDueDate = Field2Str(!inv_due_date) + txtItemAmt = Format(Field2Str2(!amount), "currency") + txtSalesCode = Field2Str(!sales_code) + txtTax = Field2Str(!taxcode) + If txtTax = "AZ" Then + txtTax.BackColor = &H80FFFF + txtTax.ForeColor = &HFF& + txtTax.FontBold = True + Else + txtTax.BackColor = &H80000005 + txtTax.ForeColor = &H80000008 + txtTax.FontBold = False + End If + chkReady = Field2CheckBox(!ready) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindDetail() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set moRSDetail = New Recordset + moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSDetail.EOF Then + FormFindDetail = False + Else + FormFindDetail = True + msglInvTotal = moRSDetail!non_tax_amt + mstrType = moRSDetail!inv_type + gintPROJID = moRSDetail!Proj_ID + Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form AR - Module FormFindDetail" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() + If lstDetail.ListIndex <> -1 Then + If FormFindDetail() Then + Call FormShow + + End If + End If +End Sub +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSDetail + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !price = Str2Field(txtItemAmt) + !amount = Str2Field(txtItemAmt) + !sales_code = Str2Field(txtSalesCode) + .Update + End With + + strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + msglInvTotal = Field2Str2(oRS!sglTOTAL) + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !ready = chkReady + !non_tax_amt = msglInvTotal + !taxcode = Str2Field(txtTax) + If Field2Str2(moRSProj!retention) > 0 Then + !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") + Else + !retention_amt = 0 + End If + .Update + End With + oRS.MoveNext + Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + cmdPrint.Enabled = True + lstHeader.col = 4 + gintLOTID = lstHeader.ColText +' gintLOTID = lstHeader.ItemData(lstHeader.ListIndex) + Call DetailLoad + If lstDetail.ListIndex <> -1 Then + Else + lstDetail.Clear + Call FormClear + End If + Else + cmdPrint.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + End If + End If + ElseIf IsDate(txtInvDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + End If + +End Sub + +Private Sub txtItemAmt_GotFocus() + Call FieldSelect(txtItemAmt) + msglItemAmt = Single2Field(txtItemAmt) +End Sub + +Private Sub txtItemAmt_LostFocus() + If msglItemAmt < Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt = Field2Str(txtItemAmt) Then + txtItemAmt = Format(txtItemAmt, "#,#.00") + End If +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTax) +End Sub + +Private Sub txtTax_LostFocus() + If Not IsNull(txtTax) Or txtTax = "" Then + txtTax = UCase(txtTax) + Else + MsgBox "You Must Enter A Sales Tax Code", vbOKOnly, "No Tax Code" + txtTax.SetFocus + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frx new file mode 100644 index 0000000..2429b9a Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMANBILL.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frm new file mode 100644 index 0000000..30b186b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frm @@ -0,0 +1,6355 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmMain + BorderStyle = 1 'Fixed Single + Caption = "Valley Wide Plastering" + ClientHeight = 8595 + ClientLeft = 150 + ClientTop = 720 + ClientWidth = 11880 + BeginProperty Font + Name = "Microsoft Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Icon = "frmMain.frx":0000 + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 8595 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + Begin LpLib.fpList lstContains + Height = 3000 + Left = 45 + TabIndex = 44 + Top = 4230 + Visible = 0 'False + Width = 11775 + _Version = 196608 + _ExtentX = 20770 + _ExtentY = 5292 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmMain.frx":068A + End + Begin VB.TextBox txtSContain + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 780 + TabIndex = 6 + Top = 2760 + Width = 2475 + End + Begin VB.CommandButton cmdFContain + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 120 + Picture = "frmMain.frx":0BD1 + Style = 1 'Graphical + TabIndex = 5 + Top = 2700 + Width = 555 + End + Begin VB.CommandButton cmdUpRGard + Caption = "Update OptNum" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5640 + TabIndex = 42 + Top = 8025 + Visible = 0 'False + Width = 960 + End + Begin VB.CommandButton cmdReNum + Caption = "ReNumber" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3975 + TabIndex = 41 + Top = 8025 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdFixBill + Caption = "Setup Billing" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1980 + TabIndex = 40 + Top = 8025 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdHourly + Caption = "Hourly Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9855 + TabIndex = 39 + Top = 2985 + Width = 1515 + End + Begin VB.CommandButton cmdJCList + Caption = "Select JC List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 37 + Top = 2460 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdFindSPO + Caption = "Find Special PO Info." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 36 + Top = 2460 + Width = 1515 + End + Begin VB.CommandButton cmdFindOrder + Caption = "Find Purchase Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 35 + Top = 2460 + Width = 1515 + End + Begin MSComDlg.CommonDialog cdMain + Left = 840 + Top = 8085 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + CancelError = -1 'True + DialogTitle = "Select Bank Rec File" + InitDir = "c:\BankOne" + End + Begin VB.CommandButton cmdChecks + Caption = "Verify Checks" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 34 + TabStop = 0 'False + Top = 2460 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdProjNotes + Caption = "Pro&Ject Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 33 + TabStop = 0 'False + Top = 2460 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdInvoice + Caption = "Builder Invoice List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 32 + TabStop = 0 'False + Top = 240 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdShip + Caption = "Lot Invoice && Shipping" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 31 + TabStop = 0 'False + Top = 825 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdBilling + Caption = "Billing &Grid" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 30 + TabStop = 0 'False + Top = 1365 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdScafList + Caption = "Scaffold List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 29 + TabStop = 0 'False + Top = 1920 + Width = 1515 + End + Begin VB.CommandButton cmdPrintJCRpt + Caption = "Print Only - Job Cost Reports" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 28 + TabStop = 0 'False + Top = 1920 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdJCRpt + Caption = "Calculate && Print Job Cost" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6555 + TabIndex = 27 + TabStop = 0 'False + Top = 1905 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdJCUpdate + Caption = "&Update Lot Job Code Info" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4965 + TabIndex = 26 + TabStop = 0 'False + Top = 1890 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdScaffold + Caption = "Scaffold Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 25 + TabStop = 0 'False + Top = 1920 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdPOInfo + Caption = "PO Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 23 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdLotInfo + Caption = "Lot &Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 22 + TabStop = 0 'False + Top = 1380 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdSchedule + Caption = "&Schedule Repair" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6585 + TabIndex = 21 + TabStop = 0 'False + Top = 1380 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdRepairList + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 20 + TabStop = 0 'False + Top = 1380 + Width = 1515 + End + Begin Crystal.CrystalReport crMain + Left = 195 + Top = 8055 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdYardOrder + Caption = "&Yard Order Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 19 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdPOList + Caption = "Process Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 18 + TabStop = 0 'False + Top = 1380 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdDates + Caption = "Order &Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 17 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 16 + TabStop = 0 'False + Top = 840 + Width = 1515 + End + Begin VB.CommandButton cmdPayroll + Caption = "&Payroll Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 15 + TabStop = 0 'False + Top = 240 + Width = 1515 + End + Begin VB.CommandButton cmdNewSearch + Caption = "&New Search" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 14 + TabStop = 0 'False + Top = 240 + Width = 1515 + End + Begin VB.CommandButton cmdPlans + Caption = "&Plans" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1740 + TabIndex = 13 + TabStop = 0 'False + Top = 240 + Width = 1515 + End + Begin VB.TextBox txtSCode + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 780 + TabIndex = 0 + Top = 1200 + Width = 2475 + End + Begin VB.TextBox txtSName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 780 + TabIndex = 2 + Top = 1980 + Width = 2475 + End + Begin VB.CommandButton cmdFCode + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 120 + Picture = "frmMain.frx":1013 + Style = 1 'Graphical + TabIndex = 1 + Top = 1140 + Width = 555 + End + Begin VB.CommandButton cmdFName + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 120 + Picture = "frmMain.frx":1455 + Style = 1 'Graphical + TabIndex = 3 + Top = 1920 + Width = 555 + End + Begin VB.CommandButton cmdTakeR + Caption = "&Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3375 + TabIndex = 7 + TabStop = 0 'False + Top = 240 + Width = 1515 + End + Begin VB.CommandButton cmdOrderR + Caption = "&Orders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 10 + Top = 240 + Width = 1515 + End + Begin VB.CommandButton cmdLotSearch + Caption = "&Lot Search" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 105 + TabIndex = 4 + TabStop = 0 'False + Top = 225 + Width = 1515 + End + Begin VB.ListBox lstProject + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 3570 + Left = 705 + Sorted = -1 'True + TabIndex = 9 + TabStop = 0 'False + Top = 3990 + Visible = 0 'False + Width = 2640 + End + Begin VB.ListBox lstLots + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 3570 + Left = 3405 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 3990 + Visible = 0 'False + Width = 6000 + End + Begin VB.Label lblCALC + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Calculating - Be Patient" + BeginProperty Font + Name = "Arial Black" + Size = 24 + Charset = 0 + Weight = 900 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 630 + Left = 1140 + TabIndex = 45 + Top = 7185 + Visible = 0 'False + Width = 6885 + End + Begin VB.Label lblContain + Caption = "Search Address Info" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 43 + Top = 2385 + Width = 2805 + End + Begin VB.Label lblDesc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 705 + TabIndex = 38 + Top = 3630 + Visible = 0 'False + Width = 7320 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 705 + TabIndex = 24 + Top = 3330 + Visible = 0 'False + Width = 7320 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Code:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 12 + Top = 840 + Width = 1905 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Name:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 11 + Top = 1620 + Width = 1965 + End + Begin VB.Menu mnuFile + Caption = "&File" + Begin VB.Menu mnuExit + Caption = "E&xit" + End + End + Begin VB.Menu mnuPrograms + Caption = "&Programs" + Begin VB.Menu mnuOrders + Caption = "&Orders" + Enabled = 0 'False + Begin VB.Menu mnuOrderR + Caption = "Orders Regular" + Checked = -1 'True + End + Begin VB.Menu mnuOrder5 + Caption = "Orders PreMix/Typar" + End + Begin VB.Menu mnuOrderE + Caption = "Orders Synthetic" + End + End + Begin VB.Menu mnuPlans + Caption = "&Plans" + Enabled = 0 'False + End + Begin VB.Menu mnuTake + Caption = "&Takeoff" + Enabled = 0 'False + Begin VB.Menu mnuTakeR + Caption = "TakeOff Regular" + Checked = -1 'True + End + Begin VB.Menu mnuTake5 + Caption = "TakeOff PreMix/Typar" + End + Begin VB.Menu mnuTakeE + Caption = "TakeOff Synthetic" + End + End + Begin VB.Menu mnuPayroll + Caption = "&Payroll Informaton" + Enabled = 0 'False + End + Begin VB.Menu mnuPOList + Caption = "Purchase Order &List" + End + Begin VB.Menu mnuMARUpdate + Caption = "Update Metro Stucco AR Master File" + End + Begin VB.Menu mnuARUPDATE + Caption = "Update AR Master File" + End + Begin VB.Menu mnuFIXAR + Caption = "Fix AR Invoice JC Information" + End + Begin VB.Menu mnuAPUPDATE + Caption = "Update AP Master File" + End + Begin VB.Menu mnuFIXAP + Caption = "Fix AP Invoice JC Information" + End + Begin VB.Menu mnuUpCheck + Caption = "&Update Check Information" + Visible = 0 'False + End + Begin VB.Menu mnuEstInv + Caption = "Estimator Inventory" + End + Begin VB.Menu mnuMARTransfer + Caption = "Setup Metro AR Transfer" + Enabled = 0 'False + End + Begin VB.Menu mnuTransfer + Caption = "Setup AR &Transfer" + Enabled = 0 'False + End + Begin VB.Menu mnuMJCTrans + Caption = "Metro JC Transfer Complete" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuJCTrans + Caption = "&JC Transfer Complete" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuCMSAP + Caption = "Import CMS AP Info" + Enabled = 0 'False + End + Begin VB.Menu mnuCMSAR + Caption = "Import CMS AR Info" + Enabled = 0 'False + End + Begin VB.Menu mnuAck + Caption = "Orders Shipped &Acknowlegement" + End + Begin VB.Menu mnuFoamOrder + Caption = "Foam Order Information" + End + Begin VB.Menu mnuPosPay + Caption = "Set&Up PosPay File" + Begin VB.Menu mnuABTPosPay + Caption = "AZ Bank and Trust" + End + Begin VB.Menu mnuWFPosPay + Caption = "Wells Fargo Account" + End + Begin VB.Menu mnuJPPosPay + Caption = "JP Morgan" + End + End + Begin VB.Menu mnuUInv + Caption = "Update Inventory Delivery Flag" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuSetupSWMAR + Caption = "Setup SW Metro AR Transfer" + End + Begin VB.Menu mnuSWTRANSFER + Caption = "Setup SW AR Transfer" + End + Begin VB.Menu mnuMAPTransfer + Caption = "Setup Metro AP Transfer" + End + Begin VB.Menu mnuAPTransfer + Caption = "Setup AP Transfer" + End + Begin VB.Menu mnuFindPO + Caption = "&Find PO ID Number" + End + End + Begin VB.Menu mnuUtilities + Caption = "&Utilities" + Begin VB.Menu mnuLabor + Caption = "&Labor Rates" + Enabled = 0 'False + End + Begin VB.Menu mnuSupplier + Caption = "&Suppliers" + Enabled = 0 'False + End + Begin VB.Menu mnuBP + Caption = "&Black Paper" + Enabled = 0 'False + End + Begin VB.Menu mnuTexture + Caption = "&Texture" + Enabled = 0 'False + End + Begin VB.Menu mnuContractor + Caption = "Cont&ractors" + Enabled = 0 'False + End + Begin VB.Menu mnuCrew + Caption = "Lath/Stucco &Crews" + Enabled = 0 'False + End + Begin VB.Menu mnuRCrew + Caption = "&Repair Crews" + Enabled = 0 'False + End + Begin VB.Menu mnuSCrew + Caption = "Scaffolding Drivers" + End + Begin VB.Menu mnuProject + Caption = "&Projects" + Enabled = 0 'False + End + Begin VB.Menu mnuScaffold + Caption = "Scaffold Setup" + Visible = 0 'False + End + Begin VB.Menu mnuInvList + Caption = "&Inventory List" + Enabled = 0 'False + End + Begin VB.Menu mnuInvPrice + Caption = "Inventory &Price" + Enabled = 0 'False + End + Begin VB.Menu mnuYInvList + Caption = "&Yard Inventory List" + Enabled = 0 'False + End + Begin VB.Menu mnuSand + Caption = "Sand &Zone" + Enabled = 0 'False + End + Begin VB.Menu mnuUser + Caption = "&Users" + Enabled = 0 'False + End + End + Begin VB.Menu mnuReports + Caption = "&Reports" + Begin VB.Menu mnuInvCount + Caption = "Inventory Count" + End + Begin VB.Menu mnuYardRange + Caption = "Yard Orders - Date Range" + End + Begin VB.Menu mnuYard1Date + Caption = "Yard Orders - 1 Date" + End + Begin VB.Menu mnuOrdersDate + Caption = "Texture Orders - Date Range" + Visible = 0 'False + End + Begin VB.Menu mnuLathList + Caption = "Lath Orders - Date Range" + Visible = 0 'False + End + Begin VB.Menu mnuPlanUse + Caption = "Plan Usage by Project" + End + Begin VB.Menu mnuProjPlan + Caption = "Project Plan Information" + End + Begin VB.Menu mnuBid + Caption = "&Bid Report" + End + Begin VB.Menu mnuVoid + Caption = "&Void Check List" + Visible = 0 'False + End + Begin VB.Menu mnuPOListdesc + Caption = "PO List in Descending Order" + End + Begin VB.Menu mnuMAPEdit + Caption = "Metro AP Edit List" + End + Begin VB.Menu mnuAPEdit + Caption = "AP &Edit List" + End + Begin VB.Menu mnuMAREdit + Caption = "Metro AR Edit List" + End + Begin VB.Menu mnuAREditMenu + Caption = "AR Edit List" + Begin VB.Menu mnuAREdit + Caption = "AR Edit for SW" + End + Begin VB.Menu mnuAREdit2 + Caption = "AR Edit List For Lots" + End + End + Begin VB.Menu mnuProjJC + Caption = "Project JC Summary" + Visible = 0 'False + End + Begin VB.Menu mnuRepList + Caption = "Report List" + End + End + Begin VB.Menu mnuMainHelp + Caption = "&Help" + Begin VB.Menu mnuHelp + Caption = "&Help" + End + Begin VB.Menu mnuLine + Caption = "-" + End + Begin VB.Menu mnuAbout + Caption = "&About" + End + End + Begin VB.Menu mnuTOI + Caption = "Tie Options" + Visible = 0 'False + End +End +Attribute VB_Name = "frmMain" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSProj As Recordset, moRS As Recordset, moRSAPHist As Recordset +Dim mstrBegDate As String, mstrEndDate As String +Dim mboolSHOW As Boolean +Dim mboolPRINT As Boolean + +Private Sub cmdBilling_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmBilling.Show 1 +End Sub + +Private Sub ImportCMSAP() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCount As Integer +Dim strVend As String, strINVOICE As String, strTYPE As String, strINVDATE As String, strJCCODE As String, dblAMT As String +Dim strVNAME As String, strSQLV As String, oRSAPV As Recordset +'Dim strSKU As String, strDESC As String, lngONHAND As Long, lngCount As Long +'Dim dblCost1 As Double, dblCost2 As Double, sglNum1 As Single +'Dim sglNum2 As Single, lngNum3 As Long +'Dim lngLOC As Long, strHOLD As String +'Dim strSEC As String, strMIN As String, strDAY As String, strMONTH As String + + On Error GoTo Error_EH +' mstrDEVICE = "" +' strSEC = Second(Time) +' strMIN = Minute(Time) +' strDAY = Format(Day(Date), "00") +' strMONTH = Format(Month(Date), "00") + cdMain.InitDir = "G:\Access\Export\" + cdMain.Action = 1 + strFile = cdMain.FileName + intCount = 0 + + strSQLV = "SELECT * FROM tblJCVENDOR" + Set oRSAPV = New Recordset + oRSAPV.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + +' mstrDEVICE = InputBox("Enter The Device Number (SYM#) To Import", "Import Prompts") +' mstrDEVICE = UCase(mstrDEVICE) + strSQL = "Select * FROM APH_JobDistDetail" + Set moRSAPHist = New Recordset + moRSAPHist.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + strF = Split(strLine, vbTab) + If intCount = 0 Then + strVend = Mid(Field2Str(strF(0)), 4, 15) + intCount = 99 + Else + strVend = Field2Str(strF(0)) + End If + strINVOICE = Field2Str(strF(1)) + strTYPE = Field2Str(strF(2)) + strINVDATE = Field2Str(strF(3)) + strJCCODE = Field2Str(strF(4)) + strJOBNUM = Left(strJCCODE, 7) + dblAMT = Field2Str2(strF(5)) + strSQLV = "SELECT * FROM tblJCVENDOR WHERE ARCode = '" & strVend & "'" + Set oRSAPV = New Recordset + oRSAPV.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + If Not oRSAPV.EOF Then + strSQL = "SELECT * FROM APH_JobDistDetail WHERE InvoiceNumber = '" & strINVOICE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +'*Need to get a list of vendors that are JC Vendors to compare against this file +' If Left(strJOBNUM, 2) = "A0" Or Left(strJOBNUM, 2) = "B0" Then + If oRS.EOF Then + With moRSAPHist + .AddNew + !Division = "00" + !VendorNumber = Left(Field2Str(strVend), 30) + !InvoiceNumber = Field2Str2(strINVOICE) + gstrMODULE = strJOBNUM & " Inv# " & strINVOICE + !JobNumber = Field2Str(strJOBNUM) + !CostCode = "201200000" + !CostType = "0" + !distributionamount = dblAMT + !RetentionAmount = 0 + !Balance = 0 + !AmountAppliedToday = 0 + !InvoiceDate = strINVDATE + !InvType = Field2Str(strTYPE) + .Update + End With + End If + End If +' moRSAPHist.MoveNext + Loop + moRSAPHist.Close + Close #1 + MsgBox ("Import of CMS AP Data is Complete"), vbInformation + vbOKOnly, "Import Complete" +' intYN = MsgBox("Do You Want To Rename The Import File?", vbYesNo, "Rename File") +' If intYN = vbYes Then +' strOLD = "PPCINV.TXT" +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, lngLOC - 8, lngLOC - 1) +' strOLD = strHOLD +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, 1, lngLOC - 1) +' strOLD = strHOLD +' strOLD = strFILE +' strNEW = "PPCINV" & Trim$(strMIN) & Trim$(strSEC) & ".TXT" +' strNEW = Trim$(strMONTH) & Trim$(strDAY) & Trim$(strSEC) & Trim$(strHOLD) & ".TXT" +' strNEW = Trim$(strMIN) & Trim$(strSEC) & Trim$(strMONTH) & Trim$(strDAY) & Trim$(strHOLD) ' & ".TXT" +' Name strFILE As strNEW +' End If + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSAP " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub ImportCMSAR() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCount As Integer +Dim strINVOICE As String, strINVDATE As String, strCustomer As String, strJCCODE As String +Dim strTAXSALESAMT As String, strNONTAXSALESAMT As String, strSALESTAXAMT As String +Dim bytINVTYPE As Byte, strSEQUENCENum As String, strCUSTNAME As String, lngUNIQUEID As Long +'Dim sglNum2 As Single, lngNum3 As Long +'Dim lngLOC As Long, strHOLD As String +'Dim strSEC As String, strMIN As String, strDAY As String, strMONTH As String + + On Error GoTo Error_EH +' mstrDEVICE = "" +' strSEC = Second(Time) +' strMIN = Minute(Time) +' strDAY = Format(Day(Date), "00") +' strMONTH = Format(Month(Date), "00") + cdMain.InitDir = "G:\Access\Export\" + cdMain.Action = 1 + strFile = cdMain.FileName + intCount = 0 + +' mstrDEVICE = InputBox("Enter The Device Number (SYM#) To Import", "Import Prompts") +' mstrDEVICE = UCase(mstrDEVICE) + strSQL = "Select * FROM ARN_InvHistoryHeader" + Set moRSAPHist = New Recordset + moRSAPHist.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + strF = Split(strLine, vbTab) + If intCount = 0 Then + lngUNIQUEID = Mid(Field2Str(strF(0)), 4, 1) + intCount = 99 + Else + lngUNIQUEID = Field2Str2(strF(0)) + End If +' lngUNIQUEID = Field2Str2(strF(0)) + bytINVTYPE = Field2Str2(strF(1)) + strCustomer = Field2Str(strF(2)) + strCUSTNAME = Field2Str(strF(3)) + strINVOICE = Field2Str(strF(4)) + strINVDATE = Left(Field2Str(strF(5)), 10) + strJCCODE = Field2Str(strF(6)) + strNONTAXSALESAMT = Field2Str2(strF(7)) + strTAXSALESAMT = Field2Str2(strF(7)) + + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE InvoiceNumber = '" & strINVOICE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +' If Left(strJOBNUM, 2) = "A0" Or Left(strJOBNUM, 2) = "B0" Then + If oRS.EOF Then + With moRSAPHist + .AddNew +' !I = "00" + !InvoiceNumber = Left(Field2Str2(strINVOICE), 20) + !InvoiceDate = strINVDATE + !CustomerNumber = Left(Field2Str(strCustomer), 20) + gstrMODULE = "Job " & strJCCODE & " Inv# " & strINVOICE + !JobNumber = Field2Str(strJCCODE) + !TaxableSalesAmount = Field2Str2(strTAXSALESAMT) + !NonTaxableSalesAmount = Field2Str2(strNONTAXSALESAMT) + !InvoiceType = bytINVTYPE + !CustName = Field2Str(strCUSTNAME) + !intunique = lngUNIQUEID +' !AmountAppliedToday = 0 +' !InvType = Field2Str(strTYPE) + .Update + End With + End If +' End If +' moRSAPHist.MoveNext + Loop + moRSAPHist.Close + Close #1 + MsgBox ("Import of CMS AR Data is Complete"), vbInformation + vbOKOnly, "Import Complete" +' intYN = MsgBox("Do You Want To Rename The Import File?", vbYesNo, "Rename File") +' If intYN = vbYes Then +' strOLD = "PPCINV.TXT" +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, lngLOC - 8, lngLOC - 1) +' strOLD = strHOLD +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, 1, lngLOC - 1) +' strOLD = strHOLD +' strOLD = strFILE +' strNEW = "PPCINV" & Trim$(strMIN) & Trim$(strSEC) & ".TXT" +' strNEW = Trim$(strMONTH) & Trim$(strDAY) & Trim$(strSEC) & Trim$(strHOLD) & ".TXT" +' strNEW = Trim$(strMIN) & Trim$(strSEC) & Trim$(strMONTH) & Trim$(strDAY) & Trim$(strHOLD) ' & ".TXT" +' Name strFILE As strNEW +' End If + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSAR " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub FixAPH() +Dim oRS As Recordset, strSQL As String, strJCCODE As String, strVENDOR As String, strINVOICE As String +Dim oRSS As Recordset, strSQLL As String, strJCCode2 As String, strV2 As String, strI2 As String + + strSQL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail WHERE JobNumber = ' '" +' strSQL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail ORDER By VendorNumber, InvoiceNumber, JobNumber" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strJCCODE = Trim(Field2Str(oRS!JobNumber)) + If strJCCODE = "" Then + strVENDOR = Field2Str(oRS!VendorNumber) + strINVOICE = Field2Str(oRS!InvoiceNumber) + strSQLL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail WHERE VendorNumber = '" + strSQLL = strSQLL & strVENDOR & "' AND InvoiceNumber = '" & strINVOICE & "' AND JobNumber <> ''" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + strJCCode2 = Field2Str(oRSS!JobNumber) + strV2 = Field2Str(oRSS!VendorNumber) + strI2 = Field2Str(oRSS!InvoiceNumber) + oRS!JobNumber = strJCCode2 + oRS.Update + oRSS.Close + End If + oRS.MoveNext + End If + Loop + End If + oRS.Close + + MsgBox "AP_JobDistDetail JCCode has been updated.", vbOKOnly, "Complete" + +End Sub + +Private Sub FixARH() +Dim oRS As Recordset, strSQL As String, strJCCODE As String, strCustomer As String, strINVOICE As String +Dim oRSS As Recordset, strSQLL As String, strJCCode2 As String, strV2 As String, strI2 As String, intCount As Long + + + strSQL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM ARN_InvHistoryHeader WHERE JobNumber = ' '" +' strSQL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail ORDER By CustomerNumber, InvoiceNumber, JobNumber" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strJCCODE = Trim(Field2Str(oRS!JobNumber)) + If strJCCODE = "" Then + strCustomer = Field2Str(oRS!CustomerNumber) + strINVOICE = Field2Str(oRS!InvoiceNumber) + strSQLL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM ARN_InvHistoryHeader WHERE CustomerNumber = '" + strSQLL = strSQLL & strCustomer & "' AND InvoiceNumber = '" & strINVOICE & "' AND JobNumber <> ''" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + intCount = oRSS.RecordCount + strJCCode2 = Field2Str(oRSS!JobNumber) + strV2 = Field2Str(oRSS!CustomerNumber) + strI2 = Field2Str(oRSS!InvoiceNumber) + oRS!JobNumber = strJCCode2 + oRS.Update + oRSS.Close + End If + oRS.MoveNext + End If + Loop + End If + oRS.Close + + MsgBox "ARN_InvHistoryHeader JCCode has been updated.", vbOKOnly, "Complete" + +End Sub + +Private Sub cmdChecks_Click() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String, strMSG As String +Dim strINPUT As String, strFile As String +Dim intCount As Integer, dblAMT As Double, intResponse As Integer +Dim intYear As Integer, intMonth As Integer, intDay As Integer + + On Error GoTo CancelOpen + strSQL = "DELETE * FROM tblCheckRec" + goConn.Execute strSQL + + cdMain.Filter = "Text Files|*.txt" + cdMain.Action = 1 + strFile = cdMain.FileName + + strSQL = "SELECT * FROM tblCheckRec" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Open strFile For Input As #1 + Do While Not EOF(1) + strINPUT = Input(152, #1) + oRS.AddNew + oRS!check_no = Mid(strINPUT, 36, 6) + oRS!ck_name = Mid(strINPUT, 80, 15) + dblAMT = Mid(strINPUT, 43, 18) + oRS!ck_amt = dblAMT / 100 + intYear = Mid(strINPUT, 62, 4) + intMonth = Mid(strINPUT, 66, 2) + intDay = Mid(strINPUT, 68, 2) + oRS!ck_date = DateSerial(intYear, intMonth, intDay) + oRS.Update + Loop + Close #1 + + strSQL = "SELECT * FROM tblCheckRec" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + Do Until oRS.EOF + strSql2 = "SELECT * FROM BR1_Transaction WHERE BankCode = '4' and TransactionType = 'C' and CheckNumber = '" & oRS!check_no & "' and SeqNo = '000'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + With oRS + !m90_amt = Field2Str2(oRSS!amount) + !m90_name = Left(Field2Str(oRSS!CheckPayeeName), 15) + If !ck_amt <> !m90_amt Then + !bad = vbChecked + End If + .Update + End With + Else + With oRS + !m90_amt = 0 + !m90_name = "No MAS 90 Check Found" + !bad = vbChecked + .Update + End With + End If +' End With +' End If + oRS.MoveNext + Loop + strSQL = "SELECT * FROM tblCheckRec WHERE Bad" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + intCount = oRS.RecordCount + + strMSG = "Bank Reconcilliation Files have been Compared" & vbLf & vbCr + strMSG = strMSG & intCount & " Checks did not match - Do You Want A Report" + intResponse = MsgBox(strMSG, vbYesNo, "Done") + If intResponse = vbYes Then + gintCOPY = 1 + crMain.ReportFileName = App.Path & "\CheckRecErrors.rpt" +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + Else + Exit Sub + End If + +CancelOpen: + Exit Sub +End Sub + +Private Sub cmdDates_Click() + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Else + gintLOTID = 0 + End If + frmOrderDates.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFContain_Click() + If Len(txtSContain) > 0 Then + txtSContain.Enabled = False + txtSName.Enabled = False + Call ContainLoad + Else + MsgBox "Information To Find Must Be Entered", , "No Information" + txtSContain.SetFocus + End If +' cmdOrderR.Enabled = False +' mnuOrders.Enabled = False + If mboolSHOW Then + cmdLotSearch.Enabled = True + cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "JDV" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstContains.SetFocus + Else + cmdNewSearch.Enabled = True +' txtSContain.Enabled = False +' txtSContain.SetFocus + End If + +End Sub + +Private Sub cmdFindOrder_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + gstrPONUM = UCase(InputBox("Enter The VWP PO Number You Want", "PO Number")) + If gstrPONUM = "" Then +' MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + strSQL = "SELECT PO_Num, Lot_ID FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then +' gintLOTID = Field2Integer(oRS!Lot_id) + gintLOTID = Field2Long(oRS!Lot_id) + strSql2 = "SELECT lot_id, proj_id FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + gintPROJID = Field2Integer(oRSS!Proj_ID) + End If + Else + MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' gintORDER = 8 + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdFindSPO_Click() +' gintPONUM = Field2Integer(lblD_SPO) + On Error GoTo EH_ERROR + gintPONUM = UCase(InputBox("Enter The Special PO Number You Want", "PO Number")) + frmPOInfo.Show 1 + Exit Sub +EH_ERROR: + MsgBox "Invalid Response", vbOKOnly, "Invalid" + Exit Sub +End Sub + +Private Sub cmdFixBill_Click() +Dim oRSPlan As Recordset, oRSPlanBIll As Recordset, oRSOPT As Recordset, oRSOptBill As Recordset, oRSProjDate As Recordset +Dim strSQL As String, strSQL1 As String, strSql2 As String, strSQL3 As String, strSQL4 As String +Dim lngESTID As Long, lngPROJID As Long, strCONVERT As String, lngUsedProj As Long + + Call FixBilling +' Call FixOpenPR +' Call FixOpenPR2 + +'' strCONVERT = "07/01/2004" + +'' strSQL = "SELECT * FROM tblLotInfo WHERE STARTDATE is null" ' ORDER BY Proj_ID" +'' Set oRSPlan = New Recordset +'' oRSPlan.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' strSQL1 = "SELECT * FROM tblPlanBill" +' Set oRSPlanBIll = New Recordset +' oRSPlanBIll.Open strSQL1, goConn, adOpenKeyset, adLockOptimistic + +' strSql2 = "SELECT * FROM tblPOption" ' WHERE Est_id = " & lngESTID +' Set oRSOPT = New Recordset +' oRSOPT.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + +' strSQL3 = "SELECT * FROM tblPoptbill" +' Set oRSOptBill = New Recordset +' oRSOptBill.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + +' strSQL4 = "SELECT * FROM tblprojdate" +' Set oRSProjDate = New Recordset +' oRSProjDate.Open strSQL4, goConn, adOpenKeyset, adLockOptimistic + +'' Do Until oRSPlan.EOF +' On Error GoTo EH_ERROR_PLANS +'' strCONVERT = "01/01/2005" +'' oRSPlan!startdate = strCONVERT +'' oRSPlan.Update +'' oRSPlan.MoveNext +'' Loop +' lngProjID = Field2Long(oRSPlan!proj_id) +' lngESTID = Field2Long(oRSPlan!est_id) +' With oRSPlanBIll +' .AddNew +' !proj_id = Field2Long(oRSPlan!proj_id) +' !est_id = Field2Long(oRSPlan!est_id) +' !mod_elv = Field2Str(oRSPlan!mod_elv) +' !l_bill = Field2Str2(oRSPlan!l_bill) +' !s_bill = Field2Str2(oRSPlan!s_bill) +' !Create = oRSPlan!Create +' !LSave = oRSPlan!LSave +' !LSUser = Field2Str(oRSPlan!LSUser) +' !createuser = (oRSPlan!createuser) +' !CreateUser = Field2Str(oRSPlan!CreateUser) +' !notes = Field2Str(oRSPlan!notes) +' !BUpdate = oRSPlan!BUpdate +' !BUUser = oRSPlan!BUUser +' !BUUSer = Field2Str(oRSPlan!BUUSer) +' !l_code = Field2Str(oRSPlan!l_code) +' !s_code = Field2Str(oRSPlan!s_code) +' !st_bill = Field2Str2(oRSPlan!st_bill) +' !st_code = Field2Str(oRSPlan!st_code) +' !Update = oRSPlan!Update +' !LUUser = (oRSPlan!LUUser) +'' !LUUser = Field2Str(oRSPlan!LUUser) +' If IsNull(oRSPlan!effdate) Then +' !effdate = strCONVERT +' Else +' !effdate = oRSPlan!effdate +' strCONVERT = oRSPlan!effdate +' End If +' .Update +' End With +'' On Error GoTo EH_ERROR_PROJDATE +' If lngUsedProj <> lngProjID Then +' oRSProjDate.AddNew +' oRSProjDate!proj_id = lngProjID +' oRSProjDate!startdate = strCONVERT +' lngUsedProj = Field2Long(oRSPlan!proj_id) +' oRSProjDate.Update +' End If +'' oRSPlan.MoveNext +'' Loop +' On Error GoTo EH_ERROR_OPT +' strSql2 = "SELECT * FROM tblPOption WHERE Est_id = " & lngESTID +' Set oRSOPT = New Recordset +' oRSOPT.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' +' Do Until oRSOPT.EOF +' With oRSOptBill +' .AddNew +' !est_id = Field2Long(oRSOPT!est_id) +' !OPTID = Field2Long(oRSOPT!OPTID) +' !opt_no = Field2Str2(oRSOPT!opt_no) +' !Desc = Field2Str(oRSOPT!Desc) +' !b_code = (oRSOPT!b_code) +'' !created = Field2Str2(oRSOPT!created) +' !Updated = (oRSOPT!Updated) +' !C_USER = (oRSOPT!C_USER) +' !U_USER = (oRSOPT!U_USER) +' !amt = Field2Str2(oRSOPT!amt) +' If IsNull(oRSOPT!effdate) Then +' !effdate = strCONVERT +'' Else +' !effdate = Field2Str2(oRSOPT!effdate) +' End If +'' .Update +' oRSOPT.MoveNext +' End With +' Loop +' +'' On Error GoTo EH_ERROR_PROJDATE +' oRSProjDate.AddNew +' oRSProjDate!proj_id = lngProjID +' oRSProjDate!startdate = strCONVERT +' oRSProjDate.Update +' oRSPlan.MoveNext +' Loop +' MsgBox "Plan Opening Percentage Update COmpleted" +Exit Sub +'EH_ERROR_PLANS: +' oRSPlanBIll.Cancel +' Resume Next + +'EH_ERROR_OPT: +' oRSOptBill.Cancel +' Resume Next + +'EH_ERROR_PROJDATE: +' oRSProjDate.Cancel +' Resume Next +End Sub + +Private Sub cmdHourly_Click() + frmHourList.Show 1 +End Sub + +Private Sub cmdInvoice_Click() + frmAR.Show 1 +End Sub + +Private Sub cmdJCList_Click() + frmJCList.Show +End Sub + +Private Sub cmdJCRpt_Click() + + mboolPRINT = False + Screen.MousePointer = vbHourglass + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Call CalcJobCost + If mboolPRINT Then + Call cmdPrintJCRpt_Click + End If + Call ToggleButtons1 + Screen.MousePointer = vbDefault + lstLots.SetFocus +End Sub + +Private Sub ToggleButtons1() + cmdJCUpdate.Enabled = Not cmdJCUpdate.Enabled + cmdExit.Enabled = Not cmdExit.Enabled + cmdDates.Enabled = Not cmdDates.Enabled + cmdLotInfo.Enabled = Not cmdLotInfo.Enabled + cmdLotSearch.Enabled = Not cmdLotSearch.Enabled + cmdNewSearch.Enabled = Not cmdNewSearch.Enabled + cmdOrderR.Enabled = Not cmdOrderR.Enabled + cmdPayroll.Enabled = Not cmdPayroll.Enabled + cmdPrintJCRpt.Enabled = Not cmdPrintJCRpt.Enabled + cmdJCRpt.Enabled = Not cmdJCRpt.Enabled + cmdPOInfo.Enabled = Not cmdPOInfo.Enabled + cmdPOList.Enabled = Not cmdPOList.Enabled + cmdRepairList.Enabled = Not cmdRepairList.Enabled + cmdScaffold.Enabled = Not cmdScaffold.Enabled + cmdSchedule.Enabled = Not cmdSchedule.Enabled + cmdYardOrder.Enabled = Not cmdYardOrder.Enabled + cmdScafList.Enabled = Not cmdScafList.Enabled + cmdBilling.Enabled = Not cmdBilling.Enabled +End Sub + +Private Sub CalcJobCost2() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String + + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(oRS!jobcost) Or oRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strJOBCOST = Field2Str(oRS!jobcost) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblORDERS WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" + End If + + oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!crew_boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + If !workdone = "C" Then + oRSD!desc3 = "COMPLETE" + ElseIf !workdone = "P" Then + oRSD!desc3 = "PARTIAL" + ElseIf !workdone = "T" Then + oRSD!desc3 = "TEXTURE" + ElseIf !workdone = "S" Then + oRSD!desc3 = "SCRATCH" + ElseIf !workdone = "B" Then + oRSD!desc3 = "BROWN" + ElseIf !workdone = "U" Then + oRSD!desc3 = "CMU" + ElseIf !workdone = "F" Then + oRSD!desc3 = "FENCE" + ElseIf !workdone = "W" Then + oRSD!desc3 = "WORKORDER/REPAIR" + End If + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_id = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form Main - Module CalcJobCost2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcJobCost() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String +Dim strCont As String, strProj As String, strPROJCODE As String, strLOTNO As String +Dim strMODEL As String, strADD As String, strOWNER As String +Dim intYDS As Integer, intMETAL As Integer + + + On Error GoTo Error_EH + +' Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(oRS!jobcost) Or oRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strCALC = "SELECT * FROM tblproject WHERE proj_id = " & Field2Long(oRS!Proj_ID) + Set oRSC = New Recordset + oRSC.Open strCALC, goConn, adOpenForwardOnly, adLockReadOnly + strJOBCOST = Field2Str(oRS!jobcost) + strMODEL = Field2Str(oRS!model) + strADD = Field2Str(oRS!address) + strOWNER = Field2Str(oRS!Owner) + strLOTNO = Field2Str(oRS!lot_no) + strCont = Field2Str(oRSC!proj_cont) + strProj = Field2Str(oRSC!Proj_Desc) + strPROJCODE = Field2Str(oRSC!Proj_Code) + intYDS = Field2Integer(oRS!sq_yd) + intMETAL = Field2Integer(oRS!METAL) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblORDERS WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" + End If + + oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!crew_boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + If !workdone = "C" Then + oRSD!desc3 = "COMPLETE" + ElseIf !workdone = "P" Then + oRSD!desc3 = "PARTIAL" + ElseIf !workdone = "T" Then + oRSD!desc3 = "TEXTURE" + ElseIf !workdone = "S" Then + oRSD!desc3 = "SCRATCH" + ElseIf !workdone = "B" Then + oRSD!desc3 = "BROWN" + ElseIf !workdone = "U" Then + oRSD!desc3 = "CMU" + ElseIf !workdone = "F" Then + oRSD!desc3 = "FENCE" + ElseIf !workdone = "W" Then + oRSD!desc3 = "WORKORDER/REPAIR" + End If + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + + If oRS.State = adStateOpen Then + oRS.Close + Set oRS = Nothing + End If + If oRSF.State = adStateOpen Then + oRSF.Close + Set oRSF = Nothing + End If + If oRSD.State = adStateOpen Then + oRSD.Close + Set oRSD = Nothing + End If + If oRSC.State = adStateOpen Then + oRSC.Close + Set oRSC = Nothing + End If + + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_id = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form Main - Module CalcJobCost" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdJCUpdate_Click() +Dim strSQL As String, strJC As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Else + MsgBox "You Must Select A Lot Before Pressing This Button", vbOKOnly, "Select Lot" + gintLOTID = 0 + Exit Sub + End If + + strSQL = "SELECT lot_id, jobcost, lot_no FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + With oRS + If Not IsNull(!jobcost) Then + strJC = InputBox("Enter the JC Code for the HiLited Lot", "Update JC Code", Field2Str(!jobcost)) + Else + !jobcost = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(!lot_no), 3), "000") + strJC = InputBox("Enter the JC Code for the HiLited Lot", "Update JC Code", Field2Str(!jobcost)) + End If + !jobcost = UCase$(Field2Str(strJC)) + .Update + End With + + End If + lstLots.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module cmdPrintPOInfo_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLotInfo_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmLotList.Show 1 +End Sub + +Private Sub cmdOrderR_Click() + +' Call ListChanges + + If cmdOrderR.Caption = "Orders" Then + If gboolBAG = True Or gboolSYN = True Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrder_Click + End If + End If + + If cmdOrderR.Caption = "Orders PreMix" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrder5_Click + End If + End If + + If cmdOrderR.Caption = "Orders Synthetic" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrderE_Click + End If + End If +End Sub + +Private Sub cmdPayroll_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmPayroll.Show 1 +End Sub + +Private Sub cmdPOInfo_Click() +Dim strSQL As String + + On Error GoTo Error_EH + + gintPRINT = 1 + + strSQL = "{tblOrders.Lot_id} = " & lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POInfo.rpt" + crMain.SelectionFormula = strSQL + crMain.Destination = crptToWindow +' crmain.Destination = crptToPrinter + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module cmdPrintPOInfo_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPOList_Click() + frmPayList.Show ' 1 + +End Sub + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then + Do Until oRS.EOF + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + Loop +' End If + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub cmdPrintJCRpt_Click() +Dim strSQL As String + + On Error GoTo Error_EH + + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintCOPY = 1 + crMain.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID +' strSQL = gintLOTID + crMain.ReportFileName = App.Path & "\jobcost.rpt" +' crMain.SelectionFormula = strSQL + crMain.GroupSelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY +' crmain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + + crMain.Reset +' crMain.ReportFileName = App.Path & "\lath.rpt" + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crMain.ReportFileName = App.Path & "\jobcost2.rpt" + crMain.SelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY +' crmain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintJCRpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdProjNotes_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmProjNotes.Show 1 +End Sub + +Private Sub cmdReNum_Click() + Dim oRS As Recordset, strSQL As String, strUPDATE As String + + strSQL = "SELECT * FROM tblLotMatrl" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + + strUPDATE = "UPDATE tblYardOrder set SPLIT=0 " + goConn.Execute strUPDATE + +End Sub + +Private Sub cmdRepairList_Click() + frmRepair.Show 1 +End Sub + +Private Sub cmdScaffold_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmScaffold.Show 1 +End Sub + +Private Sub cmdScafList_Click() + frmScafList.Show 1 +End Sub + +Private Sub cmdSchedule_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmRepairLot.Show 1 +End Sub + +Private Sub cmdShip_Click() + frmBillingStatus.Show 1 +End Sub + +Private Sub cmdTakeR_Click() + + If cmdTakeR.Caption = "Takeoff" Then +' If cmdTakeR.Caption = "&Takeoff" And gboolBAG = True Then + If gboolBAG = True Or gboolSYN = True Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else +' ElseIf Not gboolSYN Then + Call cmdTake_Click + End If + End If +' If cmdTakeR.Caption = "Takeoff Pre&Mix" Or cmdTakeR.Caption = "Takeoff S&ynthetic" Then + If cmdTakeR.Caption = "Takeoff PreMix" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else + Call cmdTake5_Click + End If + End If +' If cmdTakeR.Caption = "Takeoff Pre&Mix" Or cmdTakeR.Caption = "Takeoff S&ynthetic" Then +' If gboolBAG = False And gboolSYN = False Then +' MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly +' Exit Sub +' Else +' Call cmdTake5_Click +' End If +' End If + If cmdTakeR.Caption = "Takeoff Synthetic" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else + Call cmdTakeE_Click + End If + End If +End Sub + +Private Sub cmdUpRGard_Click() +Dim strSQL As String, oRS As Recordset + + strSQL = "SELECT * FROM tblTOLabor" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + oRS.MoveFirst + + Do Until oRS.EOF + If IsNull(oRS!OptNum) Then + oRS!OptNum = 1 + oRS.Update + End If + oRS.MoveNext + Loop + oRS.Close + MsgBox ("Texture Option Number is UpDated") +End Sub + +Private Sub cmdYardOrder_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmYardOrder.Show 1 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdNewSearch_Click() + gintLOTID = 0 + gintPROJID = 0 + txtSCode.Enabled = True + txtSName.Enabled = True + txtSContain.Enabled = True + txtSCode = "" + txtSName = "" +' txtSCode.Text = "" +' txtSName.Text = "" + txtSContain = "" + lstProject.Clear + lstLots.Clear + lstContains.Clear + lblProjCode.Caption = "" + lstLots.Visible = False + lblProjCode.Visible = False + lblDesc.Visible = False + cmdLotSearch.Enabled = False + cmdNewSearch.Enabled = False + cmdJCUpdate.Visible = False + cmdJCRpt.Visible = False + cmdPrintJCRpt.Visible = False + cmdTakeR.Enabled = False + mnuTake.Enabled = False + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + cmdPlans.Enabled = False + mnuPlans.Enabled = False + cmdPayroll.Enabled = False + mnuPayroll.Enabled = False + cmdFCode.Enabled = False + cmdFName.Enabled = False + cmdFContain.Enabled = False + lstContains.Visible = False + lstProject.Visible = False + cmdDates.Visible = False + cmdYardOrder.Visible = False + cmdSchedule.Visible = False + cmdLotInfo.Visible = False + cmdProjNotes.Visible = False + cmdBilling.Visible = False + txtSCode.SetFocus +End Sub + +Private Sub cmdPlans_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmPlans.Show 1 +End Sub + +Private Sub cmdOrder_Click() + On Error GoTo Error_EH + cmdDates.Visible = False + cmdYardOrder.Visible = False + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfo.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdOrder5_Click() + On Error GoTo Error_EH + cmdDates.Visible = False + cmdYardOrder.Visible = False + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfo5.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdOrderE_Click() + On Error GoTo Error_EH + cmdDates.Visible = False + cmdYardOrder.Visible = False + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfoE.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdTake_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTake + frmTake.Show 1 +End Sub + +Private Sub cmdTake5_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTake5 + frmTake5.Show 1 +End Sub + +Private Sub cmdTakeE_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTakeE + frmTakeE.Show 1 +End Sub + +Private Sub Form_Load() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 45 + + cmdNewSearch.Enabled = False + If gbytSECURITY = 6 Then + mnuContractor.Enabled = True + mnuProject.Enabled = True + cmdShip.Visible = True +' mnuJCTrans.Enabled = True + mnuSWTRANSFER.Enabled = True + mnuAPTransfer.Enabled = True + End If + If gbytSECURITY = 7 Then + mnuContractor.Enabled = True + mnuProject.Enabled = True + mnuTransfer.Enabled = True + cmdInvoice.Visible = True + cmdShip.Visible = True +' mnuJCTrans.Enabled = True + End If + If gbytSECURITY = 1 Then + mnuUser.Enabled = True + mnuRCrew.Enabled = True + mnuCrew.Enabled = True + cmdPOList.Visible = True + mnuUpCheck.Visible = True + mnuTransfer.Enabled = True + ' mnuJCTrans.Enabled = True + cmdInvoice.Visible = True + mnuVoid.Visible = True + mnuPosPay.Visible = True + +' mnuTOI.Visible = True + cmdJCList.Visible = True + If gstrLOGIN = "DWW" Then + cmdChecks.Visible = True + cmdUpRGard.Visible = False + End If + End If + If gbytSECURITY < 3 Then + mnuSand.Enabled = True + mnuLabor.Enabled = True + mnuSupplier.Enabled = True + mnuBP.Enabled = True + mnuTexture.Enabled = True + mnuContractor.Enabled = True + mnuProject.Enabled = True + mnuInvList.Enabled = True + mnuYInvList.Enabled = True + mnuInvPrice.Enabled = True + cmdShip.Visible = True + mnuOrdersDate.Visible = True + mnuLathList.Visible = True + mnuCMSAP.Visible = True + mnuCMSAP.Enabled = True + mnuCMSAR.Visible = True + mnuCMSAR.Enabled = True + mnuUInv.Enabled = True + mnuSWTRANSFER.Enabled = True + mnuAPTransfer.Enabled = True + mnuProjJC.Visible = True + End If + If gbytSECURITY = 8 Or gbytSECURITY = 10 Then + mnuCrew.Enabled = True + mnuRCrew.Enabled = True + End If + If gbytSECURITY = 9 Or gbytSECURITY = 8 Then + mnuInvList.Enabled = True + mnuYInvList.Enabled = True + mnuInvPrice.Enabled = True + End If + If gbytSECURITY = 10 Then + cmdPOList.Visible = True + mnuUpCheck.Visible = True + End If + If gstrLOGIN = "TC" Then + mnuVoid.Visible = True + mnuPosPay.Visible = True + End If + If gstrLOGIN = "GK" Then + cmdJCList.Visible = True + End If +' If gstrLOGIN = "KA" Then +' cmdScaffold.Visible = False +' cmdScafList.Visible = False +' End If +End Sub + +Private Function LotFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + LotFind = False + Else + LotFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module LotFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstLots_Click() +Dim strTEST As String + + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) +' gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + If LotFind() Then + lstLots.ToolTipText = Field2Str(moRS!jobcost) + strTEST = lstLots.ToolTipText + End If +End Sub + +Private Sub lstLots_DblClick() + Call cmdOrderR_Click +End Sub + +Private Sub lstProject_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Call FindProject + +End Sub +Private Sub FixStart() +Dim oRS As Recordset +Dim strSQL As String, strSTARTDATE As String, strNEWSTART As String + + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + + strSQL = "SELECT * FROM tblLOTINFO WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSTARTDATE = Field2Str(oRS!startdate) + + strNEWSTART = InputBox("Enter The Start Date For The Highlighted Lot (mm/dd/yyyy)", "New Start Date", strSTARTDATE) + If Not IsDate(strNEWSTART) Then + MsgBox "You Entered An Invalid Date, StartDate Will Not Be Updated", vbOKOnly, "Invalid Date" + Exit Sub + Else + oRS!startdate = Str2Field(strNEWSTART) + oRS.Update + End If +End Sub + +Private Sub FixPOCount() +Dim oRS As Recordset +Dim strSQL As String + +Dim bytPOMAX As Byte, bytNEWMAX As Integer + + strSQL = "SELECT pomax, proj_id FROM tblPROJECT WHERE proj_id = " & gintPROJID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + bytPOMAX = Field2Str2(oRS!pomax) + + bytNEWMAX = Field2Str2(InputBox("Enter the New Maximum PO Count for this Project", "Update PO MAX", bytPOMAX)) + If bytNEWMAX > 254 Then + MsgBox "You Entered an Invalid Number - 254 is the MAX allowed", vbOKOnly, "Update Max POCount" + Exit Sub + ElseIf bytNEWMAX = 0 Then + Exit Sub + Else + oRS!pomax = bytNEWMAX + oRS.Update + End If +End Sub +Private Sub FixPrinting() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + oRS!l_FLG = "P" + oRS!y_FLG = "P" + oRS!s_FLG = "P" + oRS!z_FLG = "P" + '***** May need to add the check box for B_FLG also. + oRS.Update + End If +End Sub +Private Sub FixBilling() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim lngINVOICE As Long, lngLOTINFO As Long, strTYPE As String +Dim strDATE1 As Date, strFIND As String + + strDATE1 = Date - 30 + + strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= " & strDATE1 '& "#'" +' strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= '#" & strDATE1 & "#'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + + strSQLL = "SELECT * FROM tblLotInfo" ' WHERE lot_id = " & lngLOTINFO + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRS.EOF + lngLOTINFO = oRS!Lot_id + strTYPE = Field2Str(oRS!inv_type) + oRSS.MoveFirst + strFIND = "lot_id = " & lngLOTINFO + oRSS.Find strFIND +' If Not oRSS.EOF Then +' oRSS!notes = Field2Str(oRS!notes) +' oRSS.Update +' End If +' oRS.MoveNext + + If Not oRSS.EOF Then + If strTYPE = "L" Then + If Not IsDate(oRSS!billdt_L) Then + oRSS!billdt_L = oRS!invoice_date + oRSS.Update + End If + End If + If strTYPE = "S" Or strTYPE = "C" Then + If Not IsDate(oRSS!billdt_S) Then + oRSS!billdt_S = oRS!invoice_date + oRSS.Update + End If + End If + End If + oRS.MoveNext + Loop + MsgBox "Billing Date Update is Complete", vbOKOnly, "Update Complete" +End Sub + +Private Sub FixBillingM() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim lngINVOICE As Long, lngLOTINFO As Long, strTYPE As String +Dim strDATE1 As Date, strFIND As String + + strDATE1 = Date - 30 + + strSQL = "SELECT * FROM tblARINVOICEM WHERE Header and Invoice_date >= " & strDATE1 '& "#'" +' strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= '#" & strDATE1 & "#'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + + strSQLL = "SELECT * FROM tblLotInfo" ' WHERE lot_id = " & lngLOTINFO + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRS.EOF + lngLOTINFO = oRS!Lot_id + strTYPE = Field2Str(oRS!inv_type) + oRSS.MoveFirst + strFIND = "lot_id = " & lngLOTINFO + oRSS.Find strFIND +' If Not oRSS.EOF Then +' oRSS!notes = Field2Str(oRS!notes) +' oRSS.Update +' End If +' oRS.MoveNext + + If Not oRSS.EOF Then + If strTYPE = "L" Then + If Not IsDate(oRSS!billdt_L) Then + oRSS!billdt_L = oRS!invoice_date + oRSS.Update + End If + End If + If strTYPE = "S" Or strTYPE = "C" Then + If Not IsDate(oRSS!billdt_S) Then + oRSS!billdt_S = oRS!invoice_date + oRSS.Update + End If + End If + End If + oRS.MoveNext + Loop +' MsgBox "Billing Date Update is Complete", vbOKOnly, "Update Complete" +End Sub + +Private Sub FixLOTINFO() +Dim strSQL As String +Dim oRS As Recordset + + strSQL = "SELECT TOID, origtoid FROM tblTAKE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!origTOID = oRS!toid + oRS.Update + oRS.MoveNext + Loop +' End If +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strSQL As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyU Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\OrdChkList.rpt" + strSQL = "{tblLOTINFO.LOT_ID} = " & gintLOTID + crMain.SelectionFormula = (strSQL) +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID +' crMain.ReplaceSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyZ Then ' Update The Job Cost Code in AP History File + If CtrlDown Then + Call FixAPH + End If + End If + + If KeyCode = vbKeyX Then ' Update The Job Cost Code in AR History File + If CtrlDown Then + Call FixARH + End If + End If + + If KeyCode = vbKeyW Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POMatS.rpt" + strSQL = "{tblLOTINFO.LOT_ID} = " & gintLOTID + crMain.SelectionFormula = (strSQL) +' crMain.ReplaceSelectionFormula = ("{tblLOTINFO.LOT_ID} = " & gintLOTID) +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyD Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POMatD.rpt" +' strSQL = "{tblORDERS.LOT_ID} = " & gintLOTID & " AND {tblORDERS.M_TYPE} = 'R'" + strSQL = "{tblORDERS.LOT_ID} = " & gintLOTID '& " AND {tblORDERS.M_TYPE} = 'R'" + crMain.SelectionFormula = (strSQL) +' crMain.ReplaceSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyM And gbytSECURITY = 1 Then + If CtrlDown Then + Call FixPOCount +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyT And gbytSECURITY < 3 Then ' Display the Pay SHeet information + If CtrlDown Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmPaySheet.Show 1 + End If + Exit Sub + End If + + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Call FixPrinting + End If + Exit Sub + End If + + If KeyCode = vbKeyA And (gbytSECURITY < 3 Or gstrLOGIN = "JDV") Then ' Fix BIlling Date + If CtrlDown Then + Call cmdNewSearch_Click + lblCALC.Visible = True + Call cmdFixBill_Click + lblCALC.Visible = False + End If + Exit Sub + End If + + If KeyCode = vbKeyS And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If lstLots.ListCount > 0 Then + If CtrlDown Then + Call FixStart + End If + Exit Sub + End If + End If + If KeyCode = vbKeyB And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Display key combinations. + If CtrlDown Then + Call UpStart + End If + Exit Sub + End If +End Sub + +Private Sub UpStart() +Dim strEffDate As String +Dim strSQL As String, oRS As Recordset + + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strEffDate = InputBox("Enter the New Effective Date for This Project", "New Effective Date", Date) + If IsDate(strEffDate) Then + strSQL = "SELECT * FROM tblProjDate" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + oRS.AddNew + oRS!Proj_ID = gintPROJID + oRS!startdate = strEffDate + oRS.Update + End If +End Sub + +Private Sub lstProject_DblClick() + Call cmdLotSearch_Click +End Sub + +Private Sub mnuABTPosPay_Click() + Call ABTPosPay +End Sub + +Private Sub mnuAck_Click() + frmAck.Show 1 +End Sub + + +Private Sub mnuAPEdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\APEdit.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuAREdit_Click() +Dim strSQL As String, strYN As String, strYN2 As String, strMSG As String + +' cdMain.CancelError = True + cdMain.Action = 5 +' If cdMain.CancelError Then +' MsgBox ("Printer Selection Canceled") +' Exit Sub +' End If + +'' strMSG = "To Print A Summary Report, Click YES" & vbCrLf & vbCrLf +'' strMSG = strMSG & "To Print A Detailed Report, Click No" +'' strYN2 = MsgBox(strMSG, vbYesNo, "Select YES or NO") + + crMain.ReportFileName = App.Path & "\AREdit.rpt" + +'' If strYN2 = vbYes Then +'' crMain.ReportFileName = App.Path & "\ARTransSum.rpt" +'' ElseIf strYN2 = vbNo Then +'' crMain.ReportFileName = App.Path & "\ARTrans.rpt" +'' End If + + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuAREdit2_Click() +Dim strSQL As String, strYN As String, strYN2 As String, strMSG As String + +' cdMain.CancelError = True + cdMain.Action = 5 +' If cdMain.CancelError Then +' MsgBox ("Printer Selection Canceled") +' Exit Sub +' End If + +'' strMSG = "To Print A Summary Report, Click YES" & vbCrLf & vbCrLf +'' strMSG = strMSG & "To Print A Detailed Report, Click No" +'' strYN2 = MsgBox(strMSG, vbYesNo, "Select YES or NO") + +' crMain.ReportFileName = App.Path & "\AREdit.rpt" + +'' If strYN2 = vbYes Then +'' crMain.ReportFileName = App.Path & "\ARTransSum.rpt" +'' ElseIf strYN2 = vbNo Then + crMain.ReportFileName = App.Path & "\ARTrans.rpt" +'' End If + + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then +' cdMain.Action = 5 + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuBid_Click() +Dim strSQL As String + + crMain.ReportFileName = App.Path & "\BidReport.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + + +End Sub + +Private Sub mnuCMSAP_Click() + Call ImportCMSAP +End Sub + +Private Sub mnuCMSAR_Click() + Call ImportCMSAR +End Sub + +Private Sub mnuFindPO_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + gstrPONUM = UCase(InputBox("Enter The PO Number You Want (From Upper Left)", "PO Number")) + If gstrPONUM = "" Then +' MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + strSQL = "SELECT PONum, Lot_ID FROM tblOrders WHERE ponum = " & Int(gstrPONUM) ' & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + gintLOTID = Field2Long(oRS!Lot_id) +' gintLOTID = Field2Integer(oRS!Lot_id) + strSql2 = "SELECT lot_id, proj_id FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + gintPROJID = Field2Long(oRSS!Proj_ID) +' gintPROJID = Field2Integer(oRSS!proj_id) + End If + Else + MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' gintORDER = 8 + gintORDER = 9 + frmOrders.Show 1 + +End Sub + +Private Sub mnuFIXAP_Click() + frmAPFIX.Show 1 +End Sub + +Private Sub mnuFIXAR_Click() + frmARFIX.Show 1 +End Sub + +Private Sub mnuFoamOrder_Click() + frmFoam.Show 1 +End Sub + +Private Sub mnuJCTrans_Click() +Dim strSQL As String, intYN As Integer + intYN = MsgBox("Are You Sure You Want Clear The Job Cost File for VWP?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblJCTrans" + goConn.Execute strSQL + + MsgBox "VWP Job Cost Transfer Is Complete", vbOKOnly, "Job Cost" + +End Sub + +Private Sub mnuJPPosPay_Click() + Call BOPosPay +End Sub + +Private Sub mnuMAPEdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\APEditM.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuMAREdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\AREditM.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuMJCTrans_Click() +Dim strSQL As String, intYN As Integer + intYN = MsgBox("Are You Sure You Want Clear The Job Cost File for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblJCTransM" + goConn.Execute strSQL + + MsgBox "Metro Stucco Job Cost Transfer Is Complete", vbOKOnly, "Job Cost" + +End Sub + +Private Sub mnuAbout_Click() + frmAbout.Show +End Sub + +Private Sub mnuARUPDATE_Click() +Dim strSQL As String, strSELECT As String, strTEST As String +Dim oRS As Recordset, oRSS As Recordset + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strTEST = "DELETE * FROM tblARMASTER" + goConn.Execute strTEST + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AR1_CustomerMaster WHERE SORTFIELD <> '99'" + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + If Trim(oRS!SortField) = "99" Then + + Else + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblARMaster WHERE Cust_NO = '" & oRS!CustomerNumber & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!cust_no = Field2Str(oRS!CustomerNumber) + oRSS!Name = Field2Str(oRS!customername) + oRSS!address1 = Field2Str(oRS!addressline1) + oRSS!address2 = Field2Str(oRS!addressline2) + ' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!city = Field2Str(oRS!city) + oRSS!State = Field2Str(oRS!State) + oRSS!zipcode = Left(Field2Str(oRS!zipcode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + End If + + frmMain.MousePointer = vbArrow + MsgBox "AR Master file update is complete" + +End Sub + +Private Sub mnuAPUPDATE_Click() +Dim strSQL As String, strSELECT As String, strTEST As String +Dim oRS As Recordset, oRSS As Recordset + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strTEST = "DELETE * FROM tblAPMASTER" + goConn.Execute strTEST + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AP1_VendorMaster WHERE SORTFIELD <> '99'" + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + If Trim(oRS!SortField) = "99" Then + + Else + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblAPMaster WHERE Cust_NO = """ & oRS!VendorNumber & """" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!cust_no = Field2Str(oRS!VendorNumber) + oRSS!Name = Field2Str(oRS!VendorName) + oRSS!address1 = Field2Str(oRS!addressline1) + oRSS!address2 = Field2Str(oRS!addressline2) + ' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!city = Field2Str(oRS!city) + oRSS!State = Field2Str(oRS!State) + oRSS!zipcode = Left(Field2Str(oRS!zipcode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + End If + + frmMain.MousePointer = vbArrow + MsgBox "AP Master file update is complete" + +End Sub + +Private Sub mnuBP_Click() + frmBlackPaper.Show +End Sub + +Private Sub mnuContractor_Click() + frmContractor.Show +End Sub + +Private Sub mnuCrew_Click() + frmCrews.Show +End Sub + +Private Sub mnuCrews_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM tblTime" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT Crew_id, Old_id, type FROM tblCrew WHERE type = '" & oRS!pay_type & "' and Old_id = " & oRS!crew + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + oRS!crew = Field2Str(oRSS!crew_id) + oRS.Update + Else + oRS!crew = 0 + oRS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + + frmMain.MousePointer = vbArrow + MsgBox "Crew conversion is complete" + +End Sub + +Private Sub mnuEstInv_Click() + frmInvTake.Show 1 +End Sub + +Private Sub mnuInvCount_Click() + crMain.ReportFileName = App.Path & "\InventoryReport.rpt" + crMain.Destination = crptToPrinter + crMain.Action = 1 + +End Sub + +Private Sub mnuNotes_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + frmMain.MousePointer = vbHourglass + strSQL = "SELECT lot_id, notes FROM lotnote ORDER BY lot_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT lot_id, notes FROM tblLotInfo" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "lot_id = " & oRS!Lot_id + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + strSQL = "SELECT toid, notes FROM takenote ORDER BY toid" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, notes FROM tblTake" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "toid = " & oRS!toid + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + strSQL = "SELECT est_id, notes FROM plannote ORDER BY est_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT est_id, notes FROM tblplans" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "est_id = " & oRS!est_id + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + frmMain.MousePointer = vbArrow + MsgBox "Notes conversion is complete" + +End Sub + +Private Sub mnuExit_Click() + Unload Me +End Sub +''Private Sub mnuFixTOM_Click() +''Dim strSQL As String, strSql2 As String, strSQL3 As String +''Dim oRS As Recordset, oRSS As Recordset +''Dim strID As String + +'' strSQL = "SELECT * FROM tblCrewList" ' where Order_date > #12/31/2001#" +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' strSql2 = "SELECT * FROM tblLotInfo" ' where proj_id = " & Field2Integer(oRS!proj_id) & " and pln_elv = '" & Field2Str(oRS!mod_elv) & "'" +' Set oRSS = New Recordset +' oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + +'' Do Until oRS.EOF +'' strID = oRS!emp_id +'' strSql2 = "SELECT Department, EmployeeNumber, LastName, FirstName, DefaultWCCode FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" +'' Set oRSS = New Recordset +'' oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic +' strSQL3 = "lot_id = " & Field2Integer(oRS!Lot_id) ' & " and pln_elv = '" & Field2Str(oRS!mod_elv) & "'" + ' oRSS.BOF +' oRSS.Filter = strSQL3 +'' If Not oRSS.EOF Then + 'With oRSS +'' oRS!wc_code = Field2Str(oRSS!defaultwccode) ' * Field2Str(!openpr)) / 100) + 0.99) +'' oRS.Update + 'End With + 'oRSS.MoveFirst +'' End If +' oRSS.MoveFirst +'' oRS.MoveNext +'' Loop + +'' MsgBox "The WCCode Update is Complete" + +''End Sub + +Private Sub mnuLathList_Click() +Dim strSELECT As String + + On Error GoTo Error_EH + gintPRINT = 9 + frmReport.Show 1 + + crMain.ReportFileName = App.Path & "\LathOrderDateList.rpt" + crMain.GroupSelectionFormula = strSELECT + crMain.CopiesToPrinter = gintCOPY + crMain.Destination = gintDEST + crMain.WindowState = crptMaximized + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuLathList" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuMAPTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AP Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupMAPTransfer + +End Sub + +Private Sub mnuMARUpdate_Click() +Dim strSQL As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AR1_CustomerMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn3, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblARMasterM WHERE Cust_NO = '" & oRS!CustomerNumber & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!cust_no = Field2Str(oRS!CustomerNumber) + oRSS!Name = Field2Str(oRS!customername) + oRSS!address1 = Field2Str(oRS!addressline1) + oRSS!address2 = Field2Str(oRS!addressline2) +' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!city = Field2Str(oRS!city) + oRSS!State = Field2Str(oRS!State) + oRSS!zipcode = Left(Field2Str(oRS!zipcode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop +' oRSS.Close +' oRS.Close + + + frmMain.MousePointer = vbArrow + MsgBox "Metro Stucco AR Master file update is complete" + +End Sub + +Private Sub mnuOrder5_Click() + cmdOrderR.Caption = "Orders PreMix" + mnuOrder5.Checked = True + mnuOrderR.Checked = False + mnuOrderE.Checked = False + +End Sub + +Private Sub mnuOrderE_Click() + cmdOrderR.Caption = "Orders Synthetic" + mnuOrder5.Checked = False + mnuOrderR.Checked = False + mnuOrderE.Checked = True + +End Sub + +Private Sub mnuOrderR_Click() + cmdOrderR.Caption = "Orders" + mnuOrder5.Checked = False + mnuOrderR.Checked = True + mnuOrderE.Checked = False +End Sub + +Private Sub mnuPayroll_Click() + Call cmdPayroll_Click +End Sub + +Private Sub mnuPlanUse_Click() +Dim strSQL As String + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + crMain.GroupSelectionFormula = "{tblLOTINFO.PROJ_ID} = " & gintPROJID + crMain.ReportFileName = App.Path & "\PlanUsage.rpt" +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuPOList_Click() + frmPOList.Show 1 +End Sub + +Private Sub mnuPOListdesc_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\POListDescend.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub BOPosPay() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCount As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") + strBANK = "4" + strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCount = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCount = intCount + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCount & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module BOPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub ABTPosPay() +Dim strEXPORT As String * 80, strSQL As String, strSql2 As String +Dim strCHECK As String * 10, strAMT As String * 10, strSTART As String +Dim strDate As String * 6, strName As String * 34 +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim strBegDate2 As String, strEndDate2 As String +Dim intCount As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBANK = "5" + strBANK = "7" + strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + + strBegDate2 = Format(strBegDate, "MMDDYY") + strEndDate2 = Format(strEndDate, "MMDDYY") + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + MsgBox "Did not open bank code", vbOKOnly + Exit Sub + End If + strName = Space(34) + strFile = "C:\AZBank\PosPay.txt" + intCount = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MMDDYY") + strAMT = Format(Field2Str(!amount), "0000000.00") + strCHECK = Format(!CheckNumber, "0000000000") +' strName = Field2Str(!CheckPayeeName) + strEXPORT = "C007009361130919 RA " & strCHECK & strAMT & strDate & strName + If strDate >= strBegDate2 And strDate <= strEndDate2 Then + intCount = intCount + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCount & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module BOPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub WFPosPay() +'Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strEXPORT As String, strSQL As String, strSql2 As String +'Dim strCHECK As String * 6, strAMT As String * 13 +Dim strCHECK As String, strAMT As String +'Dim strDate As String * 8, strName As String * 30 +Dim strDate As String, strName As String +Dim oRS As Recordset, strFile As String +Dim strBegDate As String, strEndDate As String +Dim intCount As Integer, dblTotal As Double, strBANK As String +Dim strRTN, strACCT, strTYPE, strMSG As String +Dim lngRTN, lngTYPE As Long + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") + strBANK = "5" + strMSG = "Enter the Beginning Date (MMDDYYYY)" + strBegDate = InputBox(strMSG, "Beginning Date") + + If IsDate(strBegDate) Then + Else + If Len(strBegDate) > 0 Then + strBegDate = Format(strBegDate, "00-00-####") + If Not IsDate(strBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the Ending Date (MMDDYYYY)" + strEndDate = InputBox(strMSG, "Ending Date", strBegDate) + + If IsDate(strEndDate) Then + Else + If Len(strEndDate) > 0 Then + strEndDate = Format(strEndDate, "00-00-####") + If Not IsDate(strEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +' strBegDate = InputBox("Enter the Beginning Date (MM-DD-YYYY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM-DD-YYYY)", "Ending Date", strBegDate) + MousePointer = 11 + + lngRTN = 122105278 +'* strRTN = "122105278" + strACCT = "6861290531" + lngTYPE = 320 +'* strTYPE = "320" + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\WellsFargo\PosPay.csv" + intCount = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM-DD-YYYY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") +' strName = Field2Str(!CheckPayeeName) +'** strDate = "06-29-2013" +'** strAMT = "1250.00" +'** strCHECK = "123456" + strEXPORT = lngRTN & "," & strACCT & "," & strCHECK & "," & strDate & "," & strAMT & "," & lngTYPE +'** strEXPORT = strRTN & "," & strACCT & "," & strDate & "," & strCHECK & "," & strAMT & "," & strTYPE + + If strDate >= strBegDate And strDate <= strEndDate Then + intCount = intCount + 1 + dblTotal = dblTotal + Field2Str2(strAMT) +' dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCount & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module WFPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuPosPayHold_Click() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRSP As Recordset, strSQLP As String +Dim oRSP2 As Recordset, strSQLP2 As String +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCount As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + mstrBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + mstrEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", mstrBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + +'' strSQLP = "SELECT * FROM PR_23PerptHistoryDetail WHERE CheckNumber = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + +'' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCount = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCount = intCount + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCount & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module mnuPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuPosPay2_Click() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCount As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") + strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCount = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCount = intCount + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCount & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module mnuPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuProjJC_Click() +Dim strYN As String + + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strYN = MsgBox("Do You Want To Print to the Printer", vbYesNo, "Print to Printer") + + crMain.ReportFileName = App.Path & "\JCSummary.rpt" + crMain.ReplaceSelectionFormula "{tblPROJECT.PROJ_ID} = " & gintPROJID & " and {tblLOTINFO.BILL}>0" + If strYN = vbNo Then + crMain.Destination = crptToWindow + Else + crMain.Destination = crptToPrinter + End If + crMain.WindowState = crptMaximized + crMain.Action = 1 +End Sub + +Private Sub mnuProjPlan_Click() +Dim strSQL As String + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + crMain.ReportFileName = App.Path & "\PlansInfo.rpt" + crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + + +End Sub + +Private Sub mnuRCrew_Click() + frmRCrew.Show +End Sub + +Private Sub mnuInvList_Click() +' frmInventory.Load + frmInventory.Show +End Sub + +Private Sub mnuRepList_Click() + frmRepList.Show 1 +End Sub + +Private Sub mnuSand_Click() + frmSand.Show +End Sub + +Private Sub mnuSCrew_Click() + frmSCrew.Show +End Sub + +Private Sub mnuSetupSWMAR_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The SW AR Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupARMTransfer + + MsgBox "SW Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" + +End Sub + +Private Sub mnuTake5_Click() + cmdTakeR.Caption = "Takeoff PreMix" + mnuTake5.Checked = True + mnuTakeR.Checked = False + mnuTakeE.Checked = False +End Sub + +Private Sub mnuTakeE_Click() + cmdTakeR.Caption = "Takeoff Synthetic" + mnuTakeE.Checked = True + mnuTake5.Checked = False + mnuTakeR.Checked = False +End Sub + +Private Sub mnuTakeR_Click() + cmdTakeR.Caption = "Takeoff" + mnuTakeR.Checked = True + mnuTake5.Checked = False + mnuTakeE.Checked = False +End Sub + +Private Sub mnuTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The Invoice Transfer?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupTransfer +' Call CMSTransfer ' this command must be removed for production + +' MsgBox "Invoices are now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto CMS" +' MsgBox "Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuMARTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AR Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupMARTransfer + + MsgBox "Metro Stucco Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuSWTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The SW AR Transfer?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupARTransfer + + MsgBox "SW Accounts Receivable is now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuAPTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AP Transfer?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + +' Call CMSAPTransfer + Call SetupAPTransfer + +End Sub + +Private Sub mnuUInv_Click() +Dim intTAKE As Integer, intPLAN As Integer, intLOT As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + intTAKE = MsgBox("This will take as much as 10 minutes per file - Do You Want To Continue?", vbQuestion + vbYesNo + 256, "Just Do It") + If intTAKE <> 6 Then + Exit Sub + End If + + intTAKE = MsgBox("Do You Want to Update Takeoff Inventory?", vbYesNo + 256, "Takeoff Inventory") + intPLAN = MsgBox("Do You Want to Update Plan Inventory?", vbYesNo + 256, "Plans Inventory") + intLOT = MsgBox("Do You Want to Update Lot Orders Inventory?", vbYesNo + 256, "Lot Orders Inventory") + + strSQL = "SELECT * FROM tblINVTRY" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + If intTAKE = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblTOMatrl set d_flag = '" & oRSS!d_flag & "', m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' strSQL2 = "UPDATE tblTOMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 +' strSQL2 = "UPDATE tblTOMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' goConn.Execute strSQL2 + strSql2 = "UPDATE tblOPTMatrl set d_flag = '" & oRSS!d_flag & "', m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' strSQL2 = "UPDATE tblOPTMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 +' strSQL2 = "UPDATE tblOPTMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' goConn.Execute strSQL2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "TakeOff Material Has Been Updated", vbOKOnly, "Update Complete" + End If + + If intPLAN = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblPlanMat set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPlanMat set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPOMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPOMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "Plan Material Has Been Updated", vbOKOnly, "Update Complete" + End If + + If intLOT = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblLOTMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblLOTMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "Lot Order Material Has Been Updated", vbOKOnly, "Update Complete" + End If + End If +End Sub + +Private Sub mnuUpCheck_Click() +Dim strPayDate As String, strMSG As String +Dim strSQL As String, strSql2 As String, strSQL3 As String, strSQL4 As String, strSQL5 As String +Dim oRS As Recordset, oRSC As Recordset, oRST As Recordset, oRSCH As Recordset +Dim strRDate As String + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strMSG = "Enter the Payroll Date to Process (MM/DD/YYYY)" & vbCrLf + strMSG = strMSG & "If you have not exported the check information" & vbCrLf + strMSG = strMSG & "from MAS90, then EXIT and do it before processing!!" + strPayDate = InputBox(strMSG, "Process Checks") + If IsDate(strPayDate) Then + strSQL5 = "SELECT Department, EmployeeNumber, CheckDate, CheckNumber FROM PR5_CheckHistory " 'WHERE PR5_CheckHistory.CheckDate = '04/20/2001'" '& strPayDate '& "'" + Set oRSCH = New Recordset + oRSCH.Open strSQL5, goConn2, adOpenForwardOnly, adLockReadOnly + If oRSCH.RecordCount = 0 Then + MsgBox "There Were No Checks Found In The MAS90 Check File", vbOKOnly, "NO CHECKS" + Exit Sub + End If + + strSQL = "SELECT Crew_id, Pay_id FROM tblPayHeader WHERE Pay_date = #" & Field2Str(strPayDate) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSql2 = "SELECT Empno FROM tblCREW WHERE crew_id = " & Field2Str2(oRS!crew_id) + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If IsNull(oRSC!empno) Or oRSC!empno = "0000000" Then + strMSG = "No Employee Number was found for crew # " & Field2Str(oRS!crew_id) + strMSG = strMSG & vbCrLf & "Add the Employee Number and ReProcess Checks" + MsgBox strMSG, vbOKOnly, "No Employee Number" + Exit Sub + End If + + strSQL3 = "EmployeeNumber = '" & Field2Str(oRSC!empno) & "' AND CheckDate = '" & strPayDate & "'" +' strSQL3 = "EmployeeNumber = '" & Field2Str(oRSC!empno) & "'" + oRSCH.Filter = strSQL3 +' Set oRSCH = New Recordset +' oRSCH.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSCH.EOF Then + strMSG = "No Check Was Found For Employee Number " & Field2Str(oRSC!empno) + strMSG = strMSG & vbCrLf & "Check to See Why There is No Check and ReProcess Checks" + MsgBox strMSG, vbOKOnly, "No Check" + Exit Sub + Else + strSQL4 = "UPDATE tblTIME SET prcheck = '" & Field2Str(oRSCH!CheckNumber) & "' WHERE pay_id = " & Field2Str(oRS!pay_id) + goConn.Execute strSQL4 + strSQL4 = "UPDATE tblTIME SET prdate = '" & Field2Str(strPayDate) & "' WHERE pay_id = " & Field2Str(oRS!pay_id) + goConn.Execute strSQL4 + End If + oRS.MoveNext + Loop + Else + MsgBox "The Date You Entered Is Invalid -- ReEnter", vbOKOnly, "Invalid Date" + Exit Sub + End If + + MsgBox "Check Number Update Is Complete", vbOKOnly, "UPDATE CHECKS" + + crMain.ReportFileName = App.Path & "\PRCheckList.rpt" + crMain.CopiesToPrinter = 1 + strRDate = Format(strPayDate, "yyyy,mm,dd") +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.ParameterFields(0) = "StartDate;date(" & strRDate & ");TRUE" + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuVoid_Click() +Dim intResponse As Integer + + crMain.ReportFileName = App.Path & "\VoidCk.rpt" + intResponse = MsgBox("Do You Want to View the Report Instead of Printing?", vbYesNo, "Print Where?") + If intResponse = vbYes Then + crMain.Destination = crptToWindow + Else + crMain.Destination = crptToPrinter + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuWFPosPay_Click() + Call WFPosPay +End Sub + +Private Sub mnuYInvList_Click() + frmYInventory.Show +End Sub + +Private Sub mnuInvPrice_Click() + frmInvPrice.Show +End Sub + +Private Sub mnuLabor_Click() + frmLabor.Show +End Sub + +Private Sub mnuOrders_Click() + Call cmdOrder_Click +End Sub + +Private Sub mnuOrdersDate_Click() +Dim strSELECT As String + + On Error GoTo Error_EH + gintPRINT = 9 + frmReport.Show 1 + + crMain.ReportFileName = App.Path & "\TextureOrderDateList.rpt" + crMain.GroupSelectionFormula = strSELECT + crMain.CopiesToPrinter = gintCOPY + crMain.Destination = gintDEST + crMain.WindowState = crptMaximized + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuOrdersDate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuPlans_Click() + Call cmdPlans_Click +End Sub + +Private Sub cmdLotSearch_Click() + lstLots.Width = 6000 + lstLots.Visible = True + lstProject.Width = 2595 + Call LotLoad + cmdJCUpdate.Visible = True + cmdNewSearch.Enabled = True + cmdYardOrder.Visible = True + cmdSchedule.Visible = True + cmdLotInfo.Visible = True + cmdPOInfo.Visible = True + cmdScaffold.Visible = True + If gbytSECURITY < 10 Then + cmdOrderR.Enabled = True + mnuOrders.Enabled = True + cmdDates.Visible = True + End If + If gbytSECURITY = 8 Or gbytSECURITY = 1 Or gbytSECURITY = 10 Or gstrLOGIN = "TYF" Then + cmdPayroll.Enabled = True + mnuPayroll.Enabled = True + End If + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = False + mnuTake.Enabled = False +' cmdJCRpt.Visible = True +' cmdPrintJCRpt.Visible = True + End If + If gbytSECURITY < 7 Then + cmdPlans.Enabled = False + mnuPlans.Enabled = False + End If + +' If gstrLOGIN = "KA" Then +' cmdScaffold.Visible = False +' cmdScafList.Visible = False +' End If + + If gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = False + mnuPlans.Enabled = False + End If + lstLots.SetFocus +End Sub + +Private Sub cmdFCode_Click() + If Len(txtSCode) > 0 Then + txtSCode.Enabled = False + txtSName.Enabled = False + Call CodeLoad + Else + MsgBox "A Project Code Must Be Entered", , "No Project Code" + txtSCode.SetFocus + End If + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + If mboolSHOW Then + cmdLotSearch.Enabled = True + cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "CKW" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstProject.SetFocus + Else + txtSCode.SetFocus + End If +End Sub + +Private Sub cmdFName_Click() + If Len(txtSName) > 0 Then + txtSCode.Enabled = False + txtSName.Enabled = False + Call NameLoad + Else + MsgBox "A Project Name Must Be Entered", , "No Project Name" + txtSName.SetFocus + End If + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + + If mboolSHOW Then + cmdLotSearch.Enabled = True + cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "CKW" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstProject.SetFocus + Else + txtSName.SetFocus + End If +End Sub + +Private Sub ContainLoad() + Dim oRS As Recordset, oRSP As Recordset + Dim strSQL As String, strSELECT As String, strContain As String + Dim strSQLP As String, intYN As Integer, strADDRESS As String, strLine As String + Dim strProj_Desc As String, strProj_Cont As String, strProj_Code As String + + mboolSHOW = False + + lstContains.Visible = True + lstContains.Left = 60 + lstContains.Height = 4815 + lstContains.Top = 3600 + lstContains.Width = 11775 + lstContains.Clear + DoEvents + lstLots.Visible = False + lstProject.Visible = False + lblProjCode.Visible = False +' lblProjCode.Visible = True +' lblDesc.Visible = True + +' lstContains.Clear + + strContain = Trim$(txtSContain.Text) +' strSELECT = "Lot_ID,Proj_ID, Lot_No, Address FROM tblLOTINFO" +' strSELECT = "Lot_ID,Proj_ID, Lot_No, Address FROM tblLOTINFO" + + strSQL = "SELECT Lot_ID, Proj_ID, Lot_No, Address FROM tblLOTINFO" +' strSQLP = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject " + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + + If Len(oRS!address) = 0 Then '1 + intYN = 0 + Else + strADDRESS = Field2Str(oRS!address) + intYN = InStr(1, UCase(Trim(strADDRESS)), UCase(Trim(txtSContain))) ', vbTextCompare) + End If + + If intYN > 0 Then + + strSQLP = "SELECT Proj_ID, Proj_Desc, Proj_Cont, Proj_Code FROM tblPROJECT WHERE Proj_ID = " & Field2Str2(oRS!Proj_ID) + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSP.EOF Then + strProj_Desc = Field2Str(oRSP!Proj_Desc) + strProj_Cont = Field2Str(oRSP!proj_cont) + strProj_Code = Field2Str(oRSP!Proj_Code) + strLine = Field2Str2(oRS!Lot_id) & vbTab & RTrim(strProj_Cont) & vbTab & RTrim(strProj_Code) & vbTab & RTrim(strProj_Desc) ' & " -- " & oRS!Desc + strLine = strLine & vbTab & RTrim(Field2Str(oRS!lot_no)) & vbTab & RTrim(strADDRESS) & vbTab & Field2Str2(oRS!Proj_ID) + lstContains.AddItem strLine + oRSP.Close + End If + End If + ' strLINE = Field2Str2(oRS!lot_ID) & vbTab & RTrim(Field2Str(oRS!Proj_Cont)) & vbTab & RTrim(strProj_Desc) & vbTab & RTrim(strProj_Code) ' & " -- " & oRS!Desc + ' strLINE = strLINE & vbTab & RTrim(Field2Str(oRS!Lot_NO)) & vbTab & RTrim(strADDRESS) & vbTab & Field2Str2(oRS!Proj_ID) + ' lstContains.AddItem strLINE + ' lstContains.ItemData(lstContains.NewIndex) = oRS("Proj_id") + + oRS.MoveNext +' mboolSHOW = True + Loop + oRS.Close + If lstContains.ListCount = 0 Then + MsgBox "No Address Information Found" + Call cmdNewSearch_Click + Else + lstContains.ListIndex = 0 + End If +' End If '1 + +End Sub + +Private Sub CodeLoad() + Dim oRS As Recordset, intCNT As Integer, intCount As Integer + Dim strSQL As String, strSELECT As String, strCode As String + mboolSHOW = False + intCount = 1 + lstProject.Visible = True + lstProject.Width = 4035 + lstLots.Visible = False + lblProjCode.Visible = True +' lblDesc.Visible = True + + strCode = Trim$(txtSCode.Text) +' strSELECT = "proj_code LIKE '" & strCode & "*'" ' & """" +' strSELECT = "proj_code LIKE '" & strCode & "%'" ' & """" + +' strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject " +' strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject WHERE Proj_Code = '" & strCode & "%'" + strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject WHERE Proj_Code LIKE '" & strCode & "%'" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly +' oRS.Filter = strSELECT +' intCNT = oRS.RecordCount + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem RTrim(oRS("Proj_desc")) ' & " -- " & oRS!Desc + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + intCount = intCount + 1 + + oRS.MoveNext + mboolSHOW = True + Loop + oRS.Close + If lstProject.ListCount = 0 Then + MsgBox "No Project/Subdivisions Found" + Call cmdNewSearch_Click + Else + lstProject.ListIndex = 0 + End If +End Sub + +Private Sub FindProject() + Dim strSQL As String, strSELECT As String, strCode As String + + strSQL = "SELECT proj_code, proj_cont, jccode, proj_desc, bag100, pomax, inv_type, synthetic FROM tblProject WHERE proj_id = " & gintPROJID +' strSQL = "SELECT proj_code, proj_cont, jccode, desc FROM tblProject WHERE proj_id = " & lstProject.ItemData(lstProject.ListIndex) + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lblProjCode.Caption = moRSProj!Proj_Code & " -- " & moRSProj!proj_cont +' lblDesc = Field2Str(moRSProj!Desc) + If Len(lblDesc) > 0 Then + lblDesc.Visible = True + Else + lblDesc.Visible = False + End If + If moRSProj!bag100 Then + gboolBAG = True + cmdTakeR.Caption = "Takeoff PreMix" + mnuTakeR.Checked = False + mnuTake5.Checked = True + cmdOrderR.Caption = "Orders PreMix" + ElseIf moRSProj!SYNTHETIC Then + gboolSYN = True + cmdTakeR.Caption = "Takeoff Synthetic" + mnuTakeR.Checked = False + mnuTake5.Checked = True + cmdOrderR.Caption = "Orders Synthetic" + Else + gboolBAG = False + cmdTakeR.Caption = "Takeoff" + mnuTakeR.Checked = True + mnuTake5.Checked = False + cmdOrderR.Caption = "Orders" + End If + gbytINV_TYPE = Field2Str2(moRSProj!inv_type) +End Sub + +Private Sub NameLoad() + Dim oRS As Recordset, intCNT As Integer + Dim strSQL As String, strSELECT As String, strCode As String + mboolSHOW = False + + lstProject.Visible = True + lstProject.Width = 4035 + lstLots.Visible = False + lblProjCode.Visible = True +' lblDesc.Visible = True + + strCode = Trim$(txtSName.Text) +' strSELECT = "proj_desc LIKE '" & strCode & "*'" ' & """" + strSELECT = "proj_desc LIKE '" & strCode & "%'" ' & """" + + strSQL = "SELECT Proj_id, Proj_desc FROM tblProject WHERE proj_desc LIKE '" & strCode & "%'" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' intCNT = oRS.RecordCount +' oRS.Filter = strSELECT + lstProject.Clear + + Do Until oRS.EOF +' intCNT = oRS.RecordCount + lstProject.AddItem RTrim(oRS("Proj_desc")) ' & " -- " & oRS!Desc + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + + oRS.MoveNext + mboolSHOW = True + Loop + oRS.Close + If lstProject.ListCount = 0 Then + MsgBox "No Project/Subdivisions Found" + Call cmdNewSearch_Click + Else + lstProject.ListIndex = 0 + End If +End Sub + +Private Sub mnuProject_Click() + frmProject.Show +End Sub + +Private Sub mnuScaffold_Click() + frmScaffold.Show +End Sub + +Private Sub mnuSupplier_Click() + frmSupplier.Show +End Sub + +Private Sub mnuTake_Click() +' Call cmdTake_Click +End Sub + +Private Sub mnuTexture_Click() + frmTexture.Show +End Sub + +Private Sub mnuTOI_Click() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim lngTOID As Long, lngOPTID As Long, lngPROJID As Long +Dim strMOD_ELV As String, intCount As Integer, lngCount As Long +Dim oRS As Recordset, oRSS As Recordset + On Error Resume Next + + strSQL = "SELECT * FROM tblPOption" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + lngCount = lngCount + 1 + strSql2 = "SELECT * FROM tblPlans WHERE est_id = " & Field2Long(oRS!est_id) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + strMOD_ELV = Field2Str(oRSS!Mod_Elv) + lngPROJID = Field2Long(oRSS!Proj_ID) + strSql2 = "SELECT * FROM tblTAKE WHERE proj_id = " & lngPROJID & " AND pln_elv = '" & strMOD_ELV & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + intCount = oRSS.RecordCount + If intCount <> 0 Then + lngTOID = Field2Long(oRSS!toid) + strSql2 = "SELECT * FROM tblOption WHERE toid = " & lngTOID & " and desc = '" & Field2Str(oRS!Desc) & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + ' If Not IsNull(oRSS!Create) Then + oRS!T_OptID = oRSS!OPTID + oRS.Update + ' End If + End If + End If + oRS.MoveNext + Loop + + MsgBox "Options Are Tied Together" + On Error GoTo 0 +End Sub + +Private Sub mnuTOI2_Click() +Dim strSQL As String + + strSQL = "UPDATE tblTake SET mtmu = (mtmu/100) where mtmu > 0" + goConn.Execute strSQL + strSQL = "UPDATE tblTake SET mu = (mu/100) where mu > 0" + goConn.Execute strSQL + MsgBox "Transfer Flag Setup is Complete" +End Sub + +Private Sub mnuUser_Click() + frmUser.Show +End Sub + +Private Sub mnuYard1Date_Click() + crMain.ReportFileName = App.Path & "\YardOrder.rpt" +' crMain.SelectionFormula = strSQL +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuYardRange_Click() + crMain.ReportFileName = App.Path & "\YardOrderRange.rpt" +' crMain.SelectionFormula = strSQL +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub txtSCode_Change() + cmdNewSearch.Enabled = True + +End Sub + +Private Sub txtSCode_LostFocus() + txtSCode.Text = UCase(txtSCode.Text) + If Len(txtSCode) > 0 Then + cmdFCode.Enabled = True + cmdFCode.SetFocus + End If +End Sub +Private Sub LotLoad() + Dim oRS As Recordset + Dim strSQL As String, strLine As String + + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strSQL = "SELECT lot_id, lot_no, address, model, owner from tbllotinfo WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLots.Clear + + Do Until oRS.EOF + With lstLots + strLine = oRS!lot_no & vbTab & oRS!model & vbTab & oRS!address & " --- " & oRS!Owner + .AddItem Field2Str(strLine) + .ItemData(.NewIndex) = oRS("lot_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLots.ListCount Then + lstLots.ListIndex = 0 + End If + +End Sub + +Private Sub txtSContain_GotFocus() + txtSContain.SelStart = 0 + txtSContain.SelLength = 100 +' If Len(txtSContain) > 0 Then +' txtSContain.SelText +' End If +End Sub + +Private Sub txtSContain_LostFocus() + txtSContain.Text = UCase(txtSContain.Text) + If Len(txtSContain) > 0 Then + cmdFContain.Enabled = True + cmdFContain.SetFocus + End If + +End Sub + +Private Sub txtSName_Change() + cmdNewSearch.Enabled = True + +End Sub + +'Private Sub txtSName_Change() +' cmdNewSearch.Enabled = True +'End Sub + +Private Sub txtSName_LostFocus() + txtSName.Text = UCase(txtSName.Text) + If Len(txtSName) > 0 Then + cmdFName.Enabled = True + cmdFName.SetFocus + End If +End Sub + +Private Sub SetupTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim strYN As String, strMSG As String + + On Error GoTo Error_EH + + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready ORDER By Invoice_NO, DETNUM" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + !taxcode = UCase(oRS!taxcode) + !CodeDesc = Field2Str(oRS!CodeDesc) + !DETNUM = oRS!DETNUM + !DETTOT = oRS!DETNUM + !UDF2 = "Lot " & oRS!lot_no & "," & Left$(Trim$(Field2Str(oRS!address)), 38) +' !UDF2 = Trim$(Field2Str(oRS!projcode)) & "-" & Left$(Trim$(Field2Str(oRS!address)), 43) + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + + strMSG = "Do You Want To Print An Edit Report For This Transfer Batch? Y/N" + strYN = MsgBox(strMSG, vbYesNo, "Print Edit Report?") + + If strYN = "6" Then + Call mnuAREdit2_Click + End If + + Call SetTransNumber + Call CMSTransfer + + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetTransNumber() +Dim strSQL As String, strFIX As String, intMAX As Integer, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset +Dim strINVNO1 As String, strINVNOHold As String + + strSQL = "Select * FROM tblARTRANS ORDER By INVOICE_NO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRS.EOF Then + MsgBox "No Invoices In The Transfer File - ReSelect", vbOKOnly, "No Invoices" + Exit Sub + End If + + Do Until oRS.EOF + strINVNO1 = Field2Str(oRS!invoice_no) + If strINVNO1 <> strINVNOHold Then + strSQLL = "SELECT * FROM tblARTRANS WHERE INVOICE_NO = '" & strINVNO1 & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + intMAX = oRSS.RecordCount + End If + strFIX = "Update tblARTRANS SET DETTOT = " & intMAX & " WHERE INVOICE_NO = '" & strINVNO1 & "'" + goConn.Execute strFIX +' Else + strINVNOHold = strINVNO1 + End If + oRS.MoveNext + Loop + +End Sub + +Private Sub SetupTransferTest() + Call SetTransNumber + +End Sub +Private Sub SetupTransferOLD() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + !taxcode = UCase(oRS!taxcode) + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + +'''' Call mnuAREdit_Click +'' crMain.Reset +'' crMain.ReportFileName = App.Path & "\AREdit.rpt" +' crMain.Formulas(1) = "Sand = " & intORDER +' crMain.ReplaceSelectionFormula (strSQL) +'' crMain.CopiesToPrinter = 1 +'' crMain.Destination = crptToWindow +' crMain.Destination = crptToPrinter +'' crMain.Action = 1 + +'''' Call FixBilling + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupMARTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICEM WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + !taxcode = oRS!taxcode + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + crMain.Reset + crMain.ReportFileName = App.Path & "\ARTransM.rpt" +' crMain.Formulas(1) = "Sand = " & intORDER +' crMain.ReplaceSelectionFormula (strSQL) + crMain.CopiesToPrinter = 1 + crMain.Destination = crptToWindow +' crMain.Destination = crptToPrinter + crMain.Action = 1 + + Call FixBillingM + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupMARTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupARTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim oRL As Recordset, oRP As Recordset +Dim strSQL3 As String, strSQL4 As String +Dim strDueDate As String +'************************************* +'******* Need to setup the sub routine to create the transfer file for CMS +'************************************* + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AR and CoCode = 0" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblSWARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblSWARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT lot_id, proj_id, jobcost, lot_no, address FROM tblLotInfo WHERE lot_id = " & Field2Long(oRS!Lot_id) + Set oRL = New Recordset + oRL.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSQL4 = "SELECT proj_id, proj_desc FROM tblProject WHERE proj_id = " & oRL!Proj_ID + Set oRP = New Recordset + oRP.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + Else + MsgBox "No Lot Found", vbOKOnly, "No Lot" + Exit Sub + End If + .AddNew + !invoice_no = oRS!Vend_Inv +' !invoice_no = oRS!sup_inv +' !customer_no = oRS!customer_no + !customer_no = "VALLEY" + !invoice_date = oRS!inv_date + !job_number = oRS!po_num + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + !inv_due_date = DateAdd("d", 30, oRS!inv_date) + !disc_due_date = DateAdd("d", 30, oRS!inv_date) + !non_tax_amt = oRS!orderamt + !retention_amt = 0 + If Field2Str(oRS!m_type) = "L" Then + !sales_code = "LATH" + !Description = "LATH MATERIALS" + ElseIf Field2Str(oRS!m_type) = "R" Then + !sales_code = "SPO" + !Description = "SPECIAL PURCHASE ORDER" + ElseIf Field2Str(oRS!m_type) = "S" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "B" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "T" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + End If + !price = oRS!orderamt + !amount = oRS!orderamt + !ready = True + !shipping = Left$(Field2Str(oRP!Proj_Desc), 15) + !comment = "Lot " & oRL!lot_no & "," & Left$(Field2Str(oRL!address), 20) + !DETNUM = 1 + !DETTOT = 1 + .Update + oRS!ar = False + oRS!ar_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupARTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupARMTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim oRL As Recordset, oRP As Recordset +Dim strSQL3 As String, strSQL4 As String +Dim strDueDate As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AR and CoCode = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblSWARTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblSWARTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT lot_id, proj_id, jobcost, lot_no, address FROM tblLotInfo WHERE lot_id = " & Field2Long(oRS!Lot_id) + Set oRL = New Recordset + oRL.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSQL4 = "SELECT proj_id, proj_desc FROM tblProject WHERE proj_id = " & oRL!Proj_ID + Set oRP = New Recordset + oRP.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + Else + MsgBox "No Lot Found", vbOKOnly, "No Lot" + Exit Sub + End If + .AddNew + !invoice_no = oRS!Vend_Inv +' !invoice_no = oRS!sup_inv +' !customer_no = oRS!customer_no + !invoice_date = oRS!inv_date + !job_number = oRS!po_num + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + !inv_due_date = DateAdd("d", 30, oRS!inv_date) + !disc_due_date = DateAdd("d", 30, oRS!inv_date) + !non_tax_amt = oRS!orderamt + !retention_amt = 0 + If Field2Str(oRS!m_type) = "L" Then + !sales_code = "LATH" + !Description = "LATH MATERIALS" + ElseIf Field2Str(oRS!m_type) = "R" Then + !sales_code = "SPO" + !Description = "SPECIAL PURCHASE ORDER" + ElseIf Field2Str(oRS!m_type) = "S" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "B" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "T" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + End If + !price = oRS!orderamt + !amount = oRS!orderamt + !ready = True + !shipping = Left$(Field2Str(oRP!Proj_Desc), 15) + !comment = "Lot " & oRL!lot_no & "," & Left$(Field2Str(oRL!address), 20) + .Update + oRS!ar = False + oRS!ar_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupARMTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupAPTransferTEST() + Call CMSAPTransfer +End Sub +Private Sub SetupAPTransfer() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim oRS As Recordset, oRSS As Recordset, oRSP As Recordset +Dim intDay As Integer, intMonth As Integer, intYear As Integer +Dim strDUE As String, strJC As String, strPONM As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AP and CoCode = 0" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblAPTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblAPTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT * FROM tblSupplier WHERE supplier = '" & Field2Str(oRS!supplier) & "'" + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If oRSP.EOF Then + MsgBox "No Supplier Information Was Found - Correct and ReTransfer", vbOKOnly, "Invalid Supplier" + Exit Sub + End If + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + intDay = Day(oRS!inv_date) + intMonth = Month(oRS!inv_date) + intYear = Format(Year(oRS!inv_date), "0000") + Select Case intDay + Case 1 To 25 + If intMonth > 11 Then + intMonth = 1 + intYear = intYear + 1 + Else + intMonth = intMonth + 1 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + Case 26 To 31 + If intMonth > 10 Then + intMonth = (intMonth + 2) - 12 + intYear = intYear + 1 + Else + intMonth = intMonth + 2 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + End Select + .AddNew + !invoice_no = Field2Str2(oRS!Vend_Inv) +' !invoice_no = Field2Str2(oRS!sup_inv) + !Vendor_no = Field2Str(oRSP!Vendor_no) + !invoice_date = Field2Str(oRS!inv_date) + !job_number = Field2Str(oRS!jobcost) + !inv_due_date = Field2Str2(strDUE) + !disc_due_date = DateAdd("d", 30, strDUE) + !non_tax_amt = Field2Str2(oRS!orderamt) + !net_invc_amt = Field2Str2(oRS!orderamt) + !INVOICE_AMT = Field2Str2(oRS!orderamt) + !DISCOUNT_AMT = Format(Field2Str2((oRS!orderamt * (oRSP!disc / 100))), "#,#.00") + !Terms_Code = Field2Str(oRSP!terms) +' !PO_NUMBER = Trim$((oRS!jobcost)) & Trim$((oRS!po_num)) + !PO_NUMBER = Trim$(Field2Str(oRS!jobcost)) & Trim$(Field2Str(oRS!po_num)) + !ready = True + .Update + oRS!ap = False + oRS!ap_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + + Call CMSAPTransfer + + MsgBox "VWP Accounts Payable is now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto CMS" + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupAPTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupMAPTransfer() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim oRS As Recordset, oRSS As Recordset, oRSP As Recordset +Dim intDay As Integer, intMonth As Integer, intYear As Integer +Dim strDUE As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AP and CoCode = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblAPTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblAPTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT * FROM tblSupplier WHERE supplier = '" & Field2Str(oRS!supplier) & "'" + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If oRSP.EOF Then + MsgBox "No Supplier Information Was Found - Correct and ReTransfer", vbOKOnly, "Invalid Supplier" + Exit Sub + End If + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + intDay = Day(oRS!inv_date) + intMonth = Month(oRS!inv_date) + intYear = Format(Year(oRS!inv_date), "0000") + Select Case intDay + Case 1 To 25 + If intMonth > 11 Then + intMonth = 1 + intYear = intYear + 1 + Else + intMonth = intMonth + 1 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + Case 26 To 31 + If intMonth > 10 Then + intMonth = (intMonth + 2) - 12 + intYear = intYear + 1 + Else + intMonth = intMonth + 2 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + End Select + .AddNew + !invoice_no = Field2Str2(oRS!Vend_Inv) +' !invoice_no = Field2Str2(oRS!sup_inv) + !Vendor_no = Field2Str(oRSP!Vendor_no) + !invoice_date = Field2Str(oRS!inv_date) + !job_number = Field2Str(oRS!jobcost) + !inv_due_date = Field2Str2(strDUE) + !disc_due_date = DateAdd("d", 30, strDUE) + !non_tax_amt = Field2Str2(oRS!orderamt) + !net_invc_amt = Field2Str2(oRS!orderamt) + !INVOICE_AMT = Field2Str2(oRS!orderamt) + !DISCOUNT_AMT = Format(Field2Str2((oRS!orderamt * (oRSP!disc / 100))), "#,#.00") + !Terms_Code = Field2Str(oRSP!terms) + !ready = True + .Update + oRS!ap = False + oRS!ap_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + MsgBox "Metro Accounts Payable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupMAPTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixOpenPR() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim lngPROJID As Long, strMODELV As String +Dim dblMatCost As Double + + strSELECT = "SELECT * FROM tblPlans" ' where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + Do Until oRS.EOF + With oRS + lngPROJID = oRS!Proj_ID + strMODELV = Field2Str(oRS!Mod_Elv) + strSQL = "SELECT * FROM tblTake where proj_id = " & lngPROJID & " and Pln_Elv = '" & strMODELV & "' AND Not SuperSede" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!openpr = Field2Integer(oRSS!openpr) + oRS.Update + End If + End With + oRS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module FixOpenPR" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixOpenPR2() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim lngESTID As Long +Dim dblMatCost As Double + + + strSELECT = "SELECT * FROM tblLotInfo" ' where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS.RecordCount > 0 Then + Do Until oRS.EOF + If Not IsNull(oRS!est_id) Then + With oRS + lngESTID = oRS!est_id + strSQL = "SELECT * FROM tblPlans where EST_ID = " & lngESTID '& " and Pln_Elv = '" & strMODELV & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!openpr = Field2Integer(oRSS!openpr) + oRS.Update + End If + End With + End If + oRS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module FixOpenPR2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +'Remove cmdExport_Click if there are no problems with exporting to cms + +'Private Sub cmdExport_Click() +'Dim strSQL As String, oRS As Recordset, strSQLL As String, oRSS As Recordset +'Dim strFLAG As String, strSTOCKNO As String, strDESC As String +'Dim strONHAND As String, strCOUNT As String, strCost1 As String +'Dim strCost2 As String, strNumber1 As String, strNumber2 As String, strNumber3 As String +'Dim strINVDATE As String, strDueDate As String, strDISCDATE As String +'Dim strCHKDATE As String, strGLDATE As String, strFILLER As String +'Dim strLinType As String, strSTOCK As String, strFILLER1 As String +'Dim strEXPDate As String, strQTY As String, strCOST As String +'Dim strFILLER2 As String, lngPOID As Long, intYN As Integer, lngPOID2 As Long +'Dim strFile As String, strLINE1 As String, strLINE2 As String +'Dim strTDATE1, strTDATE2, strDept1, strDept2, strDept3 As String +'Dim dblRU1D1, dblOT1U1D1, dblVU1D1, dblHU1D1, dblATG1 As Double +'Dim dblRU2D1, dblOT1U2D1, dblVU2D1, dblHU2D1, dblATG2 As Double +'Dim dblRU1D2, dblOT1U1D2, dblVU1D2, dblHU1D2 As Double +'Dim dblRU2D2, dblOT1U2D2, dblVU2D2, dblHU2D2 As Double +'Dim dblRU1D3, dblOT1U1D3, dblVU1D3, dblHU1D3 As Double +'Dim dblRU2D3, dblOT1U2D3, dblVU2D3, dblHU2D3 As Double +'Dim strEMPNO As String +'Dim FSys As New FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +'Dim dblCHANGE As Double, lngDIF As Long, strMSG As String +'Dim lngCount As Long, lngSALES As Long, lngPO As Long +'Dim strMONTH As String, strDAY As String, strSEC As String +'Dim dteWK1, dteWK2 As Date +'Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String + + +' dteWK2 = DTPickerDateEnd +' dteWK1 = DTPickerDateEnd - 7 +' strTDATE1 = Format(dteWK2, "YYYYMMDD ") +' strTDATE2 = Format(dteWK2, "YYYYMMDD ") +'' dteWK1 = mdteENDDATE +'' dteWK2 = mdteENDDATE - 7 +'' strDAY = Format(Day(Date), "00") +'' strMONTH = Format(Month(Date), "00") + +' strSQLLL = "SELECT * FROM tblSummary WHERE PPID = " & mintPPID +' strSQLLL = "SELECT * FROM tblSummary WHERE not NoPrint AND PPID = " & mintPPID & " ORDER BY DEPT1, CMSEMP" +' Set oRSSS = New Recordset +' oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic +'' strSTORE = gstrCOMPANY & "DATA" + +' strEXT = "E:\CMSWIN\PREXT." & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "c:\CMSWIN\PREXT." & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + +' Set TStream = FSys.CreateTextFile(strEXT, True) + +' Do Until oRSSS.EOF +' strEMPNO = Field2Str(oRSSS!CMSEmp) +' dblRU1D1 = Field2Str2(oRSSS!D1W1) +' dblRU2D1 = Field2Str2(oRSSS!D1W2) +' dblRU1D2 = Field2Str2(oRSSS!D2W1) +' dblRU2D2 = Field2Str2(oRSSS!D2W2) +' dblRU1D3 = Field2Str2(oRSSS!D3W1) +' dblRU2D3 = Field2Str2(oRSSS!D3W2) +' If dblRU1D1 > 0 Or dblRU2D1 > 0 Then +' dblOT1U1D1 = Field2Str2(oRSSS!OTW1) +' dblOT1U2D1 = Field2Str2(oRSSS!OTW2) +' dblHU1D1 = Field2Str2(oRSSS!HW1) +' dblHU2D1 = Field2Str2(oRSSS!HW2) +' dblVU1D1 = Field2Str2(oRSSS!VW1) +' dblVU2D1 = Field2Str2(oRSSS!VW2) +' dblATG1 = Field2Str2(oRSSS!ATGW1) +' dblATG2 = Field2Str2(oRSSS!ATGW2) +' strDept1 = Field2Str(oRSSS!Dept1) +' strRate1 = Field2Str(oRSSS!Rate1) +' +'' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDEPT1 & vbTab & vbTab & Format(dblRU1D1, "00000000.0000") +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept1 & vbTab & mstrRate1 & vbTab & Format(dblRU1D1, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & Format(dblOT1U1D1, "00000000.0000") & vbTab & vbTab & Format(dblVU1D1, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & Format(dblHU1D1, "00000000.0000") & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & Format(dblATG1, "00000000.0000") & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +'' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDEPT1 & vbTab & vbTab & Format(dblRU2D1, "00000000.0000") +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept1 & vbTab & mstrRate1 & vbTab & Format(dblRU2D1, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & Format(dblOT1U2D1, "00000000.0000") & vbTab & vbTab & Format(dblVU2D1, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & Format(dblHU2D1, "00000000.0000") & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & Format(dblATG2, "00000000.0000") & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If + +' If dblRU1D2 > 0 Or dblRU2D2 > 0 Then +' strDept2 = Field2Str(oRSSS!Dept2) +' strRate2 = Field2Str(oRSSS!Rate2) + +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept2 & vbTab & strRate2 & vbTab & Format(dblRU1D2, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept2 & vbTab & strRate2 & vbTab & Format(dblRU2D2, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If + +' If dblRU1D3 > 0 Or dblRU2D3 > 0 Then +' strDept3 = Field2Str(oRSSS!Dept3) +' strRate3 = Field2Str(oRSSS!Rate3) + +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept3 & vbTab & strRate3 & vbTab & Format(dblRU1D3, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept3 & vbTab & strRate3 & vbTab & Format(dblRU2D3, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If +' oRSSS!lock = vbChecked +' oRSSS.Update +' oRSSS.MoveNext +' Loop +' strMSG = "Export Complete - Go To CMS Payroll and IMPORT DAILY using an External File" ', vbInformation + vbOKOnly, "Export Complete") +' strMSG = strMSG & vbCrLf & "File Name: " & strEXT +' MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + +' Close #1 + +'End Sub + +Private Sub CMSTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strPONUM, strDept, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long +Dim strMONTH As String, strDAY As String, strSEC As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strHR As String +Dim strCODEDESC As String, strSHIPINFO As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + + If strHR > 12 Then + strHR = Field2Str2(strHR) - 12 + strHR = Format(strHR, "00") + End If + + strFile = "OE" & strMONTH & strDAY & strHR & strMIN + + strSQLLL = "SELECT * FROM tblARTrans ORDER BY INVOICE_NO, DETNUM" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + strLastInvNo = "" + + Do Until oRSSS.EOF + strINVNO = oRSSS!invoice_no + If strLastInvNo = strINVNO Then + GoTo Detail + End If + + strHeadID = "H" + strCUSTNo = oRSSS!customer_no + strSHIPADD = oRSSS!shipping + strCHG = "3" + strTType = "0" + strLastInvNo = strINVNO + strPONUM = Field2Str(oRSSS!comment) +' strPONUM = "" + strDept = "Dept01" + strTaxCode = oRSSS!taxcode + strINVDATE = oRSSS!invoice_date + strShipDate = oRSSS!invoice_date + strUDF1 = oRSSS!job_number + strUDF2 = oRSSS!UDF2 + strCODEDESC = Field2Str(oRSSS!CodeDesc) + strSHIPINFO = Left(strCODEDESC, 34) + '*****need to remove strPONUM from position after the strINVNO field +' strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & strUDF2 & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & strCHG & vbTab & strTType & vbTab & strINVNO & vbTab & vbTab & vbTab & strDept & vbTab + strHEADER = strHEADER & vbTab & strTaxCode & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & vbTab & strINVDATE & vbTab & strINVDATE & vbTab & strShipDate & vbTab & strUDF1 & vbTab & strUDF2 + + TStream.WriteLine (strHEADER) + +Detail: + strDetID = "D" + strLType = "1" + strSTOCK = oRSSS!sales_code + strDESC = oRSSS!Description + strTXABLE = "1" + strOQty = "1" + strSQty = "1" +' strOQty = oRSSS!Quantity +' strSQty = oRSSS!Quantity + strPRICE = oRSSS!price + + strDETAIL = strDetID & vbTab & strLType & vbTab & strSTOCK & vbTab & vbTab & strDESC ' & vbTab & Format(dblRU2D1, "00000000.0000") + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & strTaxCode & vbTab & vbTab & strTXABLE + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & vbTab & strOQty & vbTab & strSQty & vbTab & vbTab & strPRICE 'vbTab & vbTab & vbTab & vbTab + + TStream.WriteLine (strDETAIL) + + oRSSS.Update + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Sales Module then " + strMSG = strMSG & vbCrLf & "Order Entry - GENERATE ORDERS Using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + +End Sub + +Private Sub CMSAPTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strPONUM, strDept, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String, strINV_DUE_Date As String, strDISC_Date As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long, strHR As String +Dim strMONTH As String, strDAY As String, strSEC As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strDISC_PCT As String, strDISCYN As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + strFile = "APEXT" & strMONTH & strDAY & strHR & strMIN + strSQLLL = "SELECT * FROM tblAPTrans ORDER BY INVOICE_NO" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + strLastInvNo = "" + + Do Until oRSSS.EOF + strINVNO = oRSSS!invoice_no + + strHeadID = "H" + strCUSTNo = oRSSS!Vendor_no + If Field2Str(oRSSS!Terms_Code) = "04" Then + strDISC_PCT = Field2Str2(oRSSS!DISCOUNT_AMT) +' strDISC_PCT = "2" + strDISCYN = "0" + Else + strDISC_PCT = "0" + strDISCYN = "0" + End If + strTType = "1" + strPONUM = oRSSS!PO_NUMBER + strINVDATE = oRSSS!invoice_date + strShipDate = oRSSS!invoice_date + strINV_DUE_Date = oRSSS!inv_due_date + strDISC_Date = oRSSS!disc_due_date + strUDF1 = oRSSS!job_number + + strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strINVNO & vbTab & vbTab & vbTab & strPONUM & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & "0" & vbTab & "0" & vbTab & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + strHEADER = strHEADER & strDISC_PCT & vbTab & "7" & vbTab & "10150" & vbTab & "0" ' & vbTab & vbTab & vbTab & vbTab & vbTab + + TStream.WriteLine (strHEADER) + +'Detail: + strDetID = "D" + strLType = "1" + strTXABLE = "1" + strPRICE = oRSSS!INVOICE_AMT + + strDETAIL = strDetID & vbTab & strLType & vbTab & "MATERIALS" & vbTab & "50050" & vbTab & vbTab & strDISCYN & vbTab & strDISC_PCT + strDETAIL = strDETAIL & vbTab & vbTab & strUDF1 & vbTab & strINVDATE & vbTab & "1" & vbTab & strPRICE ' & vbTab & vbTab & strTXABLE + + TStream.WriteLine (strDETAIL) + + oRSSS.Update + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Accounts Payable - Enter Bills and " + strMSG = strMSG & vbCrLf & "GENERATE BILLS using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frx new file mode 100644 index 0000000..9abdbc7 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmMain.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frm new file mode 100644 index 0000000..9071064 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frm @@ -0,0 +1,9647 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" +Begin VB.Form frmPO + Caption = "Purchase Order Selection " + ClientHeight = 8670 + ClientLeft = 165 + ClientTop = 735 + ClientWidth = 12045 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8670 + ScaleWidth = 12045 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + WindowState = 2 'Maximized + Begin VB.CommandButton cmdPONotes + Caption = "PO Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 10935 + TabIndex = 55 + Top = 5145 + Visible = 0 'False + Width = 1080 + End + Begin LpLib.fpList lstHistory + Height = 840 + Left = 3735 + TabIndex = 53 + Top = 4290 + Width = 8010 + _Version = 196608 + _ExtentX = 14129 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 16578720 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 195 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":0000 + End + Begin VB.CheckBox chkHistory + Caption = "Check to Use CMS Inventory List for CTRL-O" + Height = 240 + Left = 105 + TabIndex = 51 + Top = 7530 + Width = 3600 + End + Begin VB.CommandButton cmdAlias + Caption = "Alias" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6555 + TabIndex = 49 + Top = 900 + Visible = 0 'False + Width = 735 + End + Begin VB.CheckBox chkNoDisplay + Caption = "Skip Display" + Height = 240 + Left = 2115 + TabIndex = 48 + Top = 7320 + Visible = 0 'False + Width = 585 + End + Begin VB.CheckBox chkOKPO + Caption = "Do Not Create" + Height = 240 + Left = 1365 + TabIndex = 47 + Top = 7335 + Visible = 0 'False + Width = 510 + End + Begin VB.CheckBox chkByDesc + Caption = "PO By Description" + Height = 210 + Left = 4845 + TabIndex = 46 + Top = 1245 + Width = 1620 + End + Begin VB.CommandButton cmdAPAR + Caption = "AP/AR Check" + Height = 300 + Left = 3915 + TabIndex = 45 + Top = 7530 + Visible = 0 'False + Width = 1245 + End + Begin VB.CommandButton cmdPromo + Caption = "Promo" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 44 + Top = 495 + Width = 1035 + End + Begin VB.CommandButton cmdOnOrder + Caption = "OnOrder List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9990 + TabIndex = 43 + ToolTipText = "This Will Display The Outstanding PO's For The Hi-Lited Inventory Item" + Top = 900 + Width = 840 + End + Begin VB.CommandButton cmdAltVend2 + Caption = "Vendor Stock List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 40 + Top = 15 + Width = 1035 + End + Begin VB.CheckBox chkKEEP + Caption = "Keep Search Info" + Height = 210 + Left = 1770 + TabIndex = 38 + Top = 1245 + Value = 1 'Checked + Width = 1680 + End + Begin VB.Timer tmrAltVend + Left = 3375 + Top = 7215 + End + Begin VB.CommandButton cmdAltVendor + Caption = "Vendor Stock #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8355 + TabIndex = 37 + Top = 600 + Visible = 0 'False + Width = 1650 + End + Begin VB.CheckBox chkZero + Caption = "No Zero Qty" + Height = 210 + Left = 3510 + TabIndex = 36 + Top = 1245 + Value = 1 'Checked + Width = 1260 + End + Begin VB.CommandButton cmdMinMax2 + Caption = "Update Order List Min/Max" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 2535 + TabIndex = 30 + Top = 4305 + Width = 1215 + End + Begin VB.CommandButton cmdSales + Caption = "Calc Sales" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 7260 + TabIndex = 29 + Top = 585 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 285 + Left = 5580 + TabIndex = 26 + Top = 660 + Width = 975 + End + Begin VB.TextBox txtEndDate + Height = 285 + Left = 5580 + TabIndex = 25 + Top = 960 + Width = 975 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Order Checklist" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7305 + TabIndex = 24 + Top = 900 + Width = 1050 + End + Begin VB.CommandButton cmdMINMAX + Caption = "Update Inv List - MIN/MAX && Type" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8370 + TabIndex = 23 + Top = 900 + Width = 1620 + End + Begin VB.CommandButton cmdLabel + Caption = "Setup BC Labels" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 480 + Left = 10830 + TabIndex = 21 + Top = 975 + Width = 1035 + End + Begin VB.ComboBox cboSortOrder + Height = 315 + ItemData = "frmPO.frx":073D + Left = 1920 + List = "frmPO.frx":0750 + Style = 2 'Dropdown List + TabIndex = 20 + Top = 240 + Width = 1755 + End + Begin MSComDlg.CommonDialog cdPO + Left = 3855 + Top = 7185 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin Crystal.CrystalReport crPO + Left = 2865 + Top = 7185 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtOrderQty + Alignment = 1 'Right Justify + Height = 285 + Left = 9975 + TabIndex = 16 + Tag = """OrderQty""" + Top = 5130 + Width = 795 + End + Begin VB.TextBox txtEndSelect + Height = 285 + Left = 5580 + TabIndex = 8 + Top = 360 + Width = 4845 + End + Begin VB.TextBox txtBegSelect + Height = 285 + Left = 5580 + TabIndex = 7 + Top = 60 + Width = 4845 + End + Begin VB.ComboBox cboSort + Height = 315 + ItemData = "frmPO.frx":078D + Left = 45 + List = "frmPO.frx":07A3 + Style = 2 'Dropdown List + TabIndex = 3 + Top = 240 + Width = 1755 + End + Begin LpLib.fpList lstInventory + Height = 2535 + Left = 90 + TabIndex = 0 + Top = 1470 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 4471 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 21 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 2 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 450 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":07ED + End + Begin LpLib.fpList lstProcess + Height = 2040 + Left = 90 + TabIndex = 50 + Top = 5445 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 16 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":123A + End + Begin LpLib.fpCombo cboVendor + Height = 315 + Left = 3750 + TabIndex = 41 + Top = 240 + Visible = 0 'False + Width = 5730 + _Version = 196608 + _ExtentX = 10107 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPO.frx":1B50 + End + Begin LpLib.fpList lstCompare + Height = 780 + Left = 90 + TabIndex = 52 + Top = 7800 + Width = 11715 + _Version = 196608 + _ExtentX = 20664 + _ExtentY = 1376 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Courier New" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 8454143 + ForeColor = -2147483640 + Columns = 8 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":21EB + End + Begin VB.TextBox txtSearch + Height = 285 + Left = 60 + TabIndex = 5 + Top = 840 + Width = 2520 + End + Begin VB.Label lblMessage + BackColor = &H0000FFFF& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 270 + Left = 75 + TabIndex = 54 + Top = 4005 + Visible = 0 'False + Width = 11670 + End + Begin VB.Label lblWait + Alignment = 2 'Center + BackColor = &H00FF0000& + Caption = "Please Wait" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H0000FFFF& + Height = 645 + Left = 2580 + TabIndex = 31 + Top = 615 + Visible = 0 'False + Width = 1800 + End + Begin VB.Label lblSelectVend + Caption = "Select Vendor and Press ENTER to Complete PO" + Height = 240 + Left = 3720 + TabIndex = 42 + Top = 0 + Visible = 0 'False + Width = 6045 + End + Begin VB.Label lblTest + BeginProperty Font + Name = "Arial" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 720 + Left = 90 + TabIndex = 39 + Top = 4350 + Width = 2250 + End + Begin VB.Label txtPOTotal + Height = 195 + Left = 10665 + TabIndex = 35 + Top = 7545 + Width = 1065 + End + Begin VB.Label lblPOTotalAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated PO Total:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8895 + TabIndex = 34 + Top = 7545 + Width = 1710 + End + Begin VB.Label lblWeight + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "TTL Weight" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6780 + TabIndex = 33 + Top = 7545 + Width = 1020 + End + Begin VB.Label txtWeight + Alignment = 2 'Center + Height = 195 + Left = 7890 + TabIndex = 32 + Top = 7545 + Width = 975 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Date:" + Height = 195 + Left = 4560 + TabIndex = 28 + Top = 1020 + Width = 930 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Date:" + Height = 195 + Left = 4380 + TabIndex = 27 + Top = 720 + Width = 1140 + End + Begin VB.Label lblUser + Caption = "User: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3150 + TabIndex = 22 + Top = 885 + Width = 1185 + End + Begin VB.Label lblSort2 + Caption = "Sort Field - Order List" + Height = 255 + Left = 1920 + TabIndex = 19 + Top = 0 + Width = 1635 + End + Begin VB.Label lblSort1 + Caption = "Sort Field - Inventory" + Height = 240 + Left = 0 + TabIndex = 18 + Top = 0 + Width = 1635 + End + Begin VB.Label lblOrderHold + Height = 315 + Left = 11490 + TabIndex = 17 + Top = 3945 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Qty:" + Height = 195 + Left = 9180 + TabIndex = 15 + Top = 5145 + Width = 720 + End + Begin VB.Label lblShowDesc + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 4560 + TabIndex = 14 + Top = 5115 + Width = 4515 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 3660 + TabIndex = 13 + Top = 5145 + Width = 840 + End + Begin VB.Label lblStock + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 255 + Left = 1860 + TabIndex = 12 + Top = 5115 + Width = 1755 + End + Begin VB.Label lblStockNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stock #:" + Height = 195 + Left = 1170 + TabIndex = 11 + Top = 5115 + Width = 615 + End + Begin VB.Label lblEndSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Selection: " + Height = 195 + Left = 4245 + TabIndex = 10 + Top = 420 + Width = 1290 + End + Begin VB.Label lblBegSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Selection: " + Height = 195 + Left = 4035 + TabIndex = 9 + Top = 120 + Width = 1500 + End + Begin VB.Label lblSearch + Caption = "Enter Stock Number to Find" + Height = 255 + Left = 60 + TabIndex = 6 + Top = 600 + Width = 3075 + End + Begin VB.Label lblSort + Caption = "Sort Field - Inventory" + Height = 255 + Left = 60 + TabIndex = 4 + Top = 0 + Width = 1635 + End + Begin VB.Label lblProcess + AutoSize = -1 'True + Caption = "Order List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 15 + TabIndex = 2 + Top = 5130 + Width = 840 + End + Begin VB.Label lblCMS + AutoSize = -1 'True + Caption = "CMS Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 1 + Top = 1260 + Width = 1620 + End + Begin VB.Menu mnuSelect + Caption = "Set Selection" + Begin VB.Menu mnuBegin + Caption = "Beginning Selection" + End + Begin VB.Menu mnuEnding + Caption = "Ending Selection" + End + Begin VB.Menu mnuBegDate + Caption = "Beginning Date" + End + Begin VB.Menu mnuEndDate + Caption = "Ending Date" + End + End + Begin VB.Menu mnuPartial + Caption = "Select By Criteria" + Begin VB.Menu mnuMinMax + Caption = "Select by Min/Max" + End + Begin VB.Menu mnuPOSSales + Caption = "Select by POS Sales" + End + Begin VB.Menu mnuSelAll + Caption = "Select ALL For 1 Vendor" + End + End + Begin VB.Menu mnuCreate2 + Caption = "Create PO" + End + Begin VB.Menu mnuClear + Caption = "c&Lear" + End + Begin VB.Menu mnuReports + Caption = "&Reports" + End + Begin VB.Menu cmdOpenPO + Caption = "Open PO List" + End + Begin VB.Menu mnuImport + Caption = "Import Electronic Invoices" + Begin VB.Menu mnuCPet + Caption = "Central Pet" + End + Begin VB.Menu mnuSunburst + Caption = "Sunburst Pet" + Visible = 0 'False + End + Begin VB.Menu mnuTVet + Caption = "Thompson Vet" + End + Begin VB.Menu mnuLextron + Caption = "Lextron" + Visible = 0 'False + End + Begin VB.Menu mnuPurina1 + Caption = "Purina (Land O Lakes)" + End + Begin VB.Menu mnuPurina2 + Caption = "Purina (CSV Detail Old)" + End + Begin VB.Menu mnuPurina + Caption = "Purina (CSV Detail 2016)" + End + Begin VB.Menu mnuEagle + Caption = "Eagle - Create PO" + Visible = 0 'False + End + End + Begin VB.Menu cmdImpCMS + Caption = "Import CMS PO's" + Visible = 0 'False + End + Begin VB.Menu mnuLabels + Caption = "Labels" + End + Begin VB.Menu mnuUpdate + Caption = "Update" + Begin VB.Menu mnuUpVendor + Caption = "Primary Vendor" + End + Begin VB.Menu mnuUpDesc + Caption = "Description" + End + Begin VB.Menu mnuUpWgt + Caption = "Weight" + End + Begin VB.Menu mnuUpCase + Caption = "Units in a Case" + End + End + Begin VB.Menu mnuAddInv + Caption = "Add Inventory" + Begin VB.Menu mnuAddV + Caption = "Add From Vendor" + End + Begin VB.Menu mnuAddS + Caption = "Add From Another Store" + End + End + Begin VB.Menu mnuExit + Caption = "E&Xit" + End + Begin VB.Menu mnuHelp + Caption = "&Help" + End +End +Attribute VB_Name = "frmPO" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim moRSPOList As Recordset, moRSUpdate As Recordset, moRSAV As Recordset +Dim moRSPOHeader As Recordset, moRSPODetail As Recordset +Dim mstrBEGDATE As String, mstrENDDATE As String, mboolCTRLO As Boolean +Dim mstrCUSTOMER As String * 20, mintYN As String +'Dim mstrVSTOCK As String, mstrAVENDOR As String, mstrSTOCK As String +Dim mstrVSTOCK As String * 20, mstrAVENDOR As String * 20, mstrSTOCK As String * 20 +Dim mstrADDVStock As String, mintBOOKMARK3 As Integer, mstrNSTOCK As String * 20 +Dim mstrLine As String, strCode As String, strCompany As String +Dim mstrName As String, strCUST As String, strVEND As String, strTYPE As String +Dim mstrCP_PO As String, mstrDATE As String, mstrTABLE As String +Dim mstrALIAS As String, mboolALIASFOUND As Boolean, mstrOldVendor As String +Dim mstrVENDOR As String, mboolNOVSTOCK As Boolean, mintBOOKMARK2 As Integer +Dim mstrDESC As String, mintBOOKMARK As Integer, mlngCOUNT As Long, mintBOOKMARK5 As Integer +Dim mdblQORDER As Double, mboolALL As Boolean, mstrVFIND As String * 20 +Dim mbytSort As Byte, mintBOOKMARK12 As Integer, mintBOOKMARK13 As Integer +Dim mintCnt1 As Integer, mintCnt2 As Integer +Dim mdteBegin As Date, mdteEnd As Date +Dim mstrN_LPD, mstrN_Desc, mstrN_LC, mstrN_RTL, mstrN_VND, mstrN_VS As String, mstrFStock As String +Dim mstrS_LPD, mstrS_Desc, mstrS_LC, mstrS_RTL, mstrS_VND, mstrS_VS As String ', mstrStore1 As String +Dim mstrT_LPD, mstrT_Desc, mstrT_LC, mstrT_RTL, mstrT_VND, mstrT_VS As String ', mstrStore2 As String +Dim mstrN_LM, mstrN_LY, mstrN_YA, mstrN_ICLM, mstrN_ICLY, mstrN_ICYA As String +Dim mstrS_LM, mstrS_LY, mstrS_YA, mstrS_ICLM, mstrS_ICLY, mstrS_ICYA As String +Dim mstrT_LM, mstrT_LY, mstrT_YA, mstrT_ICLM, mstrT_ICLY, mstrT_ICYA As String +Dim mstrT_TY, mstrN_TY, mstrS_TY As String + +'vbDefaultButton2 + +Private Sub InventoryLoad() +Dim oSTATUS As Long, oRSAV As Recordset, strSQLAV As String +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + mintCnt1 = mintCnt1 + 1 + +' mdteBegin = Now +' Label1 = mdteBegin + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If rc = r4success Then +' If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + lngSTDCST = d4field(db, "IN_STDCST") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + mstrSTOCK = UCase(Field2Str(strNAME)) + strCUST = f4str(lngCUST) + strVEND = f4str(lngVEND) + mstrAVENDOR = Field2Str(strVEND) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) +' If Mid$(strCUST, 1, 7) = "Dobbins" Then + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT +' End If + strCSQty = f4str(lngCSQty) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + + .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVEND) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + strWeight = "" + End With + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + MsgBox "No Inventory Items Were Found", vbInformation + vbOKOnly, "No Inventory" + End If + lstInventory.SortState = SortStateActiveReSort + +' mdteEnd = Now +' Label2 = mdteEnd +' If gstrLOGIN = "DWW" Then +' Label1.Visible = True +' Label2.Visible = True +' Else +' Label1.Visible = False +' Label2.Visible = False +' End If +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadInventory() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim intYN As Integer, strMSG As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngCUST = d4field(db, "IN_DES") + strCUST = f4str(lngCUST) + If IsNull(strCUST) Or IsNull(txtSearch) Or txtSearch = "" Then + intYN = 0 + Else + intYN = InStr(1, UCase(Trim(strCUST)), UCase(Trim(txtSearch))) ', vbTextCompare) + End If + If intYN > 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + ' lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngSTDCST = d4field(db, "IN_STDCST") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + ' strCUST = f4str(lngCUST) + strVEND = f4str(lngVEND) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT + strCSQty = f4str(lngCSQty) + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVEND) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + End With + End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + strMSG = "No Inventory Items Were Found Matching The" + strMSG = strMSG & vbCrLf & " Information You Entered" + MsgBox strMSG, vbInformation + vbOKOnly, "Nothing Matches" + End If + lstInventory.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 +Dim lngPVENDOR As Long, strPVENDOR As String +Dim lngBUYCON As Long, dblBUYCON As Double, lngWEIGHT As Long, dblWEIGHT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrAVENDOR = Field2Str(oRS!VENDOR) +' Call GETALTVEND + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + mstrSTOCK = UCase(Field2Str(oRS!VStock)) + mstrVSTOCK = Field2Str(oRS!VStock) + + Call GetALIAS + If mboolALIASFOUND = False Then + mstrSTOCK = UCase(Field2Str(oRS!inv_no)) + Call GetALIAS2 + Else + oRS!inv_no = Field2Str(mstrALIAS) + oRS.Update + End If + + If Not mboolALIASFOUND Then + Call GETAVINFO2 + strFIND = RTrim(mstrSTOCK) + Else + strFIND = Field2Str(mstrALIAS) + End If + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN2") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngPVENDOR = d4field(db, "IN_VENDOR") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblWEIGHT = f4double(lngWEIGHT) + strPVENDOR = f4str(lngPVENDOR) + End If + If strNAME = strFIND Then + oRS!inv_no = strNAME + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + strSQL = gstrCOMPANY & "INAL" + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strNAME + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + + strSQL = gstrCOMPANY & "INAL" + + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strNAME + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + +'************** Need to make this look up a corrected description and fix it. If the record needs to be updated, then +'************** be sure to also pickup last cost + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM tblPODetail WHERE POID = " & poid & " and LineNo = " & xxxx + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = UCase(oRS!StockNo) + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + End If + If strNAME = strFIND Then + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module UpdateStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectAllLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim strSELECT As String +Dim oRS As Recordset + +'TAG4 pointers +Dim lngCustTag As Long + +' On Error GoTo Error_EH + On Error Resume Next + + aTabs(0) = 100 + aTabs(1) = 120 + aTabs(2) = 200 + + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + lngRET = SendMessage(lstInventory.hWnd, LB_SETTABSTOPS, 3, aTabs(0)) +' strSQLL = cboARCode.Text + rc = d4top(db) + +' lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then +' lngRECORD = d4field(db, "AR_CODE") +' strCode = f4str(lngRECORD) +' If strCode = strSQLL Then + With oRS + .AddNew + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") +' strTYPE = f4str(lngTYPE) +' strNAME = f4str(lngNAME) +' strCUST = f4str(lngCUST) + !inv_no = f4str(lngNAME) + !Description = f4str(lngCUST) + !VENDOR = f4str(lngVEND) + !Type = f4str(lngType) + !OnHand = f4double(lngONHAND) + !User = gstrLOGIN + .Update +' .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) + End With +' End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectAllLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then '1 + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then '2 + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) +' If dblMAX > 0 And Not chkZero Then +' If dblMAX > 0 And chkZero Then + If dblMAX > 0 Then '3 + If cboSort.ListIndex = 0 Then '4 + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then '5 + + If dblALLTOTAL <= dblMIN Then ' 6 + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Or mboolALL Then '7 + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If +' End If +' If dblMAX > 0 And Not chkZero Then + ElseIf cboSort.ListIndex = 1 Then '4 + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If THIS MAY NOT BE CORRECT +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 2 Then '4 +' If Not chkZero And dblOrder > 0 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVEND) >= Trim$(strBEG2) And Trim$(strVEND) <= Trim$(strEND2) Then '5 + +' If dblALLTOTAL <= dblMIN Then + If chkZero = vbUnchecked Then '6 +' If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + End If '7 + + If dblOrder < 0 Then + dblOrder = 0 + End If + + +' If Not chkZero Then '7 +' If Not chkZero And dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '6 +' If chkZero Then + + If chkZero = vbChecked And dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + + End If '6 +' End If + End If '5 +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 3 Then '4 + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 + End If '4 + End If '3 + End If '2 + + rc = d4skip(db, 1) + Loop While rc = r4success +' End If '2 + End If '1 + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoadHold() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + If dblOrder > 0 Or mboolALL Then + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 1 Then + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 2 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVEND) >= Trim$(strBEG2) And Trim$(strVEND) <= Trim$(strEND2) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then + intREM = dblOrder Mod dblBUYCON + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 3 Then + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + End If + + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSearch_Click() +'Multiple character search code. + lstInventory.SearchText = txtSearch.Text + + lstInventory.SearchMethod = 2 + lstInventory.SearchIndex = -1 + lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub cboSort_Click() +Dim intMIN As Integer + + On Error Resume Next + mintCnt2 = mintCnt2 + 1 + lblCount2 = mintCnt2 + mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex + cboSortOrder.ListIndex = 4 + + If cboSort.ListIndex = 0 Then +' If mbytSort <> cbolistindex Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.Col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 0 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 0 + + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.caption = "Enter Stock # Search Information:" + + ElseIf cboSort.ListIndex = 1 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.Col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 1 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 1 + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.caption = "Enter Description Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 2 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.Col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 1 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.Col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 2 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 2 + + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.caption = "Enter Vendor Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 3 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.Col = 0 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.Col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 3 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 3 + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.caption = "Enter Product Type Search Information:" + ElseIf cboSort.ListIndex = 5 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.Col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.Col = 16 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 16 + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.caption = "Enter Vendor Stock Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 4 Then + Call LoadInventory +' txtSearch.SetFocus + End If + mbytSort = cboSort.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub cboSortOrder_Click() + + On Error Resume Next + + If cboSortOrder.ListIndex = 0 Then + + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 8 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 0 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + ElseIf cboSortOrder.ListIndex = 1 Then + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + ElseIf cboSortOrder.ListIndex = 2 Then + + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + txtSearch = "" + lblSearch.caption = "Enter Vendor Search Information:" + txtSearch.SetFocus + ElseIf cboSortOrder.ListIndex = 3 Then + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + + ElseIf cboSortOrder.ListIndex = 4 Then + + lstProcess.Col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.Col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeInteger + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + End If + +End Sub + +'Private Sub cmdCalc_Click() +' Screen.MousePointer = vbHourglass +' If lblBegDate2.caption = "" Then +' MsgBox "No Dates Set, No Calculations Will Process", vbOKOnly, "No Calculation" +' Exit Sub +' End If +' lblMessage.Visible = True +' lblMessage.caption = "Calculating -- Be Patient" +' DoEvents +' Call InvProcess +' lblMessage.Visible = False +' MsgBox "Calculation Complete", vbOKOnly, "Done" +' Screen.MousePointer = vbDefault +'End Sub + +Private Sub cmdClear_Click() +Dim strSQL As String + +' strSQL = "UPDATE tblPOList SET User = 'XX'" ' WHERE User = '" & gstrLOGIN & "'" + strSQL = "Delete * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + goConn.Execute strSQL +' strSQL = "DELETE * FROM tblINVUsage" +' goConn.Execute strSQL + Call ClearMiddle + Call Inventory2Load + chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If +End Sub + +Private Sub ClearMiddle() + lblMessage = "" + lblMessage.Visible = False + lblTest = "" + lblStock = "" + lblShowDesc = "" + txtOrderQty = 0 + lstCompare.Clear +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPartial_Click() + lblMessage.caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + Call SelectPartialLoad + lblMessage.Visible = False +End Sub + +Private Sub cmdReports_Click() + frmRepList.Show 1 +End Sub + +Private Sub cmdSetEnd_Click() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.Col = 0 + strINVNO = lstInventory.ColText + lstInventory.Col = 1 + strDESC = lstInventory.ColText + lstInventory.Col = 2 + strVEND = lstInventory.ColText + lstInventory.Col = 3 + strTYPE = lstInventory.ColText + lstInventory.Col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtEndSelect = strVEND + ElseIf cboSort.ListIndex = 3 Then + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetEnd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSetBeg_Click() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.Col = 0 + strINVNO = lstInventory.ColText + lstInventory.Col = 1 + strDESC = lstInventory.ColText + lstInventory.Col = 2 + strVEND = lstInventory.ColText + lstInventory.Col = 3 + strTYPE = lstInventory.ColText + lstInventory.Col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtBegSelect = strINVNO + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtBegSelect = strDESC + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtBegSelect = strVEND + txtEndSelect = strVEND + ElseIf cboSort.ListIndex = 3 Then + txtBegSelect = strTYPE + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetBeg_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFixDesc_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.Col = 1 + strDESC = lstInventory.ColText + + +' cdPO.CancelError = True + mstrDESC = InputBox("Enter The Updated Description (45 Char Max)", "New Description", strDESC) + If mstrDESC = "" Then + MsgBox "Description Was Not Changed", vbInformation + vbOKOnly, "No Change" + Exit Sub + Else + mstrDESC = Mid(mstrDESC, 1, 45) + End If + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "IN_DES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) +'******** Update INMAT File + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "INMXDES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On + +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdFixDesc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboVendor_KeyPress(KeyAscii As Integer) +Dim strControl As String + strControl = Me.ActiveControl.name + + If KeyAscii = 13 Then + KeyCode = vbTab + KeyAscii = 0 + + cboVendor.SetFocus + cboVendor.Col = 1 + gstrVENDOR = cboVendor.ColText + Call mnuCreate_Click + + End If + + If strControl = "cboVendor" Then + If KeyAscii = 27 Then + KeyAscii = 0 + + lblSelectVend.Visible = False + cboVendor.Visible = False + + + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If +End Sub + +Private Sub cmdAlias_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Changing Alias Information - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmAlias.Show 1 + + +End Sub + +Private Sub cmdAltVend2_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + + gboolALTVEND = True + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + gstrSTOCK = strVSTOCK + frmVendAlt2.Show 1 + gstrSTOCK = "" + Call Inventory2Load + +End Sub + +Private Sub cmdAltVendor_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + strVENDOR = InputBox("Enter The Vendor NUMBER for the Vendor Stock Number", "Vendor Number") + strVENDOR = UCase(strVENDOR) + If Trim(strVENDOR) = "" Then + MsgBox "You Must Enter A Vendor Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVSTOCK") +' mstrAVENDOR = "LEX500 " + mstrSTOCK2 = strVSTOCK + strVENDOR +' mstrSTOCK2 = mstrSTOCK + "LEX500 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK2) + + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If Trim(strSTOCK) = Trim(strVSTOCK) Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(strVENDOR) Then + mstrNSTOCK = f4str(lngVSTOCK) + cboSort.ListIndex = 0 + txtSearch = Trim(mstrNSTOCK) + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdAltVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAPAR_Click() + frmAPAR.Show 1 +End Sub + +Private Sub cmdImpCMS_Click() + frmPOImp.Show +End Sub + +Private Sub cmdMinMax_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim strMIN As String, strMAX As String, strTType As String +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstInventory.Col = 0 + strSTOCK = lstInventory.ColText + lstInventory.Col = 3 + strTYPE = lstInventory.ColText + lstInventory.Col = 4 + dblMIN = Field2Str2(lstInventory.ColText) + lstInventory.Col = 5 + dblMAX = Field2Str2(lstInventory.ColText) + +' dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + strMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + If strMIN = "" Then + MsgBox "MIN Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMIN) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMIN = Field2Str2(strMIN) + End If +' dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + strMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + If strMAX = "" Then + MsgBox "MAX Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMAX) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMAX = Field2Str2(strMAX) + End If + strCATNBR = "M" + strUDF01 = "N" + strTType = InputBox("Enter The New Type if Desired", "Type", strTYPE) + If strTType = "" Then + MsgBox "TYPE Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + strTYPE = strTType + mintBOOKMARK = lstInventory.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") + lngCATNBR = d4field(db4, "IN_CATNBR") + lngUDF01 = d4field(db4, "IN_FIELD01") + lngType = d4field(db4, "IN_TYPE") + lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) + Call f4assign(lngCATNBR, strCATNBR) + Call f4assign(lngUDF01, strUDF01) + Call f4assign(lngType, strTYPE) + Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngType = d4field(db4, "INMXTYPE") + Call f4assign(lngType, strTYPE) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMinMax2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.Col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.Col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.Col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWAIT.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWAIT.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdType2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.Col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.Col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.Col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWAIT.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWAIT.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdType2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOnOrder_Click() + lstInventory.Col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.Col = 1 + gstrDESC = lstInventory.ColText + lstInventory.Col = 2 + gstrVENDOR = lstInventory.ColText + + frmOnOrder.Show 1 +End Sub + +Private Sub cmdOpenPO_Click() +' chkNoDisplay = vbUnchecked + frmPOOpen.Show 1 +' chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If + Call Inventory2Load +' chkNoDisplay = vbChecked + lstProcess.ListIndex = 0 + +End Sub + +Private Sub cmdTest_Click() + frmInvAdd2.Show 1 +End Sub + +Private Sub cmdSunburst_Click() +Dim xlInvoice As Excel.Application +Dim strSBFile As String + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strSBFile = cdPO.FileName + + Set xlInvoice = Excel.Workbooks.Item(strSBFile) + +End Sub + +Private Sub cmdPrint_Click() +Dim intYN As Integer, intYN2 As Integer, strFILE As String +Dim intYN3 As Integer, strMSG As String, intYN4 As Integer, intYN5 As Integer +Dim intYN6 As Integer + + On Error GoTo Error_EH + + intYN3 = 0 + intYN = 0 + intYN2 = 0 + intYN4 = 0 + intYN5 = 0 +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 + + strMSG = "Answer YES to Print Checklist by Stock #" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN3 = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Stock #") +' intYN3 = MsgBox("Do You Want To Print A CheckList by Stock #", vbQuestion + vbYesNo, "Print Checklist") + If intYN3 = vbNo Then + strMSG = "Answer YES to Print Checklist by Description" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Description") +' intYN = MsgBox("Do You Want To Print A CheckList by Description", vbYesNo, "Print Checklist") + End If +' If intYN = vbNo Then + If intYN = vbNo And intYN3 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN4 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Stock #") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Description Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN5 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Description") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo And intYN5 = vbNo Then + strMSG = "Answer YES to Print A Checklist With Barcodes in Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO To Exit Without Printing Anything" + intYN6 = MsgBox(strMSG, vbQuestion + vbYesNo, "Barcodes by Stock No.") + End If +' End If +' If intYN5 = vbNo Then +' Exit Sub +' End If + + If intYN3 = vbYes Then + strFILE = "\POCheckSTK.rpt" + End If + If intYN = vbYes Then + strFILE = "\POCheckDESC.rpt" + End If + If intYN4 = vbYes Then + strFILE = "\POCheckNoZero.rpt" + End If + If intYN5 = vbYes Then + strFILE = "\POCheckNoZeroD.rpt" +' ElseIf intYN5 = vbNo Then +' Exit Sub + End If + If intYN6 = vbYes Then + strFILE = "\POCheckCP.rpt" + ElseIf intYN6 = vbNo Then + Exit Sub + End If + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + crPO.ReportFileName = App.Path & strFILE + crPO.GroupSelectionFormula = "{tblPOlist.User}= '" & gstrLOGIN & "'" +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPromo_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Promo Detail - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmPromo.Show 1 + +End Sub + +Private Sub cmdSales_Click() + frmInvUsed.Show 1 + Call Inventory2Load +End Sub + +Private Sub cmdTEST2_Click() + frmInvAdd2.Show 1 + Call Inventory2Load + +End Sub + +Private Sub lstInventory_Click() + +'Dim intTEST As Integer + +' intTEST = lstInventory.ListIndex + +' lblCount1 = mintCnt1 +' lblCount2 = mintCnt2 + +' DoEvents +' lblTest = intTEST +' inttext = lstInventory.ListIndex +' mintBOOKMARK12 = lstInventory.ListIndex ' = mintbookmark12 +End Sub + +Private Sub mnuAddInvO_Click() + Call cmdTest_Click + Call Inventory2Load +End Sub + +Private Sub mnuAddS_Click() + + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmInvStore.Show 1 + Call Inventory2Load +End Sub + +Private Sub mnuAddV_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + Call mnuAddInvO_Click +End Sub + +Private Sub mnuCreate2_Click() + lblBegSelect.Visible = False + lblEndSelect.Visible = False + txtEndSelect.Visible = False + txtBegSelect.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + cboVendor.Action = 6 + Call VendLoad + lblSelectVend.Visible = True + cboVendor.Visible = True + cboVendor.SetFocus +End Sub + +Private Sub VendLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCITY As String, strVEND As String, strPHONE As String, strFAX As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCITY As Long, lngVEND As Long, lngPHONE As Long, lngFAX As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "APMSD" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + cboVendor.Clear + cboVendor.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngRECORD = d4field(db, "AP_FIELD01") + strCode = Trim(f4str(lngRECORD)) + If strCode = "Y" Then + With cboVendor + lngNAME = d4field(db, "AP_NAME") + lngVEND = d4field(db, "AP_VENDOR") + strNAME = f4str(lngNAME) + strVEND = f4str(lngVEND) + .AddItem "A" & vbTab & strVEND & vbTab & strNAME '& vbTab & strCITY & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + End With + End If + End If + rc = d4skip(db, 1) + oSTATUS = rc + Loop While rc = r4success + End If + + rc = d4close(db) + + cboVendor.SortState = SortStateActiveReSort + If cboVendor.ListCount Then + cboVendor.ListIndex = 0 + Else + MsgBox "No Vendors Were Found", vbInformation + vbOKOnly, "No Vendors" + End If +' cboVendor.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module VendLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuHelp_Click() +Dim strMSG As String + +' strMSG = "Ctrl-O = Show A List Of All Purchases For The Highlited Item" & vbCrLf +' strMSG = strMSG & " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = strMSG & " F5 = Reload The Inventory List (Will Update Any Changes Made" & vbCrLf + strMSG = strMSG & "F11 = Move The Highlite Line To The Same Place As The Before The Last Action" & vbCrLf + strMSG = strMSG & "Ctrl-G = Show A List Of All Vendors For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-K = Set Order Qty To Zero For All Items In The PO List (Must ReEnter" & vbCrLf + strMSG = strMSG & "Ctrl-D = Display A List Of Every PO That The Highlited Item Was Deleted" & vbCrLf + strMSG = strMSG & "Ctrl-H = Update The Cost For The Highlighted Item In The Order List" & vbCrLf + strMSG = strMSG & "Ctrl-O = Display A List Of Every PO That Was Placed For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-U = ReCalc The OnOrder Amount For The Item That Is Higlighted In The CMS Inventory List" & vbCrLf + strMSG = strMSG + + MsgBox strMSG, vbOKOnly, "Information Screen" +End Sub + +Private Sub mnuRenumber_Click() + frmInvtry3.Show 1 +End Sub + +Private Sub mnuUpDesc_Click() + Call cmdFixDesc_Click +End Sub + +Private Sub F5On() + lblWAIT.caption = "Press F5 To Show Updates" + lblWAIT.Visible = True + DoEvents +End Sub + +Private Sub F5Off() + lblWAIT.Visible = False + lblWAIT.caption = "Please Wait" + DoEvents +End Sub + +Private Sub cmdUpVendor_Click() +Dim ARCode As Long, oSTATUS As Long, lngVENDOR As Long +Dim strSQL As String, strFILE As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strVENDOR As String, dblALIAS As Double + + On Error GoTo Error_EH + + frmVendor.Show 1 +' DoEvents + mstrSTOCK = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "IN_VENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdUpVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + + +End Sub + +Private Sub mnuUpWgt_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.Col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Package Weight For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD07") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpWgt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuUpCase_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.Col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Units Per Case For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD08") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 +' On Error Resume Next +' DoEvents + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpCase" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +' mnuRenumber.Visible = False + If gstrLOGIN = "DWW" Then + frmPO.WindowState = 0 + frmPO.Left = 2 + frmPO.Top = 2 + frmPO.Height = 9600 + frmPO.Width = 12000 + cmdAPAR.Visible = True +' mnuRenumber.Visible = True + End If + If gstrLOGIN = "KLB" Then + chkByDesc = vbChecked + Else + chkByDesc = vbUnchecked + End If + If gstrLOGIN = "CCP" Then + cmdAPAR.Visible = True + End If +' If chkNoDisplay = vbUnchecked Then +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +' End If + If gboolInvList Then + chkHistory = vbChecked + Else + chkHistory = vbUnchecked + End If + frmPO.lblUser = "User: " & gstrLOGIN + +' txtBegSelect = "" +' frmPO.Width = 12000 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) +Dim strControl As String + + strControl = frmPO.ActiveControl.name +' If Screen.ActiveControl <> "cboVendor" Then + If strControl <> "cboVendor" Then +' If frmPO.ActiveControl <> frmPO.cboVendor Then + If KeyAscii = 27 Then + KeyAscii = 0 + Unload Me + End If + End If + +End Sub + +Private Sub Form_Load() +Dim strSQL As String, strAV As String + mboolALIASFOUND = False +' frmPO.Height = 8760 + + strAV = "SELECT * FROM tblAV ORDER BY StockNo, Vendor" + Set moRSAV = New Recordset + moRSAV.Open strAV, goConn, adOpenDynamic, adLockOptimistic + + mintCnt1 = 0 + mintCnt2 = 0 + lblCount1 = mintCnt1 + lblCount2 = mintCnt2 + + Call InventoryLoad + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set moRSPOList = New Recordset + moRSPOList.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + cboSort.ListIndex = gbytPOSort +' cboSort.ListIndex = 0 + If moRSPOList.RecordCount > 0 Then + Call Inventory2Load + End If + frmPO.caption = frmPO.caption & " -- " & gstrCOMPANY & " -- " & gstrLOGIN + frmPO.Width = 12000 + frmPO.Height = 9600 + If gstrLOGIN = "DWW" Then +' cmdPromo.Visible = True +' mnuAddInv.Visible = True + Else +' mnuAddInv.Visible = False + End If + mbytSort = cboSort.ListIndex +' If gboolConn3Bad Then +' MsgBox "History Files From All Stores Are Not Available - Call Darv", vbOKOnly, "No History" +' End If +' mnuAddInv +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double +Dim dblMIN As Double, dblMAX As Double, dblAVAILABLE As Double +Dim dblOrder As Double, intYN As Integer, strMSG As String, intWHOLE As Integer +Dim dblLASTCOST As Double, dblRETAIL1 As Double, dblBUYCON As Double, intREM As Integer +Dim dblONORDER As Double, dblALLTOTAL As Double, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim strWeight As String, strONHAND As String, dblSTDCST As Double + + + On Error Resume Next + intYN = vbYes + lstInventory.Col = 0 + strINVNO = lstInventory.ColText + lstInventory.Col = 1 + strDESC = lstInventory.ColText + lstInventory.Col = 2 + strVEND = lstInventory.ColText + lstInventory.Col = 3 + strTYPE = lstInventory.ColText + lstInventory.Col = 4 + dblMIN = lstInventory.ColText + lstInventory.Col = 5 + dblMAX = lstInventory.ColText + lstInventory.Col = 6 + dblAVAILABLE = lstInventory.ColText + lstInventory.Col = 10 + dblONORDER = lstInventory.ColText + lstInventory.Col = 11 + dblWEIGHT = lstInventory.ColText + strWeight = lstInventory.ColText +' strWeight = dblWEIGHT + dblALLTOTAL = dblONORDER + dblAVAILABLE + If dblALLTOTAL < dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + Else + dblOrder = 0 + End If + + lstInventory.Col = 7 + dblLASTCOST = lstInventory.ColText + lstInventory.Col = 8 + dblRETAIL1 = lstInventory.ColText + lstInventory.Col = 9 + dblBUYCON = lstInventory.ColText + intREM = dblOrder Mod dblBUYCON + lstInventory.Col = 13 + strLOrder = lstInventory.ColText + lstInventory.Col = 14 + strLPur = lstInventory.ColText + lstInventory.Col = 15 + strLSALE = lstInventory.ColText + lstInventory.Col = 18 + strONHAND = lstInventory.ColText + lstInventory.Col = 19 + dblSTDCST = lstInventory.ColText + + If NoDups2("tblPOList", "Inv_No", strINVNO, gstrLOGIN) Then +' intWHOLE = 0 + + Else + MsgBox "You Already Have This Item in This PO", vbCritical + vbOKOnly, "Duplicate Item" + Exit Sub + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON 'THis makes the order be in full cases/bundles + End If + + If dblOrder <= 0 Then + strMSG = "The Hi-Lited Stock Item Has An Order Quantity Of Zero Or Less" + strMSG = strMSG & Chr(10) & "Do You Want To Order Anyway?" + + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Order Zero or Less") + End If + If intYN = vbYes Then + moRSPOList.AddNew + moRSPOList!inv_no = Field2Str(strINVNO) + moRSPOList!Description = Field2Str(strDESC) + moRSPOList!VENDOR = Field2Str(strVEND) + moRSPOList!Type = Field2Str(strTYPE) + moRSPOList!Min = dblMIN + moRSPOList!Max = dblMAX + moRSPOList!OnOrder = dblONORDER + moRSPOList!Available = dblALLTOTAL +' moRSPOList!Available = dblAVAILABLE + moRSPOList!Order = dblOrder + moRSPOList!OnHand = strONHAND + moRSPOList!LastCost = dblLASTCOST + moRSPOList!Retail1 = dblRETAIL1 + moRSPOList!Weight = dblWEIGHT + moRSPOList!User = gstrLOGIN + moRSPOList!LastOrder = strLOrder + moRSPOList!LastPurchase = strLPur + moRSPOList!LastSale = strLSALE + moRSPOList!StdCost = dblSTDCST + moRSPOList.Update + End If + + Call Inventory2Load + lstProcess.ListIndex = lstProcess.ListCount - 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Inventory2Load() +Dim oSTATUS As Long +Dim oRS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long, dblTotalWgt As Double, dblPOTotal As Double +Dim intYN As Integer, strYN As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lstProcess.Clear + lstProcess.SortState = SortStateSuspend + Do Until oRS.EOF +' intYN = Field2CheckBox(oRS!FixAV) +' If intYN = vbChecked Then +' strYN = "UV" +' Else +' strYN = " " +' End If + lstProcess.AddItem Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!Description) & vbTab & Field2Str(oRS!VENDOR) & vbTab & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!Min) & vbTab & Field2Str(oRS!Max) & vbTab & Field2Str(oRS!Available) & vbTab & Field2Str(oRS!Order) & vbTab & Field2Str(oRS!LastCost) & vbTab & Field2Str(oRS!ListID) & vbTab & Field2Str2(oRS!Weight) & vbTab & Field2Str(oRS!LastOrder) & vbTab & Field2Str(oRS!LastPurchase) & vbTab & Field2Str(oRS!LastSale) & vbTab & Format(Field2Str(oRS!Retail1), "#,#0.00") & vbTab & Format(Field2Str(oRS!StdCost), "#,#0.00") + dblTotalWgt = dblTotalWgt + (Field2Str2(oRS!Weight) * Field2Str2(oRS!Order)) + dblPOTotal = dblPOTotal + (Field2Str2(oRS!Order) * Field2Str(oRS!LastCost)) + oRS.MoveNext + Loop +' End If + + oRS.Close + +' If lstProcess.ListCount Then +' lstProcess.ListIndex = 0 +' End If + lstProcess.SortState = SortStateActiveReSort + txtWeight = Format(dblTotalWgt, "#,#") + txtPOTotal = Format(dblPOTotal, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module Inventory2Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer, intBOOKMARK9 As Integer +Dim strSQL As String, oRS As Recordset, intORDER As Integer +Dim boolPOLIST As Boolean, boolPOOrder As Boolean, strNNCOST As String +Dim strNCOST As String, oRSF As Recordset, strSQLF As String, lngListID As Long +Dim strSTDCST As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyF11 Then ' Display key combinations. + lstInventory.ListIndex = mintBOOKMARK12 + lstProcess.ListIndex = mintBOOKMARK13 + End If + + If KeyCode = vbKeyF5 Then ' Display key combinations. + Call F5Off + mintBOOKMARK12 = lstInventory.ListIndex + lblWAIT.caption = "Reloading Inventory" + lblWAIT.Visible = True + DoEvents + Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK12 + lblWAIT.Visible = False + lblWAIT.caption = "Please Wait" + End If + + If KeyCode = vbKeyF12 Then ' Display key combinations. +' If CtrlDown Then +' If gbytSECURITY <> 2 Then +' If gstrLOGIN = "DWW" Then + lstInventory.Col = 17 + gstrIMAGE = Trim$(lstInventory.ColText) + If Len(gstrIMAGE) > 0 Then + frmImage.Show 1 + Else + MsgBox "No Image File Is Available", vbOKOnly, "No Image" + Exit Sub + End If + +' Call cmdTest_Click +' Call Inventory2Load +' Call UpdatePRList +' End If +' End If + Exit Sub + End If + + If KeyCode = vbKeyQ Then ' Same as adding inventory from another store. + If CtrlDown Then +' If gbytSECURITY <> 2 Then + If gstrLOGIN = "DWW" Then +' Call cmdTest_Click + frmInvStore.Show 1 + Call Inventory2Load +' Call UpdatePRList + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyG Then ' And gbytSECURITY < 3 Then ' Display Alternate Vendors + If CtrlDown Then + txtOrderQty.SetFocus + DoEvents + mintBOOKMARK3 = lstInventory.ListIndex + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + lstInventory.Col = 0 + gstrSTOCK = CStr(lstInventory.ColText) + lstInventory.Col = 1 + gstrDESC = CStr(lstInventory.ColText) + lstInventory.SortState = SortStateSuspend + frmVendAlt.Show 1 +' Call InventoryLoad + lstInventory.SortState = SortStateActive + lstInventory.ListIndex = mintBOOKMARK3 + KeyCode = vbKeyF5 + DoEvents + KeyCode = vbKeyF11 + DoEvents + End If + Exit Sub + End If + + If KeyCode = vbKeyO Then ' And gbytSECURITY < 3 Then ' Show where the highlited items has been purchased + +' If chkNoDisplay = vbUnchecked Then +' chkNoDisplay = vbChecked +' End If + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + If CtrlDown Then + If chkHistory = vbChecked Then + lstInventory.Col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.Col = 1 + gstrDESC = lstInventory.ColText + lstInventory.Col = 2 + gstrVENDOR = lstInventory.ColText + lstInventory.Col = 9 + gstrAVAIL = lstInventory.ColText + lstInventory.Col = 10 + gstrOrderAmt = lstInventory.ColText + lstInventory.Col = 19 + gdblSTDCST = lstInventory.ColText + intBOOKMARK9 = lstInventory.ListIndex + frmOnOrder2.Show 1 + lstInventory.ListIndex = intBOOKMARK9 + Else + lstProcess.Col = 0 + gstrONORDER = lstProcess.ColText + lstProcess.Col = 1 + gstrDESC = lstProcess.ColText + lstProcess.Col = 2 + gstrVENDOR = lstProcess.ColText + intBOOKMARK9 = lstProcess.ListIndex + frmOnOrder2.Show 1 + lstProcess.ListIndex = intBOOKMARK9 + End If + End If +' lstInventory.ListIndex = mintBOOKMARK12 + KeyCode = vbKeyF11 + DoEvents + Exit Sub + End If + +' If KeyCode = vbKeyL Then ' And gbytSECURITY < 3 Then ' Display key combinations. + +' If CtrlDown Then +' lstProcess.Col = 0 +' gstrONORDER = lstProcess.ColText +' lstProcess.Col = 1 +' gstrDESC = lstProcess.ColText +' lstProcess.Col = 2 +' gstrVENDOR = lstProcess.ColText +' intBOOKMARK9 = lstProcess.ListIndex +' mintBOOKMARK5 = lstInventory.ListIndex +' frmOnOrder2.Show 1 +' lstProcess.ListIndex = intBOOKMARK9 +' lstInventory.ListIndex = mintBOOKMARK5 +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyD Then ' And gbytSECURITY < 3 Then ' Show items deleted + If CtrlDown Then + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK5 = lstInventory.ListIndex + lstInventory.Col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.Col = 1 + gstrDESC = lstInventory.ColText + lstInventory.Col = 2 + gstrVENDOR = lstInventory.ColText + mintBOOKMARK5 = lstInventory.ListIndex + frmOnOrder3.Show 1 + lstInventory.ListIndex = mintBOOKMARK5 + End If + KeyCode = vbKeyF11 + Exit Sub + End If + + If KeyCode = vbKeyK Then ' Changes the Order QTY to 0 - Must reEnter the Desired Qty + If CtrlDown Then +' strSQL = "UPDATE tblPOList SET Order = 0" 'WHERE User = '" & gstrLOGIN & "'" +' goConn.Execute strSQL + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF +' intORDER = Field2Str2(oRS!Order) + oRS!Order = 0 + oRS.Update + oRS.MoveNext + Loop + Call Inventory2Load + lstProcess.ListIndex = 0 + End If + Exit Sub + End If + + If KeyCode = vbKeyA Then + If CtrlDown Then + + End If + End If + + If KeyCode = vbKeyW Then + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.Col = 8 + strNCOST = lstProcess.ColText + lstProcess.Col = 9 + lngListID = Field2Str2(lstProcess.ColText) + lstProcess.Col = 15 + strSTDCST = Field2Str2(lstProcess.ColText) + If strSTDCST = "0" Then + MsgBox "BuyIn Price Cannot Be Zero", vbOKOnly, "Price = 0" + Exit Sub + End If +' strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) +' If strNCOST = "" Then +' MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" +' Exit Sub +' End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strSTDCST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + + End If + End If + If KeyCode = vbKeyH Then '** UpDate the Last Cost for the highlighted item + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.Col = 8 + strNCOST = lstProcess.ColText + lstProcess.Col = 9 + lngListID = Field2Str2(lstProcess.ColText) + strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) + If strNCOST = "" Then + MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" + Exit Sub + End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strNCOST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + End If + End If + + If KeyCode = vbKeyU Then 'UPdates The On Order Amount for the highlited item + If CtrlDown Then + If lstInventory.ListIndex = -1 Then + MsgBox "Select An Item From The Inventry List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstInventory.ListIndex + lblWAIT.Visible = True + lblWAIT.caption = "ReCalculate On Order" + DoEvents + Call ChgONOrder + Call FixONOrder + lstInventory.Refresh + lblWAIT.Visible = False + lblWAIT.caption = "Please Wait" + lstInventory.ListIndex = mintBOOKMARK12 + End If + End If + End If + +End Sub + +Private Sub lstProcess_Click() +Dim oRS As Recordset, oRSU As Recordset, strSQLL As String, strTIP2 As String, strTIP As String +Dim strSQL As String, strSTOCK As String, strDESC As String, dblQTY As Double, strNA As String +Dim strLOrder As String, strLPur As String, strLSALE As String ' strNA As String +Dim sglSTDCST As Single + + lstCompare.Clear + lstHistory.Clear +' lstProcess.TextTipDelay = 50 + lstProcess.Col = 0 + mstrFStock = lstProcess.ColText + lstProcess.Col = 9 + strSTOCK = lstProcess.ColText + lblMessage = "" + lblMessage.Visible = False + lblTest = "" +' strSTOCK = lstProcess.ColText + strNA = "N/A" + + If strSTOCK <> "" Then + strSQL = "SELECT * FROM tblPOList WHERE ListID = " & strSTOCK ' & """" + + Set moRSUpdate = New Recordset + moRSUpdate.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lblStock = moRSUpdate!inv_no + lblShowDesc = moRSUpdate!Description + txtOrderQty = moRSUpdate!Order + lblOrderHold = moRSUpdate!Order + strLOrder = Field2Str(moRSUpdate!LastOrder) + strLOrder = Format(strLOrder, "####/##/##") + strLPur = Field2Str(moRSUpdate!LastPurchase) + strLPur = Format(strLPur, "####/##/##") + strLSALE = Field2Str(moRSUpdate!LastSale) + strLSALE = Format(strLSALE, "####/##/##") + sglSTDCST = Field2Str2(moRSUpdate!StdCost) + sglSTDCST = Format(sglSTDCST, "#,#0.00") + lblTest = "Last Order - " & Trim(strLOrder) & vbCrLf + lblTest = lblTest & "Last Purchase - " & Trim(strLPur) & vbCrLf + lblTest = lblTest & "Last Sale - " & Trim(strLSALE) & vbCrLf + If sglSTDCST > 0 Then + lblTest = lblTest & "Buyin Amt - " & Format(sglSTDCST, "#,#0.00") + End If +' lblTest = lblTest & "Std Cost - " & sglSTDCST + +' If Not gboolConn3Bad Then + Call GetTSSHist + Call GetAFNHist + Call GetAFSHist +' Else +' MsgBox "History Files From All Store Not Available - Call Darv", vbOKOnly, "No History" +' End If + + If gstrCOMPANY = "TSS" Then + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFN" Then + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFS" Then + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + End If + +' lblMessage.Visible = True +' lblMessage = strTIP + If lstProcess.ListCount <> 0 Then + If gstrCOMPANY = "TSS" Then +' If Not gboolConn3Bad Then + Call GetAFN + Call GetAFS +' Else + +' End If + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + End If + + If gstrCOMPANY = "AFN" Then + Call GetTSS + Call GetAFS + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + + End If + + If gstrCOMPANY = "AFS" Then + Call GetAFN + Call GetTSS + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + End If + End If + +' lstProcess.ToolTipText = strTIP2 + mintBOOKMARK2 = lstProcess.ListIndex + txtOrderQty.SetFocus + + End If +End Sub + +Private Sub lstProcess_DblClick() +Dim strSQL As String, strINVNO As String +Dim oRS As Recordset, intBookmark As Integer + lblMessage.Visible = False + lblTest = "" + txtOrderQty = "" + lstProcess.Col = 0 + strINVNO = lstProcess.ColText + intBookmark = lstProcess.ListIndex + +' strSQL = "SELECT * FROM tblPOList WHERE Inv_No = '" & Trim(strINVNO) & "'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then + moRSUpdate.Delete +' End If + Call Inventory2Load + If intBookmark >= lstProcess.ListCount Then + intBookmark = lstProcess.ListCount - 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus +End Sub + +Private Sub cmdSetDate_Click() +Dim strMSG As String, intYN As Integer +Dim strBEGDATE As String +Dim strENDDATE As String +Dim intMONTH As Integer, intYEAR As Integer + + strMSG = "Enter the beginning date for Inventory Calculations (MM/DD/YYYY)" + lblBegDate.Visible = True + lblEndDate.Visible = True + lblBegDate2.Visible = True + lblEndDate2.Visible = True + lblBegDate2 = "" + lblEndDate2 = "" + intMONTH = Month(Date) + intYEAR = Year(Date) + intYN = MsgBox("Do You Want To Set The Dates At The Last 30 Days?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBEGDATE = Date - 30 + strENDDATE = Date + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Fiscal Year (Oct-Sep)?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + If intMONTH >= 10 Then + strBEGDATE = "10/01/" & Trim(str(intYEAR - 1)) & "" + strENDDATE = "09/30/" & Trim(str(intYEAR)) & "" + Else + strBEGDATE = "10/01/" & Trim(str(intYEAR - 2)) & "" + strENDDATE = "09/30/" & Trim(str(intYEAR - 1)) & "" + End If + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Year?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBEGDATE = Date - 365 + strENDDATE = Date + GoTo FixDate + End If + strBEGDATE = InputBox(strMSG, "Beginning Date") + If IsDate(strBEGDATE) Then + + Else + If Len(strBEGDATE) > 0 Then + strBEGDATE = Format(strBEGDATE, "00/00/####") + If Not IsDate(strBEGDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Inventory Calculations (MM/DD/YYYY)" + strENDDATE = InputBox(strMSG, "Ending Date") + + If IsDate(strENDDATE) Then + + Else + If Len(strENDDATE) > 0 Then + strENDDATE = Format(strENDDATE, "00/00/####") + If Not IsDate(strENDDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If +FixDate: + lblBegDate2 = strBEGDATE + lblEndDate2 = strENDDATE + mstrBEGDATE = Year(strBEGDATE) & "/" & Format(Month(strBEGDATE), "00") & "/" & Format(Day(strBEGDATE), "00") + mstrENDDATE = Year(strENDDATE) & "/" & Format(Month(strENDDATE), "00") & "/" & Format(Day(strENDDATE), "00") + strENDDATE = "" +End Sub + +Private Sub mnuBegDate_Click() +Dim strMSG As String, intYN As Integer, intYN2 As Index, intYN3 As Integer + + intYN = MsgBox("Do You Want The Last Week", vbQuestion + vbYesNo) + + If intYN = vbYes Then + txtBegDate = Date - 8 + txtEndDate = Date - 1 + End If + strMSG = "Enter the beginning date for Purchase Order Calculations (MM/DD/YYYY)" + txtBegDate = InputBox(strMSG, "Beginning Date", txtBegDate) + + If IsDate(txtBegDate) Then + + Else + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Purchase Order Calculations (MM/DD/YYYY)" + + txtEndDate = InputBox(strMSG, "Ending Date", txtEndDate) + If IsDate(txtEndDate) Then + + Else + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +End Sub + +Private Sub mnuBegin_Click() + Call cmdSetBeg_Click +End Sub + +Private Sub mnuClear_Click() + Call cmdClear_Click +End Sub + +Private Sub mnuCPet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Central Pet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CEN500" +' !VENDOR = "CENTPET" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CENTPET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then +' mstrVENDOR = "CENTPET" + mstrVENDOR = "CEN500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CENTPET" + End If + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuTVet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + If strCKStock = "" Then + strCKStock = strCKVStock + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "THOMVET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "THOMVET" + End If + Call GetStock + Call TVPO +' Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuTVet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuEagle_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strInv_No As String, strV_Stock As String +Dim intLength As Integer, boolINVOICE As Boolean, boolDATE As Boolean +Dim strINVOICE As String, strINVDATE As String +Dim strTEST1 As String, strTEST2 As String, strTEST3 As String, strTEST4 As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + + boolINVOICE = False + boolDATE = False + + strSQL = "DELETE * FROM tblEagle" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Eagle Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 + strSQL = "SELECT * FROM tblEagle ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + intLength = Len(strINPUT) + If intLength = 73 Then 'And Not boolINVOICE Then + strTEST4 = Mid(strINPUT, 1, 7) + If strTEST4 = "Cargill" Then + strINVOICE = Field2Str(Trim$(Mid(strINPUT, 64, 10))) + boolINVOICE = True + End If + End If + If intLength = 77 And Not boolDATE Then + strINVDATE = Field2Str(Trim$(Mid(strINPUT, 70, 8))) + boolDATE = True + End If + If intLength = 79 Then + strTEST1 = Mid(strINPUT, 1, 8) + strTEST2 = Mid(strINPUT, 77, 3) + strTEST3 = Mid(strINPUT, 35, 5) + If Not (strTEST1 = "Customer" Or strTEST1 = " Please ") Then 'Or Not strTEST2 = "LBS" Then + If Not strTEST2 = "LBS" Then + If Not strTEST3 = "STORE" Then + ' If Not Mid(strINPUT, 1, 8) = "Customer" Or Not Mid(strINPUT, 77, 3) = "LBS" Then + intSTART = 18 + With moRSInv + intAUX = 0 + intTAB = 10 'InStr(intSTART, strINPUT, Chr(9)) + strV_Stock = Field2Str(Trim$(Mid(strINPUT, intSTART, intTAB))) + If Trim(strV_Stock) <> "FS" Then + .AddNew + !VStock = strV_Stock + !VDesc = Field2Str(Trim$(Mid(strINPUT, 28, 25))) + intSTART = 1 + intTAB = 11 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = 53 'intSTART + intTAB + 1 + intTAB = 12 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !Invoice = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CAR400" + + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CARGANI" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = strINVDATE + .Update + + End If + End With + End If + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblEagle" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "CAR400" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CARGANI" + End If + Call GetStock + Call EAPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form PO - Module ImportEagle" + Call ErrorHandler2 + gstrMODULE = "" +End Sub + +Private Sub EAPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + +' On Error GoTo Error_EH + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblEagle" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!Invoice + + + Do Until oRS.EOF + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = oRS!lineno + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = Trim(Field2Str(oRS!inv_no)) + moRSPODetail!vstockno = oRS!VStock + moRSPODetail!Desc = Trim(oRS!Description) + strTEST = Left(Trim(oRS!Description), 4) +' moRSPODetail!qty = dblQORDER + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!Weight = Field2Str2(oRS!Weight) + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "CAR400" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CAR400" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CARGANI" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CARGANI" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "ANDREW" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module EAPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuLabels_Click() + frmLabels.Show 1 +End Sub + +Private Sub mnuLextron_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblLextron" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Lextron Invoice Date MM/DD/YYYY", "Invoice Date", Date) + strPONUM = InputBox("Enter the Orginal PO Number", "PO Number") + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblLextron ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT +' If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, 10))) + intSTART = 14 + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, 30))) + intSTART = 56 + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, 6))) + intSTART = 61 + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, 9))) + intSTART = 70 + !lineno = intLINENO + intLINENO = intLINENO + 1 + !VENDOR = "LEX500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblLextron" + Call GetStock + Call LEXPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + Close #1 +End Sub + +Private Sub mnuCreate_Click() +Dim intYN As Integer, intYN2 As Integer, strFILE As String, intYN3 As Integer +Dim intOK As Integer, intOK2 As Integer, strMSG As String + + On Error GoTo Error_EH + + gstrMODULE = "Point 1 " +' lstInventory.SetFocus + Call POCreate + gstrMODULE = gstrMODULE & "Point 2 " + If mintYN = vbNo Then + Exit Sub + End If + gstrMODULE = gstrMODULE & "Point 3 " +' If gstrLOGIN = "DWW" Then + If gboolPOPrint Then + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton2, "Print PO") ', , vbDefaultButton2) + Else + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton1, "Print PO") ', , vbDefaultButton2) + End If +' intYN = MsgBox("Do You Want To Print A PO Now", vbYesNo, "Print PO", , vbDefaultButton2) + If intYN = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 ' &H40 + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + intYN3 = MsgBox("Do You Want To Use Vendor Stock #'s", vbYesNo, "Use Vendor Stock") + If intYN3 = vbYes Then +' If Not chkByDesc Then + If chkByDesc = vbUnchecked Then + strFILE = "\POVend.rpt" + Else + strFILE = "\POVDesc.rpt" + End If + Else + If chkByDesc = vbUnchecked Then + strFILE = "\PO.rpt" + Else + strFILE = "\PODesc.rpt" + End If + End If + crPO.ReportFileName = App.Path & strFILE + crPO.GroupSelectionFormula = "{tblPOHeader.PONum}=" & glngPO +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 ' &H40 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 + End If + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form PO - Module mnuCreate" + Call ErrorHandler2 + gstrMODULE = "" +' Close #1 +End Sub + +Private Sub mnuEnding_Click() + Call cmdSetEnd_Click + +End Sub + +Private Sub mnuExit_Click() + Unload Me +End Sub + +Private Sub mnuMinMax_Click() + mboolALL = False + +' strMSG = "Do You Want To Update CMS OnOrder Amount Before Creating The New PO?" +' strMSG = strMSG & Chr(10) & "This May Take As Long As 2 Minutes To Run" +' intOK = MsgBox(strMSG, vbYesNo, "Update ONORDER") +' If intOK = vbYes Then +' Call cmdZeroOnOrd_Click +' Call cmdReCalc_Click +' ElseIf intOK = vbNo Then + +' End If + + Call cmdPartial_Click +End Sub + +Private Sub mnuPOSSales_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" + strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad2 + Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub mnuSelALL_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Then 'Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select ALL For 1 Vendor Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" +' strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad3 +' Call SelectPartialLoad2 +' Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub CalcSales2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strSTOCK As String, strDATE As String +Dim strYEAR As String, strMONTH As String, strDAY As String, strBDATE As String +Dim strMSG As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + gboolVEND = True + + frmVendor.Show 1 + +' On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = Field2Str(oRS!inv_no) + strYEAR = Format(Year(txtBegDate), "0000") + strMONTH = Format(Month(txtBegDate), "00") + strDAY = Format(Day(txtBegDate), "00") + strBDATE = strYEAR + strMONTH + strDAY +' strDATE = txtBegDate + strSTOCK = mstrSTOCK + strBDATE + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strSTOCK) +' db = d4open(cb, fPath + strSQL) + +' rc = d4top(db) + +' lstInventory.SortState = SortStateSuspend +' If d4top(db) = r4success Then + +' Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + ' If dblAVAIL <= dblMIN Then + ' dblOrder = dblMAX - dblAVAIL '**************** + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + ' dblOrder = intWHOLE + End If + If dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !Available = dblALLTOTAL + ' !Available = dblAVAIL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + rc = d4skip(db, 1) + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(25), Chr(34), "") +''' test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) +''' dblQTY = Replace(strG(28), Chr(34), "") + dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If +''' strDESC = Replace(strG(26), Chr(34), "") + strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(37), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then +'' strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" +'' Set oRSS = New Recordset +'' oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock +'' If Not oRSS.EOF Then +'' strDiscCost = Replace(strF(3), Chr(34), "") +'' strNET = Mid$(strDiscCost, 1, 8) +'' If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) +'' bytLEN = Len(strDiscCost) +'' bytLEN2 = bytLEN - 8 +'' dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) +'' oRSS!Cost = Round(dblDCost, 4) +' oRS.Save +'' oRSS.Update +'' End If +'' End If +'' End If 'May Need To Comment Out + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina2_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") +'''' test0 = Replace(strF(25), Chr(34), "") + test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) + dblQTY = Replace(strG(28), Chr(34), "") +'''' dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strG(26), Chr(34), "") +'''' strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(36), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then + + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina1_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") + strSTOCK = Replace(strF(2), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" +' oRS!VENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) + bytLEN = Len(strDiscCost) + bytLEN2 = bytLEN - 8 + dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" +' mstrVENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina0126_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then + strCELL = Replace(strF(3), Chr(34), "") + strSTOCK = Mid$(strCELL, 1, 12) + strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then + dblDCost = Field2Str2(Right$(strDiscCost, 13)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub PurninaHold() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + If ExcelOpen() Then + ' Add New WorkBook + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) ' & "\JHDPrice.xls") + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If oRS.EOF Then + End If + ' Load data into Excel + intRow = 1 + Do Until boolCHECK +' Do Until strCHECK = "TLR10" +' Do Until boolSTOP + strTYPE = Trim$(.Cells(intRow, 1).value) + If strTYPE = "HDR10" Then + strINVOICE = Trim$(.Cells(intRow, 6).value) +' intRow = intRow + 1 + ElseIf strTYPE = "DTL10" Then + lngQTY = Round((.Cells(intRow, 5).value), 0) + If lngQTY > 0 Then + strCELL = Trim$(.Cells(intRow, 4).value) + strSTOCK = Mid$(strCELL, 1, 14) + strDESC = Mid$(strCELL, 16, 30) + dblCost = Round((.Cells(intRow, 6).value), 4) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + + End If + End If + intRow = intRow + 1 + strCHECK = .Cells(intRow, 1).value + If strCHECK = "TLR10" Then + intCHECK = 1 + End If + If strCHECK = "" And intCHECK = 1 Then + intCHECK = 2 + ElseIf strCHECK = "" And intCHECK = 2 Then + boolCHECK = True + ElseIf strCHECK = "HDR10" And intCHECK = 2 Then + intCHECK = 0 + End If + Loop + End With + oRS.Close + End If + goExcel.Quit + + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuReports_Click() + Call cmdReports_Click +End Sub + +Private Sub mnuThomp2_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !inv_no = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) +' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Order = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Cost = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Invoice = "" + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + Else + !VENDOR = "THOMVET" + End If + +' !VENDOR = "THO500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + Else + mstrVENDOR = "THOMVET" + End If +' mstrVENDOR = "THO500" + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuThomp" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuUpVendor_Click() + Call cmdUpVendor_Click +End Sub + +Private Sub txtBegSelect_GotFocus() + txtBegSelect.SelStart = 0 + txtBegSelect.SelLength = 1000 +End Sub + +Private Sub txtEndSelect_GotFocus() + txtEndSelect.SelStart = 0 + txtEndSelect.SelLength = 1000 +End Sub + +Private Sub txtOrderQty_Click() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + txtOrderQty.SetFocus +End Sub + +Private Sub txtOrderQty_GotFocus() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + +End Sub + +Private Sub txtOrderQty_KeyPress(KeyAscii As Integer) +Dim intBookmark As Integer + + If KeyAscii = vbKeyReturn Then +' MsgBox "THis is a test" + If txtOrderQty <> lblOrderHold Then + intBookmark = lstProcess.ListIndex + If IsNumeric(txtOrderQty) Then + moRSUpdate!Order = (txtOrderQty) + Else + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid Number" + moRSUpdate!Order = 0 + txtOrderQty.SetFocus + Exit Sub +' moRSUpdate!Order = 0 + End If + moRSUpdate.Update + txtOrderQty = "" + lblOrderHold = "" + Call Inventory2Load + If mintBOOKMARK2 >= lstProcess.ListCount - 1 Then + intBookmark = lstProcess.ListCount - 1 + Else + intBookmark = intBookmark + 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + Else + lstProcess.ListIndex = lstProcess.ListIndex + 1 +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + End If + End If +' txtOrderQty.SetFocus +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstInventory.SearchText = txtSearch.Text +lstInventory.SearchMethod = 2 +lstInventory.Action = ActionSearch +lstInventory.SearchIndex = -1 +lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_GotFocus() + txtSearch.SelStart = 0 + txtSearch.SelLength = 1000 +End Sub + +Private Sub POCreate() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Long +Dim lngPOID As Long, strOrderDate As String, strDueDate As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngAdd1 As Long +Dim lngAdd2 As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long, lngSTOCK As Long, lngONORDER As Long +Dim lngTTLWEIGHT As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strAdd2 As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String, dblCALCONORDER As Double +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double, dblONORDER As Double +Dim lngONHAND As Long, dblONHAND As Double, strBUYER As String +Dim dblEXT As Double, dblQORDER As Double, dblQCost As Double, strONHAND As String +Dim lngDueCtl As Long, lngDueDay As Long, lngDisCtl As Long, lngDisDay As Long +Dim lngDUECTL2 As Long, lngDUEDAY2 As Long, lngDISCTL2 As Long, lngDISDAY2 As Long +Dim lngAPCODE As Long, strAPCODE As String, intYNNote As Integer +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long, lngPOS As Long +Dim strYEAR As String, strMONTH2 As String, strDAY As String, strDATE As String +Dim lngODATE As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + intYNNote = vbNo + strYEAR = Year(Date) + strMONTH2 = Format(Month(Date), "00") + strDAY = Format(Day(Date), "00") + strDATE = strYEAR & strMONTH2 & strDAY + + gstrMODULE = "Before frmVendor.Show" + lngTTLWEIGHT = 0 + mintYN = vbYes +' frmVendorLook.Show 1 +' frmVendor.Show 1 + If gstrVENDOR = "" Then + MsgBox "No Vendor Selected", vbCritical + vbOKOnly, "No PO Created" + mintYN = vbNo + Exit Sub + End If +' On Error GoTo Error_EH + strOrderDate = InputBox("Enter The PO Order Date", "PO Order Date", Date) + + gstrMODULE = "Point 1 " + If IsDate(strOrderDate) Then + + Else +' lngPOS = InStr(1, strOrderDate, "/", 1) +' If lngPOS = 0 Then + If Len(strOrderDate) > 0 Then + strOrderDate = Format(strOrderDate, "00/00/####") + If Not IsDate(strOrderDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strDueDate = InputBox("Enter the Due Date for the PO", "PO Due Date", (Date + 1)) + + If IsDate(strDueDate) Then + + Else + If Len(strDueDate) > 0 Then + strDueDate = Format(strDueDate, "00/00/####") + If Not IsDate(strDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strBUYER = InputBox("Enter The Name Of The Person Creating The PO", "Buyer's Name", "This is Required") + If strBUYER = "This is Required" Or Trim$(strBUYER) = "" Then + MsgBox "You have entered an invalid Buyer -- NO PO WILL BE CREATED", vbCritical + vbOKOnly + mintYN = vbNo + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + Else + intYNNote = MsgBox("Do You Want To Add Notes To This PO?", vbYesNo + vbDefaultButton2, "Add Notes?") + + + End If + strBUYER = UCase(strBUYER) + gstrMODULE = "Point 2 " + + cb = code4init + lngPOLineNum = 1 + + strSQL = "Select * FROM tblProgInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = Field2Str2(oRS!NextPO) + glngPO = lngNextPO + oRS!NextPO = lngNextPO + 1 + oRS.Update + + strVENDOR = gstrVENDOR + + strSQL = "SELECT * FROM tblPOHeader" + + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + '******* + strSQL = gstrCOMPANY & "APMSD" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "AP_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR) + gstrMODULE = "Point 3 " + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngVEND = d4field(db, "AP_VENDOR") + lngNAME = d4field(db, "AP_NAME") + lngAdd1 = d4field(db, "AP_ADDR1") + lngAdd2 = d4field(db, "AP_ADDR2") + lngCITY = d4field(db, "AP_CITY") + lngState = d4field(db, "AP_STATE") + lngZIP = d4field(db, "AP_ZIP") + lngPHONE = d4field(db, "AP_PHONE") + lngFAX = d4field(db, "AP_FAX") + lngAPCODE = d4field(db, "AP_CODE") + lngDueCtl = d4field(db, "AP_DUECTL") + lngDisCtl = d4field(db, "AP_DISCTL") + lngDueDay = d4field(db, "AP_DUEDAY") + lngDisDay = d4field(db, "AP_DISDAY") + + strVEND = Field2Str(f4str(lngVEND)) + strNAME = f4str(lngNAME) + strAdd1 = f4str(lngAdd1) + strAdd2 = f4str(lngAdd2) + strCITY = f4str(lngCITY) + strState = f4str(lngState) + strZIP = f4str(lngZIP) + strPHONE = f4str(lngPHONE) + strFAX = f4str(lngFAX) + strAPCODE = f4str(lngAPCODE) + lngDUECTL2 = f4long(lngDueCtl) + lngDISCTL2 = f4long(lngDisCtl) + lngDUEDAY2 = f4long(lngDueDay) + lngDISDAY2 = f4long(lngDisDay) + + moRSPOHeader.AddNew + moRSPOHeader!ponum = lngNextPO +' moRSPOHeader!VendorID = Trim(gstrVENDOR) + moRSPOHeader!vendorid = Trim(strVEND) + moRSPOHeader!vendorname = Trim(strNAME) + moRSPOHeader!vaddress1 = Trim(strAdd1) + moRSPOHeader!vaddress2 = Trim(strAdd2) + moRSPOHeader!vcity = Trim(strCITY) + moRSPOHeader!vstate = Trim(strState) + moRSPOHeader!vzip = Trim(strZIP) + moRSPOHeader!VPhone = Trim(strPHONE) + moRSPOHeader!VFAX = Trim(strFAX) + moRSPOHeader!OrderDate = strOrderDate + moRSPOHeader!DueDate = strDueDate + moRSPOHeader!Buyer = strBUYER + moRSPOHeader!duectl = lngDUECTL2 + moRSPOHeader!disctl = lngDISCTL2 + moRSPOHeader!dueday = lngDUEDAY2 + moRSPOHeader!disday = lngDISDAY2 + moRSPOHeader!CreateID = gstrLOGIN + If Trim(strAPCODE) = "ACC" Then + moRSPOHeader!CCard = vbChecked + Else + moRSPOHeader!CCard = vbUnchecked + End If + moRSPOHeader.Update + End If +'' End If + rc = d4close(db) + + strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & lngNextPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + mstrAVENDOR = moRSPOHeader!vendorid + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + gstrMODULE = "Point 4 " + Do Until oRS.EOF +'************** + mstrSTOCK = Trim(oRS!inv_no) + strSQL = gstrCOMPANY & "INMAS" + gstrMODULE = "Point 5 " + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngODATE = d4field(db, "IN_LSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDATE) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDATE) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + '************** + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + If Field2Str2(oRS!Order) > 0 Then + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + ' mstrSTOCK = Trim(oRS!Inv_No) + ' If oRS!new = 1 Then + If oRS!New = True Then + moRSPODetail!vstockno = Field2Str(oRS!VStock) + ElseIf Len(Field2Str(oRS!VStock)) > 0 Then '***** This may need to be removed if it causes PO to not have a vendor stock number + moRSPODetail!vstockno = Field2Str(oRS!VStock) + Else + Call GETAVINFO + mstrADDVStock = Trim(mstrVSTOCK) + If Len(mstrADDVStock) = 20 Then + mstrADDVStock = "" + End If + moRSPODetail!vstockno = mstrADDVStock + End If + ' If Len(mstrADDVStock) = 20 Then + ' mstrADDVStock = "" + ' End If + ' moRSPODetail!vstockno = mstrADDVStock + moRSPODetail!Desc = Trim(oRS!Description) + moRSPODetail!BalQty = Field2Str2(oRS!Order) + moRSPODetail!Qty = Field2Str2(oRS!Order) + moRSPODetail!Cost = Field2Str2(oRS!LastCost) + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!Min = Field2Str2(oRS!Min) + moRSPODetail!Max = Field2Str2(oRS!Max) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!Add = oRS!New + ' moRSPODetail!Available = dblONORDER + moRSPODetail!CreateID = gstrLOGIN + moRSPODetail!PVendor = Field2Str(oRS!VENDOR) + moRSPODetail!StdCost = Field2Str2(oRS!StdCost) + moRSPODetail.Update + lngTTLWEIGHT = lngTTLWEIGHT + (Field2Str2(oRS!Order) * Field2Str2(oRS!Weight)) + End If + oRS.MoveNext + gstrMODULE = "Point 7 " + + Loop + + If intYNNote = vbYes Then + gboolNoteADD = True + frmPONotes.Show 1 + End If + + If glngPONID > 0 Then + moRSPOHeader!PONoteFlag = vbChecked + moRSPOHeader!PONID = glngPONID + moRSPOHeader.Update + End If + gstrMODULE = "Point 8 " + moRSPOHeader!TTLWEIGHT = lngTTLWEIGHT + moRSPOHeader!DetailLines = lngPOLineNum - 1 + + moRSPOHeader.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module POCreate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CPPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!Invoice + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CEN500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CEN500" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "JOE" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CENTPET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CENTPET" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "ERIC" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub TVPO() +Dim strSQL As String, oRS As Recordset, strTEST As String +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String + + On Error GoTo Error_EH + + +' GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + strTEST = Field2Str(oRS!VENDOR) + mstrCP_PO = oRS!Invoice + GoSub Set_Header + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module TVPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub GETAVINFO() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVENDOR") + Call d4tagSelect(db, lngCustTag) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc = d4seek(db, strVEND_STOCK) + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO3() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim oRSAV As Recordset, strSQLAV As String +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO, strTEST As String + + On Error GoTo Error_EH + +' cb = code4init + + strSQLAV = "SELECT * FROM tblAV WHERE STOCKNO = '" & Trim(mstrSTOCK) & "' AND VENDOR = '" & Trim(mstrAVENDOR) & "'" + Set oRSAV = New Recordset + oRSAV.Open strSQLAV, goConn, adOpenDynamic, adLockOptimistic + + + If Not oRSAV.EOF Then + mstrVSTOCK = Trim(Field2Str(oRSAV!VStock)) + Else + mstrVSTOCK = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO4() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db6 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db6, "INAVVENDOR") + Call d4tagSelect(db6, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc6 = d4seek(db6, strVEND_STOCK) + + oSTATUS = d4deleted(db6) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db6, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db6, "INAVVENDOR") + lngVSTOCK = d4field(db6, "INAVVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc6 = d4close(db6) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuSunburst_Click() + Dim intRow As Integer, boolSTOP As Boolean + Dim strLOCATE As String, strVDESC As String, strVSTOCK As String + Dim sglActQTY As Single, dblCost As Double + Dim oRS As Recordset + Dim strSQL As String, strPATH As String, dblPRICE5 As Double + Dim lngLINENO As Long + + Screen.MousePointer = vbHourglass + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + lngLINENO = 1 +' Call ExcelOpen +' Call ButtonReset + mnuSunburst.Enabled = False +' cmdGroup.Enabled = False +' lblMessage.caption = "Importing Excel Price List -- Please Wait" +' lblMessage.Visible = True + On Error GoTo Error_EH + + boolSTOP = False + If ExcelOpen() Then + ' Add New WorkBook + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblSUNBURST" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblSUNBURST" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' If oRS.EOF Then +' End If + ' Load data into Excel + intRow = 3 + Do Until boolSTOP + strVDESC = Trim$(.Cells(intRow, 7).value) + strVSTOCK = Trim$(.Cells(intRow, 8).value) + sglActQTY = (.Cells(intRow, 9).value) +' sglActQTY = Trim$(.Cells(intRow, 9).value) + dblCost = (.Cells(intRow, 10).value) + oRS.AddNew + oRS!VStock = strVSTOCK + oRS!VDesc = strVDESC + oRS!Order = sglActQTY + oRS!Cost = dblCost + oRS!VENDOR = "SUN750" + oRS!lineno = lngLINENO + oRS.Update +' End If + intRow = intRow + 1 + If .Cells(intRow, 7).value = "" Then + boolSTOP = True + End If + lngLINENO = lngLINENO + 1 + Loop + End With + oRS.Close + End If + goExcel.Quit + +' Call ButtonReset + mnuSunburst.Enabled = True +' cmdGroup.Enabled = True +' lblMessage.Visible = False + mstrTABLE = "tblSunburst" + + Call GetStock +' Call CPPO + + Screen.MousePointer = vbDefault + MsgBox "Sunburst Pet Import is Complete", vbInformation + vbOKOnly, "Import Complete" + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuSunburst" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LEXPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblLextron" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + Do Until oRS.EOF + + strINVOICE = Field2Str(oRS!Invoice) + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) +' mstrSTOCK = Trim(oRS!inv_no) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + moRSPODetail!Cost = oRS!Cost + moRSPODetail!ActCost = oRS!Cost + moRSPODetail!ActCostO = oRS!Cost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = oRS!Order + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail.Update + oRS.MoveNext + + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO +' moRSPOHeader!InvoiceNo = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "LEX500" + moRSPOHeader!vendorname = "Lextron Animal Health" + moRSPOHeader!vaddress1 = "C/O Lextron-TEXAN LLP" + moRSPOHeader!vaddress2 = "Department 1305" + moRSPOHeader!vcity = "Denver" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80256" + moRSPOHeader!VPhone = "800 292-5692" + moRSPOHeader!VFAX = "800 411-4412" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "BILL" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 10 + moRSPOHeader.Update + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETALTVEND() +Dim strSQL As String, oRS As Recordset + + strSQL = "SELECT * FROM tblAltVend WHERE Primary = '" & RTrim$(mstrAVENDOR) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrOldVendor = Field2Str(oRS!secondary) + End If +End Sub + +Private Sub GETAVINFO2() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db3 = d4open(cb, fPath + strSQL) +' lngCustTag = d4tag(db3, "INAVVSTOCK") + lngCustTag = d4tag(db3, "INAVVSTOCK") + + mstrSTOCK2 = mstrVSTOCK ' + mstrAVENDOR +' mstrSTOCK2 = mstrVSTOCK + mstrAVENDOR + + Call d4tagSelect(db3, lngCustTag) + + rc3 = d4seek(db3, mstrSTOCK2) + + + oSTATUS = d4deleted(db3) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db3, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrVSTOCK Then + lngVEND = d4field(db3, "INAVVENDOR") + lngVSTOCK = d4field(db3, "INAVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Or Trim(strVEND) = Trim(mstrOldVendor) Then + mstrSTOCK = f4str(lngVSTOCK) + mboolALIASFOUND = True + Else + mstrSTOCK = " " + mboolALIASFOUND = False + End If + End If + End If + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Recieve - Module GETAVINFO2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLabel_Click() +Dim oRS As Recordset +Dim strSQL As String, intCOUNT As Integer +Dim intQTY As Integer, strQTY As String +Dim strINVNO As String, strDESC As String, txtPRICE1 As String + + On Error GoTo Error_EH + + lstInventory.Col = 0 + strINVNO = lstInventory.ColText + lstInventory.Col = 1 + strDESC = lstInventory.ColText + lstInventory.Col = 8 + txtPRICE1 = lstInventory.ColText + intCOUNT = 0 + + strQTY = InputBox("How Many Labels Do You Want?", "Label Quantity", 1) + If strQTY = "" Then + MsgBox "Cancel Pressed", vbOKOnly + Exit Sub + End If + intQTY = Field2Str2(strQTY) + If intQTY <= 0 Then + intQTY = 1 + End If + strSQL = "SELECT * FROM tblLABELS2" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until intCOUNT = intQTY + oRS.AddNew + oRS!IN_STOCK = strINVNO + oRS!IN_DESC1 = Field2Str(strDESC) + oRS!IN_USER = gstrLOGIN + oRS!IN_PRICE1 = Format(Field2Str(txtPRICE1), "$#,#.00") + oRS!lbl_qty = 1 + intCOUNT = intCOUNT + 1 + oRS.Update + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form PO - Module cmdLabel" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PURPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, dblBUYCON As Double +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER BY CPID" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + oRS.MoveFirst + + mstrCP_PO = oRS!Invoice + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = lngPOLineNum + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(Field2Str(oRS!inv_no)) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) + moRSPODetail!vstockno = Field2Str(oRS!VStock) + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(Field2Str(oRS!Description)) + moRSPODetail!Qty = Field2Str2(oRS!Order) + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + If mstrVENDOR = "PUR500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "PUR500" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "PURIMIL" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!invoiceno = "" + moRSPOHeader!vendorid = "PURIMIL" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MANAGER" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module PURPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If +' dblONORDER = f4str(lngONORDER) +' strONORDER = Field2Str2(strONORDER) +' dblONORDER = CDbl(strONORDER) + +' dblQORDER = Field2Str2(oRS!Order) + +' dblCALCONORDER = dblONORDER + dblQORDER + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) +' Call f4assign(lngODATE, strDATE) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub UpONOrderHold() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + +' mstrSTOCK = Trim(oRS!Inv_No) + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then +' If strDESC = "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + ' mdblQORDER = Field2Str2(oRS!Order) + ' dblCALCONORDER = dblONORDER - mdblQORDER + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + End If + +End Sub + +Private Sub CalcSales() +Dim strSQL As String, oSTATUS As Long, strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAmount As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngQTY As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strNAME As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNEWDATE As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + strSQLL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + gboolVEND = False + + mstrBEGDATE = Year(txtBegDate) & Format(Month(txtBegDate), "00") & Format(Day(txtBegDate), "00") + mstrENDDATE = Year(txtEndDate) & Format(Month(txtEndDate), "00") & Format(Day(txtEndDate), "00") + + Do Until oRS.EOF + mstrCUSTOMER = Field2Str(oRS!inv_no) + + cb = code4init + + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrCUSTOMER) + Do Until rc <> r4success + oSTATUS = d4deleted(db) + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngNAME = d4field(db, "INHICV") + lngDOC = d4field(db, "INHIDOC") + lngINVDATE = d4field(db, "INHIDATE") + lngINVNO = d4field(db, "INHISOURCE") + lngRECORD = d4field(db, "INHIUNIQ") + lngType = d4field(db, "INHITYPE") + lngPRICE = d4field(db, "INHIPRICE") + lngQTY = d4field(db, "INHIQTY") + lngCOST = d4field(db, "INHICOST") + + strDOC = f4str(lngDOC) + strNAME = f4str(lngNAME) + If strNAME <> "" Then + If strNAME <> mstrCUSTNO Then + mstrCUSTNO = "" + mstrCUSTNAME = "" + mstrCUSTOMER2 = strNAME +' Call CustomerFind + End If + Else + mstrCUSTNO = "" + mstrCUSTNAME = "" + End If + strINVDATE = f4str(lngINVDATE) + strMONTH = date4month(strINVDATE) + Call date4format(strINVDATE, strNEWDATE, "CCYY/MM/DD") + dblPRICE = f4double(lngPRICE) + RSet strAmount = FormatCurrency(dblPRICE, 2) + strINVNO = f4str(lngINVNO) + lngPSHIREC = f4long(lngRECORD) + dblTYPE = f4double(lngType) + dblQTY = f4double(lngQTY) + dblCost = f4double(lngCOST) + dblTCOST = dblCost + If dblQTY > 0 Then + dblCost = dblCost / dblQTY + End If + RSet strCOST = FormatCurrency(dblCost, 2) + + If dblTYPE = 1 Then + strTYPE = "SUB" + If strINVDATE >= mstrBEGDATE And strINVDATE <= mstrENDDATE Then + If strINVNO = "PS" Or strINVNO = "OE" Or strINVNO = "AG" Then + dblSOLD = dblSOLD + dblQTY + End If + End If +' Else + ' strTYPE = "TRANS" + End If + End If + rc = d4seekNext(db, mstrCUSTOMER) + + Loop + rc = d4close(db) + oRS!Order = dblSOLD + oRS!usage = dblSOLD + If dblSOLD = 0 And chkZero Then + oRS.Delete + Else + oRS.Update + End If + oRS.MoveNext + dblQTY = 0 + dblSOLD = 0 + dblCost = 0 + dblTCOST = 0 + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdImportInv_Click() +Dim ARCode As Long, oSTATUS As Long +Dim lngSTOCKNO As Long, lngQTY As Long, lngDESC As Long +Dim strSTOCKNO As String, dblQTY As Double, strDESC As String +Dim strREGISTER As String, strFIND As String, strVENDOR As String, strVENDOR2 As String * 20 +Dim strSQL As String, strFILE As String, strMSG As String +Dim lngLCOST As Long, lngPRICE1 As Long, dblLCOST As Double, dblPRICE1 As Double +Dim lngVEND As Long +Dim lngWEIGHT As Long, dblWEIGHT As Double + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strNAME As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNEWDATE As String +Dim dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +Dim strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAmount As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long + + strSQL = "DELETE * FROM tblINMAS" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblINMAS" + Set moRSHAND = New Recordset + moRSHAND.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strVENDOR2 = Trim(txtBegSelect) + strFILE = gstrCOMPANY & "INMAS.DBF" + '"IN_VENDOR" + db = d4open(cb, fPath + strFILE) + + lngCustTag = d4tag(db, "IN_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR2) +' rc = d4seek(db, strINVSTOCK) + + If rc = r4success Then + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + lngSTOCKNO = d4field(db, "IN_STOCK") + lngQTY = d4field(db, "IN_ONHAND") + lngDESC = d4field(db, "IN_DES") + lngLCOST = d4field(db, "IN_LSCOST") + lngPRICE1 = d4field(db, "IN_PRICE1") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strSTOCKNO = f4str(lngSTOCKNO) + strSTOCKNO = Trim$(strSTOCKNO) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblQTY = f4double(lngQTY) + dblLCOST = f4double(lngLCOST) + dblPRICE1 = f4double(lngPRICE1) + strDESC = f4str(lngDESC) + strVENDOR = f4str(lngVEND) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If Trim$(strVENDOR) = Trim$(txtBegSelect) Then + ' strFIND = "STOCKNO = '" & strSTOCKNO & "'" + moRSHAND.AddNew + moRSHAND!StockNo = Field2Str(strSTOCKNO) + ' If Not moRSHAND.EOF Then + ' moRSHAND!Count = Field2Str2(moRSHAND!Count) + Field2Str2(dblQTY) + moRSHAND!Description = Field2Str(strDESC) + moRSHAND!OnHand = dblQTY + moRSHAND!LCost = dblLCOST + moRSHAND!Price1 = dblPRICE1 + moRSHAND!VENDOR = strVENDOR + moRSHAND!Type = strTYPE + moRSHAND!Min = dblMIN + moRSHAND!Max = dblMAX + moRSHAND!Available = dblAVAIL + moRSHAND!Weight = dblWEIGHT + moRSHAND!User = gstrLOGIN + moRSHAND!LastOrder = strLOrder + moRSHAND!LastPurchase = strLPur + moRSHAND!LastSale = strLSALE + moRSHAND.Update + End If +' End If + End If + rc = d4seekNext(db, strVENDOR2) +' rc = d4skip(db, 1) + Loop While rc = r4success + End If + + '******* Need to look at the logic to see why this is not caclulating correctly + + rc = d4close(db) + moRSHAND.Close + +End Sub + +Private Sub SelectPartialLoad2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVEND = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL +'' !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad3() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVEND = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL + !Order = 1 + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer + + If cboSort.ListIndex = 4 Then + If KeyCode = vbKeyReturn Then + Call LoadInventory + End If + End If +End Sub + +Private Sub cmdZeroOnOrd_Click() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db7 = d4open(cb, fPath + strSQL) + + rc7 = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "IN_STOCK") + lngCUST = d4field(db7, "IN_DES") + lngONHAND = d4field(db7, "IN_ORDERTE") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + strSQL = gstrCOMPANY & "INMAT" + db7 = d4open(cb, fPath + strSQL) + + rc = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "INMXSTOCK") + lngONHAND = d4field(db7, "INMXONORDR") + strNAME = f4str(lngNAME) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdZeroOnHand" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixONOrder() +Dim oSTATUS As Long, intBOOKMARK99 As Integer +Dim strSQL As String, strSQLL As String, dblONHAND As Double, oRS As Recordset +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME2 As String, lngNAME2 As Long, lngONHANDX As Long, dblONHANDX As Double +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double +Dim strSTOCK As String, dblQTY As Double, intCoun As Integer +Dim intCNT As Integer, intCNT2 As Integer +Dim lngCustTag2 As Long, intTEST As Integer +Dim lngMXSTOCK As Long, strMXSTOCK As String, lngMXONHAND As Long, dblMXONHAND As Double +Dim strMXLOC As String * 20, strMXSTK As String * 20, strMXSEARCH As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH +' intBOOKMARK99 = lstInventory.ListIndex + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + intCNT = 0 + intCNT2 = 0 + 'lstinventory.col=10 + 'lstinventory.ColText= + strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag and StockNo = '" & mstrSTOCK & "'" +' strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag " + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + intCoun = oRS.RecordCount +'********************************** + strSQL = gstrCOMPANY & "INMAS" + strSQLL = gstrCOMPANY & "INMAT" + db = d4open(cb, fPath + strSQL) + db6 = d4open(cb, fPath + strSQLL) + + lngCustTag = d4tag(db, "IN_STOCK2") + Call d4tagSelect(db, lngCustTag) + + lngCustTag2 = d4tag(db6, "INMXSTOCK3") +' lngCustTag2 = d4tag(db6, "INMXSTOCK") + Call d4tagSelect(db6, lngCustTag2) + + Do Until oRS.EOF + strSTOCK = Field2Str(oRS!StockNo) + strMXSTK = Field2Str(oRS!StockNo) + strMXSEARCH = strMXSTK & strMXLOC + dblQTY = oRS!Qty + If IsNull(strSTOCK) Or strSTOCK = "" Then + + Else + + + rc = d4seek(db, strSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngONHAND = d4field(db, "IN_ORDERTE") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If Trim(strSTOCK) = Trim(strNAME) Then + dblONHAND = dblONHAND + dblQTY + Call f4assignDouble(lngONHAND, dblONHAND) + End If + intCNT2 = intCNT2 + 1 + End If + intCNT = intCNT + 1 + + rc6 = d4seek(db6, strSTOCK) + oSTATUS = d4deleted(db6) + If oSTATUS = 0 Then + lngNAME2 = d4field(db6, "INMXSTOCK") + lngONHANDX = d4field(db6, "INMXONORDR") + strNAME2 = f4str(lngNAME2) + dblONHANDX = f4double(lngONHANDX) + If Trim(strMXSTK) = Trim(strNAME) Then + dblONHANDX = dblONHANDX + dblQTY + Call f4assignDouble(lngONHANDX, dblONHANDX) + End If + End If + End If + + oRS.MoveNext + Loop + rc = d4close(db) + rc6 = d4close(db6) + lstInventory.Col = 10 + lstInventory.ColText = dblONHANDX +' lstInventory.Refresh + inttext = lstInventory.ListIndex +' lstInventory.ListIndex = mintbookmark99 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module FixOnOrder" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ChgONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + lstInventory.Col = 0 + mstrSTOCK = lstInventory.ColText + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + +' dblONORDER = f4str(lngONORDER) +' dblCALCONORDER = dblONORDER + mdblQORDER +' If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 +' End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + + dblCALCONORDER = 0 + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub GetAFN() +Dim strSQL As String, oRS As Recordset + + mstrN_LC = "" + mstrN_RTL = "" + mstrN_VS = "" + mstrN_VND = "" + mstrN_LPD = "" + mstrN_Desc = "" + mstrN_TY = "" + + strSQL = "SELECT AFN_LCost, AFN_Retail, AFN_VSTOCK, AFN_VEND, AFN_DESC, AFN_PDATE, AFN_TYPE FROM tblPriceCompare WHERE AFN_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrN_LC = Format(Field2Str(oRS!AFN_LCost), "##,##0.00") + mstrN_RTL = Format(Field2Str(oRS!AFN_Retail), "##,##0.00") + mstrN_VS = Field2Str(oRS!AFN_VStock) + mstrN_VND = Field2Str(oRS!AFN_VEND) + mstrN_Desc = Field2Str(oRS!AFN_Desc) + mstrN_LPD = Field2Str(oRS!AFN_PDATE) + mstrN_TY = Field2Str(oRS!AFN_TYPE) + Else + mstrN_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetAFS() +Dim strSQL As String, oRS As Recordset + + On Error GoTo Error_EH + + mstrS_LC = "" + mstrS_RTL = "" + mstrS_VS = "" + mstrS_VND = "" + mstrS_LPD = "" + mstrS_Desc = "" + mstrS_TY = "" + +' strSQL = "SELECT * FROM tblPriceCompare WHERE AFSSKU = '" & mstrFStock & "'" +' If Not gboolConn3Bad Then + strSQL = "SELECT AFS_LCost, AFS_Retail, AFS_VSTOCK, AFS_VEND, AFS_DESC, AFS_PDATE, AFS_TYPE FROM tblPriceCompare WHERE AFS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn3, adOpenForwardOnly, adLockReadOnly +' Else +' MsgBox "Cannot Process AFS History", vbOKOnly, "No History" +' Exit Sub +' End If + + If Not oRS.EOF Then + mstrS_LC = Format(Field2Str(oRS!AFS_LCost), "##,##0.00") + mstrS_RTL = Format(Field2Str(oRS!AFS_Retail), "##,##0.00") + mstrS_VS = Field2Str(oRS!AFS_VStock) + mstrS_VND = Field2Str(oRS!AFS_VEND) + mstrS_Desc = Field2Str(oRS!AFS_Desc) + mstrS_LPD = Field2Str(oRS!AFS_PDATE) + mstrS_TY = Field2Str(oRS!AFS_TYPE) + Else + mstrS_LC = "NO INFORMATION FOUND" + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form PO - Module GetAFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetTSS() + +Dim strSQL As String, oRS As Recordset + + mstrT_LC = "" + mstrT_RTL = "" + mstrT_VS = "" + mstrT_VND = "" + mstrT_LPD = "" + mstrT_Desc = "" + mstrT_TY = "" + + strSQL = "SELECT TSS_LCost, TSS_Retail, TSS_VSTOCK, TSS_VEND, TSS_DESC, TSS_PDATE, TSS_TYPE FROM tblPriceCompare WHERE TSS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrT_LC = Format(Field2Str(oRS!TSS_LCost), "##,##0.00") + mstrT_RTL = Format(Field2Str(oRS!TSS_Retail), "##,##0.00") + mstrT_VS = Field2Str(oRS!TSS_VStock) + mstrT_VND = Field2Str(oRS!TSS_VEND) + mstrT_Desc = Field2Str(oRS!TSS_Desc) + mstrT_LPD = Field2Str(oRS!TSS_PDATE) + mstrT_TY = Field2Str(oRS!TSS_TYPE) + Else + mstrT_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetTSSHist() +Dim strSQL As String, oRS As Recordset + + mstrT_LM = "" + mstrT_LY = "" + mstrT_YA = "" + mstrT_ICLM = "" + mstrT_ICLY = "" + mstrT_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGET WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrT_LM = Field2Str2(oRS!LastMo) + mstrT_LY = Field2Str2(oRS!LastYr) + mstrT_YA = Field2Str2(oRS!YearAgo) + mstrT_ICLM = Field2Str2(oRS!ICLastMo) + mstrT_ICLY = Field2Str2(oRS!ICLastYr) + mstrT_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrT_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFNHist() + +Dim strSQL As String, oRS As Recordset + + mstrN_LM = "" + mstrN_LY = "" + mstrN_YA = "" + mstrN_ICLM = "" + mstrN_ICLY = "" + mstrN_ICYA = "" + + + strSQL = "SELECT * FROM tblUSAGEN WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrN_LM = Field2Str2(oRS!LastMo) + mstrN_LY = Field2Str2(oRS!LastYr) + mstrN_YA = Field2Str2(oRS!YearAgo) + mstrN_ICLM = Field2Str2(oRS!ICLastMo) + mstrN_ICLY = Field2Str2(oRS!ICLastYr) + mstrN_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrN_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFSHist() + +Dim strSQL As String, oRS As Recordset + + mstrS_LM = "" + mstrS_LY = "" + mstrS_YA = "" + mstrS_ICLM = "" + mstrS_ICLY = "" + mstrS_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGES WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrS_LM = Field2Str2(oRS!LastMo) + mstrS_LY = Field2Str2(oRS!LastYr) + mstrS_YA = Field2Str2(oRS!YearAgo) + mstrS_ICLM = Field2Str2(oRS!ICLastMo) + mstrS_ICLY = Field2Str2(oRS!ICLastYr) + mstrS_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrS_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frx new file mode 100644 index 0000000..4b17bcd Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPO.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frm new file mode 100644 index 0000000..f9e4f4b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frm @@ -0,0 +1,2507 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPaySheet + Caption = "Pay Sheet Information" + ClientHeight = 6435 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8310 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6435 + ScaleWidth = 8310 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtIWYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 66 + Top = 600 + Width = 750 + End + Begin VB.TextBox txtWrapYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 65 + Top = 600 + Width = 750 + End + Begin VB.CheckBox chkBC + Caption = "B/C" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 64 + Top = 3135 + Width = 975 + End + Begin VB.CheckBox chkPaid + Alignment = 1 'Right Justify + BackColor = &H00FFFF00& + Caption = "PaySheet Paid" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3300 + TabIndex = 63 + Top = 2220 + Visible = 0 'False + Width = 1695 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 915 + Left = 1035 + TabIndex = 23 + Top = 5490 + Width = 7215 + End + Begin VB.TextBox txtMDesc + Enabled = 0 'False + Height = 375 + Left = 1035 + MaxLength = 40 + TabIndex = 22 + Top = 5070 + Width = 5715 + End + Begin VB.CheckBox chkInvalid + BackColor = &H0080FFFF& + Caption = "Invalid PaySheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 255 + Left = 5670 + TabIndex = 60 + Top = 3855 + Visible = 0 'False + Width = 2175 + End + Begin VB.ComboBox cboWorkType1 + Height = 315 + ItemData = "frmPaySheet.frx":0000 + Left = 6615 + List = "frmPaySheet.frx":0028 + Style = 2 'Dropdown List + TabIndex = 19 + Top = 5100 + Visible = 0 'False + Width = 1695 + End + Begin VB.TextBox txtIFrames + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 57 + Top = 2775 + Width = 750 + End + Begin VB.TextBox txtFrames + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 56 + Top = 2775 + Width = 750 + End + Begin VB.TextBox txtIStYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 55 + Top = 1695 + Width = 750 + End + Begin VB.TextBox txtStYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 54 + Top = 1695 + Width = 750 + End + Begin Crystal.CrystalReport crPAY + Left = 7830 + Top = 30 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtMDollars + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 52 + Top = 3495 + Width = 750 + End + Begin VB.TextBox txtIStone + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 50 + Top = 2415 + Width = 750 + End + Begin VB.TextBox txtICMU + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 49 + Top = 2055 + Width = 750 + End + Begin VB.TextBox txtIMetal + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 48 + Top = 1335 + Width = 750 + End + Begin VB.TextBox txtILYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 47 + Top = 975 + Width = 750 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 40 + Top = 975 + Width = 750 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 39 + Top = 1335 + Width = 750 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 38 + Top = 2055 + Width = 750 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 37 + Top = 3135 + Width = 750 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 36 + Top = 2415 + Width = 750 + End + Begin VB.TextBox txtFtMetal + Height = 315 + Left = 1020 + TabIndex = 21 + Top = 3240 + Width = 1695 + End + Begin VB.TextBox txtYdge + Height = 315 + Left = 1020 + TabIndex = 20 + Top = 2880 + Width = 1695 + End + Begin VB.ComboBox cboType + Height = 315 + ItemData = "frmPaySheet.frx":0092 + Left = 1020 + List = "frmPaySheet.frx":00AE + Style = 2 'Dropdown List + TabIndex = 18 + Top = 2160 + Width = 1695 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 6810 + TabIndex = 25 + Top = 4215 + Width = 1455 + End + Begin VB.CommandButton cmdAddPS + Caption = "&Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 5310 + TabIndex = 4 + Top = 4215 + Width = 1455 + End + Begin VB.CommandButton cmdRePrint + Caption = "Re&Print" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 5310 + TabIndex = 3 + Top = 4665 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 6810 + TabIndex = 2 + Top = 4665 + Width = 1455 + End + Begin VB.ListBox lstPayInfo + Height = 1620 + Left = 120 + TabIndex = 0 + Top = 480 + Width = 5055 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1020 + TabIndex = 68 + Top = 2520 + Width = 2115 + _Version = 196608 + _ExtentX = 3731 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPaySheet.frx":00FC + End + Begin VB.Label lblWrap + AutoSize = -1 'True + Caption = "Wrap Yds:" + Height = 195 + Left = 5430 + TabIndex = 67 + Top = 630 + Width = 750 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + Caption = "PaySheet Notes:" + Height = 435 + Left = 195 + TabIndex = 62 + Top = 5550 + Width = 795 + End + Begin VB.Label lblMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Desc." + Height = 195 + Left = 255 + TabIndex = 61 + Top = 5130 + Width = 735 + End + Begin VB.Label txtWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Work Type:" + Height = 195 + Left = 120 + TabIndex = 59 + Top = 2580 + Width = 840 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames:" + Height = 195 + Left = 5625 + TabIndex = 58 + Top = 2835 + Width = 555 + End + Begin VB.Label lblStucco + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yds:" + Height = 195 + Left = 5310 + TabIndex = 53 + Top = 1755 + Width = 870 + End + Begin VB.Label lblMisc + Alignment = 1 'Right Justify + Caption = "Misc. Pay Dollars" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5370 + TabIndex = 51 + Top = 3555 + Width = 1575 + End + Begin VB.Label lblOrder + Alignment = 2 'Center + Caption = "Orders / Issued" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6180 + TabIndex = 46 + Top = 360 + Width = 1575 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 5505 + TabIndex = 45 + Top = 1035 + Width = 675 + End + Begin VB.Label lblMetalLI + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 5565 + TabIndex = 44 + Top = 1395 + Width = 615 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 5460 + TabIndex = 43 + Top = 2115 + Width = 720 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 5265 + TabIndex = 42 + Top = 3195 + Width = 915 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 5340 + TabIndex = 41 + Top = 2475 + Width = 840 + End + Begin VB.Label txtCrewName + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1860 + TabIndex = 35 + Top = 4680 + Width = 3255 + End + Begin VB.Label txtCrew + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 34 + Top = 4680 + Width = 795 + End + Begin VB.Label txtMetal + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 33 + Top = 4320 + Width = 1695 + End + Begin VB.Label txtYRate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 32 + Top = 3960 + Width = 1695 + End + Begin VB.Label txtAmount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 31 + Top = 3600 + Width = 1695 + End + Begin VB.Label txtRPDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 30 + Top = 4320 + Width = 1155 + End + Begin VB.Label txtRPId + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 29 + Top = 3960 + Width = 1155 + End + Begin VB.Label txtCDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 28 + Top = 3600 + Width = 1155 + End + Begin VB.Label txtLogin + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 27 + Top = 3240 + Width = 1155 + End + Begin VB.Label txtRPCount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 26 + Top = 2880 + Width = 1155 + End + Begin VB.Label txtPSNum + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4155 + TabIndex = 24 + Top = 2505 + Width = 1155 + End + Begin VB.Label lblRPCount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Reprint Count:" + Height = 195 + Left = 2895 + TabIndex = 17 + Top = 2940 + Width = 1020 + End + Begin VB.Label lblRPDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date RePrinted:" + Height = 195 + Left = 2775 + TabIndex = 16 + Top = 4380 + Width = 1140 + End + Begin VB.Label lblReprint + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "RePrinted By:" + Height = 195 + Left = 2940 + TabIndex = 15 + Top = 4020 + Width = 975 + End + Begin VB.Label lblCDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Created:" + Height = 195 + Left = 2925 + TabIndex = 14 + Top = 3660 + Width = 990 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CreatedBy:" + Height = 195 + Left = 3135 + TabIndex = 13 + Top = 3300 + Width = 780 + End + Begin VB.Label lblPSNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Sheet #:" + Height = 195 + Left = 3180 + TabIndex = 12 + Top = 2565 + Width = 930 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 585 + TabIndex = 11 + Top = 4740 + Width = 405 + End + Begin VB.Label lblMRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 165 + TabIndex = 10 + Top = 4380 + Width = 825 + End + Begin VB.Label lblYRage + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rate/Yard:" + Height = 195 + Left = 195 + TabIndex = 9 + Top = 4020 + Width = 795 + End + Begin VB.Label lblAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amt. Paid:" + Height = 195 + Left = 270 + TabIndex = 8 + Top = 3660 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 375 + TabIndex = 7 + Top = 3300 + Width = 615 + End + Begin VB.Label lblYardge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = 345 + TabIndex = 6 + Top = 2940 + Width = 645 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 180 + TabIndex = 5 + Top = 2220 + Width = 810 + End + Begin VB.Label lblPSheet + Caption = "Pay Sheets for " + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 1 + Top = 60 + Width = 7035 + End +End +Attribute VB_Name = "frmPaySheet" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim mintCREW As Integer, mstrCREW As String +Dim moRS As Recordset, moRSProj As Recordset, mboolAdding As Boolean +Dim mlngTIME As Long, mboolPRINT As Boolean, mboolSTOP As Boolean +Dim moRSPay As Recordset, mstrType As String +Dim mboolOVERRIDE As Boolean, mstrPROJLOT As String +Dim mstrWDone As String, mstrWTYPE As String, mstrWPayType + +Private Sub SetInvalid() +Dim intBookmark As Integer +Dim intYARDS As Integer, intMETAL As Integer + + If chkInvalid Then + MsgBox "This PaySheet has already been marked Invalid", vbOKOnly, "Invalid Option" + Exit Sub + End If + intBookmark = lstPayInfo.ListIndex + If Not chkPaid = vbChecked Then + moRSPay!invalid = vbChecked + moRSPay.Update + If moRSPay!Type = "S" Then + If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then + intYARDS = Field2Str2(moRS!pystucco) + moRS!pystucco = intYARDS - Int(Field2Long(moRSPay!pay_ydge)) + moRS.Update + End If + End If + If moRSPay!Type = "L" Then + If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then + intYARDS = Field2Str2(moRS!pylath) + intMETAL = Field2Str2(moRS!pmetal) + moRS!pmetal = intMETAL - Field2Integer(moRSPay!METAL) + moRS!pylath = intYARDS - Field2Integer(moRSPay!pay_ydge) + moRS.Update + End If + End If + If moRSPay!worktype = "W" Or moRSPay!worktype = "R" Or moRSPay!worktype = "F" Or moRSPay!worktype = "U" Then + intYARDS = Field2Str2(moRS!pmdollars) + moRS!pmdollars = intYARDS - Field2Integer(moRSPay!pay_ydge) + moRS.Update + End If + Call PayLoad + Else + MsgBox "This PaySheet Has Already Been Paid", vbOKOnly, "Already Paid" + End If + lstPayInfo.ListIndex = intBookmark +End Sub + +Private Sub cboType_LostFocus() +Dim strTYPE As String + + If cboType.ListIndex > -1 Then + strTYPE = Left(Str2Field(cboType.Text), 1) + End If + + If strTYPE = "L" Then 'Or strTYPE = "R" Or strTYPE = "W" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE ' & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +Private Sub cboWorkType_LostFocus() +Dim strTYPE As String, strWTYPE As String, strMSG As String + + strTYPE = Left(Str2Field(cboType), 1) + mstrType = strTYPE + If cboWorkType.ListIndex > -1 Then + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText +' strWTYPE = Left(Str2Field(cboWorkType), 1) + mstrWTYPE = strWTYPE + End If + + If strTYPE = "S" Then + If strWTYPE = "Y" Or strWTYPE = "Z" Then +' If strWTYPE = "C" Or strWTYPE = "P" Or strWTYPE = "Y" Or strWTYPE = "Z" Then +' or strqtype="W" or strwtype = "F" or strwtypeThen + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "L" Then + If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ + strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If +'**** start here + +' ElseIf strTYPE = "L" Then +' If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ +' strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then +' MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" +' cboWorkType.SetFocus +' Exit Sub +' End If + ElseIf strTYPE = "V" Then + If strWTYPE <> "C" And strWTYPE <> "W" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "C" Then + lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "Y" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "Y" Or strWTYPE = "Z" Then + strMSG = "Invalid Work Type has been selected. Only 'T', 'B' or 'W' are allowed, Select a valid worktype" + MsgBox strMSG, vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "B" Or strWTYPE = "T" Then + ' lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "C" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "B" Or strWTYPE = "T" Then + MsgBox "Invalid Work Type has been selected. Only 'Y', 'Z' or 'W' are allowed. Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "Y" Or strWTYPE = "Z" Then + lblYardge.Caption = "Frames" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +End Sub +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + aTabs(0) = 25 + aTabs(1) = 50 + aTabs(2) = 90 + aTabs(3) = 150 + aTabs(4) = 200 + +' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblPaySheet WHERE lotid =" & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crewid) + Call GetCrew + strLine = oRS!Type & vbTab & oRS!worktype & vbTab & oRS!pay_ydge & vbTab & IIf(oRS!METAL = 0, "", oRS!METAL) + strLine = strLine & vbTab & IIf(oRS!paid, "Paid", (IIf(oRS!invalid, "InValid", (IIf(oRS!bc, "B/C", "Not Paid"))))) + If oRS!paid Then + strLine = strLine & vbTab & oRS!crewid & vbTab & mstrCREW + End If + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!payid) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + Else + strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If + +End Sub + +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrCREW = oRS!crew_boss + End If + + oRS.Close + +End Sub + +Private Sub cmdRePrint_Click() +Dim strTYPE As String, strREPORT As String, intCount As Integer +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer +Dim strWORK As String, intResponse As Integer, strREPRINT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strTYPE = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + strWORK = cboWorkType.ColText +' strWORK = Left(Str2Field(cboWorkType.Text), 1) + + If strTYPE = "S" Then + If strWORK = "C" Or strWORK = "P" Or strWORK = "B" Or strWORK = "S" Or strWORK = "T" Then + strREPORT = App.Path & "\RPstuccopay.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + End If + ElseIf strTYPE = "L" Then + If strWORK = "C" Or strWORK = "P" Then + strREPORT = App.Path & "\RPLathpay.rpt" + Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") + End If + ElseIf strTYPE = "W" Then + If strWORK = "C" Or strWORK = "P" Then + strREPORT = App.Path & "\RPWrapPay.rpt" + Call LotChange(mstrPROJLOT, "WP Paysheet RePrint") +' Else +' strREPORT = App.Path & "\RPPOpay.rpt" +' Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") + End If + ElseIf strTYPE = "V" Then + If strWORK = "C" Or strWORK = "P" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Call LotChange(mstrPROJLOT, "STN Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "STN Paysheet RePrint") + End If + ElseIf strTYPE = "C" Then + If strWORK = "Y" Or strWORK = "Z" Then + strREPORT = App.Path & "\RPScaffoldpay.rpt" + Call LotChange(mstrPROJLOT, "SCF Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "SCF Paysheet RePrint") + End If + ElseIf strTYPE = "Y" Then + If strWORK = "B" Or strWORK = "T" Then + strREPORT = App.Path & "\RPSYNpay.rpt" + Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") + End If + ElseIf strTYPE = "X" Then + strREPORT = App.Path & "\RPPaintPay3.rpt" + strREPRINT = "PAINT " & strWORK & " Paysheet RePrint" + Call LotChange(mstrPROJLOT, strREPRINT) +'' Call LotChange(mstrPROJLOT, "PAINT Paysheet RePrint") +'' MsgBox "No Pay Sheet Reprint Setup For Paint", vbOKOnly, "Not Set Up" +'' cmdRePrint.Enabled = False +'' cmdAddPS.Enabled = True +'' Exit Sub +' If strWORK = "B" Or strWORK = "T" Then +' strREPORT = App.Path & "\RPSYNpay.rpt" +' Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") +' Else +' strREPORT = App.Path & "\RPPOpay.rpt" +' Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") +' End If + End If + + intResponse = MsgBox("Do You Want To Print To The Printer?", vbQuestion + vbYesNo, "Print to Printer") +' intRESPONSE = InputBox("Do You Want To Print To The Printer?", "Print to Printer") + If intResponse = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + strSQL = "{tblPAYSHEET.payid} = " & gintPAYID + crPAY.ReportFileName = strREPORT + crPAY.ReplaceSelectionFormula (strSQL) +' crPAY.SelectionFormula = (strSQL) + crPAY.CopiesToPrinter = gintCOPY + 'crpay. +' crPAY.Destination = crptToWindow +' crpay.Destination = crptToPrinter + crPAY.Action = 1 + intCount = Field2Integer(moRSPay!rpcount) + intCount = intCount + 1 + moRSPay!rpcount = intCount + moRSPay!rpdate = Date + moRSPay!RPUSER = gstrLOGIN + moRSPay.Update + cmdRePrint.Enabled = False + cmdAddPS.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module cmdRePrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mboolSTOP = False + Call AddPay + If Not mboolSTOP Then + Call FormSave + lstPayInfo.Enabled = True + cmdSave.Enabled = False + cmdAddPS.Enabled = True + cmdExit.Enabled = True + txtMDesc.Enabled = False + txtNotes.Enabled = False + gintPAYID = FindMax("tblPaySHeet", "payid") + Call PrintPay + chkBC.Enabled = False + Else + cboType.SetFocus + End If +' Call PrintPay + +End Sub + +Private Sub PrintPay() +Dim strSQL As String, strTYPE As String, strWTYPE As String +Dim intResponse As Integer + + strTYPE = mstrType + strWTYPE = mstrWTYPE + If strTYPE = "S" Then + If strWTYPE = "W" Or strWTYPE = "R" Or strWTYPE = "F" Or strWTYPE = "U" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSStuccopay.rpt" + End If + ElseIf strTYPE = "L" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSLathpay.rpt" + End If + ElseIf strTYPE = "V" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSStonepay.rpt" + End If + ElseIf strTYPE = "Y" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSSynPay.rpt" + End If + ElseIf strTYPE = "C" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSScaffoldpay.rpt" + End If + End If + If intResponse = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + gintCOPY = 2 + strSQL = "{tblPaySheet.PayId} = " & gintPAYID +' crPAY.ReportFileName = App.Path & "\PSLathpay.rpt" + crPAY.ReplaceSelectionFormula (strSQL) + crPAY.CopiesToPrinter = gintCOPY +' crPAY.Destination = crptToWindow +' crPAY.Destination = crptToPrinter +' crPAY.Formulas(1) = "PaySheetCount = " & i +' crPAY.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +' crPAY.CopiesToPrinter = gintCOPY ' / 2 + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + If Not mboolOVERRIDE Then + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + Call cmdAddPS_Click + strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If moRSPay.EOF Then + End If + Else + Unload Me + End If + End If + End If + If chkLook Then + mboolLOOK = True + End If +' If chkLook Then + If mboolLOOK Then +' cmdSavePay.Enabled = False +' cmdDelPay.Enabled = False +' cmdAddPay.Enabled = False +' cmdFindCrew.Visible = False +' txtPercentDone.Enabled = False +' txtVerify.Enabled = False +' txtCrewNo.Enabled = False +' txtPayDate.Enabled = False +' txtCheckNo.Enabled = False +' txtPayAmt.Enabled = False +' txtNotes.Enabled = False +' txtOffice.Enabled = False + cboType.Enabled = False +' cboType.Enabled = False +' txtCrewName.Enabled = False + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim txtYRate As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyB Then ' Mark the Pay Sheet as invalid +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + Call SetInvalid + End If + Exit Sub + End If + If KeyCode = vbKeyO Then ' Display key combinations. +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + mboolOVERRIDE = True + Call LotChange(mstrPROJLOT, "Paysheet OVERRIDE") + End If + Exit Sub + End If + If KeyCode = vbKeyF Then ' Display key combinations. +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + txtYRate = InputBox("Enter the Correct Stone Sq. Footage For This Lot", "New Rate", 0#) + Call LotChange(mstrPROJLOT, "Correct Stone SqFt") + moRS!ST_SQFT = Field2Str2(txtYRate) + moRS.Update + txtStone = txtYRate + End If + Exit Sub + End If + +' If Not cmdSave.Enabled Then +' cmdSave.Enabled = True +' End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call cmdSave_Click + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() +' Set moRS = New Recordset +' Set moRSProj = New Recordset + + If gbytSECURITY = 1 Then + ' cmdDelPay.Enabled = True + End If + + Call WTLoad + Call ProjLoad + Call LotLoad + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no +' lblPSheet = "Pay Sheets for " & Trim$(moRSProj!proj_desc) & " Lot # " & Trim$(moRS!lot_no) + Call PayLoad + mboolOVERRIDE = False +' If lstPayInfo.ListCount Then +' If FormFind() Then +' Call FormShow +' End If +' End If + +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPaySheet " + strSQL = strSQL & "WHERE payid = " & mlngTIME + + Set moRSPay = New Recordset +' If moRSTime.State = adStateOpen Then +' moRSTime.Close +' End If + + moRSPay.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function + +Private Sub FormClear() + txtCDate = "" + txtLogin = "" + txtRPDate = "" + txtRPId = "" + txtRPCount = "" + txtPSNum = "" + txtYdge = "" + txtFtMetal = "" + txtYRate = "" + txtMetal = "" + txtCrew = "" + txtCrewName = "" + txtAmount = "" + txtNotes = "" + txtMDesc = "" + chkBC = vbUnchecked + chkPaid = vbUnchecked + chkPaid.Visible = False + chkInvalid = vbUnchecked + chkInvalid.Visible = False + cboType.ListIndex = -1 + cboWorkType.ListIndex = -1 + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + mboolSTOP = False + + If mboolAdding Then + moRSPay.AddNew + End If + + ' Store the controls to the recordset + Call FieldsSave + If mboolSTOP = True Then + Exit Sub + End If + moRSPay.Update + + + If mboolAdding Then + mboolAdding = False + mboolPRINT = True + End If + mboolOVERRIDE = False + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPay.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormShow() +Dim strWTYPE As String, strDONE As String +Dim intLoop As Integer, strSTR As String, intLEN As Integer + + mboolSHOW = True +' txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtWrapYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtLathYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtStYds = Format((Field2Integer(moRS!s_yds)), "##,###") +' txtLathYds = Format((Field2Integer(moRS!sq_yd) - 19), "##,###") +' txtStYds = Format((Field2Integer(moRS!s_yds) -24), "##,###") + txtFrames = Format((Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10)), "##,###") + txtCMUYds = Format(Field2Integer(moRS!CMU), "##,###") + txtMatYds = Format(Field2Integer(moRS!sq_yd), "##,###") + txtMetalFt = Format(Field2Long(moRS!METAL), "##,###") + lblPSheet = "Pay Sheets for " & Trim$(moRSProj!Proj_Desc) & " Lot # " & Trim$(moRS!lot_no) & " " & Trim$(Field2Str(moRS!model)) +' txtModel = Field2Str(moRS!model) + txtStone = Format(Field2Str(moRS!ST_SQFT), "##,###") + txtIStone = Field2Str2(moRS!PMisc) + + With moRSPay + If !paid Then + chkPaid.Visible = True + chkPaid = vbChecked + Else + chkPaid.Visible = False + chkPaid = vbUnchecked + End If + If !invalid Then + chkInvalid.Visible = True + chkInvalid = vbChecked + Else + chkInvalid.Visible = False + chkInvalid = vbUnchecked + End If + chkBC = Field2CheckBox(!bc) + txtCDate = FormatDateTime(Field2Str(!C_Date), 2) + txtLogin = Field2Str(!Create) + txtRPDate = Field2Str(!rpdate) + txtRPId = Field2Str(!RPUSER) + txtRPCount = Field2Str2(!rpcount) + txtPSNum = Field2Str(!sheet) + txtYdge = Format(Field2Str2(!pay_ydge), "##,###") +' txtAmount = Field2Str2(!amt) + txtFtMetal = Format(Field2Str2(!METAL), "##,###") + txtYRate = IIf(Field2Str2(!y_rate) > 0, Format(Field2Str2(!y_rate), "#.00"), "") + txtMetal = IIf(Field2Str2(!m_Rate) > 0, Format(Field2Str2(!m_Rate), "#.00"), "") + txtMDesc = Field2Str(!m_desc) + txtCrew = Field2Integer(!crewid) + mintCREW = Field2Integer(!crewid) + txtNotes = Field2Str(!notes) + Call GetCrew + txtCrewName = mstrCREW +' txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) +' txtCheckNo = Field2Str(!prcheck) + txtAmount = IIf(Field2Str2(!Amt) > 0, Format(Field2Str(!Amt), "##,###.00"), "") + + + If !Type = "S" Then + cboType.Text = "Stucco" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + lblYardge = "Yardage:" + ElseIf !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + cboType.Text = "Lath" + lblYardge = "Yardage:" + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "V_Stone" + lblYardge = "Sq. Feet:" + ElseIf !Type = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Y_Synthetic" + lblYardge = "Yardage:" + ElseIf !Type = "C" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "C_Scaffold" + lblYardge = "Frames:" + ElseIf !Type = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Wrap" + lblYardge = "Yardage:" + ElseIf !Type = "X" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "X_Paint" + lblYardge = "SQ Feet:" + End If +'******* + + strWTYPE = Field2Str(!worktype) +' intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + + + + If !worktype = "B" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Brown" + ElseIf !worktype = "C" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Complete" + ElseIf !worktype = "P" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Partial" + ElseIf !worktype = "T" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Texture" + ElseIf !worktype = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Scratch" + ElseIf !worktype = "R" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Repair" + lblYardge = "Pay Amount:" +' txtFtMetal.Enabled = False + + ElseIf !worktype = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "WorkOrder/PO" + lblYardge = "Pay Amount:" + ElseIf !worktype = "F" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Fence" + lblYardge = "Pay Amount:" + ElseIf !worktype = "U" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "U_CMU" + lblYardge = "Pay Amount:" + ElseIf !worktype = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Y_UP" + lblYardge = "Frames:" + ElseIf !worktype = "Z" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Z_DOWN" + lblYardge = "Frames:" + Else +' cboWorkType.ListIndex = -1 + End If + +' If !worktype = "B" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Brown" +' ElseIf !worktype = "C" Then +' If !Type = "L" Then +' txtFtMetal.Enabled = True +' txtFtMetal.BackColor = &H80000005 +' Else +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' End If +' cboWorkType.Text = "Complete" +' ElseIf !worktype = "P" Then +' If !Type = "L" Then +' txtFtMetal.Enabled = True +' txtFtMetal.BackColor = &H80000005 +' Else +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' End If +' cboWorkType.Text = "Partial" +' ElseIf !worktype = "T" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Texture" +' ElseIf !worktype = "S" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Scratch" +' ElseIf !worktype = "R" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Repair" +' lblYardge = "Pay Amount:" +''' txtFtMetal.Enabled = False + +' ElseIf !worktype = "W" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "WorkOrder/PO" +' lblYardge = "Pay Amount:" +' ElseIf !worktype = "F" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Fence" +' lblYardge = "Pay Amount:" +' ElseIf !worktype = "U" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "U_CMU" +' lblYardge = "Pay Amount:" +' ElseIf !worktype = "Y" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Y_UP" +' lblYardge = "Frames:" +' ElseIf !worktype = "Z" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Z_DOWN" +' lblYardge = "Frames:" +' Else +' cboWorkType.ListIndex = -1 +' End If + + End With +' txtLotNotes = Field2Str(moRSMemo!payroll) + +' If chkLook Then + If mboolLOOK Then +' cmdSavePay.Enabled = False +' cmdDelPay.Enabled = False +' cmdAddPay.Enabled = False +' cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboType.Enabled = False +' cboCrewType.Enabled = False +' txtCrewName.Enabled = False + End If + txtIWYds = IIf(Field2Str2(moRS!WrapAmt) > 0, Format(Field2Str2(moRS!WrapAmt), "##,###"), "") + txtILYds = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIStYds = IIf(Field2Str2(moRS!pystucco) > 0, Format(Field2Str2(moRS!pystucco), "##,###"), "") +' txtIFrames = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIMetal = IIf(Field2Str2(moRS!pmetal) > 0, Format(Field2Str2(moRS!pmetal), "##,###"), "") + txtICMU = IIf(Field2Str2(moRS!pcmu) > 0, Format(Field2Str2(moRS!pcmu), "##,###"), "") +' txtMYds = IIf(Field2Str2(moRS!pmisc) > 0, Format(Field2Str2(moRS!pmisc), "##,###"), "") + txtMDollars = IIf(Field2Str2(moRS!pmdollars) > 0, Format(Field2Str2(moRS!pmdollars), "##,###"), "") + mboolSHOW = False + +End Sub + +Private Sub lstPayInfo_Click() + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + gintPAYID = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + +End Sub + +Private Sub cmdAddPS_Click() + Call FormClear + lstPayInfo.Enabled = False +' txtVerify = Date + cmdSave.Enabled = True + cmdAddPS.Enabled = False +' cmdFindCrew.Visible = True + mboolAdding = True + chkBC.Enabled = True + cboType.SetFocus +End Sub + +Private Sub AddPay() +Dim intLATH As Long, intSTUCCO As Long, intMETAL As Long, strTYPE As String +Dim intPLATH As Long, intPSTUCCO As Long, intPMETAL As Long, strMSG As String +Dim intPCMU As Long, intPSTONE As Long, intPDOLLARS As Long, intCALC As Long +Dim intCLATH As Long, intCSTUCCO As Long, intCMETAL As Long, lngID As Long +Dim strWTYPE As String, intSTONE As Long, intCSTONE As Long +Dim intFRAMES As Long, intCFRAMES As Long, intPFRAMES As Long +Dim strSQL As String, oRSM As Recordset + + strTYPE = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText +' strWTYPE = Left(Str2Field(cboWorkType.Text), 1) + + lngID = Field2Str2(moRS!Lot_id) + intLATH = Field2Str2(moRS!l_yds) + intSTUCCO = Field2Str2(moRS!s_yds) + intMETAL = Field2Str2(moRS!METAL) + intSTONE = Field2Str2(moRS!ST_SQFT) + intFRAMES = Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10) + + intPLATH = Field2Str2(moRS!pylath) + intPSTUCCO = Field2Str2(moRS!pystucco) + intPMETAL = Field2Str2(moRS!pmetal) + intPCMU = Field2Str2(moRS!pcmu) + intPSTONE = Field2Str2(moRS!PMisc) + intPDOLLARS = Field2Str2(moRS!pmdollars) + + If strTYPE = "S" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCSTUCCO = intPSTUCCO + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards to High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!pystucco = intCSTUCCO + moRS.Update + ElseIf strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "S" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Scratch Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) +' intCSTUCCO = intCALC + Field2Str2(txtYdge) +' If intCSTUCCO > intSTUCCO Then +' strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" +' MsgBox strMSG, vbOKOnly, "Yards to High" +' mboolSTOP = True +' mboolAdding = False +' Exit Sub +' End If + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + + End If +' moRS!pystucco = intCSTUCCO +' moRS.Update + ElseIf strTYPE = "L" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCLATH = intPLATH + Field2Str2(txtYdge) + intCMETAL = intPMETAL + Field2Str2(txtFtMetal) + If Not mboolOVERRIDE Then + If intCLATH > intLATH Then + strMSG = CStr(intCLATH) & " is greater than the " & CStr(intLATH) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + If Not mboolOVERRIDE Then + If intCMETAL > intMETAL Then + strMSG = CStr(intCMETAL) & " is greater than the " & CStr(intMETAL) & " metal feet allowed" + MsgBox strMSG, vbOKOnly, "Metal too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!pylath = intCLATH + moRS!pmetal = intCMETAL + moRS.Update + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + + ElseIf strTYPE = "V" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTONE = intPSTONE + Field2Str2(txtYdge) + If strWTYPE = "C" Then + If Not mboolOVERRIDE Then + If intCSTONE > intSTONE Then + strMSG = CStr(intCSTONE) & " Sq Feet of Stone is greater than the " & CStr(intSTONE) & " Sq Feet allowed" + MsgBox strMSG, vbOKOnly, "Square Footage to High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!PMisc = Field2Str2(intCSTONE) + moRS.Update + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "Y" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTUCCO = Field2Str2(txtYdge) + If strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "C" Then + strSQL = "SELECT SUM(pay_ydge) as MAXField FROM tblPaySHeet WHERE lotid = " & lngID + strSQL = strSQL & " and type = 'C' and worktype = '" & strWTYPE & "'" 'W'" + Set oRSM = New Recordset + oRSM.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSM.EOF Then + intCALC = Field2Integer(oRSM!maxfield) + Else + intCALC = 0 + End If + oRSM.Close +' intCALC = FindSum("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCFRAMES = intCALC + Field2Str2(txtYdge) + If strWTYPE = "Y" Or strWTYPE = "Z" Then + If Not mboolOVERRIDE Then + If intCFRAMES > intFRAMES Then + strMSG = CStr(intCFRAMES) & " Scaffold Frames is greater than the " & CStr(intFRAMES) & " frames allowed" + MsgBox strMSG, vbOKOnly, "Too Many Frames" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + Exit Sub + End If +' moRS!PMisc = intCFRAMES +' moRS.Update + End If + +End Sub + +Private Sub FieldsSave() + On Error GoTo Error_EH + + If mboolAdding Then +' moRSPay!proj_id = gintPROJID + moRSPay!lotid = gintLOTID + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = 1 + moRSPay!sheet = 1 +' Call AddPay + If mboolSTOP Then + Exit Sub + End If + End If +'need to make this so that if different types of work are selected only certain type of pay can ge celected + + With moRSPay + !pay_ydge = Integer2Field(txtYdge) +' !crew = Integer2Field(txtCrewNo) + !METAL = Integer2Field(txtFtMetal) + !Type = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + !worktype = cboWorkType.ColText 'this will not save correctly if worktype length is greater than one. +' !worktype = Left(Str2Field(cboWorkType), 1) 'this will not save correctly if worktype length is greater than one. + !m_desc = Str2Field(txtMDesc) + !notes = Str2Field(txtNotes) + If chkBC Then + !bc = vbChecked + Else + !bc = vbUnchecked + End If + If chkPaid Then + !paid = vbChecked + Else + !paid = vbUnchecked + End If +' !rpdate = Date +' !RPUSER = gstrLOGIN +' !Update = Date + End With + +' On Error Resume Next +' moRS.Update +' On Error GoTo 0 + moRSPay.Update + If mboolAdding Then +' Call GetLotID +' Call POptLoad + mboolAdding = False + mboolPRINT = True + End If + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstPayInfo_DblClick() + If chkInvalid Then + MsgBox "Reprint of this PaySheet is not allowed", vbOKOnly, "No Reprint" + Exit Sub + End If + If chkPaid Then + MsgBox "No Reprint Allowed - Already Paid", vbOKOnly, "No Reprint" + Exit Sub + End If + cmdAddPS.Enabled = False + cmdRePrint.Enabled = True + txtNotes.Enabled = True +' cmdSave.Enabled = True +End Sub + +Private Sub txtFtMetal_GotFocus() + Call FieldSelect(txtFtMetal) +End Sub + +'Private Sub PrintStuccoPay() +'Dim strSQL As String, i As Integer +'Dim intTOTAL As Integer, intYDS As Integer +' +' On Error GoTo Error_EH +' +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +'' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' intTOTAL = Int((gintCOPY / 2) + 0.99) +' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +' i = 1 +' If gintCOPY > 3 Then +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +' intTOTAL = Int((gintCOPY / 2) + 0.99) +' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +' i = 1 +' Do Until i = ((gintCOPY / 2) + 1) +' crOrder.Formulas(1) = "PaySheetCount = " & i +' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +' crOrder.CopiesToPrinter = gintCOPY / 2 +' crOrder.Action = 1 +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!pay_ydge = intYDS +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS!multipay = vbChecked +' moRS.Update +' i = i + 1 +' Loop +' Exit Sub +' Else +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Action = 1 +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!pay_ydge = intYDS +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS.Update +' End If +' Exit Sub +' +'Error_EH: +' gstrMODULE = "Form LotInfo - Module PrintStuccoPay" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub + +Private Sub txtMDesc_GotFocus() + Call FieldSelect(txtMDesc) +End Sub + +Private Sub txtMDesc_LostFocus() + txtMDesc = UCase(txtMDesc) +End Sub + +Private Sub txtNotes_GotFocus() + txtNotes.SelStart = 2000 +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtYdge_GotFocus() + Call FieldSelect(txtYdge) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frx new file mode 100644 index 0000000..4c8a12d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmPaySheetHOLD.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frm new file mode 100644 index 0000000..df476f2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frm @@ -0,0 +1,9221 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx" +Begin VB.Form frmTake2 + Caption = "Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 257 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 256 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 249 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 246 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 244 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 360 + TabIndex = 239 + Top = 0 + Width = 3255 + End + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 236 + Top = 1050 + Width = 930 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 224 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 219 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 208 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 199 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 198 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 193 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 192 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 191 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 150 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 10 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 147 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 146 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 145 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 144 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 143 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 12 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTake2.frx":0000 + Left = 8520 + List = "frmTake2.frx":0002 + Style = 2 'Dropdown List + TabIndex = 11 + Top = 600 + Visible = 0 'False + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 9 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + TabIndex = 7 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 4 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 3 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTake2.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTake2.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lstMInventory" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "chkTransfer" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "cmdFindMat" + Tab(1).Control(8)= "cmdAddMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cboMetal" + Tab(1).Control(10)= "cboMType" + Tab(1).Control(11)= "cboDFlag" + Tab(1).Control(12)= "txtMetLength" + Tab(1).Control(13)= "txtMatPrice" + Tab(1).Control(14)= "txtMatQty" + Tab(1).Control(15)= "txtMatDesc" + Tab(1).Control(16)= "txtMatInvNo" + Tab(1).Control(17)= "lstTOMatrl" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdSaveMat" + Tab(1).Control(19)= "cmdDelMat" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTake2.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "txtO108" + Tab(2).Control(1)= "txtO68" + Tab(2).Control(2)= "chkNoInvoice" + Tab(2).Control(3)= "chkST_Others" + Tab(2).Control(4)= "txtOST_SqFt" + Tab(2).Control(5)= "chkOStone" + Tab(2).Control(6)= "txtNote" + Tab(2).Control(7)= "cmdCopyOpt" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "cmdSaveOptMat" + Tab(2).Control(9)= "cmdSaveOpt" + Tab(2).Control(10)= "lstInventory" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "cmdFindOptMat" + Tab(2).Control(12)= "cboOMMetal" + Tab(2).Control(13)= "cboOMType" + Tab(2).Control(14)= "cboOMDFlag" + Tab(2).Control(15)= "txtOMMetL" + Tab(2).Control(16)= "txtOMPrice" + Tab(2).Control(17)= "txtOMQty" + Tab(2).Control(18)= "txtOMDesc" + Tab(2).Control(19)= "txtOMInvNo" + Tab(2).Control(20)= "cmdDelOptMat" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdAddOptMat" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdDelOpt" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdAddOpt" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "txtOFAdj" + Tab(2).Control(26)= "txtOFin2" + Tab(2).Control(27)= "cboOFinish" + Tab(2).Control(28)= "txtOBAmt" + Tab(2).Control(29)= "txtOYdge" + Tab(2).Control(30)= "txtODesc" + Tab(2).Control(31)= "lstOptions" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "lblScaf10" + Tab(2).Control(33)= "Scaf6" + Tab(2).Control(34)= "lblOScaffold" + Tab(2).Control(35)= "lblOStone" + Tab(2).Control(36)= "lblOMMLength" + Tab(2).Control(37)= "lblOMCFlag" + Tab(2).Control(38)= "lblOMMType" + Tab(2).Control(39)= "lblOMDFlag" + Tab(2).Control(40)= "lblOMPrice" + Tab(2).Control(41)= "lblOMQty" + Tab(2).Control(42)= "lblOMDesc" + Tab(2).Control(43)= "lblOMInvNo" + Tab(2).Control(44)= "lblOFadj" + Tab(2).Control(45)= "lblOFin2" + Tab(2).Control(46)= "lblOTexture" + Tab(2).Control(47)= "lblBAmt" + Tab(2).Control(48)= "lblYrdge" + Tab(2).ControlCount= 49 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTake2.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 254 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 253 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 243 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 35 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 34 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 32 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 33 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 228 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 37 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 223 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 220 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 222 + Top = 120 + Value = -1 'True + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 221 + Top = 120 + Width = 1215 + End + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 218 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 214 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 315 + Left = -64980 + TabIndex = 209 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 200 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 197 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 196 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 47 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 36 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 195 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.ListBox lstMInventory + Height = 2010 + Left = -66840 + Sorted = -1 'True + TabIndex = 194 + TabStop = 0 'False + Top = 1260 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 315 + Left = -66360 + TabIndex = 181 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTake2.frx":0074 + Style = 1 'Graphical + TabIndex = 39 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmTake2.frx":04B6 + Style = 1 'Graphical + TabIndex = 172 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTake2.frx":08F8 + Left = -65400 + List = "frmTake2.frx":0902 + Style = 2 'Dropdown List + TabIndex = 45 + Top = 3930 + Visible = 0 'False + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTake2.frx":0913 + Left = -65400 + List = "frmTake2.frx":0915 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTake2.frx":0917 + Left = -68160 + List = "frmTake2.frx":0921 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 4320 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 46 + Top = 4320 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 42 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 41 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 40 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 38 + Top = 2760 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 182 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTake2.frx":0935 + Left = -68100 + List = "frmTake2.frx":093F + Style = 2 'Dropdown List + TabIndex = 178 + Top = 2640 + Visible = 0 'False + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTake2.frx":0950 + Left = -68100 + List = "frmTake2.frx":0952 + Style = 2 'Dropdown List + TabIndex = 177 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTake2.frx":0954 + Left = -68100 + List = "frmTake2.frx":095E + Style = 2 'Dropdown List + TabIndex = 176 + Top = 1920 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 179 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 175 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 174 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 173 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 171 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 161 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 159 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTake2.frx":0972 + Left = -69720 + List = "frmTake2.frx":0974 + Style = 2 'Dropdown List + TabIndex = 158 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 157 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 156 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 151 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 149 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 160 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 142 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 162 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 141 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 180 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 137 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 136 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 134 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 3735 + Left = 8760 + TabIndex = 122 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 242 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 227 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 217 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 140 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 128 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 3735 + Left = 7980 + TabIndex = 113 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 240 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 225 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 215 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 213 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 212 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 120 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 120 + TabIndex = 118 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 117 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 106 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 65 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 104 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 64 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 66 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 99 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 91 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 89 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 63 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 86 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 83 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 81 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 78 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 76 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 68 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 62 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 60 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 58 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 56 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 54 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 31 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 30 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTake2.frx":0976 + Left = -70305 + List = "frmTake2.frx":0978 + Style = 2 'Dropdown List + TabIndex = 29 + Top = 840 + Visible = 0 'False + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 28 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 26 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 25 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 201 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 17 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 16 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 21 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 15 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 14 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 13 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 231 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 229 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 207 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 206 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 205 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 204 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 203 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 202 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 255 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 252 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 251 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 250 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 241 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 230 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 226 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 216 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 211 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 210 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 190 + Top = 4380 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66180 + TabIndex = 189 + Top = 3960 + Visible = 0 'False + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 188 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 187 + Top = 4380 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 186 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 185 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 184 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 183 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 170 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 169 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 168 + Top = 2700 + Visible = 0 'False + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 167 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 166 + Top = 1980 + Visible = 0 'False + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 165 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 164 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 163 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 155 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 154 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 153 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 152 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 138 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 121 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 114 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 112 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 111 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 110 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 109 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 108 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 107 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 105 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 98 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 97 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 96 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 95 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 94 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 93 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 92 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 90 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 88 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 87 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 74 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 73 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 72 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 71 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 70 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 69 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 67 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 61 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 420 + TabIndex = 59 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 53 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 52 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 51 + Top = 900 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 50 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 49 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 48 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 1 + Top = 660 + Width = 1395 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 258 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 248 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 247 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 245 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 238 + Top = 1650 + Width = 795 + End + Begin VB.Label txtLSave + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 237 + Top = 1320 + Width = 1730 + End + Begin VB.Label txtUpdate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 235 + Top = 1650 + Width = 1730 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 234 + Top = 1005 + Width = 1730 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 233 + Top = 1320 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 232 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 148 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 24 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 23 + Top = 660 + Visible = 0 'False + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 4110 + TabIndex = 22 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 8190 + TabIndex = 8 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5925 + TabIndex = 6 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3840 + TabIndex = 5 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 2 + Top = 660 + Width = 1215 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 300 + Width = 540 + End +End +Attribute VB_Name = "frmtake2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long +Dim mboolSHOW As Boolean, mboolCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double + + On Error GoTo Error_EH + mboolCALC = False + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close + If dblRS > 0 Then + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 +' moRSCMat!qty = Int((dblWire / 50) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Str(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String + + On Error GoTo Error_EH + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblRS > 0 Then + txtSandTons = dblRS + End If + + +'Calculate Black paper + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 33) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 30 + Else + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!proj_id + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!proj_id + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc + With moRS + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' If IsNull(moRS!origTOID) Then +' moRS!origTOID = oRSMAX!maxtoid +' moRS.Update +' End If +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" + txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!newtoid = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTake2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frm new file mode 100644 index 0000000..122f3b9 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frm @@ -0,0 +1,9221 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmTake + Caption = "Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 257 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 256 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 249 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 246 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 244 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 360 + TabIndex = 239 + Top = 0 + Width = 3255 + End + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 236 + Top = 1050 + Width = 930 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 224 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 219 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 208 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 199 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 198 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 193 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 192 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 191 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 150 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 10 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 147 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 146 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 145 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 144 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 143 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 12 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTake.frx":0000 + Left = 8520 + List = "frmTake.frx":0002 + Style = 2 'Dropdown List + TabIndex = 11 + Top = 600 + Visible = 0 'False + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 9 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + TabIndex = 7 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 4 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 3 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTake.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "lblMeDesc" + Tab(0).Control(1)= "lblMeSqFt" + Tab(0).Control(2)= "lblMeLocate" + Tab(0).Control(3)= "lblMeType" + Tab(0).Control(4)= "fraYardage" + Tab(0).Control(5)= "cmdAddMeas" + Tab(0).Control(6)= "cmdDelMeas" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "cmdSaveMeas" + Tab(0).Control(8)= "cmdUpMeasCalc" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lstMeasure" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtMeDesc" + Tab(0).Control(11)= "txtMeSqFt" + Tab(0).Control(12)= "cboMeLocate" + Tab(0).Control(13)= "txtMeType" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTake.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lstMInventory" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "chkTransfer" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "cmdFindMat" + Tab(1).Control(8)= "cmdAddMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cboMetal" + Tab(1).Control(10)= "cboMType" + Tab(1).Control(11)= "cboDFlag" + Tab(1).Control(12)= "txtMetLength" + Tab(1).Control(13)= "txtMatPrice" + Tab(1).Control(14)= "txtMatQty" + Tab(1).Control(15)= "txtMatDesc" + Tab(1).Control(16)= "txtMatInvNo" + Tab(1).Control(17)= "lstTOMatrl" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdSaveMat" + Tab(1).Control(19)= "cmdDelMat" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTake.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblYrdge" + Tab(2).Control(1)= "lblBAmt" + Tab(2).Control(2)= "lblOTexture" + Tab(2).Control(3)= "lblOFin2" + Tab(2).Control(4)= "lblOFadj" + Tab(2).Control(5)= "lblOMInvNo" + Tab(2).Control(6)= "lblOMDesc" + Tab(2).Control(7)= "lblOMQty" + Tab(2).Control(8)= "lblOMPrice" + Tab(2).Control(9)= "lblOMDFlag" + Tab(2).Control(10)= "lblOMMType" + Tab(2).Control(11)= "lblOMCFlag" + Tab(2).Control(12)= "lblOMMLength" + Tab(2).Control(13)= "lblOStone" + Tab(2).Control(14)= "lblOScaffold" + Tab(2).Control(15)= "Scaf6" + Tab(2).Control(16)= "lblScaf10" + Tab(2).Control(17)= "lstOptions" + Tab(2).Control(17).Enabled= 0 'False + Tab(2).Control(18)= "txtODesc" + Tab(2).Control(19)= "txtOYdge" + Tab(2).Control(20)= "txtOBAmt" + Tab(2).Control(21)= "cboOFinish" + Tab(2).Control(22)= "txtOFin2" + Tab(2).Control(23)= "txtOFAdj" + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "cmdAddOpt" + Tab(2).Control(25).Enabled= 0 'False + Tab(2).Control(26)= "cmdDelOpt" + Tab(2).Control(26).Enabled= 0 'False + Tab(2).Control(27)= "cmdAddOptMat" + Tab(2).Control(27).Enabled= 0 'False + Tab(2).Control(28)= "cmdDelOptMat" + Tab(2).Control(28).Enabled= 0 'False + Tab(2).Control(29)= "txtOMInvNo" + Tab(2).Control(30)= "txtOMDesc" + Tab(2).Control(31)= "txtOMQty" + Tab(2).Control(32)= "txtOMPrice" + Tab(2).Control(33)= "txtOMMetL" + Tab(2).Control(34)= "cboOMDFlag" + Tab(2).Control(35)= "cboOMType" + Tab(2).Control(36)= "cboOMMetal" + Tab(2).Control(37)= "cmdFindOptMat" + Tab(2).Control(38)= "lstInventory" + Tab(2).Control(38).Enabled= 0 'False + Tab(2).Control(39)= "cmdSaveOpt" + Tab(2).Control(40)= "cmdSaveOptMat" + Tab(2).Control(41)= "cmdCopyOpt" + Tab(2).Control(41).Enabled= 0 'False + Tab(2).Control(42)= "txtNote" + Tab(2).Control(43)= "chkOStone" + Tab(2).Control(44)= "txtOST_SqFt" + Tab(2).Control(45)= "chkST_Others" + Tab(2).Control(46)= "chkNoInvoice" + Tab(2).Control(47)= "txtO68" + Tab(2).Control(48)= "txtO108" + Tab(2).ControlCount= 49 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTake.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 254 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 253 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 243 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 35 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 34 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 32 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 33 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 228 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 37 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 223 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 220 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 222 + Top = 120 + Value = -1 'True + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 221 + Top = 120 + Width = 1215 + End + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 218 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 214 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 315 + Left = -64980 + TabIndex = 209 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 200 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 197 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 196 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 47 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 36 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 195 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.ListBox lstMInventory + Height = 2010 + Left = -66840 + Sorted = -1 'True + TabIndex = 194 + TabStop = 0 'False + Top = 1260 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 315 + Left = -66360 + TabIndex = 181 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTake.frx":0074 + Style = 1 'Graphical + TabIndex = 39 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmTake.frx":04B6 + Style = 1 'Graphical + TabIndex = 172 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTake.frx":08F8 + Left = -65400 + List = "frmTake.frx":0902 + Style = 2 'Dropdown List + TabIndex = 45 + Top = 3930 + Visible = 0 'False + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTake.frx":0913 + Left = -65400 + List = "frmTake.frx":0915 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTake.frx":0917 + Left = -68160 + List = "frmTake.frx":0921 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 4320 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 46 + Top = 4320 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 42 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 41 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 40 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 38 + Top = 2760 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 182 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTake.frx":0935 + Left = -68100 + List = "frmTake.frx":093F + Style = 2 'Dropdown List + TabIndex = 178 + Top = 2640 + Visible = 0 'False + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTake.frx":0950 + Left = -68100 + List = "frmTake.frx":0952 + Style = 2 'Dropdown List + TabIndex = 177 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTake.frx":0954 + Left = -68100 + List = "frmTake.frx":095E + Style = 2 'Dropdown List + TabIndex = 176 + Top = 1920 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 179 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 175 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 174 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 173 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 171 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 161 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 159 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTake.frx":0972 + Left = -69720 + List = "frmTake.frx":0974 + Style = 2 'Dropdown List + TabIndex = 158 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 157 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 156 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 151 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 149 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 160 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 142 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 162 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 141 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 180 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 137 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 136 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 134 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 3735 + Left = 8760 + TabIndex = 122 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 242 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 227 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 217 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 140 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 128 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 3735 + Left = 7980 + TabIndex = 113 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 240 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 225 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 215 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 213 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 212 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 120 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 120 + TabIndex = 118 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 117 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 106 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 65 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 104 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 64 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 66 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 99 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 91 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 89 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 63 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 86 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 83 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 81 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 78 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 76 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 68 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 62 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 60 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 58 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 56 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 54 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 31 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 30 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTake.frx":0976 + Left = -70305 + List = "frmTake.frx":0978 + Style = 2 'Dropdown List + TabIndex = 29 + Top = 840 + Visible = 0 'False + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 28 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 26 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 25 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 201 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 17 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 16 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 21 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 15 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 14 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 13 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 231 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 229 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 207 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 206 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 205 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 204 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 203 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 202 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 255 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 252 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 251 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 250 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 241 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 230 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 226 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 216 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 211 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 210 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 190 + Top = 4380 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66180 + TabIndex = 189 + Top = 3960 + Visible = 0 'False + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 188 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 187 + Top = 4380 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 186 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 185 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 184 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 183 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 170 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 169 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 168 + Top = 2700 + Visible = 0 'False + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 167 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 166 + Top = 1980 + Visible = 0 'False + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 165 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 164 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 163 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 155 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 154 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 153 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 152 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 138 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 121 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 114 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 112 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 111 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 110 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 109 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 108 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 107 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 105 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 98 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 97 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 96 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 95 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 94 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 93 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 92 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 90 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 88 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 87 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 74 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 73 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 72 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 71 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 70 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 69 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 67 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 61 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 420 + TabIndex = 59 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 53 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 52 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 51 + Top = 900 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 50 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 49 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 48 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 1 + Top = 660 + Width = 1395 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 258 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 248 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 247 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 245 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 238 + Top = 1650 + Width = 795 + End + Begin VB.Label txtLSave + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 237 + Top = 1320 + Width = 1730 + End + Begin VB.Label txtUpdate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 235 + Top = 1650 + Width = 1730 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 234 + Top = 1005 + Width = 1730 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 233 + Top = 1320 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 232 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 148 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 24 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 23 + Top = 660 + Visible = 0 'False + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 4110 + TabIndex = 22 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 8190 + TabIndex = 8 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5925 + TabIndex = 6 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3840 + TabIndex = 5 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 2 + Top = 660 + Width = 1215 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 300 + Width = 540 + End +End +Attribute VB_Name = "frmTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long +Dim mboolSHOW As Boolean, mboolCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double + + On Error GoTo Error_EH + mboolCALC = False + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close + If dblRS > 0 Then + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenDynamic, adLockPessimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenDynamic, adLockPessimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + oRC!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + oRC.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 +' moRSCMat!qty = Int((dblWire / 50) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Str(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String + + On Error GoTo Error_EH + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblRS > 0 Then + txtSandTons = dblRS + End If + + +'Calculate Black paper + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 33) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 30 + Else + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!proj_id + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!proj_id + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc + With moRS + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' If IsNull(moRS!origTOID) Then +' moRS!origTOID = oRSMAX!maxtoid +' moRS.Update +' End If +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" + txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!newtoid = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/FormTake/frmTakexx.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frm new file mode 100644 index 0000000..63853dd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frm @@ -0,0 +1,998 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotList + Caption = "Lot Information List" + ClientHeight = 8595 + ClientLeft = 60 + ClientTop = 7245 + ClientWidth = 6975 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8595 + ScaleWidth = 6975 + Begin LpLib.fpList lstInvoice + Height = 1245 + Left = 60 + TabIndex = 12 + Top = 7110 + Width = 6855 + _Version = 196608 + _ExtentX = 12091 + _ExtentY = 2196 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotList2.frx":0000 + End + Begin LpLib.fpList lstPOWO + Height = 1065 + Left = 60 + TabIndex = 11 + Top = 5700 + Width = 6855 + _Version = 196608 + _ExtentX = 12091 + _ExtentY = 1879 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotList2.frx":047C + End + Begin VB.CommandButton cmdSetYard + Caption = "Setup Yard List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3427 + TabIndex = 9 + Top = 3795 + Width = 1770 + End + Begin VB.CommandButton cmdYard + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 5565 + TabIndex = 8 + Top = 3795 + Width = 1320 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2145 + TabIndex = 7 + Top = 3795 + Width = 915 + End + Begin VB.ListBox lstPayroll + Height = 1425 + Left = 60 + TabIndex = 6 + Top = 4095 + Width = 6855 + End + Begin VB.ListBox lstPO + Height = 1425 + Left = 60 + TabIndex = 5 + Top = 2340 + Width = 6855 + End + Begin VB.ListBox lstRepairs + Height = 1035 + Left = 60 + TabIndex = 2 + Top = 1065 + Width = 6855 + End + Begin VB.Label lblPOWOList + AutoSize = -1 'True + Caption = "Billable PO/WO List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 14 + Top = 5505 + Width = 1710 + End + Begin VB.Label lblInvoiceList + AutoSize = -1 'True + Caption = "Invoice List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 13 + Top = 6900 + Width = 1005 + End + Begin VB.Label lblMatPO + AutoSize = -1 'True + Caption = "Payroll Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 10 + Top = 3780 + Width = 1590 + End + Begin VB.Label lblPO + AutoSize = -1 'True + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 4 + Top = 2130 + Width = 930 + End + Begin VB.Label lblRepairs + AutoSize = -1 'True + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 3 + Top = 855 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 3 + X1 = 15 + X2 = 6975 + Y1 = 810 + Y2 = 810 + End + Begin VB.Label lblLot + Alignment = 2 'Center + Caption = "Lot Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 60 + TabIndex = 1 + Top = 15 + Width = 6795 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 60 + TabIndex = 0 + Top = 360 + Width = 6855 + End +End +Attribute VB_Name = "frmLotList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mstrWTYPE As String, mstrWDone As String, mboolPROJ As Boolean + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSetYard_Click() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrdMatrl WHERE not x_flag and Order_Id = " & lstPO.ItemData(lstPO.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "SELECT * FROM tblYardOrder" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Else + MsgBox "No Order Items to Process", vbOKOnly, "No Items" + Exit Sub + End If + + Do Until oRS.EOF + With oRSS + .AddNew + !Lot_ID = oRS!Lot_ID + !inv_no = oRS!inv_no + !Desc = oRS!Desc + !qty = oRS!o_qty + !qtyIssue = oRS!o_qty + !po_num = oRS!po_num + !createuser = gstrLOGIN + .Update + oRS!x_flag = vbChecked + oRS.Update + oRS.MoveNext + End With + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form LotList - Module cmdSetYard" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdYard_Click() + frmShowYardMat.Show 1 +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub +Error_EH: + gstrMODULE = "Form LotList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + + Call POWOLoad + Call RepairLoad + Call OrderLoad + Call PayrollLoad + Call InvoiceLoad + If FormFind() Then + Call FormShow + Else + Unload Me + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub RepairLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long + + On Error GoTo Error_EH + + aTabs(0) = 50 + aTabs(1) = 95 + aTabs(2) = 170 +' aTabs(3) = 190 + + strSQL = "SELECT Repair_id, Proj_lot, Scheduled, completed, punch, yrend1, yrend2, wo, repair, backcharge from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstRepairs.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) + lstRepairs.Clear + + Do Until oRS.EOF + With lstRepairs + If oRS!punch Then + strTYPE = "PUNCH " + ElseIf oRS!yrend1 Then + strTYPE = "1 YEAR END" + ElseIf oRS!yrend2 Then + strTYPE = "2 YEAR END" + ElseIf oRS!wo Then + strTYPE = "PO WORK " + ElseIf oRS!repair Then + strTYPE = "WARRANTY" + ElseIf oRS!backcharge Then + strTYPE = "BACKCHARGE" + Else + strTYPE = "UNKNOWN" + End If + strLine = "" + strLine = Field2Str(oRS!scheduled) & vbTab & Field2Str(oRS!completed) & vbTab +' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " + strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine + .ItemData(.NewIndex) = oRS!repair_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module RepairLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub InvoiceLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String, strINVT As String +'dim + + On Error GoTo Error_EH + + + strSQL = "SELECT * FROM tblARINVOICE WHERE lot_id = " & gintLOTID & " ORDER BY INVOICE_DATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInvoice.Clear + + Do Until oRS.EOF + With lstInvoice + strINVT = oRS!inv_type + If strINVT = "L" Then + strTYPE = "LATH" + ElseIf strINVT = "S" Then + strTYPE = "STUCCO" + ElseIf strINVT = "PE" Then + strTYPE = "PAINT EXTERIOR" + ElseIf strINVT = "PF" Then + strTYPE = "PAINT FINAL" + ElseIf strINVT = "PI" Then + strTYPE = "PAINT INTERNAL" + ElseIf strINVT = "V" Then + strTYPE = "STONE" + Else + strTYPE = "UNKNOWN" + End If + +' mstrWDone = Field2Str(oRS!workdone) +' Call GetWorkType +' strWORK = mstrWTYPE + + strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Field2Str(oRS!invoice_no) & vbTab & Field2Str(strTYPE) & vbTab +' strLine = strLine & Field2Str(oRS!strWORK) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab + strLine = strLine & Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "#,#.00") & vbTab & Format(Field2Str2(oRS!non_tax_amt), "#,#.00") +' strLine = strLine & Field2Str(oRS!SALES_CODE) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab +' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " +' strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!repair_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module InvoiceLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetWorkType() +Dim strSQL As String, oRSW As Recordset + + strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" + Set oRSW = New Recordset + oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSW.EOF Then + mstrWTYPE = Field2Str(oRSW!worktype) + End If + + oRSW.Close +End Sub + +Private Sub PayrollLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String +Dim lngRET As Long, aTabs(3) As Long + + On Error GoTo Error_EH + + aTabs(0) = 40 + aTabs(1) = 120 + aTabs(2) = 145 + aTabs(3) = 190 + + strSQL = "SELECT * FROM tblTime WHERE lot_id = " & gintLOTID ' & " ORDER BY Order_Date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPayroll.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + lstPayroll.Clear + + Do Until oRS.EOF + With lstPayroll + If Field2Str(oRS!pay_type) = "L" Then + strTYPE = "LATH" + ElseIf Field2Str(oRS!pay_type) = "C" Then + strTYPE = "SCAFFOLD" + ElseIf Field2Str(oRS!pay_type) = "S" Then + strTYPE = "STUCCO" + ElseIf Field2Str(oRS!pay_type) = "Y" Then + strTYPE = "SYNTHETIC" + ElseIf Field2Str(oRS!pay_type) = "V" Then + strTYPE = "STONE" + ElseIf Field2Str(oRS!pay_type) = "X" Then + strTYPE = "PAINT" + End If + mstrWDone = Field2Str(oRS!WorkDone) + Call GetWorkType + strWORK = mstrWTYPE + +' If Field2Str(oRS!workdone) = "C" Then +' strWORK = "COMPLETE" +' ElseIf Field2Str(oRS!workdone) = "B" Then +' strWORK = "BROWN" +' ElseIf Field2Str(oRS!workdone) = "F" Then +' strWORK = "FENCE" +' ElseIf Field2Str(oRS!workdone) = "T" Then +' strWORK = "TEXTURE" +' ElseIf Field2Str(oRS!workdone) = "W" Then +' strWORK = "WORK ORDER" +' ElseIf Field2Str(oRS!workdone) = "U" Then +' strWORK = "CMU WALL" +' ElseIf Field2Str(oRS!workdone) = "P" Then +' strWORK = "PARTIAL" +' ElseIf Field2Str(oRS!workdone) = "R" Then +' strWORK = "REPAIR" +' ElseIf Field2Str(oRS!workdone) = "S" Then +' strWORK = "SCRATCH" +' ElseIf Field2Str(oRS!workdone) = "Z" Then +' strWORK = "DOWN" +' ElseIf Field2Str(oRS!workdone) = "Y" Then +' strWORK = "UP" +' End If + + strLine = strTYPE & vbTab & strWORK & vbTab + strLine = strLine & Field2Str(oRS!paydt) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") +' strLine = strLine & Field2Str(oRS!prdate) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module PayrollLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum, towhom, desc, date from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + strLine = Field2Str(oRS!Date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!towhom) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + .ItemData(.NewIndex) = oRS!ponum + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String +Dim strTYPE As String, strDESC As String +Dim lngRET As Long, aTabs(3) As Long + + On Error GoTo Error_EH + + aTabs(0) = 45 + aTabs(1) = 70 + aTabs(2) = 145 + aTabs(3) = 190 + + strSQL = "SELECT order_id, ponum, m_type, po_num, order_date, supplier from tblOrders WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPO.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + lstPO.Clear + + Do Until oRS.EOF + With lstPO + Call SetType(oRS!m_type, strDESC) + + strLine = Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!po_num) & vbTab & strDESC & vbTab & Field2Str(oRS!supplier) + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + If lstRepairs.ListCount = 0 Then + lstRepairs.Enabled = False + Else + lstRepairs.Enabled = True + End If + If lstInvoice.ListCount = 0 Then + lstInvoice.Enabled = False + Else + lstInvoice.Enabled = True + End If + If lstPOWO.ListCount = 0 Then + lstPOWO.Enabled = False + Else + lstPOWO.Enabled = True + End If + If lstPO.ListCount = 0 Then + lstPO.Enabled = False + Else + lstPO.Enabled = True + End If + If lstPayroll.ListCount = 0 Then + lstPayroll.Enabled = False + Else + lstPayroll.Enabled = True + End If + + ' mboolSHOW = True + ' mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strProj As String, strMEMO As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + strProj = "SELECT * " + strProj = strProj & "FROM tblproject " + strProj = strProj & "WHERE proj_ID = " & Field2Long(oRS!PROJ_ID) +' strProj = strProj & "WHERE proj_ID = " & Field2Integer(oRS!proj_id) + Set oRSS = New Recordset + oRSS.Open strProj, goConn, _ + adOpenKeyset, adLockPessimistic + + If oRSS.EOF Then + + End If + + If oRS.EOF Then + FormFind = False + Else + FormFind = True + lblProjLot.Caption = oRSS!Proj_Code & " " & oRS!lot_no & " " & oRSS!Proj_Desc + End If + oRS.Close + oRSS.Close + Exit Function + +Error_EH: + gstrMODULE = "Form LotList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstInvoice_DblClick() + MsgBox "Mouse has been DblClicked", vbOKOnly +End Sub + +Private Sub lstPayroll_DblClick() + + lstPO.ListIndex = -1 + lstRepairs.ListIndex = -1 + Load frmPayroll + frmPayroll.chkLOOK = vbChecked + frmPayroll.Show 1 + +End Sub + +Private Sub lstPO_DblClick() +Dim oRS As Recordset +Dim strSQL As String + + lstPayroll.ListIndex = -1 + lstRepairs.ListIndex = -1 + glngORDERID = lstPO.ItemData(lstPO.ListIndex) + strSQL = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS!ponum > 0 Then + glngORDERID = Field2Long(oRS!ponum) + frmShowPO.Show 1 + Else +' glngORDERID = 0 + frmShowOrderMat.Show 1 + End If + +End Sub + +Private Sub lstPOWO_DblClick() + + lstPO.ListIndex = -1 + lstRepairs.ListIndex = -1 + lstPayroll.ListIndex = -1 + lstInvoice.ListIndex = -1 + Load frmPOWOLot + frmPOWOLot.chkLOOK = vbChecked + frmPOWOLot.Show 1 + +End Sub + +Private Sub lstRepairs_DblClick() + + lstPayroll.ListIndex = -1 + lstPO.ListIndex = -1 + + gintREPAIRID = lstRepairs.ItemData(lstRepairs.ListIndex) + frmShowRepair.Show 1 +End Sub + +Private Sub POWOLoad() +Dim oRS As Recordset, intYN As Integer +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOWO WHERE LOT_ID = " & gintLOTID ' & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOWO.Clear + + Do Until oRS.EOF + With lstPOWO + strLine = Field2Str(oRS!repair_id) & vbTab & Field2Str(oRS!builder_PO) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + End With + + oRS.MoveNext + Loop + + If lstPOWO.ListCount Then + lstPOWO.ListIndex = 0 + mboolPROJ = False + lstPOWO.Enabled = True + Else + lstPOWO.ListIndex = -1 + lstPOWO.Enabled = False +' Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormLotList - Module POWOLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frx new file mode 100644 index 0000000..d79a05d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold/frmLotList2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frm new file mode 100644 index 0000000..d2a5dbc --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frm @@ -0,0 +1,1334 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Begin VB.Form frmPayList + Caption = "Payroll List" + ClientHeight = 7995 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9030 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 7995 + ScaleWidth = 9030 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrDetail + Caption = "Print Pay Detail" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 23 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdUpEmpMaster + Caption = "Up Emp Master" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 22 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdMoveMAS90 + Caption = "Move PR to MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 21 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdPRProcess + Caption = "Setup PR for MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 20 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmd1TimeSheet + Caption = "1 Time Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 19 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPayLog + Caption = "Payroll Log" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 18 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1Crew + Caption = "1 Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 17 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1 + Caption = "1 VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 16 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintTimeSheets + Caption = "Time Sheets" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 15 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintData + Caption = "Data Input Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 14 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintCrew + Caption = "Print Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 13 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin Crystal.CrystalReport crPay + Left = 6900 + Top = 5520 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 12 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdAddMember + Caption = "Add &Members" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 5 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 6 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.TextBox txtCrewID + Height = 375 + Left = 5160 + TabIndex = 11 + TabStop = 0 'False + Top = 5580 + Visible = 0 'False + Width = 1215 + End + Begin VB.ListBox lstCrew + Height = 3765 + Left = 4680 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 1560 + Width = 4215 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 7 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 4 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.ListBox lstPayCrews + Height = 3765 + Left = 120 + TabIndex = 2 + Top = 1560 + Width = 4455 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 315 + Left = 1320 + TabIndex = 0 + Top = 180 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 92143617 + CurrentDate = 36942 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired crew listed below to add the crew to the current payroll list." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5340 + TabIndex = 10 + Top = 660 + Width = 2955 + End + Begin VB.Label lblInstruct + Caption = "Double Click or CTRL P on the desired crew to view payroll informaton for that crew for the payroll date shown." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 9 + Top = 600 + Width = 4395 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Crews for this payroll:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 180 + TabIndex = 3 + Top = 1320 + Width = 1845 + End + Begin VB.Label lblPRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 360 + TabIndex = 1 + Top = 240 + Width = 900 + End +End +Attribute VB_Name = "frmPayList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSPay As Recordset +Dim moRSCREW As Recordset +Dim mboolAdding As Boolean +'Need to change the lstPayCrews to an fplist ************************** + +Private Sub cmd1TimeSheet_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + strSQL = "{tblcrew.crew_id} = " & Left$(lstPayCrews.Text, 4) + crPay.ReportFileName = App.Path & "\timesheetNew.rpt" +' crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPay.SelectionFormula = strSQL + crPay.Destination = crptToPrinter + crPay.CopiesToPrinter = 1 + crPay.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmd1TimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +Dim intID As Integer, strSQL As String, lngINDEX As Long, lngFind As Long +Dim oRS As Recordset + On Error GoTo Error_EH + + cmdAdd.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = InputBox("Enter The Crew Number To Add", "Crew Number", 9999) + If intID > 0 Then + strSQL = "SELECT Crew_id, Crew_Boss, Type, Inactive FROM tblCREW WHERE crew_id = " & intID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + cmdAdd.Enabled = True + Exit Sub + End If + End If + If oRS.EOF Then + Call CrewLoad + Else + txtCrewID = oRS!crew_id + Call FormSave + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + + cmdAdd.SetFocus + End If + Else + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + cmdAdd.SetFocus + Exit Sub + End If + lngFind = Field2Long(intID) + Call CBFindString2(lstPayCrews, Field2Str(intID)) +' lstPayCrews.SetFocus +' lngINDEX = ListFindItem(lstPayCrews, lngFind) +' Call ListFindItem3(lstPayCrews, lngFind) +' lstPayCrews.ListIndex = lngINDEX + Exit Sub + +Error_EH: + If Err.Number = 13 Then + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + oRS.AddNew + oRS!C_USER = gstrLOGIN + End If + + + With oRS + !U_USER = gstrLOGIN + !Updated = Date + !crew_id = txtCrewID + !Pay_Date = dtpPayDate.Value + End With + + oRS.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSave + +' moRSPay.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + Exit Sub + +Error_EH: +' Call ErrorHandler(moRSPay.ActiveConnection) + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPayHeader WHERE Pay_Date = #" & dtpPayDate.Value & "# ORDER BY crew_id" + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until moRSCREW.EOF + With lstPayCrews + strCREW = "SELECT * FROM tblCrew where CREW_id = " & moRSCREW!crew_id + Set oRS = New Recordset + oRS.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + strLine = Field2Str(moRSCREW!crew_id) & " " & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!crew_boss) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!pay_id + End If + End With + + moRSCREW.MoveNext + Loop + moRSCREW.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + cmdAddMember.Enabled = True + cmdDelete.Enabled = True + cmdPrint.Enabled = True + cmdPrintCrew.Enabled = True + cmdPrintData.Enabled = True + cmdPrintTimeSheets.Enabled = True + cmdPrint1.Enabled = True + cmdPrint1Crew.Enabled = True + cmdPrintPayLog.Enabled = True + cmd1TimeSheet.Enabled = True + cmdPRProcess.Enabled = True + cmdUpEmpMaster.Enabled = True + cmdMoveMAS90.Enabled = True + cmdPrDetail.Enabled = True + + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + Else + cmdAddMember.Enabled = False + cmdDelete.Enabled = False + cmdPrint.Enabled = False + cmdPrintCrew.Enabled = False + cmdPrintData.Enabled = False + cmdPrintTimeSheets.Enabled = False + cmdPrint1.Enabled = False + cmdPrint1Crew.Enabled = False + cmdPrintPayLog.Enabled = False + cmd1TimeSheet.Enabled = False + cmdPRProcess.Enabled = False + cmdUpEmpMaster.Enabled = False + cmdMoveMAS90.Enabled = False + cmdPrDetail.Enabled = False + ' Call ChangeButton + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddMember_Click() +Dim intINDEX As Integer + If lstPayCrews.ListIndex <> -1 Then + intINDEX = lstPayCrews.ListIndex + gintCREWID = Left$(Field2Str2(lstPayCrews.Text), 3) + frmCrewList.Show 1 + Call PayLoad + lstPayCrews.ListIndex = intINDEX + Else + MsgBox "You Must Select A Crew", vbOKOnly, "Select Crew" + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + + strYN = MsgBox("Are You Sure You Want To Delete This Crew?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblTIME where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayCrew where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayHeader WHERE pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrintVWP_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintVWP_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMoveMAS90_Click() + MsgBox "Go to MAS90 and Import the Payroll", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub cmdPrDetail_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Remember to Update Check Information Before Printing - Are You Ready?", vbYesNo, "Ready to Print") + If intYN = vbNo Then + Exit Sub + End If + + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + strDate = dtpPayDate.Value + intBYear = Mid(strDate, 7, 4) + intBDay = Format(Mid(strDate, 4, 2), "00") + intBMonth = Format(Mid(strDate, 1, 2), "00") +' intEYear = Mid(txtEndDate, 7, 4) +' intEDay = Format(Mid(txtEndDate, 4, 2), "00") +' intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crPay.ReportFileName = App.Path & "\PayDetail.rpt" + + crPay.Formulas(3) = "ZZ_Date = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" +' crpay.Formulas(4) = "Z_Crew = " & mintCREW +' crpay.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crPay.Destination = crptToPrinter + Else + crPay.Destination = crptToWindow + End If + crPay.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrDetail_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + + +Private Sub cmdPrint_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint1_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint1Crew_Click() +Dim strSQL As String ', strSQL2 As String +'Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPay.ReportFileName = App.Path & "\payinfo2.rpt" + crPay.SelectionFormula = strSQL + + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1Crew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintCrew_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo2.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintData_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + intMonth = Month(dtpPayDate.Value) + intDay = Day(dtpPayDate.Value) + intYear = Year(dtpPayDate.Value) +' Do Until oRS.EOF + strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPay.ReportFileName = App.Path & "\paylist.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintData_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPayLog_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + intMonth = Month(dtpPayDate) + intDay = Day(dtpPayDate) + intYear = Year(dtpPayDate) +' Do Until oRS.EOF +' strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_Date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPay.ReportFileName = App.Path & "\paylog.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintTimeSheets_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 +' frmReport.Show 1 + + strSql2 = "SELECT crew_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblcrew.crew_id} = " & Field2Str2(oRS!crew_id) + crPay.ReportFileName = App.Path & "\timesheetNew.rpt" +' crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + crPay.Destination = crptToPrinter +' crPay.Destination = gintDEST + crPay.CopiesToPrinter = 1 + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintTimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPRProcess_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblPayHeader where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) + Set oRT = New Recordset + oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + Do Until oRT.EOF + With oRT + oRSS.AddNew + oRSS!employee_no = Field2Str(!emp_id) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str(!gross) + oRSS!Rate = Field2Str(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End With + oRT.MoveNext + Loop + oRS!P_FLAG = vbUnchecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into MAS90" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdUpEmpMaster_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strSql2 = "DELETE * FROM PR1_EmployeeMaster" + goConn.Execute strSql2 + + strSql2 = "SELECT department, employeenumber, lastname, firstname, socialsecuritynumber, DefaultWCCode, employeestatus_AIT FROM PR1_EmployeeMaster" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE employeenumber = '" & Field2Str(oRSS!employeenumber) & "' and department = '" & Field2Str(oRSS!department) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + ElseIf Field2Str(oRSS!department) <> Field2Str(oRS!department) Then + oRS.Delete + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update +' End If + Else + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + End If + oRSS.MoveNext + + Loop + Screen.MousePointer = vbDefault + MsgBox "Employee Master Information Has Been Updated" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub dtpPayDate_Change() + Call PayLoad + cmdAdd.SetFocus +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + +' mboolSETUP = False +' mboolENTER = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyP Then ' Display key combinations. + If CtrlDown Then + Call lstPayCrews_DblClick +' Call PayLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAdd_Click +' Call CrewLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyM Then ' Display key combinations. + If CtrlDown Then + Call cmdAddMember_Click +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + frmPayList.Width = 4725 + dtpPayDate.Value = Date + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub CrewLoad() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblCrew Order BY Crew_Boss" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + .AddItem Field2Str(moRSCREW!crew_boss) + .ItemData(.NewIndex) = moRSCREW!crew_id + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmPayList.Width = 9150 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_DblClick() + txtCrewID = lstCrew.ItemData(lstCrew.ListIndex) + frmPayList.Width = 4725 + cmdAdd.Enabled = True + cmdDelete.Enabled = True + Call FormSave +End Sub + +Private Sub lstPayCrews_DblClick() + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + gintCREWID = CInt(Left(lstPayCrews.Text, 3)) + Load frmPayHead + frmPayHead.lblCrewName = Trim$(Mid$(lstPayCrews.Text, InStr(lstPayCrews.Text, vbTab) + 1)) + frmPayHead.txtPayDate = dtpPayDate.Value + frmPayHead.txtCrewID = gintCREWID + + frmPayHead.Show 1 +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frx new file mode 100644 index 0000000..de8c3ff Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/Hold190111/frmPayList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frm new file mode 100644 index 0000000..63af1ad --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frm @@ -0,0 +1,892 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAR2 + Caption = "Accounts Receivable" + ClientHeight = 4950 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7530 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4950 + ScaleWidth = 7530 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstHeader + Height = 2835 + Left = 195 + TabIndex = 17 + Top = 585 + Width = 4470 + _Version = 196608 + _ExtentX = 7885 + _ExtentY = 5001 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAR2.frx":0000 + End + Begin VB.TextBox txtTax + Height = 315 + Left = 5580 + TabIndex = 16 + Top = 3000 + Width = 495 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "RePrint Invoice" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 14 + Top = 3675 + Width = 1275 + End + Begin VB.ComboBox cboARCode + Height = 315 + Left = 2955 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 1 + Top = 195 + Width = 4515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 13 + Top = 4395 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 12 + Top = 2955 + Width = 1275 + End + Begin VB.CheckBox chkReady + Alignment = 1 'Right Justify + Caption = "Ready to Transfer to CMS:" + Height = 315 + Left = 5190 + TabIndex = 7 + Top = 2415 + Width = 2205 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 11 + TabIndex = 6 + Top = 1935 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 6240 + MaxLength = 7 + TabIndex = 5 + Top = 1515 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 4 + Top = 1095 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 3 + Top = 675 + Width = 1200 + End + Begin VB.ListBox lstDetail + Height = 1230 + Left = 180 + TabIndex = 2 + Top = 3660 + Width = 5895 + End + Begin VB.Label lblTax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code" + Height = 195 + Left = 4830 + TabIndex = 15 + Top = 3090 + Width = 690 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Sales Code:" + Height = 195 + Left = 4920 + TabIndex = 11 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 5235 + TabIndex = 10 + Top = 2040 + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payment Due Date:" + Height = 195 + Left = 4770 + TabIndex = 9 + Top = 1200 + Width = 1395 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Date:" + Height = 195 + Left = 5190 + TabIndex = 8 + Top = 780 + Width = 960 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Builder's CMS AR Code:" + Height = 195 + Left = 1200 + TabIndex = 0 + Top = 240 + Width = 1710 + End +End +Attribute VB_Name = "frmAR2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSDetail As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String, mstrPO_NUM As String +Dim mstrINVNO As String, mstrPROJLOT As String, mlngTRANSID As Long +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single, mlngTRANS2 As Long + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab +' strLine = Field2Str2(oRS!Lot_id) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_ID), "000000") & vbTab & (Field2Str(oRS!po_num)) +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_id), "000000") & vbTab & Format(Field2Str(oRS!po_num)) +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoad() +Dim oRS As Recordset, strSalesCode As String +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + +' lstHeader.col = 1 + lstHeader.col = 0 + mlngTRANS2 = Field2Str2(lstHeader.ColText) +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount, PO_NUM from tblARInvoice WHERE shipped and PO_NUM = '" & mstrPO_NUM & "' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + lstDetail.Clear + + Do Until oRS.EOF + strSalesCode = Field2Str(oRS!sales_code) + If Len(strSalesCode) = 0 Then + strSalesCode = "BLANK" +' Else + + End If + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) + If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) + Else + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & vbTab & Field2Str(oRS!Description) + End If + lstDetail.AddItem strLine + lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module DetailLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboARCode_Change() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub chkReady_Click() + cmdSave.Enabled = True +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gstrPONUM = Field2Str(oRS!po_num) + mstrPROJLOT = Field2Str(oRS!ProjLot) + Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\invoice.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSDetail.State = adStateOpen Then + moRSDetail.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + lstDetail.Enabled = True + lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call ARCodeLoad + +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str(oRS!Cust_NO) & " - " & Field2Str(oRS!Name) + cboARCode.AddItem strLine + cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!Bill_ID) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ARCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSDetail + txtInvDate = Field2Str(!invoice_date) + txtDueDate = Field2Str(!inv_due_date) + txtItemAmt = Format(Field2Str2(!amount), "#,#.00;(#,#.00)") +' txtItemAmt = Format(Field2Str2(!amount), "Standard") + txtSalesCode = Field2Str(!sales_code) + If Len(txtSalesCode) = 0 Then + txtSalesCode = "BLANK" + txtSalesCode.BackColor = &H80FFFF + txtSalesCode.ForeColor = &HFF& + Else + txtSalesCode.BackColor = &H80000005 + txtSalesCode.ForeColor = &H80000008 + txtSalesCode.FontBold = False + End If + txtTAX = Field2Str(!taxcode) + If txtTAX = "AZ" Then + txtTAX.BackColor = &H80FFFF + txtTAX.ForeColor = &HFF& + txtTAX.FontBold = True + Else + txtTAX.BackColor = &H80000005 + txtTAX.ForeColor = &H80000008 + txtTAX.FontBold = False + End If + chkReady = Field2CheckBox(!ready) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindDetail() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set moRSDetail = New Recordset + moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSDetail.EOF Then + FormFindDetail = False + Else + FormFindDetail = True + msglInvTotal = moRSDetail!non_tax_amt + mstrType = moRSDetail!inv_type + gintPROJID = moRSDetail!PROJ_ID + Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form AR - Module FormFindDetail" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() + If lstDetail.ListIndex <> -1 Then + If FormFindDetail() Then + Call FormShow + + End If + End If +End Sub +Private Sub FieldsSave() +Dim strSQL As String, lngTRANSID As Long +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSDetail + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !price = Str2Field(txtItemAmt) + !amount = Str2Field(txtItemAmt) + !sales_code = Str2Field(txtSalesCode) + .Update + End With + + strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + msglInvTotal = Field2Str2(oRS!sglTOTAL) + + strSQL = "SELECT * FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !ready = chkReady + !non_tax_amt = msglInvTotal + !taxcode = Str2Field(txtTAX) + If Field2Str2(moRSProj!retention) > 0 Then + !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") + Else + !retention_amt = 0 + End If + .Update + End With + oRS.MoveNext + Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + mlngTRANSID = Field2Str2(lstHeader.ColText) + cmdPrint.Enabled = True + lstHeader.col = 4 + gintLOTID = lstHeader.ColText + lstHeader.col = 5 + mstrPO_NUM = Field2Str(lstHeader.ColText) +' gintLOTID = lstHeader.ItemData(lstHeader.ListIndex) + Call DetailLoad + If lstDetail.ListIndex <> -1 Then + Else + lstDetail.Clear + Call FormClear + End If + Else + cmdPrint.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + End If + End If + ElseIf IsDate(txtInvDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + End If + +End Sub + +Private Sub txtItemAmt_GotFocus() + Call FieldSelect(txtItemAmt) + msglItemAmt = Single2Field(txtItemAmt) +End Sub + +Private Sub txtItemAmt_LostFocus() + If msglItemAmt < Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt = Field2Str(txtItemAmt) Then + txtItemAmt = Format(txtItemAmt, "#,#.00") + End If +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTAX) +End Sub + +Private Sub txtTax_LostFocus() + If Not IsNull(txtTAX) Or txtTAX = "" Then + txtTAX = UCase(txtTAX) + Else + MsgBox "You Must Enter A Sales Tax Code", vbOKOnly, "No Tax Code" + txtTAX.SetFocus + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frx new file mode 100644 index 0000000..eeba38d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmAR2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frm new file mode 100644 index 0000000..b482a92 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frm @@ -0,0 +1,684 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmInvPrice + Caption = "Supplier Inventory Prices" + ClientHeight = 5265 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11235 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5265 + ScaleWidth = 11235 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrint + Caption = "Print Inv List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6780 + TabIndex = 16 + Top = 2400 + Width = 1155 + End + Begin Crystal.CrystalReport crInvList + Left = 10485 + Top = 2535 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8400 + TabIndex = 15 + Top = 2400 + Width = 1155 + End + Begin VB.ListBox lstInv + Height = 2205 + Left = 120 + Sorted = -1 'True + TabIndex = 14 + Top = 2880 + Visible = 0 'False + Width = 2955 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 10020 + TabIndex = 13 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8400 + TabIndex = 11 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6780 + TabIndex = 12 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = 8700 + Picture = "frmInvPrice.frx":0000 + Style = 1 'Graphical + TabIndex = 8 + Top = 1245 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 7620 + MaxLength = 8 + TabIndex = 10 + Top = 1260 + Width = 855 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 7620 + MaxLength = 30 + TabIndex = 9 + Top = 840 + Width = 3555 + End + Begin VB.TextBox txtInvNo + Height = 315 + Left = 7620 + MaxLength = 18 + TabIndex = 7 + Top = 420 + Width = 2625 + End + Begin VB.ListBox lstInventory + Height = 4740 + Left = 3240 + Sorted = -1 'True + TabIndex = 2 + Top = 420 + Width = 3375 + End + Begin VB.ListBox lstSupplier + Height = 2400 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 420 + Width = 2955 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Cost:" + Height = 195 + Left = 6735 + TabIndex = 6 + Top = 1320 + Width = 780 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 6675 + TabIndex = 5 + Top = 900 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + Height = 195 + Left = 6660 + TabIndex = 4 + Top = 480 + Width = 855 + End + Begin VB.Label lblInventory + Caption = "Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3300 + TabIndex = 3 + Top = 120 + Width = 1815 + End + Begin VB.Label lblSupplier + Caption = "Supplier" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 180 + TabIndex = 1 + Top = 120 + Width = 1095 + End +End +Attribute VB_Name = "frmInvPrice" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, Price from tblInvPrice WHERE sup_no = " & lstSupplier.ItemData(lstSupplier.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & Format$(Field2Str(oRS!price), "##,##0.00") & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub +Private Sub LoadSupplier() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSupplier WHERE type <> 'A'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstSupplier.Clear + + Do Until oRS.EOF + With lstSupplier + + strLine = oRS!Type & vbTab & oRS!supplier + .AddItem strLine + .ItemData(.NewIndex) = oRS!sup_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstSupplier.ListCount Then + lstSupplier.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice.SetFocus + + End With + Else + lstInv.Visible = True + Call LoadMInventory + lngFind = Field2Str(txtInvNo) +' Call ListFindItem2(lstInv, lngFind) '*** need to FIX + + End If + oRS.Close + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInv.Clear + + Do Until oRS.EOF + With lstInv + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInv.ListCount Then + lstInv.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = "" + txtDesc = "" + txtPrice = "" +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblInvPrice WHERE Sup_no = " & lstSupplier.ItemData(lstSupplier.ListIndex) & " AND INV_NO = " & lstInventory.ItemData(lstInventory.ListIndex) + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + moRSMat.Update + Resume Next +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!price), "##,###.00") + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !inv_no = Str2Field(txtInvNo) + !Desc = Str2Field(txtDesc) + !price = Str2Field(txtPrice) + !sup_no = lstSupplier.ItemData(lstSupplier.ListIndex) + !l_update = Now() + !LUUser = gstrLOGIN + + End With + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + Call FormClear + txtInvNo.SetFocus + cmdFindInv.Visible = True + +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMSG As String, strSql2 As String +Dim oRS As Recordset, intResponse As Integer + + strSQL = "SELECT * FROM tblInvPrice WHERE Sup_No = " & lstSupplier.ItemData(lstSupplier.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' intCount = oRS.RecordCount + strSql2 = "{tblinvprice.sup_no} = " & lstSupplier.ItemData(lstSupplier.ListIndex) + + strMSG = "Do you want to print to the Printer?" & vbLf & vbCr +' strMSG = strMSG & intCount & " Checks did not match - Do You Want A Report" + intResponse = MsgBox(strMSG, vbYesNo, "Print to Printer") + gintCOPY = 1 + crInvList.ReportFileName = App.Path & "\InvListByVendor.rpt" + crInvList.ReplaceSelectionFormula (strSql2) + + If intResponse = vbYes Then + crInvList.Destination = crptToPrinter + Else + crInvList.Destination = crptToWindow + End If + crInvList.CopiesToPrinter = gintCOPY + crInvList.WindowState = crptMaximized + crInvList.Action = 1 + crInvList.Reset +' Else +' Exit Sub +' End If + +End Sub + +Private Sub cmdSaveInv_Click() + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + cmdFindInv.Visible = False + Call FormSave + Call LoadInventory + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSaveInv.Enabled Then + cmdSaveInv.Enabled = True + cmdAddInv.Enabled = False + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + Set moRSMat = New Recordset + + Call LoadSupplier + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInv_DblClick() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc FROM tblInvtry where Inv_no = " & lstInv.ItemData(lstInv.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + End With + + oRS.Close + txtPrice.SetFocus + lstInv.Visible = False + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = True + cmdAddInv.Enabled = False +End Sub + +Private Sub lstSupplier_Click() + On Error GoTo Error_EH + + If lstSupplier.ListIndex <> -1 Then + Call LoadInventory + End If + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub + +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frx new file mode 100644 index 0000000..8d259d3 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvPrice.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frm new file mode 100644 index 0000000..37cdea2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frm @@ -0,0 +1,1062 @@ +VERSION 5.00 +Begin VB.Form frmInvTake + Caption = "Take Off Inventory List" + ClientHeight = 5115 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5115 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.ComboBox cboInvTYpe + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0000 + Left = 9600 + List = "frmInvTake.frx":0013 + Style = 2 'Dropdown List + TabIndex = 29 + Top = 420 + Width = 2175 + End + Begin VB.ComboBox cboMetal + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0056 + Left = 7920 + List = "frmInvTake.frx":0060 + Style = 2 'Dropdown List + TabIndex = 12 + Top = 2580 + Width = 1215 + End + Begin VB.ComboBox cboMType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0071 + Left = 7920 + List = "frmInvTake.frx":0073 + Style = 2 'Dropdown List + TabIndex = 11 + Top = 2220 + Width = 1215 + End + Begin VB.ComboBox cboDFlag + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0075 + Left = 7920 + List = "frmInvTake.frx":007F + Style = 2 'Dropdown List + TabIndex = 10 + Top = 1860 + Width = 1215 + End + Begin VB.TextBox txtMLength + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 13 + Top = 2940 + Width = 855 + End + Begin VB.TextBox txtQty + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 9 + Top = 1500 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 10680 + TabIndex = 18 + TabStop = 0 'False + Top = 3360 + Width = 1155 + End + Begin VB.ListBox lstInv + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 4545 + Left = 120 + Sorted = -1 'True + TabIndex = 17 + Top = 420 + Width = 2955 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete TO Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 9300 + TabIndex = 16 + TabStop = 0 'False + Top = 3360 + Width = 1215 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save TO Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 8020 + TabIndex = 14 + Top = 3360 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add TO Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 6720 + TabIndex = 15 + TabStop = 0 'False + Top = 3360 + Width = 1155 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 8 + TabIndex = 8 + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtDesc + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 30 + TabIndex = 7 + Top = 780 + Width = 3855 + End + Begin VB.TextBox txtInvNo + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 5 + TabIndex = 6 + Top = 420 + Width = 855 + End + Begin VB.ListBox lstInventory + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 4545 + Left = 3240 + Sorted = -1 'True + TabIndex = 1 + Top = 420 + Width = 3375 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv. Type: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8880 + TabIndex = 28 + Top = 480 + Width = 765 + End + Begin VB.Label lblInstruct + Caption = "CTRL S to Save CTRL A to Add CTRL D to Delete" + Height = 675 + Left = 10140 + TabIndex = 27 + Top = 1260 + Width = 1575 + End + Begin VB.Label lblLogin + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 26 + Top = 60 + Width = 855 + End + Begin VB.Label lblEstimator + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimator:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7140 + TabIndex = 25 + Top = 120 + Width = 690 + End + Begin VB.Label lblHelp + Caption = $"frmInvTake.frx":0093 + Height = 855 + Left = 6780 + TabIndex = 24 + Top = 4140 + Width = 4935 + End + Begin VB.Label lblMetalLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6840 + TabIndex = 23 + Top = 3000 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7035 + TabIndex = 22 + Top = 2640 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6810 + TabIndex = 21 + Top = 2280 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6855 + TabIndex = 20 + Top = 1920 + Width = 960 + End + Begin VB.Label lblTOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Qty:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6930 + TabIndex = 19 + Top = 1560 + Width = 885 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6855 + TabIndex = 5 + Top = 1200 + Width = 960 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6975 + TabIndex = 4 + Top = 840 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6960 + TabIndex = 3 + Top = 480 + Width = 855 + End + Begin VB.Label lblInventory + AutoSize = -1 'True + Caption = "Takeoff Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3300 + TabIndex = 2 + Top = 120 + Width = 2430 + End + Begin VB.Label lblInvList + AutoSize = -1 'True + Caption = "Full Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 180 + TabIndex = 0 + Top = 120 + Width = 1815 + End +End +Attribute VB_Name = "frmInvTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean +Dim mboolAdding As Boolean +Dim mdblQTY As Double, mintINDEX As Integer + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, TPrice from tblInvtake WHERE estimator = '" & gstrLOGIN & "'" & " AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & Format$(Field2Str(oRS!tprice), "##,##0.00") & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +'Private Sub LoadSupplier() +'Dim oRS As Recordset +'Dim strSQL As String +'Dim strLine As String +' On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblSupplier WHERE type <> 'A'" + +' Set oRS = New Recordset + +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstSupplier.Clear + +' Do Until oRS.EOF +' With lstSupplier + +' strLine = oRS!Type & vbTab & oRS!supplier +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!sup_no +' End With + +' oRS.MoveNext +' Loop +' oRS.Close + +' If lstSupplier.ListCount Then +' lstSupplier.ListIndex = 0 +' End If + +' Exit Sub + +'Error_EH: +' Call ErrorHandler2 +' Exit Sub +'End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInv.Clear + + Do Until oRS.EOF + With lstInv + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInv.ListCount Then + lstInv.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = 0 + txtDesc = "" + txtPrice = 0 + txtQty = 0 + txtMLength = 0 + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblInvTake " + strSQL = strSQL & "WHERE estimator = '" & gstrLOGIN & "' AND INV_NO = " & lstInventory.ItemData(lstInventory.ListIndex) + + Set moRSMat = New Recordset + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + + Exit Function + +Error_EH: + gstrMODULE = "Form InvTake - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!tprice), "##,###.00") + txtQty = Field2Str2(!qty) + txtMLength = Field2Str2(!calc_amt) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) +' If !m_type = "L" Then +' cboMType.Text = "Lath" +' ElseIf !m_type = "B" Then +' cboMType.Text = "Brown" +' ElseIf !m_type = "S" Then +' cboMType.Text = "Scratch" +' ElseIf !m_type = "T" Then +' cboMType.Text = "Texture" +' ElseIf !m_type = "C" Then +' cboMType.Text = "CMU" +' ElseIf !m_type = "P" Then +' cboMType.Text = "PreOrder" +' End If + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + mboolSHOW = False + +' cboInvType.Enabled = True +' cboInvType.ListIndex = gbytInv_Type +' cboInvType.ListIndex = 1 +' cboInvType.Enabled = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !estimator = gstrLOGIN + !inv_no = Str2Field(txtInvNo) + !Desc = Str2Field(txtDesc) + !tprice = Str2Field(txtPrice) + !qty = Str2Field(txtQty) + !calc_amt = Str2Field(txtMLength) + !l_y_date = Now() + + !m_type = Left$(cboMType.Text, 1) + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + !inv_type = gbytINV_TYPE + + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + mboolUPDATE = False + Call FormClear + txtInvNo.SetFocus + +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSaveInv_Click() + mintINDEX = lstInventory.ListIndex + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + Call FormSave + Call LoadInventory + If (lstInventory.ListCount - 1) = mintINDEX Then + lstInventory.ListIndex = mintINDEX + Else + lstInventory.ListIndex = mintINDEX + 1 + End If + mboolUPDATE = True + lstInventory.SetFocus + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAddInv_Click + End If + Exit Sub + End If + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown Then + Call cmdDeleteInv_Click + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call cmdSaveInv_Click + End If + Exit Sub + End If + + If Not cmdSaveInv.Enabled Then + cmdSaveInv.Enabled = True + cmdAddInv.Enabled = False + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + Set moRSMat = New Recordset + cboInvTYpe.ListIndex = gbytINV_TYPE + cboInvTYpe.Enabled = False + lblLogin = gstrLOGIN + Call MTypeLoad(cboMType) + Call LoadInventory + Call LoadMInventory + mboolUPDATE = True +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInv_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strSql2 As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblInvtry where Inv_no = " & lstInv.ItemData(lstInv.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSMat.State = adStateClosed Then + strSql2 = "SELECT * FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE + Set moRSMat = New Recordset + moRSMat.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + End If + + With oRS + moRSMat.AddNew + moRSMat!estimator = gstrLOGIN + moRSMat!inv_no = Field2Str2(!inv_no) + moRSMat!calc_amt = Field2Str(!calc_amt) + moRSMat!Desc = Field2Str(!Desc) + moRSMat!d_flag = Field2Str(!d_flag) + moRSMat!m_type = Field2Str(!m_type) + moRSMat!calc_flag = Field2Str(!calc_flag) + moRSMat!l_y_date = Now() + moRSMat!tprice = Field2Str2(!tprice) + moRSMat!inv_type = Field2Str2(!inv_type) + moRSMat.Update + End With + + oRS.Close + + Call LoadInventory + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module lstInv_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + txtQty.SetFocus + Exit Sub + +Error_EH: + If Err = 5 Then + Resume Next + Else + gstrMODULE = "Form InvTake - Module lstInventory_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub + +Private Sub lstInventory_DblClick() + Call cmdDeleteInv_Click +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtQty_GotFocus() + Call FieldSelect(txtQty) + mdblQTY = Field2Str2(txtQty) +End Sub + +Private Sub txtMLength_GotFocus() + Call FieldSelect(txtMLength) +End Sub + +Private Sub txtQty_LostFocus() + If mboolUPDATE Then + If mdblQTY <> Field2Str2(txtQty) Then + cmdSaveInv.Enabled = True + cmdSaveInv.SetFocus + End If + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frx new file mode 100644 index 0000000..43b600c Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInvTake.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frm new file mode 100644 index 0000000..13cbd57 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frm @@ -0,0 +1,927 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmInventory + Caption = "Inventory Prices" + ClientHeight = 3690 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8355 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 3690 + ScaleWidth = 8355 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpCombo cboMType + Height = 315 + Left = 4680 + TabIndex = 24 + Top = 2235 + Width = 1215 + _Version = 196608 + _ExtentX = 2143 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "cboMType" + Columns = 2 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 0 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmInventory.frx":0000 + End + Begin VB.CommandButton cmdCopy + Caption = "Copy Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5880 + TabIndex = 23 + Top = 3000 + Visible = 0 'False + Width = 1155 + End + Begin VB.ComboBox cboInvType + Height = 315 + ItemData = "frmInventory.frx":02FE + Left = 4680 + List = "frmInventory.frx":0311 + Style = 2 'Dropdown List + TabIndex = 22 + Top = 60 + Width = 3555 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update TO Cost" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5880 + TabIndex = 20 + Top = 1200 + Width = 1155 + End + Begin VB.TextBox txtLength + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + TabIndex = 10 + Top = 2940 + Width = 855 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmInventory.frx":0354 + Left = 4680 + List = "frmInventory.frx":035E + Style = 2 'Dropdown List + TabIndex = 9 + Top = 2580 + Width = 1215 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmInventory.frx":036F + Left = 4680 + List = "frmInventory.frx":0379 + Style = 2 'Dropdown List + TabIndex = 8 + Top = 1860 + Width = 1215 + End + Begin VB.TextBox txtTOCost + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + TabIndex = 7 + Top = 1500 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 14 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 13 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 11 + Top = 1800 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 12 + TabStop = 0 'False + Top = 1200 + Width = 1155 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + MaxLength = 8 + TabIndex = 6 + Top = 1125 + Width = 855 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 4680 + MaxLength = 30 + TabIndex = 5 + Top = 780 + Width = 3555 + End + Begin VB.TextBox txtInvNo + Height = 315 + Left = 4680 + MaxLength = 18 + TabIndex = 4 + Top = 420 + Width = 2625 + End + Begin LpLib.fpList lstInventory + Height = 3210 + Left = 45 + TabIndex = 25 + Top = 360 + Width = 3360 + _Version = 196608 + _ExtentX = 5927 + _ExtentY = 5662 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 210 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInventory.frx":038D + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory Type:" + Height = 195 + Left = 3465 + TabIndex = 21 + Top = 120 + Width = 1110 + End + Begin VB.Label lblLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = 3600 + TabIndex = 19 + Top = 3000 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = 3795 + TabIndex = 18 + Top = 2640 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 3570 + TabIndex = 17 + Top = 2280 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = 3615 + TabIndex = 16 + Top = 1920 + Width = 960 + End + Begin VB.Label lblTOCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Cost:" + Height = 195 + Left = 3615 + TabIndex = 15 + Top = 1560 + Width = 960 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yard Cost:" + Height = 195 + Left = 3840 + TabIndex = 3 + Top = 1200 + Width = 735 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 3735 + TabIndex = 2 + Top = 840 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + Height = 195 + Left = 3720 + TabIndex = 1 + Top = 480 + Width = 855 + End + Begin VB.Label lblInventory + Caption = "Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 1815 + End +End +Attribute VB_Name = "frmInventory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mintBOOKMARK As Integer +Dim moRSYS As Recordset + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & cboInvType.ListIndex + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = "" + txtDesc = "" + txtPrice = "" + txtTOCost = "" + txtLength = "" +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblInvtry " + strSQL = strSQL & "WHERE INV_NO = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = strSQL & " AND INV_TYPE = " & cboInvType.ListIndex + + Set moRSMat = New Recordset + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Inventory - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() +Dim strTYPE As String, strINDEX As String + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!price), "##,###.00") + txtTOCost = Format$(Field2Str(!tprice), "##,###.00") + txtLength = Field2Str2(!calc_amt) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + +' If cboMType = "" Then + + If strTYPE = "L" Then +' cboMType.Index = 1 + cboMType.Text = "Lath" +' cboMType. +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Brown" + ElseIf strTYPE = "S" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Scratch" + ElseIf strTYPE = "T" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Texture" + ElseIf strTYPE = "C" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "CMU" + ElseIf strTYPE = "P" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "PreOrder" + ElseIf strTYPE = "V" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "E-Synthetic" + ElseIf strTYPE = "J" Then + cboMType.Text = "J-PaintPrep" + ElseIf strTYPE = "K" Then + cboMType.Text = "K-P-Interior" + ElseIf strTYPE = "N" Then + cboMType.Text = "N-P-Exterior" + ElseIf strTYPE = "M" Then + cboMType.Text = "M-PaintFinal" + Else + cboMType.ListIndex = -1 + End If + + ' Else +' Call FindType3(strINDEX, strTYPE) +' cboMType.ListIndex = CLng(strINDEX) +' Call FindType(cboMType, strTYPE) + ' End If + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !inv_no = Str2Field(txtInvNo) + !Desc = Str2Field(txtDesc) + !price = Str2Field(txtPrice) + !tprice = Str2Field(txtTOCost) + !l_u_date = Now() + !LUUser = gstrLOGIN + !calc_amt = Str2Field(txtLength) + !m_type = Left$(cboMType.Text, 1) + !inv_type = cboInvType.ListIndex + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboInvType_Change() + Call LoadInventory +End Sub + +Private Sub cboInvType_Click() + Call LoadInventory +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + Call FormClear + txtInvNo.SetFocus + +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSaveInv_Click() + mintBOOKMARK = lstInventory.ListIndex + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + Call FormSave + Call LoadInventory + lstInventory.ListIndex = mintBOOKMARK + lstInventory.SetFocus +End Sub + +Private Sub cmdUpdate_Click() + txtTOCost = Round((Field2Str2(txtPrice) * Field2Str2(moRSYS!TOMMU)), 2) + Call cmdSaveInv_Click +End Sub + +Private Sub Form_Activate() + + + Call MTypeLoad(cboMType) + Call LoadInventory + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +' If Not cmdSaveInv.Enabled Then +' cmdSaveInv.Enabled = True +' cmdAddInv.Enabled = False +' End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String + + Set moRSMat = New Recordset + Set moRSYS = New Recordset + cboInvType.ListIndex = 0 + strSQL = "SELECT * FROM tblSYSInfo" + moRSYS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' Call MTypeLoad(cboMType) +' Call LoadInventory + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module lstInventory_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = True + cmdAddInv.Enabled = False +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtLength_GotFocus() + Call FieldSelect(txtLength) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtPrice_LostFocus() + If Field2Str2(txtTOCost) = 0 Then + txtTOCost = Round((Field2Str2(txtPrice) * Field2Str2(moRSYS!TOMMU)), 2) + End If +End Sub + +Private Sub txtTOCost_GotFocus() + Call FieldSelect(txtTOCost) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frx new file mode 100644 index 0000000..53285a0 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmInventory.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frm new file mode 100644 index 0000000..794bfee --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frm @@ -0,0 +1,2037 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmOrders + Caption = "Orders Information" + ClientHeight = 8385 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11415 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8385 + ScaleWidth = 11415 + StartUpPosition = 2 'CenterScreen + Visible = 0 'False + Begin VB.TextBox txtOrdCnt + Height = 300 + Left = 11025 + TabIndex = 53 + Top = 510 + Visible = 0 'False + Width = 405 + End + Begin VB.CheckBox chkCalc + Caption = "Check1" + Enabled = 0 'False + Height = 285 + Left = 11220 + TabIndex = 52 + Top = 240 + Width = 210 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 3360 + TabIndex = 48 + TabStop = 0 'False + Top = 5400 + Width = 2115 + End + Begin VB.CommandButton cmdMisc + Caption = "Add Misc Item" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9900 + TabIndex = 47 + Top = 1380 + Width = 1455 + End + Begin VB.TextBox txtNotes + Height = 1995 + Left = 6360 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 45 + TabStop = 0 'False + Top = 6300 + Width = 5055 + End + Begin VB.CommandButton cmdFindPO + Caption = "PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 2820 + Picture = "frmOrders.frx":0000 + Style = 1 'Graphical + TabIndex = 44 + TabStop = 0 'False + Top = 6240 + Visible = 0 'False + Width = 795 + End + Begin Crystal.CrystalReport crOrder + Left = 10200 + Top = 180 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdAR + Caption = "Setup S&W AR Transfer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 8400 + TabIndex = 42 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Invoice" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 6900 + TabIndex = 41 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.TextBox txtVendorInv + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 4020 + MaxLength = 10 + TabIndex = 40 + TabStop = 0 'False + Top = 7080 + Width = 1755 + End + Begin VB.CommandButton cmdAP + Caption = "Setup A&P Transfer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9900 + TabIndex = 38 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9900 + TabIndex = 37 + TabStop = 0 'False + Top = 4380 + Width = 1455 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update Total" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 6900 + TabIndex = 36 + TabStop = 0 'False + Top = 4380 + Width = 1455 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 8400 + TabIndex = 8 + Top = 4380 + Width = 1455 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 7 + Top = 2160 + Width = 2175 + End + Begin VB.TextBox txtAQty + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 6 + Top = 1740 + Width = 1035 + End + Begin VB.ListBox lstMaterials + Height = 3375 + Left = 2100 + TabIndex = 10 + Top = 720 + Width = 4155 + End + Begin VB.ListBox lstOrders + Height = 3375 + Left = 60 + TabIndex = 3 + TabStop = 0 'False + Top = 720 + Width = 1995 + End + Begin VB.Label lblHelp + AutoSize = -1 'True + Caption = "U/W" + Height = 195 + Left = 11040 + TabIndex = 51 + Top = 30 + Width = 360 + End + Begin VB.Label lblJobCost + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 3735 + TabIndex = 50 + Top = 6240 + Width = 1050 + End + Begin VB.Label lblInvDate + AutoSize = -1 'True + Caption = "Inv. Date:" + Height = 195 + Left = 5520 + TabIndex = 49 + Top = 5520 + Width = 705 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6420 + TabIndex = 46 + Top = 6060 + Width = 570 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 6360 + X2 = 11400 + Y1 = 6000 + Y2 = 6000 + End + Begin VB.Label lblLocked + Caption = "This Invoice Has Been Transfered To AP And Is Now Locked" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 1155 + Left = 120 + TabIndex = 43 + Top = 4140 + Visible = 0 'False + Width = 6075 + End + Begin VB.Label lblVendorInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor Invoice #:" + Height = 195 + Left = 2640 + TabIndex = 39 + Top = 7155 + Width = 1275 + End + Begin VB.Label lblD_Update + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 35 + Top = 3900 + Width = 4575 + End + Begin VB.Label lblD_Create + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 34 + Top = 3240 + Width = 4575 + End + Begin VB.Label lblD_Flag + BackColor = &H80000005& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = 7500 + TabIndex = 33 + Top = 2580 + Width = 3855 + End + Begin VB.Label lblD_OQty + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 32 + Top = 1320 + Width = 1035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 31 + Top = 3660 + Width = 975 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 30 + Top = 3000 + Width = 900 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = 6930 + TabIndex = 29 + Top = 2340 + Width = 405 + End + Begin VB.Label lblAQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Actual Qty:" + Height = 195 + Left = 6555 + TabIndex = 28 + Top = 1800 + Width = 780 + End + Begin VB.Label lblOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Original Qty:" + Height = 195 + Left = 6480 + TabIndex = 27 + Top = 1320 + Width = 855 + End + Begin VB.Label lblD_Desc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 26 + Top = 900 + Width = 3855 + End + Begin VB.Label lblD_InvNo + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 25 + Top = 480 + Width = 1695 + End + Begin VB.Label lblInv_No + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory:" + Height = 195 + Left = 6630 + TabIndex = 24 + Top = 600 + Width = 705 + End + Begin VB.Label lblD_Type + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 23 + Top = 7920 + Width = 3555 + End + Begin VB.Label lblD_Supplier + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 22 + Top = 7500 + Width = 4575 + End + Begin VB.Label lblD_Percent + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 21 + Top = 7080 + Width = 1035 + End + Begin VB.Label lblD_Amount + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 20 + Top = 6660 + Width = 1545 + End + Begin VB.Label lblD_SPO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 19 + Top = 6240 + Width = 1545 + End + Begin VB.Label lblD_PO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 18 + Top = 5820 + Width = 3555 + End + Begin VB.Label lblD_ODate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 17 + Top = 5400 + Width = 2115 + End + Begin VB.Label lblSPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Special PO #:" + Height = 195 + Left = 120 + TabIndex = 16 + Top = 6345 + Width = 990 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Type:" + Height = 195 + Left = 270 + TabIndex = 15 + Top = 7980 + Width = 840 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supplier:" + Height = 195 + Left = 495 + TabIndex = 14 + Top = 7575 + Width = 615 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 240 + TabIndex = 13 + Top = 7155 + Width = 870 + End + Begin VB.Label lblAmount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Amount:" + Height = 195 + Left = 90 + TabIndex = 12 + Top = 6750 + Width = 1020 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Number:" + Height = 195 + Left = 240 + TabIndex = 11 + Top = 5925 + Width = 870 + End + Begin VB.Label lblO_Date + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 285 + TabIndex = 9 + Top = 5520 + Width = 825 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 0 + Y2 = 6000 + End + Begin VB.Label lblTotal + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 5 + Top = 60 + Width = 1695 + End + Begin VB.Label lblInvTotal + AutoSize = -1 'True + Caption = "PO Total:" + Height = 195 + Left = 6720 + TabIndex = 4 + Top = 120 + Width = 675 + End + Begin VB.Label lblMatList + AutoSize = -1 'True + Caption = "Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2160 + TabIndex = 2 + Top = 480 + Width = 780 + End + Begin VB.Label lblPOList + AutoSize = -1 'True + Caption = "PO Number" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 1 + Top = 480 + Width = 975 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 6195 + End +End +Attribute VB_Name = "frmOrders" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSORDER As Recordset +Dim moRSOrdMat As Recordset +Dim moRSProj As Recordset +Dim moRS As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mstrPROJLOT As String +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mstrType As String, mstrMODEL As String, mintBOOKMARK4 As Integer +Dim mlngORDERID As Long, mdblTOTAL As Double + +Dim mstrSQL As String + +Private Sub OrderLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String + + On Error GoTo Error_EH + If gintORDER = 9 Then + strSQL = "SELECT * from tblOrders WHERE Lot_id = " & gintLOTID & " ORDER BY PO_Num" + End If + If gintORDER = 8 Then + strSQL = "SELECT * from tblOrders WHERE PO_Num = '" & gstrPONUM & "'" + End If + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOrders.Clear + + Do Until oRS.EOF + With lstOrders + + strLine = oRS!po_num ' & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + txtOrdCnt = Field2Str(lstOrders.ListCount) + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAP_Click() +Dim intBookmark As Integer + moRSORDER!ap = vbTrue + moRSORDER!cocode = moRSProj!cocode + moRSORDER.Update + intBookmark = lstOrders.ListIndex + Call OrderLoad + lstOrders.ListIndex = intBookmark +End Sub + +Private Sub cmdAR_Click() +Dim oRS As Recordset +Dim strSQL As String, lngINVNO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngINVNO = Field2Long(oRS!swinvno) + lngINVNO = lngINVNO + 1 + If lngINVNO > 99999 Then + lngINVNO = 19999 + End If + oRS!swinvno = lngINVNO + oRS.Update + + moRSORDER!Vend_Inv = lngINVNO +' moRSORDER!SUP_INV = lngINVNO + txtVendorInv = lngINVNO + moRSORDER!ar = vbTrue + moRSORDER!cocode = moRSProj!cocode + moRSORDER.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module cmdAR" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindPO_Click() + gintPONUM = Field2Long(lblD_SPO) + frmPOInfo.Show 1 +End Sub + +Private Sub cmdMisc_Click() +Dim strSql2 As String, strTYPE As String, strPONUM As String +Dim lngORDERID As Long, intBookmark As Integer +Dim oRSS As Recordset + + On Error GoTo Error_EH + + If moRSORDER!ap Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ap_trans Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar_trans Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' gstrMODULE = "Before Setup Materials " + With oRSS + strTYPE = moRSORDER!m_type + strPONUM = moRSORDER!po_num + lngORDERID = moRSORDER!order_id + .AddNew + !order_id = lngORDERID + !Lot_id = gintLOTID + !po_num = strPONUM + !d_flag = "S" + !m_type = strTYPE + !Inv_NO = 9990 + !Desc = "MISC CHARGE - SEE NOTES" + !o_qty = 0 + !a_qty = 0 + !price = 0 + !Update = Date + !U_USER = gstrLOGIN + !C_USER = gstrLOGIN + .Update + End With + intBookmark = lstOrders.ListIndex + Call OrderLoad + lstOrders.ListIndex = intBookmark + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module cmdMisc" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "{tblORDERS.order_id} = " & mlngORDERID + crOrder.ReportFileName = App.Path & "\POPrice.rpt" + crOrder.GroupSelectionFormula = strSQL + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpdate_Click() +Dim intBOOK As Integer + On Error GoTo Error_EH + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + moRSORDER!orderamt = Field2Str2(lblTotal) + moRSORDER!notes = Field2Str(txtNotes) + moRSORDER!Vend_Inv = Field2Str(txtVendorInv) +' moRSORDER!SUP_INV = Field2Str(txtVendorInv) + moRSORDER!inv_date = Field2Str(txtInvDate) + moRSORDER.Update + Call OrderLoad + Call OrderMatLoad + cmdUpdate.Enabled = False + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module cmdUpdate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + +' R Reset Purchase Order for AR(Not Allowed if VOIDED) +' P Reset Purchase Order for AP(Not Allowed if VOIDED) +' V Will Void The PO if it has not been processed +' U Update the Costs for the materials in the HiLited PO for all item numbers over 1000 +' W Update the Costs for the materials in all PO's for all items numbers over 1000 +' H Update the Costs for the Hi-lited inventory item. +' I Update cost for items under inventory # 1000. Will prompt for the amount and move to the next item. + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSORDER!d_flag = "X" Then + MsgBox "This PO Has Been Voided - Reset Not Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + moRSORDER!ar_trans = vbUnchecked + moRSORDER!ar = vbUnchecked + Call cmdUpdate_Click + End If + Exit Sub + End If + If KeyCode = vbKeyP And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSORDER!d_flag = "X" Then + MsgBox "This PO Has Been Voided - Reset Not Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + moRSORDER!ap_trans = vbUnchecked + moRSORDER!ap = vbUnchecked + Call cmdUpdate_Click + End If + Exit Sub + End If + If KeyCode = vbKeyV And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + If moRSORDER!ar_trans Or moRSORDER!ap_trans Then + MsgBox "This PO Has Already Been Processed - No Void Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + Call LotChange(mstrPROJLOT, "VOID Purchase Order") + moRSORDER!m_type = "H" + moRSORDER!d_flag = "X" + moRSORDER!ar_trans = vbChecked + moRSORDER!ap_trans = vbChecked + moRSORDER.Update + Call FormShow + End If + Exit Sub + End If + + If KeyCode = vbKeyU And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices + Call OrderMatLoad + End If + Exit Sub + End If + + If KeyCode = vbKeyW And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices2 + Call OrderMatLoad + End If + Exit Sub + End If + + If KeyCode = vbKeyH And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices4 + mintBOOKMARK4 = lstMaterials.ListIndex + mintBOOKMARK2 = lstOrders.ListIndex + Call OrderMatLoad + lstMaterials.ListIndex = mintBOOKMARK4 + lstOrders.ListIndex = mintBOOKMARK2 + mintBOOKMARK4 = 0 + mintBOOKMARK2 = 0 + End If + Exit Sub + End If + + If KeyCode = vbKeyI And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices3 + Call OrderMatLoad + End If + Exit Sub + End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "PO Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + If moRSOrdMat.State = adStateOpen Then + moRSOrdMat.Close + End If + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub OrderMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(1) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + + aTabs(0) = 130 + aTabs(1) = 155 + + mdblTOTAL = 0 + strSQL = "SELECT Item_id, Inv_no, Desc, A_Qty, Price from tblOrdMatrl WHERE Order_id = " & mlngORDERID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstMaterials.hwnd, LB_SETTABSTOPS, 2, aTabs(0)) + + lstMaterials.Clear + + Do Until oRS.EOF + With lstMaterials + + strLine = oRS!Desc & vbTab & oRS!a_qty & vbTab & Format(oRS!price, "#,#.00") + .AddItem strLine + .ItemData(.NewIndex) = oRS!Item_ID + End With + dblSUM = (Field2Str2(oRS!a_qty) * Field2Str2(oRS!price)) + mdblTOTAL = mdblTOTAL + dblSUM + oRS.MoveNext + Loop + oRS.Close + + If mdblTOTAL <> Field2Str2(lblD_Amount) Then + lblD_Amount = Format(mdblTOTAL, "#,#,#.00") + moRSORDER!orderamt = mdblTOTAL + moRSORDER.Update + End If + + If lstMaterials.ListCount Then + lstMaterials.ListIndex = 0 + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + + lblTotal = Format(mdblTOTAL, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() +' Set moRSORDER = New Recordset +' Set moRSOrdMat = New Recordset + +' If gbytSECURITY < 3 Then +' cmdUpdate.Visible = True +' End If + Call ProjLoad + Call OrderLoad + If gstrPONUM = "" Then + Else + Call CBFindString(lstOrders, gstrPONUM) +' lstOrders.SetFocus + End If +' Call ListLoad +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + mlngORDERID = moRSORDER!order_id + glngORDERID = moRSORDER!order_id + lblProjLot = Trim$(moRSProj!Proj_Code) & " " & Trim$(moRSProj!Proj_Desc) & " " & moRS!lot_no + mstrPROJLOT = lblProjLot + With moRSORDER + txtVendorInv = Field2Str(!Vend_Inv) +' txtVendorInv = Field2Str(!SUP_INV) + txtNotes = Field2Str(!notes) + chkCalc = Field2CheckBox(!calc) + lblJobCost = Field2Str(!jobcost) + lblD_ODate = Field2Str(!order_date) + If !d_flag = "X" Then + lblD_Flag = "This PO Voided - Do Not Pay" + Else + lblD_Flag = "" + End If + If IsNull(!inv_date) Then + txtInvDate = Field2Str(!order_date) + Else + txtInvDate = Field2Str(!inv_date) + End If + lblD_PO = Field2Str(!po_num) + lblD_Supplier = Field2Str(!supplier) + lblD_SPO = Field2Long(!ponum) + lblD_Percent = Field2Str(!percentage) + lblD_Amount = Format(Field2Str2(!orderamt), "#,#.00") + If !m_type = "H" Then + lblD_Type = "ORDER REPRINTED" + ElseIf !m_type = "L" Then + lblD_Type = "LATH ORDER" + ElseIf !m_type = "A" Then + lblD_Type = "SAND ORDER" + ElseIf !m_type = "B" Then + lblD_Type = "BROWN ORDER" + ElseIf !m_type = "T" Then + lblD_Type = "TEXTURE ORDER" + ElseIf !m_type = "R" Then + lblD_Type = "SPECIAL PO" + ElseIf !m_type = "P" Then + lblD_Type = "PREORDER" + ElseIf !m_type = "S" Then + lblD_Type = "SCRATCH ORDER" + ElseIf !m_type = "V" Then + lblD_Type = "STONE VENEER ORDER" + ElseIf !m_type = "W" Then + lblD_Type = "TYPAR WRAP ORDER" + Else + lblD_Type = "UNKNOWN" + End If + lblLocked.Caption = "" + cmdAP.Caption = "Setup AP Transfer" + cmdAR.Caption = "Setup AR Transfer" + cmdAP.Enabled = True + cmdAR.Enabled = True + If !ap Then + lblLocked.Caption = "This Invoice Ready To Be Transfered To AP" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfer Setup" +' cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If !ap_trans Then + lblLocked.Caption = "This Invoice Has Been Transfered To AP" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfered" +' If !ar_trans Then +' cmdAR.Caption = "AR Transfered" +' End If +' cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If !ar Then + lblLocked.Caption = lblLocked.Caption & " This Invoice Ready To Be Transfered To AR" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAR.Caption = "AR Transfer Setup" + cmdAR.Enabled = False +' cmdAP.Enabled = True + End If + If !ar_trans Then + lblLocked.Caption = lblLocked.Caption & " This Invoice Has Been Transfered To AR" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAR.Caption = "AR Transfered" + cmdAR.Enabled = False +' cmdAP.Enabled = True + End If + If !ar_trans And !ap_trans Then + lblLocked.Caption = lblLocked.Caption & " And Is Now Locked" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfered" + cmdAR.Caption = "AR Transfered" + cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If Not !ar_trans And Not !ap_trans And Not !ap And Not !ar Then + lblLocked.Visible = False + txtVendorInv.Enabled = True + txtAQty.Enabled = True + txtPrice.Enabled = True + txtInvDate.Enabled = True + cmdAP.Caption = "Setup A&P Transfer" + cmdAR.Caption = "Setup S&W AR Transfer" + cmdAR.Enabled = True + cmdAP.Enabled = True + End If + + If lblD_SPO > 0 Then + cmdFindPO.Visible = True + Else + cmdFindPO.Visible = False + End If + txtNotes = Field2Str(!notes) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOrdMat() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSOrdMat + lblD_InvNo = Field2Long(!Inv_NO) + lblD_Desc = Field2Str(!Desc) + lblD_OQty = Field2Str(!o_qty) + txtPrice = Format$(Field2Str2(!price), "##,###.00") + txtAQty = Field2Integer(!a_qty) + lblD_Create = Field2Str(!Create) + lblD_Update = Field2Str(!Update) & " " & Field2Str(!U_USER) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub FormClear() + + lblD_ODate = "" + lblD_PO = "" + lblSupplier = "" + lblD_SPO = "" + lblD_Percent = "" + lblD_Amount = "" + lblD_Type = "" + lblD_Flag = "" + +End Sub + +Private Sub FormClearOrdMat() + + lblD_InvNo = "" + lblD_Desc = "" + lblD_OQty = 0 + txtPrice = 0 + txtAQty = 0 + lblCreate = "" + lblUpdate = "" + +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + + Call FieldsSave + + moRSOrdMat.Update + + + + Call OrderMatLoad +' Call ToggleButtons + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE order_id = " & _ + lstOrders.ItemData(lstOrders.ListIndex) + + Set moRSORDER = New Recordset + + moRSORDER.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSORDER.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOrdMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrdMatrl " + strSQL = strSQL & "WHERE Item_ID = " & lstMaterials.ItemData(lstMaterials.ListIndex) + + Set moRSOrdMat = New Recordset + + moRSOrdMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOrdMat.EOF Then + FormFindOrdMat = False + txtAQty.Enabled = False + txtPrice.Enabled = False + Else + FormFindOrdMat = True +' txtAQty.Enabled = True +' txtPrice.Enabled = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFindOrdMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSOrdMat + !a_qty = Single2Field(txtAQty) + !price = Format(Single2Field(txtPrice), "#,#.00") +' If txtAQty > 0 Then +' !SWAR = True +' End If +' !notes = Str2Field(txtNotes) + !Update = Date + !U_USER = gstrLOGIN + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + If lstOrders.ListCount = 0 Then + intResponse = MsgBox("No Orders Have Been Processed For This Lot", vbOKOnly + vbQuestion, "No Orders") + Unload Me + End If + +End Sub + +Private Sub lstMaterials_DblClick() + If Not moRSORDER!ap_trans Then + cmdSave.Enabled = True + End If +End Sub + +Private Sub lstOrders_Click() + On Error GoTo Error_EH + If lstOrders.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call OrderMatLoad + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + txtAQty.Enabled = False + txtPrice.Enabled = False + Call FormClearOrdMat + End If + Else + txtAQty.Enabled = False + txtPrice.Enabled = False + End If + Else + lstOrders.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstOrders_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMaterials_Click() + On Error GoTo Error_EH + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstMaterials_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String +Dim strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intBOOK As Integer + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdUpdate.Enabled = True + Call FormSave + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub lstOrders_DblClick() + If chkCalc Then + chkCalc = vbUnchecked + moRSORDER!calc = False + moRSORDER.Update + Else + chkCalc = vbChecked + moRSORDER!calc = True + moRSORDER.Update + End If +End Sub + +Private Sub txtAQty_GotFocus() + Call FieldSelect(txtAQty) +End Sub + +Private Sub txtInvDate_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If Not IsDate(txtInvDate) Then + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + Exit Sub + End If + End If + cmdUpdate.SetFocus + +End Sub + +Private Sub txtNotes_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtNotes_GotFocus() + txtNotes.SelStart = 1000 +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + txtVendorInv.SetFocus +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtVendorInv_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtVendorInv_GotFocus() + Call FieldSelect(txtVendorInv) +End Sub + +Private Sub txtVendorInv_LostFocus() + txtVendorInv = UCase(txtVendorInv) + cmdUpdate.SetFocus +End Sub + +Private Sub SetupTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub WrapMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!Inv_NO) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module WrapMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & glngORDERID +' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!Inv_NO) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + If Field2Str2(oRS!price) = 0 Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices2() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) + intCOUNT = 1 + + lstOrders.ListIndex = 0 + lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + + Do Until intCOUNT = intLSTCNT + If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & glngORDERID + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!Inv_NO) + If strINV < "1000" Then + + Else + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + End If + intCOUNT = intCOUNT + 1 + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices3() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) + intCOUNT = 1 + + lstOrders.ListIndex = 0 + lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + + Do Until intCOUNT = intLSTCNT + If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & lngORDERID & " AND INV_NO = " + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!Inv_NO) + If strINV < "1000" Then + + Else + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + End If + intCOUNT = intCOUNT + 1 + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices4() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long, strCOST As String +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer, dblCOST As Double +Dim strDESC As String + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) +' intCOUNT = 1 + +' lstOrders.ListIndex = 0 +' lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) +' lstMaterials.ListIndex = 0 + lngORDERID = lstMaterials.ItemData(lstMaterials.ListIndex) + +' Do Until intCOUNT = intLSTCNT +' If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, DESC, Price, ITEM_ID FROM tblORDMATRL WHERE ITEM_ID = " & lngORDERID ' & " AND INV_NO = " + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then +' Do Until oRS.EOF + strINV = Field2Str(oRS!Inv_NO) + strDESC = Field2Str(oRS!Desc) + If Field2Str2(oRS!price) = 0 Then + strCOST = InputBox("Enter The New Cost For '" & Trim(Field2Str(oRS!Inv_NO)) & " - " & Trim(Field2Str(oRS!Desc)) & "'", "Update Material Cost", 0) + oRS!price = Field2Str2(strCOST) + oRS.Update + Else + MsgBox "Price Is Not Zero So Cannot Be Updated", vbOKOnly, "Cannot Update" + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" +' strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" +' Set oRSS = New Recordset +' oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSS.EOF Then +' oRS!price = Field2Str2(oRSS!price) +' oRS.Update +' End If +' oRSS.Close + End If +' oRS.MoveNext +' Loop + End If +' End If +' intCOUNT = intCOUNT + 1 +' Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frx new file mode 100644 index 0000000..2fdcc63 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmOrders.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmPOInfo.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmPOInfo.frm new file mode 100644 index 0000000..4dabceb --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmPOInfo.frm @@ -0,0 +1,697 @@ +VERSION 5.00 +Begin VB.Form frmPOInfo + Caption = "Special PO Information" + ClientHeight = 4875 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9855 + LinkTopic = "Form1" + ScaleHeight = 4875 + ScaleWidth = 9855 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 915 + Left = 8040 + TabIndex = 26 + Top = 3540 + Width = 1395 + End + Begin VB.ListBox lstPOMaterial + Height = 2595 + Left = 60 + TabIndex = 12 + Top = 2220 + Width = 3915 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 120 + TabIndex = 27 + Top = 0 + Width = 9675 + End + Begin VB.Label lblD_MatPrice + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 25 + Top = 4320 + Width = 1155 + End + Begin VB.Label lblD_MType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 24 + Top = 3900 + Width = 1575 + End + Begin VB.Label lblD_DType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 23 + Top = 3480 + Width = 1575 + End + Begin VB.Label lblD_Qty + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 22 + Top = 3060 + Width = 1155 + End + Begin VB.Label lblD_Desc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 21 + Top = 2640 + Width = 4515 + End + Begin VB.Label lblD_InvNo + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5280 + TabIndex = 20 + Top = 2220 + Width = 1155 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = 4410 + TabIndex = 19 + Top = 4380 + Width = 765 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 4170 + TabIndex = 18 + Top = 3960 + Width = 1005 + End + Begin VB.Label lblDType + Caption = "Delivery Type:" + Height = 195 + Left = 4140 + TabIndex = 17 + Top = 3540 + Width = 1035 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = 4545 + TabIndex = 16 + Top = 3120 + Width = 630 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 4335 + TabIndex = 15 + Top = 2700 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = 4650 + TabIndex = 14 + Top = 2280 + Width = 525 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 13 + Top = 1980 + Width = 750 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 0 + X2 = 9840 + Y1 = 1920 + Y2 = 1920 + End + Begin VB.Label lblD_Notes + BorderStyle = 1 'Fixed Single + Height = 1035 + Left = 6120 + TabIndex = 11 + Top = 780 + Width = 3735 + End + Begin VB.Label lblD_PayYds + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 10 + Top = 1500 + Width = 1395 + End + Begin VB.Label lblD_PayDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 9 + Top = 1140 + Width = 3735 + End + Begin VB.Label lblD_InvDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 8 + Top = 780 + Width = 3735 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = 870 + TabIndex = 7 + Top = 1560 + Width = 765 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6120 + TabIndex = 6 + Top = 480 + Width = 570 + End + Begin VB.Label lblPayDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = 480 + TabIndex = 5 + Top = 1200 + Width = 1155 + End + Begin VB.Label lblInvDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = 225 + TabIndex = 4 + Top = 840 + Width = 1410 + End + Begin VB.Label lblPOType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3600 + TabIndex = 3 + Top = 420 + Width = 2475 + End + Begin VB.Label lblPODate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 2220 + TabIndex = 2 + Top = 420 + Width = 1320 + End + Begin VB.Label lblPONum + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1260 + TabIndex = 1 + Top = 420 + Width = 915 + End + Begin VB.Label lblPOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Information:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 480 + Width = 1095 + End +End +Attribute VB_Name = "frmPOInfo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolSHOW As Boolean +Dim moRSPO As Recordset, moRSPOMAT As Recordset + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & gintPONUM + + Set moRSPO = New Recordset + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + + End If + Exit Function + +Error_EH: + gstrMODULE = "Form POInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & gintPONUM & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + Set moRSPOMAT = New Recordset + + moRSPOMAT.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form POInfo - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowPO() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPO + lblPONum = Field2Long(!ponum) + lblD_InvDesc = Field2Str(!towhom) + lblD_PayDesc = Field2Str(!Desc) + lblD_Notes = Field2Str(!notes) + lblPODate = Field2Str(!Date) + lblD_PayYds = Field2Str2(!yards) + gstrPO = Field2Str(!potype) + End With + + Select Case gstrPO + Case "L" + lblInvDesc = "Invoice Description:" + lblD_InvDesc.Visible = True + lblInvDesc.Visible = True + lblPayDesc = "Pay Description:" + lblD_PayDesc.Visible = True + lblPayDesc.Visible = True + lblPayYds = "Pay Yards:" + lblD_PayYds.Visible = True + lblPayYds.Visible = True + lblPOType = "Lot Material" + + Case "Y" + lblInvDesc.Visible = False + lblD_InvDesc.Visible = False + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Yard Stock" + + Case "V" + lblInvDesc = "Mileage:" + lblD_InvDesc.Visible = True + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Vehicle/Equip." + + Case "M" + lblInvDesc = "Person Requesting:" + lblD_InvDesc.Visible = True + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Misc. Items" + + End Select + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + lblD_InvNo = Field2Long(!Inv_No) + lblD_Desc = Field2Str(!Desc) + lblD_Qty = Field2Str(!qty) + + If !d_flag = "S" Then + lblD_DType = "Supplier" + Else + lblD_DType = "Yard" + End If + + If !m_type = "L" Then + lblD_MType = "Lath" + ElseIf !m_type = "B" Then + lblD_MType = "Brown" + ElseIf !m_type = "S" Then + lblD_MType = "Scratch" + ElseIf !m_type = "T" Then + lblD_MType = "Texture" + ElseIf !m_type = "C" Then + lblD_MType = "CMU" + ElseIf !m_type = "P" Then + lblD_MType = "PreOrder" + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & gintPONUM & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS("inv_no")) + + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + + Unload Me +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + If FormFindPO() Then + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + End If + Else + MsgBox "No PO Information Was Found -- Call Darv", vbOKOnly, "No PO Info" + Unload Me + End If + + Call FindProjLot + + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FindProjLot() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblProject " + strSQL = strSQL & "WHERE Proj_id = " & Field2Long(moRSPO!proj_id) +' strSQL = strSQL & "WHERE Proj_id = " & Field2Integer(moRSPO!proj_id) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + Else + lblProjLot = Trim$(Field2Str(oRS!proj_code)) & " " & Trim$(Field2Str(oRS!proj_desc)) + End If + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_id = " & Field2Long(moRSPO!Lot_id) +' strSQL = strSQL & "WHERE Lot_id = " & Field2Integer(moRSPO!Lot_id) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + + Else + lblProjLot = lblProjLot & " -- " & Trim$(Field2Str(oRS!lot_no)) + End If + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE ponum = " & gintPONUM + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + lblProjLot = lblProjLot & " -- NO PO PRINTED" + Else + lblProjLot = lblProjLot & " -- " & Trim$(Field2Str(oRS!po_num)) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frm new file mode 100644 index 0000000..6d95f0b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frm @@ -0,0 +1,9003 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmViewTake + Caption = "View Previous Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4620 + TabIndex = 239 + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txt108 + Enabled = 0 'False + Height = 315 + Left = 10980 + TabIndex = 232 + Top = 2880 + Width = 855 + End + Begin VB.TextBox txt68 + Enabled = 0 'False + Height = 315 + Left = 9060 + TabIndex = 229 + Top = 2880 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 227 + Top = 3300 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Enabled = 0 'False + Height = 195 + Left = 360 + TabIndex = 222 + Top = 360 + Width = 3255 + End + Begin Crystal.CrystalReport crTake + Left = 11340 + Top = 1920 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5940 + TabIndex = 188 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 185 + TabStop = 0 'False + Top = 600 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 184 + TabStop = 0 'False + Top = 1020 + Width = 2115 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3300 + TabIndex = 142 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 1275 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1680 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0000 + Left = 8520 + List = "frmViewTake.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 960 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 9 + TabStop = 0 'False + Top = 540 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + TabIndex = 7 + TabStop = 0 'False + Top = 600 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 4 + TabStop = 0 'False + Top = 600 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 3 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmViewTake.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmViewTake.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "chkTransfer" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "cmdFindMat" + Tab(1).Control(7)= "cmdAddMat" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "cboMetal" + Tab(1).Control(9)= "cboMType" + Tab(1).Control(10)= "cboDFlag" + Tab(1).Control(11)= "txtMetLength" + Tab(1).Control(12)= "txtMatPrice" + Tab(1).Control(13)= "txtMatQty" + Tab(1).Control(14)= "txtMatDesc" + Tab(1).Control(15)= "txtMatInvNo" + Tab(1).Control(16)= "lstTOMatrl" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cmdSaveMat" + Tab(1).Control(18)= "cmdDelMat" + Tab(1).Control(18).Enabled= 0 'False + Tab(1).Control(19)= "lblMatDesc" + Tab(1).Control(20)= "lblMetLength" + Tab(1).Control(21)= "lblMetal" + Tab(1).Control(22)= "lblMType" + Tab(1).Control(23)= "lblDFlag" + Tab(1).Control(24)= "lblMatPrice" + Tab(1).Control(25)= "lblMatQty" + Tab(1).Control(26)= "lblInvno" + Tab(1).ControlCount= 27 + TabCaption(2) = "&Options" + TabPicture(2) = "frmViewTake.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblYrdge" + Tab(2).Control(0).Enabled= 0 'False + Tab(2).Control(1)= "lblBAmt" + Tab(2).Control(1).Enabled= 0 'False + Tab(2).Control(2)= "lblOTexture" + Tab(2).Control(2).Enabled= 0 'False + Tab(2).Control(3)= "lblOFin2" + Tab(2).Control(3).Enabled= 0 'False + Tab(2).Control(4)= "lblOFadj" + Tab(2).Control(4).Enabled= 0 'False + Tab(2).Control(5)= "lblOMInvNo" + Tab(2).Control(5).Enabled= 0 'False + Tab(2).Control(6)= "lblOMDesc" + Tab(2).Control(6).Enabled= 0 'False + Tab(2).Control(7)= "lblOMQty" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "lblOMPrice" + Tab(2).Control(8).Enabled= 0 'False + Tab(2).Control(9)= "lblOMDFlag" + Tab(2).Control(9).Enabled= 0 'False + Tab(2).Control(10)= "lblOMMType" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "lblOMCFlag" + Tab(2).Control(11).Enabled= 0 'False + Tab(2).Control(12)= "lblOMMLength" + Tab(2).Control(12).Enabled= 0 'False + Tab(2).Control(13)= "lblOStone" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "lblOScaffold" + Tab(2).Control(14).Enabled= 0 'False + Tab(2).Control(15)= "Scaf6" + Tab(2).Control(15).Enabled= 0 'False + Tab(2).Control(16)= "lblScaf10" + Tab(2).Control(16).Enabled= 0 'False + Tab(2).Control(17)= "lstOptions" + Tab(2).Control(17).Enabled= 0 'False + Tab(2).Control(18)= "txtODesc" + Tab(2).Control(18).Enabled= 0 'False + Tab(2).Control(19)= "txtOYdge" + Tab(2).Control(19).Enabled= 0 'False + Tab(2).Control(20)= "txtOBAmt" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cboOFinish" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "txtOFin2" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "txtOFAdj" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "cmdAddOpt" + Tab(2).Control(25).Enabled= 0 'False + Tab(2).Control(26)= "cmdDelOpt" + Tab(2).Control(26).Enabled= 0 'False + Tab(2).Control(27)= "cmdAddOptMat" + Tab(2).Control(27).Enabled= 0 'False + Tab(2).Control(28)= "cmdDelOptMat" + Tab(2).Control(28).Enabled= 0 'False + Tab(2).Control(29)= "txtOMInvNo" + Tab(2).Control(29).Enabled= 0 'False + Tab(2).Control(30)= "txtOMDesc" + Tab(2).Control(30).Enabled= 0 'False + Tab(2).Control(31)= "txtOMQty" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "txtOMPrice" + Tab(2).Control(32).Enabled= 0 'False + Tab(2).Control(33)= "txtOMMetL" + Tab(2).Control(33).Enabled= 0 'False + Tab(2).Control(34)= "cboOMDFlag" + Tab(2).Control(34).Enabled= 0 'False + Tab(2).Control(35)= "cboOMType" + Tab(2).Control(35).Enabled= 0 'False + Tab(2).Control(36)= "cboOMMetal" + Tab(2).Control(36).Enabled= 0 'False + Tab(2).Control(37)= "cmdFindOptMat" + Tab(2).Control(37).Enabled= 0 'False + Tab(2).Control(38)= "cmdSaveOpt" + Tab(2).Control(38).Enabled= 0 'False + Tab(2).Control(39)= "cmdSaveOptMat" + Tab(2).Control(39).Enabled= 0 'False + Tab(2).Control(40)= "cmdCopyOpt" + Tab(2).Control(40).Enabled= 0 'False + Tab(2).Control(41)= "txtNote" + Tab(2).Control(41).Enabled= 0 'False + Tab(2).Control(42)= "chkOStone" + Tab(2).Control(42).Enabled= 0 'False + Tab(2).Control(43)= "txtOST_SqFt" + Tab(2).Control(43).Enabled= 0 'False + Tab(2).Control(44)= "chkST_Others" + Tab(2).Control(44).Enabled= 0 'False + Tab(2).Control(45)= "chkNoInvoice" + Tab(2).Control(45).Enabled= 0 'False + Tab(2).Control(46)= "txtO68" + Tab(2).Control(46).Enabled= 0 'False + Tab(2).Control(47)= "txtO108" + Tab(2).Control(47).Enabled= 0 'False + Tab(2).ControlCount= 48 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmViewTake.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 237 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 236 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 226 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Enabled = 0 'False + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Enabled = 0 'False + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 212 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 208 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 207 + Top = 3240 + Width = 2955 + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 206 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 202 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Enabled = 0 'False + Height = 315 + Left = -64980 + TabIndex = 197 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 189 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 187 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 186 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Enabled = 0 'False + Height = 315 + Left = -66360 + TabIndex = 174 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmViewTake.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmViewTake.frx":04B6 + Style = 1 'Graphical + TabIndex = 165 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":08F8 + Left = -65400 + List = "frmViewTake.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0913 + Left = -65400 + List = "frmViewTake.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0917 + Left = -68160 + List = "frmViewTake.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 5 + TabIndex = 37 + Top = 2745 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 175 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0935 + Left = -68100 + List = "frmViewTake.frx":093F + Style = 2 'Dropdown List + TabIndex = 171 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0950 + Left = -68100 + List = "frmViewTake.frx":0952 + Style = 2 'Dropdown List + TabIndex = 170 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0954 + Left = -68100 + List = "frmViewTake.frx":095E + Style = 2 'Dropdown List + TabIndex = 169 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 172 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 168 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 167 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 166 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 5 + TabIndex = 164 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 154 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Enabled = 0 'False + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 152 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0972 + Left = -69720 + List = "frmViewTake.frx":0974 + Style = 2 'Dropdown List + TabIndex = 151 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 150 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Enabled = 0 'False + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 149 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 144 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 143 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 153 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 141 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 155 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 140 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 173 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 136 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 134 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 128 + TabStop = 0 'False + Top = 960 + Width = 1155 + End + Begin VB.Frame fraSecond + Enabled = 0 'False + Height = 3735 + Left = 8760 + TabIndex = 121 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 225 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 211 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 205 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 122 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Enabled = 0 'False + Height = 3735 + Left = 7980 + TabIndex = 112 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 223 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 209 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 203 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 201 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 200 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 138 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 118 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 120 + TabIndex = 117 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 114 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 105 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 64 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 63 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 65 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 99 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 90 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 62 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 83 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 67 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 61 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 59 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0976 + Left = -70305 + List = "frmViewTake.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Enabled = 0 'False + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 190 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Enabled = 0 'False + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 215 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 213 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 196 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 195 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 194 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 193 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 192 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 191 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 238 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 235 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 234 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 233 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 224 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Enabled = 0 'False + Height = 195 + Left = -66285 + TabIndex = 214 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 210 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 204 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 199 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 198 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 183 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 182 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 181 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 180 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 179 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 178 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 177 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 176 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 163 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 162 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 161 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 160 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 159 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 158 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 157 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 156 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 148 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 147 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 146 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 145 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 137 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 120 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 113 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 111 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 110 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 109 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 108 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 107 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 106 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 104 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 97 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 96 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 95 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 94 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 93 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 92 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 91 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 89 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 87 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 86 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 73 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 72 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 71 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 70 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 69 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 68 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 66 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 60 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 420 + TabIndex = 58 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 1620 + Left = 1380 + Sorted = -1 'True + TabIndex = 1 + Top = 1380 + Width = 1395 + End + Begin VB.Label lblTitle + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "* * * * This is a superceded takeoff * * * *" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 60 + TabIndex = 244 + Top = 0 + Width = 11775 + End + Begin VB.Label txtModElv + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1380 + TabIndex = 243 + Top = 960 + Width = 1395 + End + Begin VB.Label lblSDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supercede Date:" + Height = 195 + Left = 60 + TabIndex = 242 + Top = 1440 + Width = 1215 + End + Begin VB.Label txtSuperDate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 241 + Top = 2280 + Width = 1725 + End + Begin VB.Label lblSUperDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Superceded: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 240 + Top = 2340 + Width = 1620 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 231 + Top = 2940 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 230 + Top = 2940 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 228 + Top = 2640 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8535 + TabIndex = 221 + Top = 2025 + Width = 855 + End + Begin VB.Label txtLSave + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 220 + Top = 1635 + Width = 1725 + End + Begin VB.Label txtUpdate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 219 + Top = 1950 + Width = 1725 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 218 + Top = 1305 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8400 + TabIndex = 217 + Top = 1695 + Width = 990 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8595 + TabIndex = 216 + Top = 1380 + Width = 795 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 1020 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 4110 + TabIndex = 21 + Top = 1020 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 8190 + TabIndex = 8 + Top = 600 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5925 + TabIndex = 6 + Top = 660 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3840 + TabIndex = 5 + Top = 660 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 2 + Top = 1020 + Width = 1215 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 660 + Width = 540 + End +End +Attribute VB_Name = "frmViewTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset + +Dim mboolSHOW As Boolean, mboolCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() +' cmdAddMat.Enabled = False +' cmdSaveMat.Enabled = True +' cmdDel1900.Enabled = False +' cmdDelMat.Enabled = False +' cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear +' cmdAddOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdAddOptMat.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdSave.Enabled = False + cmdDelOptMat.Enabled = False +' cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False +' cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBOOKMARK As Integer + intBOOKMARK = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double + + On Error GoTo Error_EH + mboolCALC = False + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close + If dblRS > 0 Then + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 +' moRSCMat!qty = Int((dblWire / 50) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Str(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then +' txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String + + On Error GoTo Error_EH + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblRS > 0 Then + txtSandTons = dblRS + End If + + +'Calculate Black paper + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 33) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str2(txtSandPrice)) + 0.99), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 30 + Else + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str2(txtSandPrice)) + 0.99), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad +' cmdSaveMeas.Enabled = False +' cmdDelMeas.Enabled = False +' cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If +' cmdAddOpt.Enabled = True +' cmdAddOptMat.Enabled = True +' cmdSaveOptMat.Enabled = False +' cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + +' cmdDelOpt.Enabled = False +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdAddOptMat.Enabled = True +' cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + +' If optInv(0) Then +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text +' ElseIf optInv(1) Then +' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" +' End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else +' lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) +' Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() +' cmdAddMeas.Enabled = False +' cmdSaveMeas.Enabled = True +' cmdDelMeas.Enabled = False +' cmdSave.Enabled = False +' cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then +' txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + ' strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + ' cmdAddOpt.Enabled = True + ' cmdSaveOpt.Enabled = False + ' cmdDelOpt.Enabled = False + ' cmdCopyOpt.Enabled = False + ' cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!PROJ_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False +' cmdSave.Enabled = True +' cmdSaveMat.Enabled = False +' cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False +' lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() +' cmdSaveMeas.Enabled = False +' cmdSave.Enabled = True +' cmdAddMeas.Enabled = True +' cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc +' cmdSaveOpt.Enabled = False +' cmdSave.Enabled = True +' cmdCopyOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdAddOpt.Enabled = True +' cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex +' cmdAddOptMat.Enabled = True +' cmdAddOpt.Enabled = True + lstOptions.Visible = True +' lstInventory.Visible = False +' cmdSaveOptMat.Enabled = False +' cmdSaveOpt.Enabled = False +' cmdSave.Enabled = True +' cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True +' cmdAddMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdUpdate.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdUPLabRates.Enabled = False +' cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False +' cmdChgLabRates.Enabled = False +' cmdNew.Enabled = False + cboOneKote.Enabled = False +' cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear +' lstMInventory.Visible = True + Call LoadMInventory +' lstMInventory.ListIndex = 0 +' lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True +' cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False +' cmdAddMat.Enabled = True +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True +' cmdCopy.Enabled = True +' cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdUPLabRates.Enabled = True +' cmdUPInvPrices.Enabled = True +' cmdExit.Enabled = True +' cmdChgLabRates.Enabled = True +' cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False +' cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True +' cmdAddMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdUPLabRates.Enabled = False +' cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False +' cmdChgLabRates.Enabled = False +' cmdNew.Enabled = False + cboOneKote.Enabled = False +' cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False +' cmdAddMat.Enabled = True +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True +' cmdCopy.Enabled = True +' cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdUPLabRates.Enabled = True +' cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True +' cmdChgLabRates.Enabled = True +' cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If +' If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + ' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) +' ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" +' strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" +' End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + +' If Not mboolSETUP Then +' lstMInventory.Visible = False +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + +' If optInv(0) Then +' strSQL = "SELECT Inv_no, Desc from tblInvtry" +' ElseIf optInv(1) Then +' strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" +' End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstMInventory.Clear + + Do Until oRS.EOF +' With lstMInventory + +' strLine = oRS!inv_no & vbTab & oRS!Desc +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no +' End With + + oRS.MoveNext + Loop + oRS.Close + +' If lstMInventory.ListCount Then +' lstMInventory.ListIndex = -1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If +' If optInv(0) Then +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text +' ElseIf optInv(1) Then +' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " and estimator = '" & gstrLOGIN & "'" +' End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False +' lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) +' Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + +' If optInv(0) Then +' strSQL = "SELECT Inv_no, Desc from tblInvtry" +' ElseIf optInv(1) Then +' strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" +' End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstInventory.Clear + + Do Until oRS.EOF +' With lstInventory + +' strLine = oRS!inv_no & vbTab & oRS!Desc +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no +' End With + + oRS.MoveNext + Loop + oRS.Close + +' If lstInventory.ListCount Then +' lstInventory.ListIndex = -1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + +' lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + txtModElv = "" + strSQL = "SELECT TOID, Pln_Elv, superdate from tblTake WHERE supersede and origtoid = " & gintNTOID +' strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!superdate) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String + On Error GoTo Error_EH + Call ClearSecond + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + With moRS + txtModElv = Field2Str(!pln_elv) + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True +' Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff +' Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + +' strSQL = "SELECT toid FROM tblTake where proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then +' If Not cmdSave.Enabled Then +' Call ToggleButtons +' End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad +' cmdDeleteTakeoff.Enabled = False +' cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date +' If chkUpdate Then +' !LUUser = gstrLOGIN +' !Update = Date +' End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True +' cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True +' cmdNew.Enabled = False + cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdCopy.Enabled = False +' cmdDeleteTakeoff.Enabled = False +' cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear +' lblNewElv.Visible = True +' txtNewElv.Visible = True + lstMod_Elv.Enabled = False + ' txtNewElv = "" +' txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then +' Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If +' cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True +' cmdNew.Enabled = True +' cmdCopy.Enabled = True + cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdDeleteTakeoff.Enabled = True ' +' cmdSave.Enabled = False +' chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 +' Call CBFindString(lstMod_Elv, txtNewElv) +' Call Measure_Setup +' Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + +' lblNewElv.Visible = False +' txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False +' chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Superceded Plan/Elevation", vbOKOnly + vbQuestion, "No Records") +' If intResponse = vbYes Then +' strSQL = "SELECT * FROM tbltake WHERE toid = 1" +' Set moRS = New Recordset +' moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' strSql2 = "SELECT * FROM tblTOLabor where toid = 1" +' Set moRSLAB = New Recordset +' moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' Call cmdNew_Click +' Unload Me +' Else + Unload Me +' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + +' If cmdSave.Enabled Then + +' strMSG = "Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call FormSave +' +' Case vbNo +' +' Case vbCancel +' Cancel = True +' Exit Sub +' End Select +' End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If +' gintTOID = 0 +' gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" + txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True +' cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() +' cmdNew.Enabled = False +' cmdCopy.Enabled = False +' cmdDeleteTakeoff.Enabled = True ' +' cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() +' cmdSaveOpt.Enabled = True +' cmdDelOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False +' cmdAddOptMat.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex +' cmdSaveMat.Enabled = True +' cmdAddMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) +' If optInv(0) Then +' mstrFILE = "tblInvtry" +' End If +' If optInv(1) Then +' mstrFILE = "tblInvTake" +' End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then +' If cmdSaveMeas.Enabled = True Then +' strMSG = "Measure Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call MeasSave + +' Case vbNo + +' Case vbCancel +' tabTake.Tab = 0 +' Exit Sub +' End Select +' End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If +' If cmdSaveMat.Enabled = True Then +' strMSG = "Material Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call MatSave +' Case vbNo +' +' Case vbCancel +' tabTake.Tab = 1 +' Exit Sub +' End Select +' End If +' Exit Sub + End If + If PreviousTab = 2 Then +' If cmdSaveOpt.Enabled = True Then +' strMSG = "Option Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call OptSave +' Case vbNo + +' Case vbCancel +' tabTake.Tab = 2 +' Exit Sub +' End Select +' End If +' If cmdSaveOptMat.Enabled = True Then +' strMSG = "Option Material Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call OptMatSave +' Case vbNo +' +' Case vbCancel +' tabTake.Tab = 2 +' Exit Sub +' End Select +' End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then +' txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) +' If lstMInventory.ListCount > lstMInventory.ListIndex Then +' Call ListFindItem2(lstMInventory, lngFind) +' lstMInventory.ListIndex = lstMInventory.ListIndex + 1 +' Else +' Call ListFindItem2(lstMInventory, lngFind) +' End If +' lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + ' txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then +' txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then +' Call cmdDelMat_Click +' cmdDel1900.Enabled = True +' cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then +' Call cmdDelMeas_Click +' cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then +' cmdDelOptMat.Enabled = True +' cmdDelOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then +' Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then +' Call cmdDelMat_Click +' KeyCode = 0 + End If + If tabTake.Tab = 2 Then +' Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then +' Call cmdAddMat_Click +' KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then +' Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then +' Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then +' Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then +' txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else +' If Not cmdSave.Enabled Then +' cmdSave.Enabled = True +' cmdNew.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then +' cmdSaveMeas.Enabled = True +' cmdAddMeas.Enabled = False +' cmdUpMeasCalc.Enabled = False +' cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then +' cmdSaveMat.Enabled = True +' cmdAddMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then +' cmdSaveOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdAddOptMat.Enabled = False +' cmdDelOptMat.Enabled = False + End If + End If + End If + +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/InvChanges/frmViewTake.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LOGIN.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LOGIN.FRM new file mode 100644 index 0000000..e29bd86 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LOGIN.FRM @@ -0,0 +1,454 @@ +VERSION 5.00 +Begin VB.Form frmLogin + BorderStyle = 3 'Fixed Dialog + Caption = "Login" + ClientHeight = 1410 + ClientLeft = 1830 + ClientTop = 5040 + ClientWidth = 5805 + ClipControls = 0 'False + ControlBox = 0 'False + ForeColor = &H80000008& + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + PaletteMode = 1 'UseZOrder + ScaleHeight = 1410 + ScaleWidth = 5805 + Begin VB.ComboBox cboNames + Height = 300 + Left = 1200 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 0 + Top = 120 + Width = 3375 + End + Begin VB.TextBox txtName + Height = 300 + Left = 1200 + MaxLength = 20 + TabIndex = 6 + Top = 60 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdOK + Caption = "&OK" + Default = -1 'True + Enabled = 0 'False + Height = 315 + Left = 4680 + TabIndex = 5 + Top = 120 + Width = 1035 + End + Begin VB.CommandButton cmdCancel + Cancel = -1 'True + Caption = "&Cancel" + Height = 300 + Left = 4680 + TabIndex = 4 + Top = 540 + Width = 1035 + End + Begin VB.TextBox txtPassword + Height = 300 + IMEMode = 3 'DISABLE + Left = 1200 + MaxLength = 20 + PasswordChar = "*" + TabIndex = 1 + Top = 540 + Width = 3375 + End + Begin VB.Label lblAppName + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 120 + TabIndex = 7 + Top = 1020 + Width = 5595 + End + Begin VB.Label lblUserID + AutoSize = -1 'True + BackStyle = 0 'Transparent + Caption = "User ID" + Height = 192 + Left = 120 + TabIndex = 2 + Top = 180 + Width = 540 + End + Begin VB.Label lblPass + AutoSize = -1 'True + BackStyle = 0 'Transparent + Caption = "Password" + Height = 195 + Left = 120 + TabIndex = 3 + Top = 600 + Width = 690 + End +End +Attribute VB_Name = "frmLogin" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'*************************************************************** +'* Author : Paul D. Sheriff +'* Notice : Copyright 1995-1996 PDSA +'* Part of the PDSA Toolset +'* This version has been created specifically for +'* inclusion in this courseware +'* Date Created: December, 1995 +'* Form Name : s_login.frm +'* Description : +'* +'* The PDSA Toolset is a generic application builder and +'* set of templates for building Client/Server applications +'* using Visual Basic. +'* For more information on the PDSA Toolset browse our web +'* page at http://www.pdsa.com for a complete feature list. +'*************************************************************** +Option Explicit + +Private mintTimesTried As Integer +Private mboolCancel As Boolean +Private mboolValidLogon As Boolean +Private mboolDisplayUsers As Boolean +Private mboolCheckUserTable As Boolean +Private mstrInitLoginID As String +Private mstrInitPassword As String +Private mboolError As Boolean +Private mstrAppName As String + +Private mlngTop As Long +Private mlngLeft As Long + +Private mstrInfoMsg As String + +' Connection Class +'Private moDataConn As DataConnection + +Property Get InfoMsg() + InfoMsg = mstrInfoMsg +End Property + +Property Let AppName(ByVal strValue As String) + mstrAppName = strValue +End Property + +Property Let InitTop(ByVal lngTop As Long) + mlngTop = lngTop +End Property + +Property Let InitLeft(ByVal lngLeft As Long) + mlngLeft = lngLeft +End Property + +Property Get DataConnection() As DataConnection + Set DataConnection = moDataConn +End Property + +Property Set DataConnection(oConnect As DataConnection) + Set moDataConn = oConnect +End Property + +Property Get DisplayUsers() As Boolean + DisplayUsers = mboolDisplayUsers +End Property + +Property Let DisplayUsers(ByVal boolValue As Boolean) + mboolDisplayUsers = boolValue +End Property + +Property Get CheckUserTable() As Boolean + CheckUserTable = mboolCheckUserTable +End Property + +Property Let CheckUserTable(ByVal boolValue As Boolean) + mboolCheckUserTable = boolValue +End Property + +Property Get Cancel() As Boolean + Cancel = mboolCancel +End Property + +Property Get ValidLogon() As Boolean + ValidLogon = mboolValidLogon +End Property + +Property Get InitLoginID() As String + InitLoginID = mstrInitLoginID +End Property + +Property Let InitLoginID(ByVal strValue As String) + mstrInitLoginID = strValue +End Property + +Property Get InitPassword() As String + InitPassword = mstrInitPassword +End Property + +Property Let InitPassword(ByVal strValue As String) + mstrInitPassword = strValue +End Property + +Property Let Password(ByVal strValue As String) + mstrInitPassword = strValue +End Property + +Private Function UserNameLoad() As Boolean + Dim strOldMsg As String + Dim strLine As String + Dim oUser As clsUsers + Dim oConn As DataConnection + + Set oConn = New DataConnection + With oConn + .DataSource = moDataConn.DataSource + .Provider = moDataConn.Provider + .ProviderConst = moDataConn.ProviderConst + .DatabaseName = moDataConn.DatabaseName + .DSN = moDataConn.DSN + .InitialCatalog = moDataConn.InitialCatalog + .UseODBC = moDataConn.UseODBC + .LoginId = mstrInitLoginID + .Password = mstrInitPassword + End With + + If oConn.DataOpen() Then + Set oUser = New clsUsers + With oUser + Set .DataConnection = oConn + .SelectFilter = dacSelectclsUsersAll + + ' Retrieve first record + If .OpenRecordset() Then + UserNameLoad = True + cboNames.Clear + + Do Until .EOF + strLine = .LastName & ", " + strLine = strLine & .FirstName & _ + Space$(100) & vbTab + strLine = strLine & .LoginId + + cboNames.AddItem strLine + cboNames.ItemData(cboNames.NewIndex) = .userId + + ' Retrieve next record + Call .MoveNext + Loop + Else + mstrInfoMsg = oConn.ErrorMsg + UserNameLoad = False + End If + .CloseRecordset + End With + Else + mstrInfoMsg = oConn.ErrorMsg & vbCrLf & "Did you fill in the InitLoginID & InitPassword?" + UserNameLoad = False + End If + oConn.DataClose +End Function + +Private Sub cboNames_Click() + cmdOK.Enabled = True +End Sub + +Private Sub cmdCancel_Click() + mstrInfoMsg = "User Cancelled Login Process" + mboolCancel = True + Me.Hide +End Sub + +Private Sub cmdOK_Click() + Dim strLoginId As String + Dim lngUserId As Long + Dim strUserName As String + Dim strPassword As String + Dim boolPerform As Boolean + + mintTimesTried = mintTimesTried + 1 + mboolCancel = False + + ' Did they fill in name and password correctly + boolPerform = FormCheck() + + If boolPerform Then + ' Get Password from Text Box + strPassword = Trim$(txtPassword.Text) + + ' Set Properties of DataConnection Class + If mboolDisplayUsers Then + strLoginId = Trim$(cboNames.Text) + strLoginId = Mid$(strLoginId, InStr(strLoginId, vbTab) + 1) + strUserName = Trim$(Left$(cboNames.Text, InStr(cboNames.Text, vbTab) - 1)) + lngUserId = cboNames.ItemData(cboNames.ListIndex) + Else + strLoginId = Trim$(txtName.Text) + strUserName = "" + lngUserId = -1 + End If + With moDataConn + .LoginId = strLoginId + .userName = strUserName + .Password = strPassword + .userId = lngUserId + End With + End If + + If boolPerform Then + boolPerform = moDataConn.DataOpen() + If Not boolPerform Then + MsgBox "Invalid User ID and/or Password" & vbCrLf & vbCrLf & moDataConn.ErrorMsg, , "PDSASecurity.Login" + End If + End If + + If boolPerform Then + If mboolCheckUserTable Then + mboolValidLogon = UserTableCheck() + If mboolValidLogon Then + mboolValidLogon = True + Unload Me + Else + MsgBox mstrInfoMsg, , "PDSASecurity.Login" + End If + Else + ' Nothing else to do, leave validation + ' for another routine. + mboolValidLogon = True + Unload Me + End If + Else + If mintTimesTried > 2 Then + MsgBox "Exceeded the number of tries to login", , "PDSASecurity.Login" + Unload Me + End If + End If +End Sub + +Public Function UserTableCheck() + Dim oUser As clsUsers + + Set oUser = New clsUsers + With oUser + Set .DataConnection = moDataConn + ' Fill in Login ID so we can look them up in our + ' pdsaUser table. We will need to get their user + ' group for security, and their full name for + ' display on the screen. + .LoginId = moDataConn.LoginId + .WhereFilter = dacWherepdsaUsersLoginId + If .Find() Then + ' NOTE: You might want to add some encryption here + If .Password = moDataConn.Password Then + moDataConn.GroupId = .GroupId + moDataConn.userName = .LastName & ", " & .FirstName + UserTableCheck = True + Else + mstrInfoMsg = "Password does not match the password in the Users Table" + UserTableCheck = False + End If + Else + If .InfoMsg <> "" Then + mstrInfoMsg = .InfoMsg + MsgBox mstrInfoMsg, , "PDSASecurity.Login" + Else + mstrInfoMsg = "Can't Find User ID in the pdsaUsers Table, please re-enter." + MsgBox mstrInfoMsg, , "PDSASecurity.Login" + End If + + mboolValidLogon = False + End If + .CloseRecordset + End With +End Function + +Private Sub Form_Activate() + If mboolDisplayUsers Then + cboNames.SetFocus + Else + If txtName.Text = "" Then + txtName.SetFocus + Else + txtPassword.SetFocus + End If + End If + If mboolError Then + mboolValidLogon = False + Unload Me + End If +End Sub + +Private Sub Form_Initialize() + mlngTop = -1 + mlngLeft = -1 +End Sub + +Private Sub Form_Load() + Screen.MousePointer = vbHourglass + + If mlngTop = -1 Then + Me.Top = Screen.Height - Me.Height - 1000 + Else + Me.Top = mlngTop + End If + If mlngLeft = -1 Then + Me.Left = (Screen.Width / 2) - (Me.Width / 2) + Else + Me.Left = mlngLeft + End If + + lblAppName.caption = mstrAppName + + mboolValidLogon = False + If mboolDisplayUsers Then + ' Load Combo Box of Users + If Not UserNameLoad() Then + mboolError = True + End If + Else + ' Ask user for LoginID/Password + cboNames.Visible = False + With txtName + .Top = cboNames.Top + .Left = cboNames.Left + .Width = cboNames.Width + .Text = moDataConn.LoginId + .Visible = True + End With + cboNames.Width = 0 + End If + + Screen.MousePointer = vbDefault +End Sub + +Private Function FormCheck() + Dim boolValid As Integer + boolValid = True + + If mboolDisplayUsers Then + If Trim$(cboNames.Text) = "" Then + MsgBox "Please Fill In Your User Name", , "PDSASecurity.Login" + cboNames.SetFocus + boolValid = False + End If + Else + If Trim$(txtName.Text) = "" Then + MsgBox "Please Fill In Your User Name", , "PDSASecurity.Login" + txtName.SetFocus + boolValid = False + End If + End If + + FormCheck = boolValid +End Function + +Private Sub txtName_Change() + cmdOK.Enabled = True +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frm new file mode 100644 index 0000000..4cfe13f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frm @@ -0,0 +1,1876 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmCrewsNEW + Caption = "Lath and Stucco Crews" + ClientHeight = 8490 + ClientLeft = 165 + ClientTop = 450 + ClientWidth = 15105 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8490 + ScaleWidth = 15105 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdClose + Caption = "Close Project" + Enabled = 0 'False + Height = 555 + Left = 7455 + TabIndex = 51 + Top = 5730 + Width = 990 + End + Begin VB.CommandButton cmdSave2 + Caption = "Save Project" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 26 + Top = 5730 + Width = 990 + End + Begin VB.CommandButton Command1 + Caption = "Use Default Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8490 + TabIndex = 48 + Top = 5730 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdAddProj + Caption = "Add Project" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5070 + TabIndex = 47 + Top = 5730 + Width = 990 + End + Begin VB.CheckBox chkRates + Caption = "Show Project Rates" + Height = 285 + Left = 7695 + TabIndex = 46 + Top = 990 + Width = 1770 + End + Begin VB.TextBox txtProjCode + Enabled = 0 'False + Height = 285 + Left = 6060 + MaxLength = 6 + TabIndex = 42 + Top = 1335 + Visible = 0 'False + Width = 975 + End + Begin LpLib.fpList lstProj + Height = 3780 + Left = 75 + TabIndex = 40 + Top = 4515 + Width = 4860 + _Version = 196608 + _ExtentX = 8572 + _ExtentY = 6667 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrewsNEW.frx":0000 + End + Begin VB.CheckBox chkBiWeekly + Caption = "Bi Weekly PR" + Height = 210 + Left = 7710 + TabIndex = 39 + Top = 60 + Visible = 0 'False + Width = 1500 + End + Begin VB.CheckBox chkINACTIVE + Caption = "Inactive Crew" + Height = 330 + Left = 7710 + TabIndex = 38 + Top = 285 + Width = 1470 + End + Begin Crystal.CrystalReport crCrew + Left = 5310 + Top = 165 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtEndDate + Height = 300 + Left = 7590 + TabIndex = 35 + Top = 3300 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 300 + Left = 7590 + TabIndex = 34 + Top = 2760 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Pay List" + Enabled = 0 'False + Height = 555 + Left = 7455 + TabIndex = 36 + ToolTipText = "Enter Dates Before Printing" + Top = 6300 + Width = 990 + End + Begin VB.TextBox txtEmpNo + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + TabIndex = 17 + Top = 2475 + Width = 975 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 8655 + TabIndex = 29 + TabStop = 0 'False + Top = 6300 + Width = 990 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Crew" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 27 + Top = 6300 + Width = 990 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5070 + TabIndex = 28 + TabStop = 0 'False + Top = 6300 + Width = 990 + End + Begin VB.TextBox txtDA + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 24 + Top = 4995 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtQU + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 23 + Top = 4635 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSB + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 25 + Top = 5355 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMN + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 22 + Top = 4275 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSM + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 21 + Top = 3915 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSA + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 20 + Top = 3555 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 19 + Top = 3195 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 18 + Top = 2835 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + Height = 285 + Left = 6060 + MaxLength = 10 + TabIndex = 16 + Top = 990 + Width = 1575 + End + Begin VB.TextBox txtCrewBoss + Height = 285 + Left = 6060 + MaxLength = 30 + TabIndex = 15 + Top = 660 + Width = 3435 + End + Begin VB.ComboBox cboType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmCrewsNEW.frx":0367 + Left = 3180 + List = "frmCrewsNEW.frx":037D + Style = 2 'Dropdown List + TabIndex = 2 + Top = 75 + Width = 1755 + End + Begin VB.ListBox lstCrew + Height = 3960 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 495 + Width = 4875 + End + Begin LpLib.fpList lstCProj + Height = 6915 + Left = 8820 + TabIndex = 49 + Top = 1380 + Visible = 0 'False + Width = 6285 + _Version = 196608 + _ExtentX = 11086 + _ExtentY = 12197 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrewsNEW.frx":03B8 + End + Begin VB.TextBox txtProjDesc + Enabled = 0 'False + Height = 285 + Left = 6060 + TabIndex = 44 + Top = 1665 + Width = 3435 + End + Begin VB.Label lblProjInst + BackColor = &H00C0FFFF& + Caption = $"frmCrewsNEW.frx":074E + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1245 + Left = 9645 + TabIndex = 50 + Top = 15 + Width = 5490 + End + Begin VB.Label lblProjName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 5460 + TabIndex = 45 + Top = 1680 + Width = 540 + End + Begin VB.Label lblProjID + Height = 195 + Left = 7125 + TabIndex = 43 + Top = 1350 + Width = 1860 + End + Begin VB.Label lblProjCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Code:" + Height = 195 + Left = 5040 + TabIndex = 41 + Top = 1350 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblPrintInfo + Caption = $"frmCrewsNEW.frx":0837 + ForeColor = &H000000FF& + Height = 1230 + Left = 7575 + TabIndex = 37 + Top = 3645 + Visible = 0 'False + Width = 1785 + End + Begin VB.Label lblEndDate + AutoSize = -1 'True + Caption = "Ending Print Date:" + Height = 195 + Left = 7590 + TabIndex = 33 + Top = 3090 + Visible = 0 'False + Width = 1290 + End + Begin VB.Label lblBegDate + AutoSize = -1 'True + Caption = "Beginning Print Date:" + Height = 195 + Left = 7590 + TabIndex = 32 + Top = 2520 + Visible = 0 'False + Width = 1500 + End + Begin VB.Label lblEmpNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Employee No:" + Height = 195 + Left = 5325 + TabIndex = 31 + Top = 2535 + Width = 990 + End + Begin VB.Label lblInstructions + Caption = $"frmCrewsNEW.frx":08D2 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1320 + Left = 5085 + TabIndex = 30 + Top = 6930 + Width = 4545 + End + Begin VB.Label lblDA + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Dash Rate:" + Height = 195 + Left = 5535 + TabIndex = 14 + Top = 5055 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6435 + TabIndex = 13 + Top = 285 + Width = 975 + End + Begin VB.Label lblQU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quernavaca Rate:" + Height = 195 + Left = 5025 + TabIndex = 12 + Top = 4695 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblSB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Rate:" + Height = 195 + Left = 5250 + TabIndex = 11 + Top = 5415 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblMN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey Rate:" + Height = 195 + Left = 5205 + TabIndex = 10 + Top = 4290 + Visible = 0 'False + Width = 1140 + End + Begin VB.Label lblSmooth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Smooth Rate:" + Height = 195 + Left = 5370 + TabIndex = 9 + Top = 4005 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Rate:" + Height = 195 + Left = 5535 + TabIndex = 8 + Top = 3645 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 5520 + TabIndex = 7 + Top = 2940 + Visible = 0 'False + Width = 825 + End + Begin VB.Label lblPrimRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Rate:" + Height = 195 + Left = 5595 + TabIndex = 6 + Top = 3300 + Visible = 0 'False + Width = 750 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone #:" + Height = 195 + Left = 5340 + TabIndex = 5 + Top = 1050 + Width = 660 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Leader:" + Height = 195 + Left = 5055 + TabIndex = 4 + Top = 720 + Width = 945 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew #:" + Height = 195 + Left = 5820 + TabIndex = 3 + Top = 345 + Width = 555 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Select The Crew Type To Display A List:" + ForeColor = &H000000FF& + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 2865 + End +End +Attribute VB_Name = "frmCrewsNEW" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset, moRSPRATE As Recordset +Dim mintCREW As Integer, mlngProj As Long +Dim mboolAdding As Boolean +' lstCREW Height 3960 or 7470 +' need to make it so the save keys work for just crews and for projects. +' make sure that if there is a project labor rate then that displays not the +' default labor rate. +' + +Private Sub cboType_Change() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If +End Sub + +Private Sub cboType_Click() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If + +End Sub + +Private Sub LoadCProj() +Dim strSQL As String, oRS As Recordset, strLine As String + + cmdAddProj.Enabled = False + cmdSave.Enabled = True + + strSQL = "SELECT Proj_ID,Proj_Code, Proj_Desc, Proj_Cont FROM tblProject WHERE GotBid and Not Complete" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + frmCrewsNEW.Left = 0 + frmCrewsNEW.Width = 15225 + + lstCProj.Clear + + Do Until oRS.EOF + strLine = Field2Str2(oRS!proj_id) & vbTab & Field2Str(oRS!proj_code) & vbTab & Field2Str(oRS!proj_cont) & vbTab & Field2Str(oRS!proj_desc) + lstCProj.AddItem strLine + + oRS.MoveNext + + Loop + +End Sub + +Private Sub chkRates_Click() +Dim intBookmark As Integer + + intBookmark = lstCrew.ListIndex + If chkRates = vbChecked Then + lstCrew.Enabled = False + lstCrew.Height = 3960 + lstProj.Visible = True + txtProjCode.Visible = True + lblProjCode.Visible = True + txtProjDesc = "" + cmdAdd.Enabled = False + cmdAddProj.Enabled = True + Call ProjLoad + End If + + If chkRates = vbUnchecked Then + lstProj.ListIndex = -1 + lstCrew.Enabled = True + If cmdClose.Enabled = True Then + cmdClose.Enabled = False + Call FormShowCrew + End If + lstCProj.Visible = False + lblInstructions.Visible = True + cmdExit.Visible = True + frmCrewsNEW.Width = 9750 + lstCrew.Height = 7470 + lstProj.Visible = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + cmdAdd.Enabled = True + cmdAddProj.Enabled = False + End If + + If lstCrew.Enabled <> False Or lstProj.ListCount = 0 Then + Call CrewLoad + End If + lstCrew.ListIndex = intBookmark +' Call ProjLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + mboolAdding = True + Call FormClear + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdAddProj_Click() +' frmCrewsNEW.Width = 0 + lstCProj.Visible = True + cmdExit.Visible = False + lblInstructions.Visible = False + cmdClose.Enabled = True + Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdClose_Click() +' frmCrewsNEW.Width = 0 + lstCProj.Visible = False + cmdExit.Visible = True + frmCrewsNEW.Width = 9750 + If lstProj.Visible <> True Then + lstCrew.Height = 7470 + Else + lstCrew.Height = 3960 + End If + lblInstructions.Visible = True + lstCProj.Clear + lstCrew.Enabled = True + lstCrew.SetFocus + cmdAdd.Enabled = True + cmdClose.Enabled = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + If lstProj.ListCount > 0 Then + Call lstProj_Click + Else + Call lstCrew_Click ' **** may need to change this to lstproj_click if lstproj.listcount > 0 + End If +' Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call PrintPay +End Sub + +Private Sub cmdSave_Click() +Dim intBookmark As Integer + + intBookmark = lstCrew.ListIndex + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call FormSave + lstCrew.ListIndex = intBookmark +End Sub + +Private Sub cmdSave2_Click() +Dim intBookmark As Integer + + intBookmark = lstProj.ListIndex + lstProj.Enabled = True +' cmdAdd.Enabled = True + cmdSave2.Enabled = False +' cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call FormSave2 + lstProj.ListIndex = intBookmark + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + frmCrewsNEW.Width = 9750 + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + lstCrew.Height = 7470 + lstProj.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE type = '" & Left$(cboType, 1) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + If Len(Field2Str(oRS!crew_boss)) < 14 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + ElseIf Len(Field2Str(oRS!crew_boss)) > 20 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + Else + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim oRSS As Recordset +Dim strSQLR As String, intCREWID As Integer +Dim strLine As String + On Error GoTo Error_EH + intCREWID = lstCrew.ItemData(lstCrew.ListIndex) + strSQLR = "SELECT rate_id, proj_id, proj_code, proj_desc, crew_id FROM tblCREWRATE WHERE crew_id = " & intCREWID + Set oRSS = New Recordset + oRSS.Open strSQLR, goConn, adOpenForwardOnly, adLockReadOnly + + lstProj.Clear + + Do Until oRSS.EOF + With lstProj + strLine = Field2Str2(oRSS!Rate_id) & vbTab & " " & Field2Str(oRSS!proj_code) & vbTab & Field2Str(oRSS!proj_desc) & vbTab & Field2Str2(oRSS!proj_id) & vbTab & Field2Str2(oRSS!Rate_id) +' If Len(Field2Str(oRSS!crew_boss)) < 14 Then +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' ElseIf Len(Field2Str(oRSS!crew_boss)) > 20 Then +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' Else +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' End If + .AddItem strLine +' .ItemData(.NewIndex) = oRSS!crew_id + End With + + oRSS.MoveNext + Loop + + If lstProj.ListCount Then + lstProj.ListIndex = 0 + Else + lstProj.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCrew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindProj() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCREWRATE " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowProj() + +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH + lstProj.col = 4 + lngRATEID = Field2Long(lstProj.ColText) + + strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID + Set moRSPRATE = New Recordset + moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSPRATE + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!crew_boss) +' txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EMPNO) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtProjCode = Field2Str(!proj_code) + txtProjDesc = Field2Str(!proj_desc) +' chkINACTIVE = Field2CheckBox(!inactive) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowCrew() +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH +' lstProj.col = 4 +' lngRATEID = Field2Long(lstProj.ColText) + +' strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID +' Set moRSPRATE = New Recordset +' moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSCREW + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!crew_boss) + txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EMPNO) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtProjDesc = "Default Pay Rates for This Crew" +' chkINACTIVE = Field2CheckBox(!inactive) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtPrimRate = 0 + txtMetal = 0 + txtSA = 0 + txtSM = 0 + txtQU = 0 + txtDA = 0 + txtMN = 0 + txtSB = 0 + txtProjCode = "" + txtProjDesc = "" + chkINACTIVE = vbUnchecked + chkBiWeekly = vbUnchecked +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo 0 + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !crew_boss = Str2Field(txtCrewBoss) + !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !EMPNO = Format(Field2Str2(txtEmpNo), "0000000") + !inactive = chkINACTIVE + !BiWeekly = chkBiWeekly + End With + test = moRSCREW.EditMode + moRSCREW.Update + + Call CrewLoad + + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSaveP() +Dim strLOT As String, test As String + On Error GoTo 0 +' On Error GoTo Error_EH + + With moRSPRATE + !U_USER = gstrLOGIN + !Update = Date + !crew_boss = Str2Field(txtCrewBoss) +' !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) +' !EMPNO = Format(Field2Str2(txtEmpNo), "0000000") +' !inactive = chkINACTIVE +' !BiWeekly = chkBiWeekly + End With +' test = moRSCREW.EditMode + moRSPRATE.Update + + Call ProjLoad + + If mboolAdding Then + Call ProjLoad + If FormFindProj() Then + Call FormShowProj + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSaveP" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormSave2() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSCREW.AddNew +' moRSCREW!C_USER = gstrLOGIN +' End If + + ' Store the controls to the recordset + Call FieldsSaveP + + +' If mboolAdding Then +' mboolAdding = False +' End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPRATE.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCProj_DblClick() +Dim strSQL As String, oRS As Recordset +Dim strPROJID As String, strPROJCODE As String, strPROJDESC As String + + strSQL = "SELECT * FROM tblCREWRATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + lstCProj.col = 1 + strPROJCODE = lstCProj.ColText + lstCProj.col = 0 + strPROJID = lstCProj.ColText + lstCProj.col = 3 + strPROJDESC = lstCProj.ColText + + If Not oRS.EOF Then + oRS.AddNew + oRS!crew_id = Field2Str2(moRSCREW!crew_id) + oRS!crew_boss = Field2Str(moRSCREW!crew_boss) + oRS!Type = Field2Str(moRSCREW!Type) + oRS!METAL = Field2Str2(moRSCREW!METAL) + oRS!lath_skip = Field2Str(moRSCREW!lath_skip) + oRS!sand = Field2Str2(moRSCREW!sand) + oRS!Smooth = Field2Str2(moRSCREW!Smooth) + oRS!mn = Field2Str2(moRSCREW!mn) + oRS!dash = Field2Str2(moRSCREW!dash) + oRS!syn = Field2Str2(moRSCREW!syn) + oRS!qu = Field2Str2(moRSCREW!qu) + oRS!Current = Field2Str(moRSCREW!Current) + oRS!EMPNO = Field2Str2(moRSCREW!EMPNO) + oRS!Create = Date + oRS!C_USER = gstrLOGIN + oRS!proj_id = strPROJID + oRS!proj_code = strPROJCODE + oRS!proj_desc = strPROJDESC + oRS.Update + End If + + Call ProjLoad + +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + txtBegDate = "" + txtEndDate = "" + cmdAdd.Enabled = False +' cmdPrint.Enabled = True + cmdSave.Enabled = True + lblPrintInfo.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + txtCrewBoss.SetFocus +End Sub + +Private Sub lstProj_Click() + On Error GoTo Error_EH + + If lstProj.ListIndex <> -1 Then +' If FormFindProj() Then + Call FormShowProj +' mintCREW = lstProj.ItemData(lstProj.ListIndex) + Else +' lstProj.Clear + Call FormClear +' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstProj_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstProj_DblClick() +' txtBegDate = "" +' txtEndDate = "" + cmdAddProj.Enabled = False +' cmdPrint.Enabled = True + cmdSave2.Enabled = True +' lblPrintInfo.Visible = True +' lblBegDate.Visible = True +' lblEndDate.Visible = True +' txtBegDate.Visible = True +' txtEndDate.Visible = True +' txtCrewBoss.SetFocus + txtPrimRate.SetFocus + +End Sub + +Private Sub txtBegDate_GotFocus() + Call FieldSelect(txtBegDate) +End Sub + +Private Sub txtBegDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBegDate, "/", 1) + If Not IsDate(txtBegDate) Then + If lngPOS = 0 Then + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBegDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBegDate.SetFocus + End If + End If + +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + +Private Sub txtDA_GotFocus() + Call FieldSelect(txtDA) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtEndDate_GotFocus() + Call FieldSelect(txtEndDate) +End Sub + +Private Sub txtEndDate_LostFocus() +Dim lngPOS As Long + If txtBegDate <> "" Or Len(txtBegDate) > 0 Then + If Not IsDate(txtBegDate) Then + MsgBox "You Must Enter A Valid Date In The Beginning Date Field", , "Invalid Date - ReEnter" + txtEndDate = "" + txtBegDate.SetFocus + Exit Sub + End If + End If + lngPOS = InStr(1, txtEndDate, "/", 1) + If Not IsDate(txtEndDate) Then + If lngPOS = 0 Then + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtEndDate.SetFocus + ElseIf txtEndDate < txtBegDate Then + MsgBox "Ending Date cannot be earlier than the Beginning Date" + txtEndDate.SetFocus + Else + cmdPrint.Enabled = True + cmdPrint.SetFocus + lstCrew.Enabled = False + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtEndDate.SetFocus + End If + End If + +' cmdPrint.Enabled = True +End Sub + +Private Sub txtMetal_GotFocus() + Call FieldSelect(txtMetal) +End Sub + +Private Sub txtMN_GotFocus() + Call FieldSelect(txtMN) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub txtQU_GotFocus() + Call FieldSelect(txtQU) +End Sub + +Private Sub txtSA_GotFocus() + Call FieldSelect(txtSA) +End Sub + +Private Sub txtSB_GotFocus() + Call FieldSelect(txtSB) +End Sub + +Private Sub txtSM_GotFocus() + Call FieldSelect(txtSM) +End Sub + +Private Sub PrintPay() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + intBYear = Mid(txtBegDate, 7, 4) + intBDay = Format(Mid(txtBegDate, 4, 2), "00") + intBMonth = Format(Mid(txtBegDate, 1, 2), "00") + intEYear = Mid(txtEndDate, 7, 4) + intEDay = Format(Mid(txtEndDate, 4, 2), "00") + intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crCrew.ReportFileName = App.Path & "\CrewPayByDate.rpt" + + crCrew.Formulas(3) = "Z_BegDate = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" + crCrew.Formulas(4) = "Z_Crew = " & mintCREW + crCrew.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crCrew.Destination = crptToPrinter + Else + crCrew.Destination = crptToWindow + End If + crCrew.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Crew - Module PrintPay" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frx new file mode 100644 index 0000000..d7d573b Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles - Copy/frmCrewsNEW.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frm new file mode 100644 index 0000000..4cfe13f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frm @@ -0,0 +1,1876 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmCrewsNEW + Caption = "Lath and Stucco Crews" + ClientHeight = 8490 + ClientLeft = 165 + ClientTop = 450 + ClientWidth = 15105 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8490 + ScaleWidth = 15105 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdClose + Caption = "Close Project" + Enabled = 0 'False + Height = 555 + Left = 7455 + TabIndex = 51 + Top = 5730 + Width = 990 + End + Begin VB.CommandButton cmdSave2 + Caption = "Save Project" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 26 + Top = 5730 + Width = 990 + End + Begin VB.CommandButton Command1 + Caption = "Use Default Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8490 + TabIndex = 48 + Top = 5730 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdAddProj + Caption = "Add Project" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5070 + TabIndex = 47 + Top = 5730 + Width = 990 + End + Begin VB.CheckBox chkRates + Caption = "Show Project Rates" + Height = 285 + Left = 7695 + TabIndex = 46 + Top = 990 + Width = 1770 + End + Begin VB.TextBox txtProjCode + Enabled = 0 'False + Height = 285 + Left = 6060 + MaxLength = 6 + TabIndex = 42 + Top = 1335 + Visible = 0 'False + Width = 975 + End + Begin LpLib.fpList lstProj + Height = 3780 + Left = 75 + TabIndex = 40 + Top = 4515 + Width = 4860 + _Version = 196608 + _ExtentX = 8572 + _ExtentY = 6667 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrewsNEW.frx":0000 + End + Begin VB.CheckBox chkBiWeekly + Caption = "Bi Weekly PR" + Height = 210 + Left = 7710 + TabIndex = 39 + Top = 60 + Visible = 0 'False + Width = 1500 + End + Begin VB.CheckBox chkINACTIVE + Caption = "Inactive Crew" + Height = 330 + Left = 7710 + TabIndex = 38 + Top = 285 + Width = 1470 + End + Begin Crystal.CrystalReport crCrew + Left = 5310 + Top = 165 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtEndDate + Height = 300 + Left = 7590 + TabIndex = 35 + Top = 3300 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 300 + Left = 7590 + TabIndex = 34 + Top = 2760 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Pay List" + Enabled = 0 'False + Height = 555 + Left = 7455 + TabIndex = 36 + ToolTipText = "Enter Dates Before Printing" + Top = 6300 + Width = 990 + End + Begin VB.TextBox txtEmpNo + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + TabIndex = 17 + Top = 2475 + Width = 975 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 8655 + TabIndex = 29 + TabStop = 0 'False + Top = 6300 + Width = 990 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Crew" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 27 + Top = 6300 + Width = 990 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5070 + TabIndex = 28 + TabStop = 0 'False + Top = 6300 + Width = 990 + End + Begin VB.TextBox txtDA + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 24 + Top = 4995 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtQU + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 23 + Top = 4635 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSB + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 25 + Top = 5355 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMN + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 22 + Top = 4275 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSM + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 21 + Top = 3915 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSA + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 20 + Top = 3555 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 19 + Top = 3195 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Height = 285 + Left = 6405 + MaxLength = 9 + TabIndex = 18 + Top = 2835 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + Height = 285 + Left = 6060 + MaxLength = 10 + TabIndex = 16 + Top = 990 + Width = 1575 + End + Begin VB.TextBox txtCrewBoss + Height = 285 + Left = 6060 + MaxLength = 30 + TabIndex = 15 + Top = 660 + Width = 3435 + End + Begin VB.ComboBox cboType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmCrewsNEW.frx":0367 + Left = 3180 + List = "frmCrewsNEW.frx":037D + Style = 2 'Dropdown List + TabIndex = 2 + Top = 75 + Width = 1755 + End + Begin VB.ListBox lstCrew + Height = 3960 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 495 + Width = 4875 + End + Begin LpLib.fpList lstCProj + Height = 6915 + Left = 8820 + TabIndex = 49 + Top = 1380 + Visible = 0 'False + Width = 6285 + _Version = 196608 + _ExtentX = 11086 + _ExtentY = 12197 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrewsNEW.frx":03B8 + End + Begin VB.TextBox txtProjDesc + Enabled = 0 'False + Height = 285 + Left = 6060 + TabIndex = 44 + Top = 1665 + Width = 3435 + End + Begin VB.Label lblProjInst + BackColor = &H00C0FFFF& + Caption = $"frmCrewsNEW.frx":074E + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1245 + Left = 9645 + TabIndex = 50 + Top = 15 + Width = 5490 + End + Begin VB.Label lblProjName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 5460 + TabIndex = 45 + Top = 1680 + Width = 540 + End + Begin VB.Label lblProjID + Height = 195 + Left = 7125 + TabIndex = 43 + Top = 1350 + Width = 1860 + End + Begin VB.Label lblProjCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Code:" + Height = 195 + Left = 5040 + TabIndex = 41 + Top = 1350 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblPrintInfo + Caption = $"frmCrewsNEW.frx":0837 + ForeColor = &H000000FF& + Height = 1230 + Left = 7575 + TabIndex = 37 + Top = 3645 + Visible = 0 'False + Width = 1785 + End + Begin VB.Label lblEndDate + AutoSize = -1 'True + Caption = "Ending Print Date:" + Height = 195 + Left = 7590 + TabIndex = 33 + Top = 3090 + Visible = 0 'False + Width = 1290 + End + Begin VB.Label lblBegDate + AutoSize = -1 'True + Caption = "Beginning Print Date:" + Height = 195 + Left = 7590 + TabIndex = 32 + Top = 2520 + Visible = 0 'False + Width = 1500 + End + Begin VB.Label lblEmpNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Employee No:" + Height = 195 + Left = 5325 + TabIndex = 31 + Top = 2535 + Width = 990 + End + Begin VB.Label lblInstructions + Caption = $"frmCrewsNEW.frx":08D2 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1320 + Left = 5085 + TabIndex = 30 + Top = 6930 + Width = 4545 + End + Begin VB.Label lblDA + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Dash Rate:" + Height = 195 + Left = 5535 + TabIndex = 14 + Top = 5055 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6435 + TabIndex = 13 + Top = 285 + Width = 975 + End + Begin VB.Label lblQU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quernavaca Rate:" + Height = 195 + Left = 5025 + TabIndex = 12 + Top = 4695 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblSB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Rate:" + Height = 195 + Left = 5250 + TabIndex = 11 + Top = 5415 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblMN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey Rate:" + Height = 195 + Left = 5205 + TabIndex = 10 + Top = 4290 + Visible = 0 'False + Width = 1140 + End + Begin VB.Label lblSmooth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Smooth Rate:" + Height = 195 + Left = 5370 + TabIndex = 9 + Top = 4005 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Rate:" + Height = 195 + Left = 5535 + TabIndex = 8 + Top = 3645 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 5520 + TabIndex = 7 + Top = 2940 + Visible = 0 'False + Width = 825 + End + Begin VB.Label lblPrimRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Rate:" + Height = 195 + Left = 5595 + TabIndex = 6 + Top = 3300 + Visible = 0 'False + Width = 750 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone #:" + Height = 195 + Left = 5340 + TabIndex = 5 + Top = 1050 + Width = 660 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Leader:" + Height = 195 + Left = 5055 + TabIndex = 4 + Top = 720 + Width = 945 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew #:" + Height = 195 + Left = 5820 + TabIndex = 3 + Top = 345 + Width = 555 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Select The Crew Type To Display A List:" + ForeColor = &H000000FF& + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 2865 + End +End +Attribute VB_Name = "frmCrewsNEW" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset, moRSPRATE As Recordset +Dim mintCREW As Integer, mlngProj As Long +Dim mboolAdding As Boolean +' lstCREW Height 3960 or 7470 +' need to make it so the save keys work for just crews and for projects. +' make sure that if there is a project labor rate then that displays not the +' default labor rate. +' + +Private Sub cboType_Change() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If +End Sub + +Private Sub cboType_Click() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If + +End Sub + +Private Sub LoadCProj() +Dim strSQL As String, oRS As Recordset, strLine As String + + cmdAddProj.Enabled = False + cmdSave.Enabled = True + + strSQL = "SELECT Proj_ID,Proj_Code, Proj_Desc, Proj_Cont FROM tblProject WHERE GotBid and Not Complete" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + frmCrewsNEW.Left = 0 + frmCrewsNEW.Width = 15225 + + lstCProj.Clear + + Do Until oRS.EOF + strLine = Field2Str2(oRS!proj_id) & vbTab & Field2Str(oRS!proj_code) & vbTab & Field2Str(oRS!proj_cont) & vbTab & Field2Str(oRS!proj_desc) + lstCProj.AddItem strLine + + oRS.MoveNext + + Loop + +End Sub + +Private Sub chkRates_Click() +Dim intBookmark As Integer + + intBookmark = lstCrew.ListIndex + If chkRates = vbChecked Then + lstCrew.Enabled = False + lstCrew.Height = 3960 + lstProj.Visible = True + txtProjCode.Visible = True + lblProjCode.Visible = True + txtProjDesc = "" + cmdAdd.Enabled = False + cmdAddProj.Enabled = True + Call ProjLoad + End If + + If chkRates = vbUnchecked Then + lstProj.ListIndex = -1 + lstCrew.Enabled = True + If cmdClose.Enabled = True Then + cmdClose.Enabled = False + Call FormShowCrew + End If + lstCProj.Visible = False + lblInstructions.Visible = True + cmdExit.Visible = True + frmCrewsNEW.Width = 9750 + lstCrew.Height = 7470 + lstProj.Visible = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + cmdAdd.Enabled = True + cmdAddProj.Enabled = False + End If + + If lstCrew.Enabled <> False Or lstProj.ListCount = 0 Then + Call CrewLoad + End If + lstCrew.ListIndex = intBookmark +' Call ProjLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + mboolAdding = True + Call FormClear + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdAddProj_Click() +' frmCrewsNEW.Width = 0 + lstCProj.Visible = True + cmdExit.Visible = False + lblInstructions.Visible = False + cmdClose.Enabled = True + Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdClose_Click() +' frmCrewsNEW.Width = 0 + lstCProj.Visible = False + cmdExit.Visible = True + frmCrewsNEW.Width = 9750 + If lstProj.Visible <> True Then + lstCrew.Height = 7470 + Else + lstCrew.Height = 3960 + End If + lblInstructions.Visible = True + lstCProj.Clear + lstCrew.Enabled = True + lstCrew.SetFocus + cmdAdd.Enabled = True + cmdClose.Enabled = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + If lstProj.ListCount > 0 Then + Call lstProj_Click + Else + Call lstCrew_Click ' **** may need to change this to lstproj_click if lstproj.listcount > 0 + End If +' Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call PrintPay +End Sub + +Private Sub cmdSave_Click() +Dim intBookmark As Integer + + intBookmark = lstCrew.ListIndex + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call FormSave + lstCrew.ListIndex = intBookmark +End Sub + +Private Sub cmdSave2_Click() +Dim intBookmark As Integer + + intBookmark = lstProj.ListIndex + lstProj.Enabled = True +' cmdAdd.Enabled = True + cmdSave2.Enabled = False +' cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call FormSave2 + lstProj.ListIndex = intBookmark + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + frmCrewsNEW.Width = 9750 + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + lstCrew.Height = 7470 + lstProj.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE type = '" & Left$(cboType, 1) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + If Len(Field2Str(oRS!crew_boss)) < 14 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + ElseIf Len(Field2Str(oRS!crew_boss)) > 20 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + Else + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim oRSS As Recordset +Dim strSQLR As String, intCREWID As Integer +Dim strLine As String + On Error GoTo Error_EH + intCREWID = lstCrew.ItemData(lstCrew.ListIndex) + strSQLR = "SELECT rate_id, proj_id, proj_code, proj_desc, crew_id FROM tblCREWRATE WHERE crew_id = " & intCREWID + Set oRSS = New Recordset + oRSS.Open strSQLR, goConn, adOpenForwardOnly, adLockReadOnly + + lstProj.Clear + + Do Until oRSS.EOF + With lstProj + strLine = Field2Str2(oRSS!Rate_id) & vbTab & " " & Field2Str(oRSS!proj_code) & vbTab & Field2Str(oRSS!proj_desc) & vbTab & Field2Str2(oRSS!proj_id) & vbTab & Field2Str2(oRSS!Rate_id) +' If Len(Field2Str(oRSS!crew_boss)) < 14 Then +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' ElseIf Len(Field2Str(oRSS!crew_boss)) > 20 Then +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' Else +' strLine = Format(Field2Str(oRSS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRSS!crew_id) +' End If + .AddItem strLine +' .ItemData(.NewIndex) = oRSS!crew_id + End With + + oRSS.MoveNext + Loop + + If lstProj.ListCount Then + lstProj.ListIndex = 0 + Else + lstProj.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCrew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindProj() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCREWRATE " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowProj() + +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH + lstProj.col = 4 + lngRATEID = Field2Long(lstProj.ColText) + + strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID + Set moRSPRATE = New Recordset + moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSPRATE + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!crew_boss) +' txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EMPNO) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtProjCode = Field2Str(!proj_code) + txtProjDesc = Field2Str(!proj_desc) +' chkINACTIVE = Field2CheckBox(!inactive) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowCrew() +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH +' lstProj.col = 4 +' lngRATEID = Field2Long(lstProj.ColText) + +' strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID +' Set moRSPRATE = New Recordset +' moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSCREW + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!crew_boss) + txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EMPNO) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtProjDesc = "Default Pay Rates for This Crew" +' chkINACTIVE = Field2CheckBox(!inactive) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtPrimRate = 0 + txtMetal = 0 + txtSA = 0 + txtSM = 0 + txtQU = 0 + txtDA = 0 + txtMN = 0 + txtSB = 0 + txtProjCode = "" + txtProjDesc = "" + chkINACTIVE = vbUnchecked + chkBiWeekly = vbUnchecked +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo 0 + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !crew_boss = Str2Field(txtCrewBoss) + !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !EMPNO = Format(Field2Str2(txtEmpNo), "0000000") + !inactive = chkINACTIVE + !BiWeekly = chkBiWeekly + End With + test = moRSCREW.EditMode + moRSCREW.Update + + Call CrewLoad + + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSaveP() +Dim strLOT As String, test As String + On Error GoTo 0 +' On Error GoTo Error_EH + + With moRSPRATE + !U_USER = gstrLOGIN + !Update = Date + !crew_boss = Str2Field(txtCrewBoss) +' !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) +' !EMPNO = Format(Field2Str2(txtEmpNo), "0000000") +' !inactive = chkINACTIVE +' !BiWeekly = chkBiWeekly + End With +' test = moRSCREW.EditMode + moRSPRATE.Update + + Call ProjLoad + + If mboolAdding Then + Call ProjLoad + If FormFindProj() Then + Call FormShowProj + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSaveP" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormSave2() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSCREW.AddNew +' moRSCREW!C_USER = gstrLOGIN +' End If + + ' Store the controls to the recordset + Call FieldsSaveP + + +' If mboolAdding Then +' mboolAdding = False +' End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPRATE.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCProj_DblClick() +Dim strSQL As String, oRS As Recordset +Dim strPROJID As String, strPROJCODE As String, strPROJDESC As String + + strSQL = "SELECT * FROM tblCREWRATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + lstCProj.col = 1 + strPROJCODE = lstCProj.ColText + lstCProj.col = 0 + strPROJID = lstCProj.ColText + lstCProj.col = 3 + strPROJDESC = lstCProj.ColText + + If Not oRS.EOF Then + oRS.AddNew + oRS!crew_id = Field2Str2(moRSCREW!crew_id) + oRS!crew_boss = Field2Str(moRSCREW!crew_boss) + oRS!Type = Field2Str(moRSCREW!Type) + oRS!METAL = Field2Str2(moRSCREW!METAL) + oRS!lath_skip = Field2Str(moRSCREW!lath_skip) + oRS!sand = Field2Str2(moRSCREW!sand) + oRS!Smooth = Field2Str2(moRSCREW!Smooth) + oRS!mn = Field2Str2(moRSCREW!mn) + oRS!dash = Field2Str2(moRSCREW!dash) + oRS!syn = Field2Str2(moRSCREW!syn) + oRS!qu = Field2Str2(moRSCREW!qu) + oRS!Current = Field2Str(moRSCREW!Current) + oRS!EMPNO = Field2Str2(moRSCREW!EMPNO) + oRS!Create = Date + oRS!C_USER = gstrLOGIN + oRS!proj_id = strPROJID + oRS!proj_code = strPROJCODE + oRS!proj_desc = strPROJDESC + oRS.Update + End If + + Call ProjLoad + +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + txtBegDate = "" + txtEndDate = "" + cmdAdd.Enabled = False +' cmdPrint.Enabled = True + cmdSave.Enabled = True + lblPrintInfo.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + txtCrewBoss.SetFocus +End Sub + +Private Sub lstProj_Click() + On Error GoTo Error_EH + + If lstProj.ListIndex <> -1 Then +' If FormFindProj() Then + Call FormShowProj +' mintCREW = lstProj.ItemData(lstProj.ListIndex) + Else +' lstProj.Clear + Call FormClear +' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstProj_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstProj_DblClick() +' txtBegDate = "" +' txtEndDate = "" + cmdAddProj.Enabled = False +' cmdPrint.Enabled = True + cmdSave2.Enabled = True +' lblPrintInfo.Visible = True +' lblBegDate.Visible = True +' lblEndDate.Visible = True +' txtBegDate.Visible = True +' txtEndDate.Visible = True +' txtCrewBoss.SetFocus + txtPrimRate.SetFocus + +End Sub + +Private Sub txtBegDate_GotFocus() + Call FieldSelect(txtBegDate) +End Sub + +Private Sub txtBegDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBegDate, "/", 1) + If Not IsDate(txtBegDate) Then + If lngPOS = 0 Then + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBegDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBegDate.SetFocus + End If + End If + +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + +Private Sub txtDA_GotFocus() + Call FieldSelect(txtDA) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtEndDate_GotFocus() + Call FieldSelect(txtEndDate) +End Sub + +Private Sub txtEndDate_LostFocus() +Dim lngPOS As Long + If txtBegDate <> "" Or Len(txtBegDate) > 0 Then + If Not IsDate(txtBegDate) Then + MsgBox "You Must Enter A Valid Date In The Beginning Date Field", , "Invalid Date - ReEnter" + txtEndDate = "" + txtBegDate.SetFocus + Exit Sub + End If + End If + lngPOS = InStr(1, txtEndDate, "/", 1) + If Not IsDate(txtEndDate) Then + If lngPOS = 0 Then + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtEndDate.SetFocus + ElseIf txtEndDate < txtBegDate Then + MsgBox "Ending Date cannot be earlier than the Beginning Date" + txtEndDate.SetFocus + Else + cmdPrint.Enabled = True + cmdPrint.SetFocus + lstCrew.Enabled = False + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtEndDate.SetFocus + End If + End If + +' cmdPrint.Enabled = True +End Sub + +Private Sub txtMetal_GotFocus() + Call FieldSelect(txtMetal) +End Sub + +Private Sub txtMN_GotFocus() + Call FieldSelect(txtMN) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub txtQU_GotFocus() + Call FieldSelect(txtQU) +End Sub + +Private Sub txtSA_GotFocus() + Call FieldSelect(txtSA) +End Sub + +Private Sub txtSB_GotFocus() + Call FieldSelect(txtSB) +End Sub + +Private Sub txtSM_GotFocus() + Call FieldSelect(txtSM) +End Sub + +Private Sub PrintPay() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + intBYear = Mid(txtBegDate, 7, 4) + intBDay = Format(Mid(txtBegDate, 4, 2), "00") + intBMonth = Format(Mid(txtBegDate, 1, 2), "00") + intEYear = Mid(txtEndDate, 7, 4) + intEDay = Format(Mid(txtEndDate, 4, 2), "00") + intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crCrew.ReportFileName = App.Path & "\CrewPayByDate.rpt" + + crCrew.Formulas(3) = "Z_BegDate = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" + crCrew.Formulas(4) = "Z_Crew = " & mintCREW + crCrew.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crCrew.Destination = crptToPrinter + Else + crCrew.Destination = crptToWindow + End If + crCrew.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Crew - Module PrintPay" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frx new file mode 100644 index 0000000..d7d573b Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/LogFiles/frmCrewsNEW.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSSave.vbp b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSSave.vbp new file mode 100644 index 0000000..8b4019f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSSave.vbp @@ -0,0 +1,117 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\WINDOWS\system32\stdole2.tlb#OLE Automation +Reference=*\G{333C7BC1-460F-11D0-BC04-0080C7055A83}#1.1#0#..\..\WINDOWS\system32\tdc.ocx#Tabular Data Control 1.1 Type Library +Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\WINDOWS\system32\MSBIND.DLL#Microsoft Data Binding Collection +Reference=*\G{00000201-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\Program Files\Common Files\system\ado\msado21.tlb#Microsoft ActiveX Data Objects 2.1 Library +Reference=*\G{00000300-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\Program Files\Common Files\system\ado\msador15.dll#Microsoft ActiveX Data Objects Recordset 2.1 Library +Reference=*\G{00000600-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\Program Files\Common Files\System\ado\msadox.dll#Microsoft ADO Ext. 2.1 for DDL and Security +Reference=*\G{0A758DFA-C46A-4C1C-8057-C6C18375EE24}#1.0#0#..\..\WINDOWS\system32\tdbg7da.dll#True DBGrid Pro 7.0 Design Assistant +Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\WINDOWS\system32\msstdfmt.dll#Microsoft Data Formatting Object Library +Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\WINDOWS\system32\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0 +Reference=*\G{8C344710-5FEC-11CF-A0BF-00AA0062BE57}#1.0#0#..\..\Program Files\Common Files\designer\MSCDRUN.DLL#Microsoft Connection Designer Instance 1.0 +Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#2.0#0#..\..\WINDOWS\system32\MSRDO20.DLL#Microsoft Remote Data Object 2.0 +Reference=*\G{B4741C00-45A6-11D1-ABEC-00A0C9274B91}#7.0#0#..\..\Program Files\Seagate Software\Crystal Reports\craxdrt.dll#Crystal Report 7 ActiveX Designer Run Time Library +Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX +Object={DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0; todg7.ocx +Object={00025600-0000-0000-C000-000000000046}#5.2#0; crystl32.ocx +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCX +Object={32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0; EasyP.ocx +Form=frmLotInfo.frm +Form=frmMain.frm +Form=frmPlans.frm +Form=frmViewTake.frm +Module=modADO; ADO.bas +Form=frmError.frm +Form=FrmLabor.FRM +Form=frmBlackPaper.FRM +Form=frmSupplier.frm +Form=frmTexture.frm +Form=frmContractor.frm +Form=frmScaffold.frm +Form=frmPayInput.frm +Form=frmPrint.frm +Form=frmAbout.frm +Form=frmSplash.frm +Form=frmLogin.frm +Form=frmInvTake.frm +Form=frmUser.frm +Form=frmOrderDates.frm +Form=frmChange.frm +Form=frmYardOrder.frm +Form=frmYInventory.frm +Form=frmShowPO.frm +Form=frmScafList.frm +Form=frmLotList2.frm +Form=frmRepairLot.frm +Form=frmShowRepair.frm +Form=frmPayroll.frm +Form=frmPayHead.frm +Form=frmHourList.frm +Form=frmLotChLog.frm +Form=frmPayList.frm +Form=frmReport.frm +Form=frmSCrew.frm +Form=frmPOList.frm +Form=frmInventory.frm +Form=frmRepair.frm +Form=frmRCrew.frm +Form=frmBilling.frm +Form=frmBillingStatus.frm +Form=frmAR.frm +Form=frmFoam.frm +Form=frmProjNotes.frm +Form=frmAck.frm +Form=frmProject.frm +Form=frmOrders.frm +Form=frmPOInfo.frm +Form=frmCrews.frm +Form=frmElevPic.frm +Form=frmEPElev.frm +Form=frmShowYardMat.frm +Form=frmShowOrderMat.frm +Form=frmJCList.frm +Form=frmRepList.frm +Form=frmInvPrice.frm +Form=frmCrewList.frm +Form=frmSand.FRM +Form=frmPaySheet.frm +Form=frmScafPay.frm +Form=frmGetPaySheet.frm +Form=frmTake.frm +IconForm="frmMain" +Startup="Sub Main" +HelpFile="" +Title="ORDERS" +ExeName32="ORDERS.exe" +Command32="" +Name="Orders" +HelpContextID="0" +CompatibleMode="0" +MajorVer=3 +MinorVer=7 +RevisionVer=5 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Valley Wide Plastering" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbp b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbp new file mode 100644 index 0000000..7bbce92 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbp @@ -0,0 +1,139 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\Windows\system32\stdole2.tlb#OLE Automation +Reference=*\G{333C7BC1-460F-11D0-BC04-0080C7055A83}#1.1#0#..\..\Windows\System32\tdc.ocx#Tabular Data Control 1.1 Type Library +Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\Windows\system32\MSBIND.DLL#Microsoft Data Binding Collection +Reference=*\G{0A758DFA-C46A-4C1C-8057-C6C18375EE24}#1.0#0#..\..\Windows\system32\tdbg7da.dll#True DBGrid Pro 7.0 Design Assistant +Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\Windows\system32\msstdfmt.dll#Microsoft Data Formatting Object Library +Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\Windows\system32\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0 +Reference=*\G{8C344710-5FEC-11CF-A0BF-00AA0062BE57}#1.0#0#..\..\Program Files\Common Files\designer\MSCDRUN.DLL#Microsoft Connection Designer Instance 1.0 +Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#2.0#0#..\..\Windows\system32\msrdo20.dll#Microsoft Remote Data Object 2.0 +Reference=*\G{B4741C00-45A6-11D1-ABEC-00A0C9274B91}#7.0#0#..\..\Program Files\Seagate Software\Report Designer Component\craxdrt.dll#Crystal Report 7 ActiveX Designer Run Time Library +Reference=*\G{00000600-0000-0010-8000-00AA006D2EA4}#6.0#0#..\..\Program Files\Common Files\System\ado\msadox.dll#Microsoft ADO Ext. 6.0 for DDL and Security +Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\Windows\system32\scrrun.dll#Microsoft Scripting Runtime +Reference=*\G{00000206-0000-0010-8000-00AA006D2EA4}#2.6#0#..\..\Program Files\Common Files\System\ado\msado26.tlb#Microsoft ActiveX Data Objects 2.6 Library +Reference=*\G{F5078F18-C551-11D3-89B9-0000F81FE221}#4.0#0#..\..\Windows\system32\msxml4.dll#Microsoft XML, v4.0 +Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX +Object={DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0; todg7.ocx +Object={00025600-0000-0000-C000-000000000046}#5.2#0; Crystl32.OCX +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx +Object={32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0; EasyP.ocx +Object={8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0; Flp32a30.ocx +Form=frmLotInfo.frm +Form=frmMain.frm +Form=frmPlans.frm +Form=frmViewTake.frm +Module=modADO; ADO.bas +Form=frmError.frm +Form=FrmLabor.FRM +Form=frmBlackPaper.FRM +Form=frmSupplier.frm +Form=frmTexture.frm +Form=frmContractor.frm +Form=frmScaffold.frm +Form=frmPayInput.frm +Form=frmPrint.frm +Form=frmAbout.frm +Form=frmSplash.frm +Form=frmLogin.frm +Form=frmInvTake.frm +Form=frmUser.frm +Form=frmOrderDates.frm +Form=frmChange.frm +Form=frmYardOrder.frm +Form=frmYInventory.frm +Form=frmShowPO.frm +Form=frmScafList.frm +Form=frmLotList2.frm +Form=frmRepairLot.frm +Form=frmShowRepair.frm +Form=frmPayroll.frm +Form=frmPayHead.frm +Form=frmHourList.frm +Form=frmLotChLog.frm +Form=frmPayList.frm +Form=frmReport.frm +Form=frmSCrew.frm +Form=frmPOList.frm +Form=frmInventory.frm +Form=frmRepair.frm +Form=frmRCrew.frm +Form=frmBilling.frm +Form=frmBillingStatus.frm +Form=frmAR.frm +Form=frmFoam.frm +Form=frmProjNotes.frm +Form=frmAck.frm +Form=frmProject.frm +Form=frmOrders.frm +Form=frmPOInfo.frm +Form=frmCrews.frm +Form=frmShowYardMat.frm +Form=frmShowOrderMat.frm +Form=frmJCList.frm +Form=frmRepList.frm +Form=frmInvPrice.frm +Form=frmCrewList.frm +Form=frmSand.FRM +Form=frmPaySheet.frm +Form=frmScafPay.frm +Form=frmGetPaySheet.frm +Form=frmTake.frm +Form=frmTake5.frm +Form=frmLotInfo5.frm +Form=frmLotPrtJobs.frm +Form=frmPaintPrtJobs.frm +Form=frmMANBILL.frm +Form=frmLotInfoE.frm +Form=frmTakeE.frm +Form=frmPosPayS.frm +Form=frmPosPayV.frm +Form=frmAPFix.frm +Form=frmARFix.frm +Form=frmARMaster.frm +Form=frmAPMaster.frm +Form=frmProjList.frm +Form=frmCertified.frm +Form=frmEmployee.frm +Form=frmPOWOLot.frm +Form=frmWOList.frm +Form=frmPosPayC.frm +Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; MSDATGRD.OCX +Form=frmCrewsOLD.frm +Form=frmInvType.frm +IconForm="frmMain" +Startup="Sub Main" +HelpFile="" +Title="ORDERS" +ExeName32="Orders02.exe" +Command32="" +Name="Orders_C" +HelpContextID="0" +CompatibleMode="0" +MajorVer=2020 +MinorVer=6 +RevisionVer=2 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Valley Wide Plastering" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=-1 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbw b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbw new file mode 100644 index 0000000..74623bd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_C.vbw @@ -0,0 +1,81 @@ +frmLotInfo = 3, 5, 752, 322, , 110, 110, 843, 586, C +frmMain = 46, -3, 779, 445, , 132, 132, 865, 608, C +frmPlans = 0, 0, 733, 448, , -28, 29, 705, 477, C +frmViewTake = 44, 44, 775, 492, C, 154, 154, 887, 602, C +modADO = 61, 6, 905, 411, C +frmError = 0, 0, 844, 405, C, 176, 176, 909, 624, C +frmLabor = 44, 44, 888, 452, C, 198, 198, 931, 646, C +frmBlackPaper = 154, 154, 1161, 576, C, 66, 66, 799, 542, C +frmSupplier = 66, 66, 1044, 488, C, 0, 0, 733, 448, C +frmTexture = 88, 88, 1095, 510, C, 22, 22, 755, 470, C +frmContractor = 180, -9, 911, 439, C, 44, 44, 777, 492, C +frmScaffold = 132, 132, 865, 580, C, 66, 66, 799, 514, C +frmPayInput = 88, 88, 819, 536, C, 88, 88, 821, 536, C +frmPrint = 66, 66, 799, 514, C, 88, 88, 821, 536, C +frmAbout = 132, 132, 1110, 554, C, 44, 44, 777, 520, C +frmSplash = 110, 110, 841, 558, C, 132, 132, 865, 580, C +frmLogin = 66, 66, 799, 514, C, 154, 154, 887, 602, C +frmInvTake = 110, 110, 841, 558, C, 88, 88, 821, 564, C +frmUser = 22, 22, 753, 470, C, 198, 198, 931, 646, C +frmOrderDates = 88, 88, 821, 536, , 220, 220, 953, 668, C +frmChange = 22, 22, 866, 430, C, 0, 0, 733, 448, C +frmYardOrder = 110, 110, 843, 558, C, 22, 22, 755, 470, C +frmYInventory = 44, 44, 777, 492, C, 44, 44, 777, 492, C +frmShowPO = 44, 44, 1051, 466, C, 66, 66, 799, 514, C +frmScafList = 66, 66, 799, 514, C, 88, 88, 821, 536, C +frmLotList = 154, 154, 885, 602, , 110, 110, 843, 558, C +frmRepairLot = 198, 198, 931, 646, C, 132, 132, 865, 580, C +frmShowRepair = 132, 132, 863, 580, C, 154, 154, 887, 602, C +frmPayroll = 176, 176, 907, 624, C, 176, 176, 909, 624, C +frmPayHead = 44, 44, 777, 492, , 198, 198, 931, 646, C +frmHourList = 220, 220, 953, 668, Z, 220, 220, 953, 668, C +frmLotChLog = 0, 0, 731, 448, C, 0, 0, 733, 448, C +frmPayList = 22, 181, 755, 629, , 22, 22, 755, 470, C +frmReport = 198, 198, 931, 646, C, 44, 44, 777, 492, C +frmSCrew = 66, 66, 797, 514, C, 66, 66, 799, 514, C +frmPOList = 88, 88, 819, 536, C, 88, 88, 821, 536, C +frmInventory = 22, 22, 755, 470, C, 110, 110, 843, 558, C +frmRepair = 154, 154, 887, 602, C, 132, 132, 865, 580, C +frmRCrew = 132, 132, 1139, 554, C, 154, 154, 887, 602, C +frmBilling = 198, 198, 931, 646, , 176, 176, 909, 624, C +frmBillingStatus = 220, 220, 951, 668, C, 198, 198, 931, 646, C +frmAR = 198, 198, 931, 646, C, 220, 220, 953, 668, C +frmFoam = 176, 176, 909, 624, C, 0, 0, 733, 448, C +frmProjNotes = 176, 176, 909, 624, C, 22, 22, 755, 470, C +frmAck = 219, 138, 952, 586, C, 44, 44, 777, 492, C +frmProject = 220, 220, 953, 668, , 66, 66, 799, 514, C +frmOrders = 154, 154, 885, 602, , 88, 88, 821, 536, C +frmPOInfo = 22, 22, 753, 470, C, 110, 110, 843, 558, C +frmCrews = 132, 132, 865, 580, C, 132, 132, 865, 580, C +frmShowYardMat = 88, 88, 1062, 510, C, 198, 198, 931, 646, C +frmShowOrderMat = 110, 110, 1084, 532, C, 220, 220, 953, 668, C +frmJCList = 44, -14, 777, 434, C, 0, 0, 733, 448, C +frmRepList = 0, 0, 731, 448, C, 22, 22, 755, 470, C +frmInvPrice = 0, 0, 1007, 422, C, 44, 44, 777, 492, C +frmCrewList = 176, 176, 909, 624, , 66, 66, 799, 514, C +frmSand = 66, 66, 1073, 488, C, 88, 88, 821, 536, C +frmPaySheet = 44, 44, 775, 492, C, 140, 163, 873, 611, C +frmScafPay = 88, 88, 821, 536, C, 132, 132, 865, 580, C +frmGetPaySheet = 88, 88, 819, 536, C, 181, 131, 914, 579, C +frmTake = 111, 210, 842, 658, , 0, 0, 731, 448, C +frmTake5 = 88, 88, 819, 536, , 132, 132, 863, 580, C +frmLotInfo5 = 0, 294, 1164, 632, , 132, 132, 863, 580, C +frmLotPrtJobs = 44, 44, 1022, 466, C, 154, 154, 1132, 576, C +frmPaintPrtJobs = 88, 88, 1066, 510, C, 66, 66, 1044, 488, C +frmMANBILL = 22, 22, 996, 444, C, 110, 110, 1088, 532, C +frmLotInfoE = 22, 22, 1000, 444, C, 132, 132, 1110, 554, C +frmTakeE = 132, 132, 1108, 554, C, 154, 154, 1132, 576, C +frmPosPayS = 0, 0, 0, 0, C, 176, 176, 1154, 598, C +frmPosPayV = 44, 44, 1022, 466, C, 198, 198, 1176, 620, C +frmAPFIX = 66, 66, 1044, 488, C, 0, 0, 978, 422, C +frmARFIX = 88, 88, 1066, 510, C, 22, 22, 1000, 444, C +frmARMaster = 110, 110, 1074, 532, C, 44, 44, 1022, 466, C +frmAPMaster = 0, 0, 0, 0, C, 66, 66, 1044, 488, C +frmProjList = 132, 132, 1106, 554, C, 88, 88, 1066, 510, C +frmCertified = 0, 0, 0, 0, C, 66, 66, 1044, 488, C +frmEmployee = 154, 154, 1132, 576, C, 132, 132, 1110, 554, C +frmPOWOLot = 132, 132, 1110, 554, C, 110, 110, 1088, 532, C +frmWOList = 154, 154, 1130, 576, C, 132, 132, 1108, 554, C +frmPosPayC = 0, 0, 976, 422, C, 198, 198, 1174, 620, C +frmCrewsOLD = 22, 22, 997, 444, C, 44, 44, 1019, 466, C +frmInvType = 0, 0, 974, 422, C, 176, 176, 1150, 598, C diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_Cx.vbp b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_Cx.vbp new file mode 100644 index 0000000..a70fd4d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERS_Cx.vbp @@ -0,0 +1,136 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\Windows\system32\stdole2.tlb#OLE Automation +Reference=*\G{333C7BC1-460F-11D0-BC04-0080C7055A83}#1.1#0#..\..\Windows\System32\tdc.ocx#Tabular Data Control 1.1 Type Library +Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\Windows\system32\MSBIND.DLL#Microsoft Data Binding Collection +Reference=*\G{0A758DFA-C46A-4C1C-8057-C6C18375EE24}#1.0#0#..\..\Windows\system32\tdbg7da.dll#True DBGrid Pro 7.0 Design Assistant +Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\Windows\system32\msstdfmt.dll#Microsoft Data Formatting Object Library +Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\Windows\system32\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0 +Reference=*\G{8C344710-5FEC-11CF-A0BF-00AA0062BE57}#1.0#0#..\..\Program Files\Common Files\designer\MSCDRUN.DLL#Microsoft Connection Designer Instance 1.0 +Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#2.0#0#..\..\Windows\system32\msrdo20.dll#Microsoft Remote Data Object 2.0 +Reference=*\G{B4741C00-45A6-11D1-ABEC-00A0C9274B91}#7.0#0#..\..\Program Files\Seagate Software\Report Designer Component\craxdrt.dll#Crystal Report 7 ActiveX Designer Run Time Library +Reference=*\G{00000600-0000-0010-8000-00AA006D2EA4}#6.0#0#..\..\Program Files\Common Files\System\ado\msadox.dll#Microsoft ADO Ext. 6.0 for DDL and Security +Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\Windows\system32\scrrun.dll#Microsoft Scripting Runtime +Reference=*\G{00000206-0000-0010-8000-00AA006D2EA4}#2.6#0#..\..\Program Files\Common Files\System\ado\msado26.tlb#Microsoft ActiveX Data Objects 2.6 Library +Reference=*\G{F5078F18-C551-11D3-89B9-0000F81FE221}#4.0#0#..\..\Windows\system32\msxml4.dll#Microsoft XML, v4.0 +Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX +Object={DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0; todg7.ocx +Object={00025600-0000-0000-C000-000000000046}#5.2#0; Crystl32.OCX +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx +Object={32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0; EasyP.ocx +Object={8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0; Flp32a30.ocx +Form=frmLotInfo.frm +Form=frmMain.frm +Form=frmPlans.frm +Form=frmViewTake.frm +Module=modADO; ADO.bas +Form=frmError.frm +Form=FrmLabor.FRM +Form=frmBlackPaper.FRM +Form=frmSupplier.frm +Form=frmTexture.frm +Form=frmContractor.frm +Form=frmScaffold.frm +Form=frmPayInput.frm +Form=frmPrint.frm +Form=frmAbout.frm +Form=frmSplash.frm +Form=frmLogin.frm +Form=frmInvTake.frm +Form=frmUser.frm +Form=frmOrderDates.frm +Form=frmChange.frm +Form=frmYardOrder.frm +Form=frmYInventory.frm +Form=frmShowPO.frm +Form=frmScafList.frm +Form=frmLotList2.frm +Form=frmRepairLot.frm +Form=frmShowRepair.frm +Form=frmPayroll.frm +Form=frmPayHead.frm +Form=frmHourList.frm +Form=frmLotChLog.frm +Form=frmPayList.frm +Form=frmReport.frm +Form=frmSCrew.frm +Form=frmPOList.frm +Form=frmInventory.frm +Form=frmRepair.frm +Form=frmRCrew.frm +Form=frmBilling.frm +Form=frmBillingStatus.frm +Form=frmAR.frm +Form=frmFoam.frm +Form=frmProjNotes.frm +Form=frmAck.frm +Form=frmProject.frm +Form=frmOrders.frm +Form=frmPOInfo.frm +Form=frmCrews.frm +Form=frmShowYardMat.frm +Form=frmShowOrderMat.frm +Form=frmJCList.frm +Form=frmRepList.frm +Form=frmInvPrice.frm +Form=frmCrewList.frm +Form=frmSand.FRM +Form=frmPaySheet.frm +Form=frmScafPay.frm +Form=frmGetPaySheet.frm +Form=frmTake.frm +Form=frmTake5.frm +Form=frmLotInfo5.frm +Form=frmLotPrtJobs.frm +Form=frmPaintPrtJobs.frm +Form=frmMANBILL.frm +Form=frmLotInfoE.frm +Form=frmTakeE.frm +Form=frmPosPayS.frm +Form=frmPosPayV.frm +Form=frmAPFix.frm +Form=frmARFix.frm +Form=frmARMaster.frm +Form=frmAPMaster.frm +Form=frmProjList.frm +Form=frmCertified.frm +Form=frmEmployee.frm +Form=frmPOWOLot.frm +Form=frmWOList.frm +Form=frmPosPayC.frm +IconForm="frmMain" +Startup="Sub Main" +HelpFile="" +Title="ORDERS" +ExeName32="ORDERS10.exe" +Command32="" +Name="Orders_C" +HelpContextID="0" +CompatibleMode="0" +MajorVer=18 +MinorVer=12 +RevisionVer=10 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Valley Wide Plastering" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSold.vbp b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSold.vbp new file mode 100644 index 0000000..5f6f395 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/ORDERSold.vbp @@ -0,0 +1,109 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE Automation +Reference=*\G{333C7BC1-460F-11D0-BC04-0080C7055A83}#1.1#0#..\..\..\..\WINDOWS\SYSTEM\TDC.OCX#Tabular Data Control 1.1 Type Library +Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\..\..\WINDOWS\SYSTEM\MSBIND.DLL#Microsoft Data Binding Collection +Reference=*\G{00000201-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\..\COMMON FILES\SYSTEM\ADO\msado21.tlb#Microsoft ActiveX Data Objects 2.1 Library +Reference=*\G{00000300-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\..\COMMON FILES\SYSTEM\ADO\MSADOR15.DLL#Microsoft ActiveX Data Objects Recordset 2.1 Library +Reference=*\G{00000600-0000-0010-8000-00AA006D2EA4}#2.1#0#..\..\..\COMMON FILES\SYSTEM\ADO\MSADOX.DLL#Microsoft ADO Ext. 2.1 for DDL and Security +Reference=*\G{0A758DFA-C46A-4C1C-8057-C6C18375EE24}#1.0#0#..\..\..\..\WINDOWS\SYSTEM\TDBG7DA.DLL#True DBGrid Pro 7.0 Design Assistant +Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\..\..\WINDOWS\SYSTEM\MSSTDFMT.DLL#Microsoft Data Formatting Object Library +Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\..\..\WINDOWS\SYSTEM\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0 +Reference=*\G{8C344710-5FEC-11CF-A0BF-00AA0062BE57}#1.0#0#..\..\..\COMMON FILES\DESIGNER\MSCDRUN.DLL#Microsoft Connection Designer Instance 1.0 +Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#2.0#0#..\..\..\..\WINDOWS\SYSTEM\MSRDO20.DLL#Microsoft Remote Data Object 2.0 +Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX +Object={DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0; TODG7.OCX +Object={00025600-0000-0000-C000-000000000046}#5.2#0; CRYSTL32.OCX +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX +Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCX +Reference=*\G{B4741C00-45A6-11D1-ABEC-00A0C9274B91}#7.0#0#..\..\..\SEAGATE SOFTWARE\CRYSTAL REPORTS\CRAXDRT.DLL#Crystal Report 7 ActiveX Designer Run Time Library +Form=frmLotInfo.frm +Form=frmMain.frm +Form=frmPlans.frm +Form=frmTake.frm +Module=modADO; ADO.bas +Form=frmError.frm +Form=FRMLABOR.FRM +Form=frmBlackPaper.FRM +Form=frmSupplier.frm +Form=frmTexture1.frm +Form=frmContractor.frm +Form=frmInventory.frm +Form=frmScaffold.frm +Form=frmPayInput.frm +Form=frmPrint.frm +Form=frmAbout.frm +Form=frmSplash.frm +Form=Frmlogin.frm +Form=frmInvTake.frm +Form=frmUser.frm +Form=frmOrderDates.frm +Form=frmChange.frm +Form=frmYardOrder.frm +Form=frmInventory2.frm +Form=frmShowPO.frm +Form=frmScafList.frm +Form=frmLotList2.frm +Form=frmRepairLot.frm +Form=frmShowRepair.frm +Form=frmPayroll.frm +Form=frmPayHead.frm +Form=frmCrewList.frm +Form=frmLotChLog.frm +Form=frmPayList.frm +Form=frmReport.frm +Form=frmSCrew.frm +Form=frmPOList.frm +Form=frmInventory.frm +Form=frmRepair.frm +Form=frmRCrew.frm +Form=frmBilling.frm +Form=frmBillingStatus.frm +Form=frmAR.frm +Form=frmFoam.frm +Form=frmProjNotes.frm +Form=frmAck.frm +Form=frmProject.frm +Object={32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0; EASYP.OCX +Form=frmOrders.frm +Form=frmPOInfo.frm +Form=frmCrews.frm +Form=frmElevPic.frm +Form=frmEPElev.frm +Form=frmShowYardMat.frm +Form=frmShowOrderMat.frm +Form=frmJCList.frm +Form=frmRepList.frm +Form=frmInvPrice.frm +IconForm="frmMain" +Startup="Sub Main" +HelpFile="" +Title="ORDERS" +ExeName32="ORDERS.exe" +Command32="" +Name="Orders" +HelpContextID="0" +CompatibleMode="0" +MajorVer=2 +MinorVer=9 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Valley Wide Plastering" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/dbname.bas b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/dbname.bas new file mode 100644 index 0000000..a07815c --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/dbname.bas @@ -0,0 +1,14 @@ +Attribute VB_Name = "modDb" +Option Explicit + +Public gdb As Database +Public gstrDatabase As String + +Public Function DataOpen() As Boolean + gstrDatabase = "..\Employees.mdb" + + Set gdb = DBEngine.Workspaces(0).OpenDatabase(gstrDatabase) + DataOpen = True +End Function + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frm new file mode 100644 index 0000000..2029ca7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frm @@ -0,0 +1,908 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAPFIX + Caption = "Accounts Payable Correction Screen" + ClientHeight = 5310 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5310 + ScaleWidth = 8880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrint + Caption = "Print List W/ No JC#" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6285 + TabIndex = 14 + Top = 4215 + Width = 1275 + End + Begin LpLib.fpCombo cboAPCode + Height = 315 + Left = 4830 + TabIndex = 12 + Top = 150 + Width = 4035 + _Version = 196608 + _ExtentX = 7117 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmAPFix.frx":0000 + End + Begin LpLib.fpList lstHeader + Height = 4560 + Left = 30 + TabIndex = 11 + Top = 615 + Width = 6195 + _Version = 196608 + _ExtentX = 10927 + _ExtentY = 8043 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 2 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAPFix.frx":0447 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6285 + TabIndex = 10 + Top = 4755 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7590 + TabIndex = 9 + Top = 4755 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 4 + Top = 1980 + Visible = 0 'False + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 7 + TabIndex = 3 + Top = 1560 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 2 + Top = 1140 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 1 + Top = 720 + Width = 1200 + End + Begin VB.Label lblLOAD + Alignment = 2 'Center + BackColor = &H00C0FFFF& + Caption = "Loading Invoices -- Patience" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 750 + Left = 6435 + TabIndex = 13 + Top = 3420 + Visible = 0 'False + Width = 2430 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Amount:" + Height = 195 + Left = 6390 + TabIndex = 8 + Top = 1650 + Width = 1155 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 6630 + TabIndex = 7 + Top = 2085 + Visible = 0 'False + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Job Cost Number:" + Height = 195 + Left = 6285 + TabIndex = 6 + Top = 1245 + Width = 1260 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice #:" + Height = 195 + Left = 6825 + TabIndex = 5 + Top = 810 + Width = 720 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor's CMS AP Code:" + Height = 195 + Left = 2970 + TabIndex = 0 + Top = 240 + Width = 1815 + End +End +Attribute VB_Name = "frmAPFIX" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + lblLOAD.Visible = True + DoEvents + If cboAPCode.ListIndex = -1 Then + strSQL = "SELECT * FROM APH_JobDistDetail " 'WHERE vendornumber = '" & strVend & "'" ' and not done" + Else + cboAPCode.col = 1 + strVend = cboAPCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" + strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!AP_ID) & vbTab & Field2Str(oRS!VendorNumber) & vbTab '& Field2Str(oRS!Name) & vbTab + strLine = strLine & Field2Str(oRS!InvoiceNumber) & vbTab & Field2Str(oRS!JobNumber) & vbTab + strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") & vbTab & Format(Field2Str(oRS!InvoiceDate), "MM/DD/YYYY") & vbTab & Format(Field2Str(oRS!InvoiceDate), "YYYYMMDD") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + lblLOAD.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboAPCode_Click() + lstHeader.Clear + Call HeaderLoad +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + cboAPCode.col = 1 + strCUST = cboAPCode.ColText + gintCOPY = 1 + strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' gstrPONUM = Field2Str(oRS!po_num) +' mstrPROJLOT = Field2Str(oRS!ProjLot) +' Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\apblankJC.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARFix - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +' mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK +' lstDetail.Enabled = True +' lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call APCodeLoad +' Call HeaderLoad +End Sub +'Private Sub ProjLoad() +'Dim strSQL As String +' On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + +' Set moRSProj = New Recordset +' moRSProj.Open strSQL, goConn, _ +' adOpenForwardOnly, adLockReadOnly +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form APFix - Module ProjLoad" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub +Private Sub APCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblAPMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str2(oRS!Bill_ID) & vbTab & Field2Str(oRS!Cust_NO) & vbTab & Field2Str(oRS!Name) ' & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) + cboAPCode.AddItem strLine +' cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!bill_id) + oRS.MoveNext + Loop + oRS.Close +' cboAPCode.ListIndex = 0 + cboAPCode.ListIndex = -1 + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module APCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail +' txtInvDate = Field2Str(!invoice_date) +' txtDueDate = Field2Str(!inv_due_date) +' txtItemAmt = Format(Field2Str2(!amount), "currency") +' txtSalesCode = Field2Str(!sales_code) +' txtTax = Field2Str(!taxcode) +' chkReady = Field2CheckBox(!ready) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + +' strSQL = "SELECT * " +' strSQL = strSQL & "FROM tblARInvoice " +' strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) +' Set moRSDetail = New Recordset +' moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + msglInvTotal = moRSHeader!non_tax_amt + mstrType = moRSHeader!inv_type +' gintPROJID = moRSHeader!proj_id +' Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form APFix - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() +' If lstDetail.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If +' End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader +' !invoice_date = Str2Field(txtInvDate) + !JobNumber = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) +' !amount = Str2Field(txtItemAmt) +' !sales_code = Str2Field(txtSalesCode) + .Update + End With + +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' msglInvTotal = Field2Str2(oRS!sglTOTAL) + +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + +' Do Until oRS.EOF +' With oRS +' !invoice_date = Str2Field(txtInvDate) +' !inv_due_date = Str2Field(txtDueDate) +' !ready = chkReady +' !non_tax_amt = msglInvTotal +' !taxcode = Str2Field(txtTax) +' If Field2Str2(moRSProj!retention) > 0 Then +' !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") +' Else +' !retention_amt = 0 +' End If +' .Update +' End With +' oRS.MoveNext +' Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" +' chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() +Dim strSQL As String, oRS As Recordset +Dim strID As String + + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + strID = lstHeader.ColText + strSQL = "SELECT * FROM APH_JobDistDetail WHERE ap_id = " & strID + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not moRSHeader.EOF Then + txtSalesCode = Format(Field2Str(moRSHeader!distributionamount), "#,#.00") + txtDueDate = Field2Str(moRSHeader!JobNumber) + txtInvDate = Field2Str(moRSHeader!InvoiceNumber) + Else + txtSalesCode = "" + txtDueDate = "" + txtInvDate = "" + End If + txtDueDate.SetFocus + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True + txtDueDate.SetFocus +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + +' lngPOS = InStr(1, txtDueDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtDueDate) > 0 Then +' txtDueDate = Format(txtDueDate, "00/00/####") +' If Not IsDate(txtDueDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtDueDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtDueDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtDueDate.SetFocus +' End If + txtDueDate = UCase(txtDueDate) + +End Sub + +'Private Sub txtInvDate_GotFocus() +' Call FieldSelect(txtInvDate) +'End Sub + +'Private Sub txtInvDate_LostFocus() +'Dim lngPOS As Long + +' lngPOS = InStr(1, txtInvDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtInvDate) > 0 Then +' txtInvDate = Format(txtInvDate, "00/00/####") +' If Not IsDate(txtInvDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtInvDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtInvDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtInvDate.SetFocus +' End If + +'End Sub + +'Private Sub txtItemAmt_GotFocus() +' Call FieldSelect(txtItemAmt) +' msglItemAmt = Single2Field(txtItemAmt) +'End Sub + +'Private Sub txtItemAmt_LostFocus() +' If msglItemAmt < Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt = Field2Str(txtItemAmt) Then +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' End If +'End Sub + +'Private Sub txtSalesCode_GotFocus() +' Call FieldSelect(txtSalesCode) +'End Sub + +'Private Sub txtSalesCode_LostFocus() +' txtSalesCode = UCase(txtSalesCode) +'End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frx new file mode 100644 index 0000000..e3841d2 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPFix.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frm new file mode 100644 index 0000000..3fa6ca7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frm @@ -0,0 +1,687 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAPMaster + Caption = "AP Master List" + ClientHeight = 3780 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10590 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 3780 + ScaleWidth = 10590 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtZip + Height = 345 + Left = 6120 + MaxLength = 5 + TabIndex = 8 + Top = 2805 + Width = 1470 + End + Begin VB.TextBox txtState + Height = 315 + Left = 6120 + MaxLength = 2 + TabIndex = 7 + Top = 2475 + Width = 465 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5250 + TabIndex = 15 + Top = 3225 + Width = 1275 + End + Begin VB.TextBox txtAddress1 + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 2 + Top = 1425 + Width = 4395 + End + Begin LpLib.fpList lstHeader + Height = 3675 + Left = 180 + TabIndex = 13 + Top = 45 + Width = 5010 + _Version = 196608 + _ExtentX = 8837 + _ExtentY = 6482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 3 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 2 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAPMaster.frx":0000 + End + Begin Crystal.CrystalReport crAR + Left = 9555 + Top = 2625 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 12 + Top = 3225 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7275 + TabIndex = 10 + Top = 3225 + Width = 1275 + End + Begin VB.TextBox txtName + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 1 + Top = 1065 + Width = 4395 + End + Begin VB.TextBox txtCity + Height = 315 + Left = 6120 + MaxLength = 20 + TabIndex = 6 + Top = 2130 + Width = 4395 + End + Begin VB.TextBox txtAddress2 + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 4 + Top = 1785 + Width = 4395 + End + Begin VB.TextBox txtCustNo + Enabled = 0 'False + Height = 315 + Left = 6120 + MaxLength = 7 + TabIndex = 0 + Top = 720 + Width = 1200 + End + Begin VB.Label lblCNum + Caption = "This Field Must Match CMS Vendor No" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 255 + Left = 7320 + TabIndex = 19 + Top = 780 + Width = 3225 + End + Begin VB.Label lblInstr + Caption = "Fill out the information on this screen completely. Especially the Vendor No which must match CMS." + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 630 + Left = 5370 + TabIndex = 18 + Top = 60 + Width = 5145 + End + Begin VB.Label lblZip + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ZipCode: " + Height = 195 + Left = 5415 + TabIndex = 17 + Top = 2910 + Width = 690 + End + Begin VB.Label blbState + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "State: " + Height = 195 + Left = 5640 + TabIndex = 16 + Top = 2535 + Width = 465 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address1: " + Height = 195 + Left = 5355 + TabIndex = 14 + Top = 1545 + Width = 750 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "City: " + Height = 195 + Left = 5760 + TabIndex = 11 + Top = 2235 + Width = 345 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vend Name:" + Height = 195 + Left = 5220 + TabIndex = 9 + Top = 1170 + Width = 885 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address2: " + Height = 195 + Left = 5355 + TabIndex = 5 + Top = 1890 + Width = 750 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor No: " + Height = 195 + Left = 5250 + TabIndex = 3 + Top = 840 + Width = 855 + End +End +Attribute VB_Name = "frmAPMaster" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String, mboolADD As Boolean +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String, strAMOUNT As String +Dim strLine As String + + On Error GoTo Error_EH + strSQL = "SELECT * FROM tblAPMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear + + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!Bill_ID) & vbTab & Field2Str(oRS!Cust_NO) & vbTab & Field2Str(oRS!Name) ' & vbTab +' strLine = strLine & Field2Str(oRS!Address1) & vbTab & Field2Str(oRS!Address2) & vbTab & Field2Str(oRS!InvoiceType) & vbTab +' strLine = strLine & Field2Str(oRS!InvoiceDate) & vbTab & Field2Str(oRS!JobNumber) & vbTab & Format(strAMOUNT, "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine + End With + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + lstHeader.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form APMaster - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() + cmdSave.Enabled = True + cmdExit.Enabled = True + mboolADD = True + txtCustNo.Enabled = True + Call FormClear + Call FormSave +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + txtCustNo.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call HeaderLoad + mboolADD = False +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSHeader + txtCustNo = Field2Str(!Cust_NO) + txtNAME = Field2Str(!Name) + txtAddress1 = Field2Str(!Address1) + txtAddress2 = Field2Str(!Address2) + txtCity = Field2Str(!City) + txtSTATE = Field2Str(!State) + txtZIP = Field2Str(!ZipCode) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form APMaster - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form APMaster - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strID As String + On Error GoTo Error_EH + + lstHeader.col = 0 + strID = lstHeader.ColText + strSQL = "SELECT * FROM tblAPMaster WHERE Bill_id = " & strID + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form APMaster - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstHeader_Click() + + If lstHeader.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If + End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader + If mboolADD = True Then + .AddNew + mboolADD = False + End If + !Cust_NO = Field2Str(txtCustNo) + !Name = Field2Str(txtNAME) + !Address1 = Field2Str(txtAddress1) + !Address2 = Field2Str(txtAddress2) + !City = Field2Str(txtCity) + !State = Field2Str(txtSTATE) + !ZipCode = Field2Str(txtZIP) + .Update + End With + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form APMaster - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +End Sub + +Private Sub FormClear() + txtCustNo = "" + txtNAME = "" + txtAddress1 = "" + txtAddress2 = "" + txtCity = "" + txtSTATE = "" + txtZIP = "" +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True + txtNAME.SetFocus +End Sub + +Private Sub txtAddress1_GotFocus() + Call FieldSelect(txtAddress1) +End Sub + +Private Sub txtAddress1_LostFocus() + txtAddress1 = UCase(txtAddress1) +End Sub + +Private Sub txtAddress2_GotFocus() + Call FieldSelect(txtAddress2) +End Sub + +Private Sub txtAddress2_LostFocus() + txtAddress2 = UCase(txtAddress2) +End Sub + +Private Sub txtCity_GotFocus() + Call FieldSelect(txtCity) +End Sub + +Private Sub txtCity_LostFocus() + txtCity = UCase(txtCity) +End Sub + +Private Sub txtCustNo_GotFocus() + Call FieldSelect(txtCustNo) +End Sub + +Private Sub txtCustNo_LostFocus() +Dim lngPOS As Long + + txtCustNo = UCase(txtCustNo) + +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE CustomerNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + + strSELECT = "{ARN_InvHistoryHeader.CustomerNumber}= '" & strCUST & "' and {ARN_InvHistoryHeader.JobNumber} = ''" + crAR.ReportFileName = App.Path & "\arblanks.rpt" + crAR.ReplaceSelectionFormula (strSELECT) + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form APMaster - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + + +Private Sub txtNAME_GotFocus() + Call FieldSelect(txtNAME) +End Sub + +Private Sub txtNAME_LostFocus() + txtNAME = UCase(txtNAME) +End Sub + +Private Sub txtState_GotFocus() + Call FieldSelect(txtSTATE) +End Sub + +Private Sub txtState_LostFocus() + txtSTATE = UCase(txtSTATE) +End Sub + +Private Sub txtZip_GotFocus() + Call FieldSelect(txtZIP) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frx new file mode 100644 index 0000000..6435c25 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAPMaster.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frm new file mode 100644 index 0000000..86dbcd2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frm @@ -0,0 +1,1240 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAR + Caption = "Accounts Receivable" + ClientHeight = 6570 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7530 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6570 + ScaleWidth = 7530 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtDueDates + Height = 1350 + Left = 195 + MultiLine = -1 'True + TabIndex = 19 + Top = 5175 + Width = 7125 + End + Begin LpLib.fpList lstDetail + Height = 1425 + Left = 195 + TabIndex = 17 + Top = 3480 + Width = 5895 + _Version = 196608 + _ExtentX = 10398 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAR.frx":0000 + End + Begin LpLib.fpList lstHeader + Height = 2835 + Left = 195 + TabIndex = 16 + Top = 585 + Width = 4470 + _Version = 196608 + _ExtentX = 7885 + _ExtentY = 5001 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAR.frx":0436 + End + Begin VB.TextBox txtTax + Height = 315 + Left = 5580 + TabIndex = 15 + Top = 3000 + Width = 495 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "RePrint Invoice" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6165 + TabIndex = 13 + Top = 3660 + Width = 1275 + End + Begin VB.ComboBox cboARCode + Height = 315 + Left = 2955 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 1 + Top = 195 + Width = 4515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 12 + Top = 4395 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 11 + Top = 2955 + Width = 1275 + End + Begin VB.CheckBox chkReady + Alignment = 1 'Right Justify + Caption = "Ready to Transfer to CMS:" + Height = 315 + Left = 5190 + TabIndex = 6 + Top = 2415 + Width = 2205 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 11 + TabIndex = 5 + Top = 1935 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 6240 + MaxLength = 7 + TabIndex = 4 + Top = 1515 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 3 + Top = 1095 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 2 + Top = 675 + Width = 1200 + End + Begin VB.Label lblDueDt + AutoSize = -1 'True + Caption = "Invoice Due Dates For Selected Builder" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 195 + TabIndex = 18 + Top = 4950 + Width = 3390 + End + Begin VB.Label lblTax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code" + Height = 195 + Left = 4830 + TabIndex = 14 + Top = 3090 + Width = 690 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Sales Code:" + Height = 195 + Left = 4920 + TabIndex = 10 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 5235 + TabIndex = 9 + Top = 2040 + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payment Due Date:" + Height = 195 + Left = 4770 + TabIndex = 8 + Top = 1200 + Width = 1395 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Date:" + Height = 195 + Left = 5190 + TabIndex = 7 + Top = 780 + Width = 960 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Builder's CMS AR Code:" + Height = 195 + Left = 1200 + TabIndex = 0 + Top = 240 + Width = 1710 + End +End +Attribute VB_Name = "frmAR" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSDetail As Recordset +Dim moRSProj As Recordset, moRSARMASTER As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String, mstrPO_NUM As String +Dim mstrINVNO As String, mstrPROJLOT As String, mlngTRANSID As Long, mstrINVNO2 As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer, mboolHEADER As Boolean +Dim msglItemAmt As Single, msglInvTotal As Single, mlngTRANS2 As Long, mlngDTRANSID As Long + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab +' strLine = Field2Str2(oRS!Lot_id) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_ID), "000000") & vbTab & (Field2Str(oRS!po_num)) +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_id), "000000") & vbTab & Format(Field2Str(oRS!po_num)) +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoad() +Dim oRS As Recordset, strSalesCode As String +Dim strSQL As String, strLine As String, strHEADER As String + + On Error GoTo Error_EH + +' lstHeader.col = 1 + lstHeader.col = 0 + mlngTRANS2 = Field2Str2(lstHeader.ColText) +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, Delete, INVOICE_NO, description, amount, PO_NUM from tblARInvoice WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" ' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + + lstDetail.Clear + + Do Until oRS.EOF + strSalesCode = Field2Str(oRS!sales_code) + If Len(strSalesCode) = 0 Then + strSalesCode = "BLANK" +' Else + End If + If Field2Str(oRS!header) = True Then + strHEADER = "1" + mboolHEADER = True + ElseIf Field2Str(oRS!header) = False Then + strHEADER = "2" + mboolHEADER = False + End If + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) +' If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then +' strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) +' Else + strLine = Field2Long(oRS!Trans_ID) & vbTab & Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "#,0.00") & vbTab & Field2Str(oRS!Description) & vbTab & strHEADER +' strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) & vbTab & strHEADER +' End If + lstDetail.AddItem strLine +' lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module DetailLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoadHOLD() +Dim oRS As Recordset, strSalesCode As String +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + +' lstHeader.col = 1 + lstHeader.col = 0 + mlngTRANS2 = Field2Str2(lstHeader.ColText) +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, INVOICE_NO, description, amount, PO_NUM from tblARInvoice WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" ' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + lstDetail.Clear + + Do Until oRS.EOF + strSalesCode = Field2Str(oRS!sales_code) + If Len(strSalesCode) = 0 Then + strSalesCode = "BLANK" +' Else + + End If + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) + If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) + Else + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & vbTab & Field2Str(oRS!Description) + End If + lstDetail.AddItem strLine + lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module DetailLoadHOLD" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboARCode_Change() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad + Call FormFindBuilder +End Sub + +Private Sub chkReady_Click() + cmdSave.Enabled = True +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String +Dim lngTransID As Long, strPONUM As String + + On Error GoTo Error_EH + + gintCOPY = 1 + lstDetail.col = 0 + lngTransID = Field2Str2(lstDetail.ColText) + +' strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lngTransID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gstrPONUM = Field2Str(oRS!po_num) + mstrPROJLOT = Field2Str(oRS!ProjLot) + Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "' and Not {tblARInvoice.Delete}" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\invoice.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strYN As String, strSQL As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, strUPDT As String + +' D - Mark the Highlighted Item As Deleted and DONE and not READY to keep from transfering to CMS + + If Shift = 4 Then + Exit Sub + End If + + + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +' Ctrl-D - Delete a line in the detail list but will not allow if a header line +' Ctrl-Q - Save the Notes information - only needs to be used if there are not invoices listed + + If KeyCode = vbKeyD And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Mark an item as DELETED so it will not transfer to CMS +' If KeyCode = vbKeyD And (gbytSECURITY < 3) Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then + If mboolHEADER Then + MsgBox "You Cannot Delete A Header Line", vbOKOnly, "Cannot Delete" + Exit Sub + End If + + strYN = MsgBox("Are You Sure You Want To Delete This Line?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + + strSQL = "SELECT * FROM tblARInvoice WHERE Trans_id = " & mlngDTRANSID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then +' MsgBox "This Option Has Been Used With A Lot - No Delete Allowed", vbCritical + vbOKOnly, "No DELETE" +' Exit Sub +' End If + +' strSQL = "DELETE * FROM tblPOptBill WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, Delete, INVOICE_NO, description, amount, PO_NUM from tblARInvoice WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" ' and not done" +' strSELECT = "SELECT SUM(AMOUNT) as SUMAmount FROM tblARINVOICE WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" + + + oRS!Delete = vbTrue + oRS!ready = vbFalse + oRS!done = vbTrue +' oRS!NON_TAX_AMT = Field2Str2(oRSS!SUMAmount) + oRS.Update + + + strSELECT = "SELECT SUM(AMOUNT) as SUMAmount FROM tblARINVOICE WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" +' strSELECT = "SELECT SUM(AMOUNT) as SUMAmount FROM tblARINVOICE WHERE shipped and not done and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strUPDT = "UPDATE tblARINVOICE SET NON_TAX_AMT = " & Field2Str2(oRSS!SUMAmount) & " WHERE not DELETE and INVOICE_NO = '" & mstrINVNO2 & "'" + goConn.Execute strUPDT +' oRS.Update +' goConn.Execute strSQL + Call DetailLoad +' Call UpStart +' Call AddBill2 + End If + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then 'Or gbytSECURITY = 7) Then ' Mark an item as DELETED even if it is a HEADER so it will not transfer to CMS +' If KeyCode = vbKeyD And (gbytSECURITY < 3) Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then +' If mboolHEADER Then +' MsgBox "You Cannot Delete A Header Line", vbOKOnly, "Cannot Delete" +' Exit Sub +' End If + + strYN = MsgBox("Are You Sure You Want To Delete This Line?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + + strSQL = "SELECT * FROM tblARInvoice WHERE Trans_id = " & mlngDTRANSID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + oRS!Delete = vbTrue + oRS!ready = vbFalse + oRS!done = vbTrue + oRS.Update + + + strSELECT = "SELECT SUM(AMOUNT) as SUMAmount FROM tblARINVOICE WHERE shipped and not done and not delete and PO_NUM = '" & mstrPO_NUM & "' and INVOICE_NO = '" & mstrINVNO2 & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strUPDT = "UPDATE tblARINVOICE SET NON_TAX_AMT = " & Field2Str2(oRSS!SUMAmount) & " WHERE not DELETE and INVOICE_NO = '" & mstrINVNO2 & "'" + goConn.Execute strUPDT + Call DetailLoad + End If + End If + + If KeyCode = vbKeyQ And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Save Notes where there are not invoices + If CtrlDown Then + moRSARMASTER!DueDate = Str2Field(txtDueDates) + moRSARMASTER.Update + End If + End If + +' If Not cmdSave.Enabled Then +' Call DataHasChanged +' End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSDetail.State = adStateOpen Then + moRSDetail.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + If lstHeader.ListIndex = -1 Then + cmdSave.Enabled = False + Exit Sub + End If + mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + lstDetail.Enabled = True + lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call ARCodeLoad + +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str(oRS!Cust_NO) & " - " & Field2Str(oRS!Name) + cboARCode.AddItem strLine + cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!Bill_ID) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ARCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSDetail + txtInvDate = Field2Str(!invoice_date) + txtDueDate = Field2Str(!inv_due_date) + txtItemAmt = Format(Field2Str2(!amount), "#,#.00;(#,#.00)") +' txtItemAmt = Format(Field2Str2(!amount), "Standard") + txtSalesCode = Field2Str(!sales_code) + If Len(txtSalesCode) = 0 Then + txtSalesCode = "BLANK" + txtSalesCode.BackColor = &H80FFFF + txtSalesCode.ForeColor = &HFF& + Else + txtSalesCode.BackColor = &H80000005 + txtSalesCode.ForeColor = &H80000008 + txtSalesCode.FontBold = False + End If + txtTax = Field2Str(!taxcode) + If txtTax = "AZ" Then + txtTax.BackColor = &H80FFFF + txtTax.ForeColor = &HFF& + txtTax.FontBold = True + ElseIf txtTax = "" Then + txtTax.BackColor = &H80FFFF + txtTax.ForeColor = &HFF& + txtTax.FontBold = True + Else + txtTax.BackColor = &H80000005 + txtTax.ForeColor = &H80000008 + txtTax.FontBold = False + End If + chkReady = Field2CheckBox(!ready) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindDetail() As Boolean +Dim strSQL As String, lngDETAIL As Long + On Error GoTo Error_EH + + lstDetail.col = 0 + lngDETAIL = Field2Str2(lstDetail.ColText) + mlngDTRANSID = lngDETAIL + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE trans_id = " & lngDETAIL +' strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set moRSDetail = New Recordset + moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSDetail.EOF Then + FormFindDetail = False + Else + FormFindDetail = True + msglInvTotal = moRSDetail!non_tax_amt + mstrType = moRSDetail!inv_type + gintPROJID = moRSDetail!PROJ_ID + Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form AR - Module FormFindDetail" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindBuilder() As Boolean +Dim strSQL As String, lngBUILDER As Long +Dim oRSB As Recordset + + On Error GoTo Error_EH + + lngBUILDER = cboARCode.ItemData(cboARCode.ListIndex) + + strSQL = "SELECT * FROM tblARMaster WHERE bill_id = " & lngBUILDER + Set moRSARMASTER = New Recordset + moRSARMASTER.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSARMASTER.EOF Then + FormFindBuilder = False + txtDueDates = "" + Else + FormFindBuilder = True + txtDueDates = Field2Str(moRSARMASTER!DueDate) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form AR - Module FormFindBuilder" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() + If lstDetail.ListIndex <> -1 Then + If FormFindDetail() Then + Call FormShow + + End If + End If +End Sub +Private Sub FieldsSave() +Dim strSQL As String, lngTransID As Long +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSDetail + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !price = Str2Field(txtItemAmt) + !amount = Str2Field(txtItemAmt) + !sales_code = Str2Field(txtSalesCode) + !taxcode = Str2Field(txtTax) '*************This may need to be turned off + .Update + moRSARMASTER!DueDate = Str2Field(txtDueDates) + moRSARMASTER.Update + End With + + strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + msglInvTotal = Field2Str2(oRS!sglTOTAL) + + strSQL = "SELECT * FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !ready = chkReady + !non_tax_amt = msglInvTotal + !taxcode = Str2Field(txtTax) '*****DOES THIS NEED TO BE TURNED BACK ON?????? + If Field2Str2(moRSProj!retention) > 0 Then + !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") + Else + !retention_amt = 0 + End If + .Update + End With + oRS.MoveNext + Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + mlngTRANSID = Field2Str2(lstHeader.ColText) + lstHeader.col = 1 + mstrINVNO2 = Field2Str2(lstHeader.ColText) '********** TEST THIS + cmdPrint.Enabled = True + lstHeader.col = 4 + gintLOTID = lstHeader.ColText + lstHeader.col = 5 + mstrPO_NUM = Field2Str(lstHeader.ColText) +' gintLOTID = lstHeader.ItemData(lstHeader.ListIndex) + Call DetailLoad + If lstDetail.ListIndex <> -1 Then + Else + lstDetail.Clear + Call FormClear + End If + Else + cmdPrint.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + If cboARCode.ListIndex = -1 Then + MsgBox "Must Select A Builder", vbOKOnly, "Select Builder" + cboARCode.SetFocus + Exit Sub + End If + cmdSave.Enabled = True +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If + +End Sub + +Private Sub txtDueDates_GotFocus() + txtDueDate.SelStart = 1000 + +End Sub + +Private Sub txtDueDates_LostFocus() + txtDueDates = UCase(txtDueDates) +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + End If + End If + ElseIf IsDate(txtInvDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + End If + +End Sub + +Private Sub txtItemAmt_GotFocus() + Call FieldSelect(txtItemAmt) + msglItemAmt = Single2Field(txtItemAmt) +End Sub + +Private Sub txtItemAmt_LostFocus() + If msglItemAmt < Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt = Field2Str(txtItemAmt) Then + txtItemAmt = Format(txtItemAmt, "#,#.00") + End If +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTax) +End Sub + +Private Sub txtTax_LostFocus() + If Not IsNull(txtTax) Or txtTax = "" Then + txtTax = UCase(txtTax) + Else + MsgBox "You Must Enter A Sales Tax Code", vbOKOnly, "No Tax Code" + txtTax.SetFocus + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frx new file mode 100644 index 0000000..7a4970e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frm new file mode 100644 index 0000000..63af1ad --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frm @@ -0,0 +1,892 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAR2 + Caption = "Accounts Receivable" + ClientHeight = 4950 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7530 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4950 + ScaleWidth = 7530 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstHeader + Height = 2835 + Left = 195 + TabIndex = 17 + Top = 585 + Width = 4470 + _Version = 196608 + _ExtentX = 7885 + _ExtentY = 5001 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAR2.frx":0000 + End + Begin VB.TextBox txtTax + Height = 315 + Left = 5580 + TabIndex = 16 + Top = 3000 + Width = 495 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "RePrint Invoice" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 14 + Top = 3675 + Width = 1275 + End + Begin VB.ComboBox cboARCode + Height = 315 + Left = 2955 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 1 + Top = 195 + Width = 4515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 13 + Top = 4395 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6180 + TabIndex = 12 + Top = 2955 + Width = 1275 + End + Begin VB.CheckBox chkReady + Alignment = 1 'Right Justify + Caption = "Ready to Transfer to CMS:" + Height = 315 + Left = 5190 + TabIndex = 7 + Top = 2415 + Width = 2205 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 11 + TabIndex = 6 + Top = 1935 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 6240 + MaxLength = 7 + TabIndex = 5 + Top = 1515 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 4 + Top = 1095 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6240 + MaxLength = 10 + TabIndex = 3 + Top = 675 + Width = 1200 + End + Begin VB.ListBox lstDetail + Height = 1230 + Left = 180 + TabIndex = 2 + Top = 3660 + Width = 5895 + End + Begin VB.Label lblTax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code" + Height = 195 + Left = 4830 + TabIndex = 15 + Top = 3090 + Width = 690 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Sales Code:" + Height = 195 + Left = 4920 + TabIndex = 11 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 5235 + TabIndex = 10 + Top = 2040 + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payment Due Date:" + Height = 195 + Left = 4770 + TabIndex = 9 + Top = 1200 + Width = 1395 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Date:" + Height = 195 + Left = 5190 + TabIndex = 8 + Top = 780 + Width = 960 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Builder's CMS AR Code:" + Height = 195 + Left = 1200 + TabIndex = 0 + Top = 240 + Width = 1710 + End +End +Attribute VB_Name = "frmAR2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSDetail As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String, mstrPO_NUM As String +Dim mstrINVNO As String, mstrPROJLOT As String, mlngTRANSID As Long +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single, mlngTRANS2 As Long + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab +' strLine = Field2Str2(oRS!Lot_id) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_ID), "000000") & vbTab & (Field2Str(oRS!po_num)) +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "#,#.00;(#,#.00)") & vbTab & Format(Field2Str2(oRS!Lot_id), "000000") & vbTab & Format(Field2Str(oRS!po_num)) +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoad() +Dim oRS As Recordset, strSalesCode As String +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + +' lstHeader.col = 1 + lstHeader.col = 0 + mlngTRANS2 = Field2Str2(lstHeader.ColText) +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount, PO_NUM from tblARInvoice WHERE shipped and PO_NUM = '" & mstrPO_NUM & "' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + lstDetail.Clear + + Do Until oRS.EOF + strSalesCode = Field2Str(oRS!sales_code) + If Len(strSalesCode) = 0 Then + strSalesCode = "BLANK" +' Else + + End If + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) + If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) + Else + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & vbTab & Field2Str(oRS!Description) + End If + lstDetail.AddItem strLine + lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module DetailLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboARCode_Change() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub chkReady_Click() + cmdSave.Enabled = True +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gstrPONUM = Field2Str(oRS!po_num) + mstrPROJLOT = Field2Str(oRS!ProjLot) + Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\invoice.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSDetail.State = adStateOpen Then + moRSDetail.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + lstDetail.Enabled = True + lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call ARCodeLoad + +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str(oRS!Cust_NO) & " - " & Field2Str(oRS!Name) + cboARCode.AddItem strLine + cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!Bill_ID) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module ARCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSDetail + txtInvDate = Field2Str(!invoice_date) + txtDueDate = Field2Str(!inv_due_date) + txtItemAmt = Format(Field2Str2(!amount), "#,#.00;(#,#.00)") +' txtItemAmt = Format(Field2Str2(!amount), "Standard") + txtSalesCode = Field2Str(!sales_code) + If Len(txtSalesCode) = 0 Then + txtSalesCode = "BLANK" + txtSalesCode.BackColor = &H80FFFF + txtSalesCode.ForeColor = &HFF& + Else + txtSalesCode.BackColor = &H80000005 + txtSalesCode.ForeColor = &H80000008 + txtSalesCode.FontBold = False + End If + txtTAX = Field2Str(!taxcode) + If txtTAX = "AZ" Then + txtTAX.BackColor = &H80FFFF + txtTAX.ForeColor = &HFF& + txtTAX.FontBold = True + Else + txtTAX.BackColor = &H80000005 + txtTAX.ForeColor = &H80000008 + txtTAX.FontBold = False + End If + chkReady = Field2CheckBox(!ready) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindDetail() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set moRSDetail = New Recordset + moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSDetail.EOF Then + FormFindDetail = False + Else + FormFindDetail = True + msglInvTotal = moRSDetail!non_tax_amt + mstrType = moRSDetail!inv_type + gintPROJID = moRSDetail!PROJ_ID + Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form AR - Module FormFindDetail" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() + If lstDetail.ListIndex <> -1 Then + If FormFindDetail() Then + Call FormShow + + End If + End If +End Sub +Private Sub FieldsSave() +Dim strSQL As String, lngTRANSID As Long +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSDetail + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !price = Str2Field(txtItemAmt) + !amount = Str2Field(txtItemAmt) + !sales_code = Str2Field(txtSalesCode) + .Update + End With + + strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID & " and not done" +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + msglInvTotal = Field2Str2(oRS!sglTOTAL) + + strSQL = "SELECT * FROM tblARInvoice WHERE PO_NUM = '" & mstrPO_NUM & "' and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE Trans_ID = " & mlngTRANSID & " and lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !ready = chkReady + !non_tax_amt = msglInvTotal + !taxcode = Str2Field(txtTAX) + If Field2Str2(moRSProj!retention) > 0 Then + !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") + Else + !retention_amt = 0 + End If + .Update + End With + oRS.MoveNext + Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + mlngTRANSID = Field2Str2(lstHeader.ColText) + cmdPrint.Enabled = True + lstHeader.col = 4 + gintLOTID = lstHeader.ColText + lstHeader.col = 5 + mstrPO_NUM = Field2Str(lstHeader.ColText) +' gintLOTID = lstHeader.ItemData(lstHeader.ListIndex) + Call DetailLoad + If lstDetail.ListIndex <> -1 Then + Else + lstDetail.Clear + Call FormClear + End If + Else + cmdPrint.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form AR - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + End If + End If + ElseIf IsDate(txtInvDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + End If + +End Sub + +Private Sub txtItemAmt_GotFocus() + Call FieldSelect(txtItemAmt) + msglItemAmt = Single2Field(txtItemAmt) +End Sub + +Private Sub txtItemAmt_LostFocus() + If msglItemAmt < Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt = Field2Str(txtItemAmt) Then + txtItemAmt = Format(txtItemAmt, "#,#.00") + End If +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTAX) +End Sub + +Private Sub txtTax_LostFocus() + If Not IsNull(txtTAX) Or txtTAX = "" Then + txtTAX = UCase(txtTAX) + Else + MsgBox "You Must Enter A Sales Tax Code", vbOKOnly, "No Tax Code" + txtTAX.SetFocus + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frx new file mode 100644 index 0000000..eeba38d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAR2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frm new file mode 100644 index 0000000..8ee9940 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frm @@ -0,0 +1,998 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmARFIX + Caption = "Accounts Receivable Correction Screen" + ClientHeight = 5310 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5310 + ScaleWidth = 8880 + StartUpPosition = 3 'Windows Default + Begin VB.ComboBox cboSort + Height = 315 + ItemData = "frmARFix.frx":0000 + Left = 7035 + List = "frmARFix.frx":000A + Style = 2 'Dropdown List + TabIndex = 17 + Top = 2505 + Width = 1845 + End + Begin VB.CommandButton cmdPrint + Caption = "Print List Of Blank JC#" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6120 + TabIndex = 16 + Top = 4220 + Width = 1275 + End + Begin VB.TextBox Text1 + Enabled = 0 'False + Height = 315 + Left = 7665 + TabIndex = 15 + Top = 1425 + Width = 465 + End + Begin LpLib.fpCombo cboARCode + Height = 315 + Left = 4815 + TabIndex = 12 + Top = 150 + Width = 4035 + _Version = 196608 + _ExtentX = 7117 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmARFix.frx":001D + End + Begin LpLib.fpList lstHeader + Height = 4260 + Left = 60 + TabIndex = 11 + Top = 600 + Width = 6000 + _Version = 196608 + _ExtentX = 10583 + _ExtentY = 7514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 9 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 2 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmARFix.frx":041D + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6120 + TabIndex = 10 + Top = 4755 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7590 + TabIndex = 3 + Top = 4755 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 5 + Top = 1065 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 7 + TabIndex = 4 + Top = 2145 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Height = 315 + Left = 7665 + MaxLength = 7 + TabIndex = 2 + Top = 1785 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 1 + Top = 720 + Width = 1200 + End + Begin VB.Label lblSort + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sort By:" + Height = 195 + Left = 6420 + TabIndex = 18 + Top = 2565 + Width = 555 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Type:" + Height = 195 + Left = 6480 + TabIndex = 14 + Top = 1545 + Width = 975 + End + Begin VB.Label lblLOAD + Alignment = 2 'Center + BackColor = &H00C0FFFF& + Caption = "Loading Invoices -- Patience" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 750 + Left = 6105 + TabIndex = 13 + Top = 3420 + Visible = 0 'False + Width = 2745 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Amount:" + Height = 195 + Left = 6390 + TabIndex = 9 + Top = 2235 + Width = 1155 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Sequence:" + Height = 195 + Left = 6195 + TabIndex = 8 + Top = 1170 + Width = 1350 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Job Cost Number:" + Height = 195 + Left = 6285 + TabIndex = 7 + Top = 1890 + Width = 1260 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice #:" + Height = 195 + Left = 6825 + TabIndex = 6 + Top = 810 + Width = 720 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Builders's CMS AR Code:" + Height = 195 + Left = 3000 + TabIndex = 0 + Top = 240 + Width = 1785 + End +End +Attribute VB_Name = "frmARFIX" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String, strAMOUNT As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + lblLOAD.Visible = True + DoEvents + If cboARCode.ListIndex = -1 Then + strSQL = "SELECT * FROM ARN_InvHistoryHeader " 'WHERE vendornumber = '" & strVend & "'" ' and not done" + Else + cboARCode.col = 1 + strVend = cboARCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE customernumber = '" & strVend & "'" ' and not done" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + If Field2Str2(oRS!TaxableSalesAmount) >= 0 Then + strAMOUNT = Field2Str2(oRS!NonTaxableSalesAmount) + Else + strAMOUNT = Field2Str2(oRS!TaxableSalesAmount) + End If + strLine = Field2Str2(oRS!AR_ID) & vbTab & Field2Str(oRS!CustomerNumber) & vbTab '& Field2Str(oRS!Name) & vbTab + strLine = strLine & Field2Str(oRS!InvoiceNumber) & vbTab & Field2Str(oRS!seqnumber) & vbTab & Field2Str(oRS!InvoiceType) & vbTab + strLine = strLine & Field2Str(oRS!InvoiceDate) & vbTab & Field2Str(oRS!JobNumber) & vbTab & Format(strAMOUNT, "Currency") & vbTab & Format(Field2Str(oRS!InvoiceDate), "YYYYMMDD") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else +' gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + + lblLOAD.Visible = False + cboSort.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form ARFix - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + lblLOAD.Visible = False + Exit Sub +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + Call HeaderLoad +End Sub + +Private Sub cboSort_Change() + If cboSort.ListIndex = 0 Then + lstHeader.col = 2 + lstHeader.ColSortDataType = ColSortDataTypeTextNoCase + lstHeader.ColSorted = SortedDescending + lstHeader.Sorted = SortedDescending +' lstHeader.Sorted + ElseIf cboSort.ListIndex = 1 Then + lstHeader.col = 5 + lstHeader.ColSorted = SortedDescending + + End If +End Sub + +Private Sub cboSort_Click() + If cboSort.ListIndex = 0 Then + lstHeader.col = 8 +' lstHeader.ColSortDataType = ColSortDataTypeDate + lstHeader.ColSortSeq = -1 + lstHeader.ColSorted = SortedNone + lstHeader.Sorted = SortedNone + lstHeader.col = 2 + lstHeader.ColSortSeq = 0 + lstHeader.ColSortDataType = ColSortDataTypeTextNoCase + lstHeader.ColSorted = SortedAscending + lstHeader.Sorted = SortedAscending +' lstHeader.Sorted + ElseIf cboSort.ListIndex = 1 Then + lstHeader.col = 2 + lstHeader.ColSortSeq = -1 +' lstHeader.ColSortDataType = ColSortDataTypeTextNoCase + lstHeader.ColSorted = SortedNone + lstHeader.Sorted = SortedNone + lstHeader.col = 8 + lstHeader.ColSortSeq = 0 + lstHeader.ColSortDataType = ColSortDataTypeTextNoCase +' lstHeader.ColSortDataType = ColSortDataTypeDate + lstHeader.ColSorted = SortedDescending + lstHeader.Sorted = SortedDescending + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + +' If moRSProj.State = adStateOpen Then +' moRSProj.Close +' End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +' mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK +' lstDetail.Enabled = True +' lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call ARCodeLoad +' Call HeaderLoad +End Sub + +'Private Sub ProjLoad() +'Dim strSQL As String +' On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + +' Set moRSProj = New Recordset +' moRSProj.Open strSQL, goConn, _ +' adOpenForwardOnly, adLockReadOnly +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form APFix - Module ProjLoad" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub + +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str2(oRS!Bill_ID) & vbTab & Field2Str(oRS!Cust_NO) & vbTab & Field2Str(oRS!Name) ' & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) '& vbTab & Field2Str(oRS!Name) + cboARCode.AddItem strLine +' cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!bill_id) + oRS.MoveNext + Loop + oRS.Close +' cboARCode.ListIndex = 0 + cboARCode.ListIndex = -1 + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module APCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail +' txtInvDate = Field2Str(!invoice_date) +' txtDueDate = Field2Str(!inv_due_date) +' txtItemAmt = Format(Field2Str2(!amount), "currency") +' txtSalesCode = Field2Str(!sales_code) +' txtTax = Field2Str(!taxcode) +' chkReady = Field2CheckBox(!ready) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + +' strSQL = "SELECT * " +' strSQL = strSQL & "FROM tblARInvoice " +' strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) +' Set moRSDetail = New Recordset +' moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Else + FormFind = True + msglInvTotal = moRSHeader!non_tax_amt + mstrType = moRSHeader!inv_type + gintPROJID = moRSHeader!PROJ_ID +' Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form APFix - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +'Private Sub lstDetail_Click() +' If lstDetail.ListIndex <> -1 Then +' If FormFind() Then +' Call FormShow + +' End If +' End If +'End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader +' !invoice_date = Str2Field(txtInvDate) + !JobNumber = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) +' !amount = Str2Field(txtItemAmt) +' !sales_code = Str2Field(txtSalesCode) + .Update + End With + +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' msglInvTotal = Field2Str2(oRS!sglTOTAL) + +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + +' Do Until oRS.EOF +' With oRS +' !invoice_date = Str2Field(txtInvDate) +' !inv_due_date = Str2Field(txtDueDate) +' !ready = chkReady +' !non_tax_amt = msglInvTotal +' !taxcode = Str2Field(txtTax) +' If Field2Str2(moRSProj!retention) > 0 Then +' !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") +' Else +' !retention_amt = 0 +' End If +' .Update +' End With +' oRS.MoveNext +' Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" +' chkReady = vbUnchecked +End Sub + +'Private Sub lstDetail_DblClick() +' cmdSave.Enabled = True +'End Sub + +Private Sub lstHeader_Click() +Dim strSQL As String, oRS As Recordset +Dim strID As String + + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + strID = lstHeader.ColText + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE ar_id = " & strID + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not moRSHeader.EOF Then + txtSalesCode = Format(Field2Str(moRSHeader!TaxableSalesAmount), "#,#.00") + txtDueDate = Field2Str(moRSHeader!JobNumber) + txtInvDate = Field2Str(moRSHeader!InvoiceNumber) + txtItemAmt = Field2Str2(moRSHeader!seqnumber) + Else + txtSalesCode = "" + txtDueDate = "" + txtInvDate = "" + txtItemAmt = "" + End If +' txtDueDate.SetFocus + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True + txtDueDate.SetFocus +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + +' lngPOS = InStr(1, txtDueDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtDueDate) > 0 Then +' txtDueDate = Format(txtDueDate, "00/00/####") +' If Not IsDate(txtDueDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtDueDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtDueDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtDueDate.SetFocus +' End If + txtDueDate = UCase(txtDueDate) + +End Sub + +'Private Sub txtInvDate_GotFocus() +' Call FieldSelect(txtInvDate) +'End Sub + +'Private Sub txtInvDate_LostFocus() +'Dim lngPOS As Long + +' lngPOS = InStr(1, txtInvDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtInvDate) > 0 Then +' txtInvDate = Format(txtInvDate, "00/00/####") +' If Not IsDate(txtInvDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtInvDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtInvDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtInvDate.SetFocus +' End If + +'End Sub + +'Private Sub txtItemAmt_GotFocus() +' Call FieldSelect(txtItemAmt) +' msglItemAmt = Single2Field(txtItemAmt) +'End Sub + +'Private Sub txtItemAmt_LostFocus() +' If msglItemAmt < Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt = Field2Str(txtItemAmt) Then +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' End If +'End Sub + +'Private Sub txtSalesCode_GotFocus() +' Call FieldSelect(txtSalesCode) +'End Sub + +'Private Sub txtSalesCode_LostFocus() +' txtSalesCode = UCase(txtSalesCode) +'End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + cboARCode.col = 1 + strCUST = cboARCode.ColText + gintCOPY = 1 + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE CustomerNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' gstrPONUM = Field2Str(oRS!po_num) +' mstrPROJLOT = Field2Str(oRS!ProjLot) +' Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{ARN_InvHistoryHeader.CustomerNumber}= '" & strCUST & "' and {ARN_InvHistoryHeader.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\arblanks.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARFix - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frx new file mode 100644 index 0000000..73042b3 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARFix.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frm new file mode 100644 index 0000000..8b03527 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frm @@ -0,0 +1,762 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmARMaster + Caption = "AR Master List" + ClientHeight = 4980 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10590 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4980 + ScaleWidth = 10590 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtDueDateInfo + Height = 885 + Left = 180 + MultiLine = -1 'True + TabIndex = 10 + Text = "frmARMaster.frx":0000 + Top = 4050 + Width = 10365 + End + Begin VB.TextBox txtZip + Height = 345 + Left = 6120 + MaxLength = 5 + TabIndex = 8 + Top = 2805 + Width = 1470 + End + Begin VB.TextBox txtState + Height = 315 + Left = 6120 + MaxLength = 2 + TabIndex = 7 + Top = 2475 + Width = 465 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5415 + TabIndex = 16 + Top = 3225 + Width = 1275 + End + Begin VB.TextBox txtAddress1 + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 2 + Top = 1425 + Width = 4395 + End + Begin LpLib.fpList lstHeader + Height = 3675 + Left = 180 + TabIndex = 14 + Top = 45 + Width = 5010 + _Version = 196608 + _ExtentX = 8837 + _ExtentY = 6482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 3 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 2 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmARMaster.frx":0006 + End + Begin Crystal.CrystalReport crAR + Left = 9555 + Top = 2625 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9135 + TabIndex = 13 + Top = 3225 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7275 + TabIndex = 11 + Top = 3225 + Width = 1275 + End + Begin VB.TextBox txtName + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 1 + Top = 1065 + Width = 4395 + End + Begin VB.TextBox txtCity + Height = 315 + Left = 6120 + MaxLength = 20 + TabIndex = 6 + Top = 2130 + Width = 4395 + End + Begin VB.TextBox txtAddress2 + Height = 315 + Left = 6120 + MaxLength = 30 + TabIndex = 4 + Top = 1785 + Width = 4395 + End + Begin VB.TextBox txtCustNo + Enabled = 0 'False + Height = 315 + Left = 6120 + MaxLength = 7 + TabIndex = 0 + Top = 720 + Width = 1200 + End + Begin VB.Label lblDue + AutoSize = -1 'True + Caption = "Due Date Information For This Builder: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 225 + TabIndex = 21 + Top = 3810 + Width = 3345 + End + Begin VB.Label lblCNum + Caption = "This Field Must Match CMS Cust No" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 255 + Left = 7365 + TabIndex = 20 + Top = 780 + Width = 3210 + End + Begin VB.Label lblInstr + Caption = $"frmARMaster.frx":0322 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 630 + Left = 5370 + TabIndex = 19 + Top = 60 + Width = 5145 + End + Begin VB.Label lblZip + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ZipCode: " + Height = 195 + Left = 5415 + TabIndex = 18 + Top = 2910 + Width = 690 + End + Begin VB.Label blbState + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "State: " + Height = 195 + Left = 5640 + TabIndex = 17 + Top = 2535 + Width = 465 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address1: " + Height = 195 + Left = 5355 + TabIndex = 15 + Top = 1545 + Width = 750 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "City: " + Height = 195 + Left = 5760 + TabIndex = 12 + Top = 2235 + Width = 345 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cust Name:" + Height = 195 + Left = 5280 + TabIndex = 9 + Top = 1170 + Width = 825 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address2: " + Height = 195 + Left = 5355 + TabIndex = 5 + Top = 1890 + Width = 750 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cust No: " + Height = 195 + Left = 5445 + TabIndex = 3 + Top = 840 + Width = 660 + End +End +Attribute VB_Name = "frmARMaster" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String, mboolADD As Boolean +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String, strAMOUNT As String +Dim strLine As String + + On Error GoTo Error_EH + strSQL = "SELECT * FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear + + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!Bill_ID) & vbTab & Field2Str(oRS!Cust_NO) & vbTab & Field2Str(oRS!Name) ' & vbTab +' strLine = strLine & Field2Str(oRS!Address1) & vbTab & Field2Str(oRS!Address2) & vbTab & Field2Str(oRS!InvoiceType) & vbTab +' strLine = strLine & Field2Str(oRS!InvoiceDate) & vbTab & Field2Str(oRS!JobNumber) & vbTab & Format(strAMOUNT, "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine + End With + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + lstHeader.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARMaster - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() + cmdSave.Enabled = True + cmdExit.Enabled = True + mboolADD = True + txtCustNo.Enabled = True + Call FormClear + Call FormSave +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + txtCustNo.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call HeaderLoad + mboolADD = False +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSHeader + txtCustNo = Field2Str(!Cust_NO) + txtNAME = Field2Str(!Name) + txtAddress1 = Field2Str(!Address1) + txtAddress2 = Field2Str(!Address2) + txtCity = Field2Str(!City) + txtSTATE = Field2Str(!State) + txtZIP = Field2Str(!ZipCode) + txtDueDateInfo = Field2Str(!DueDate) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form ARMaster - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARMaster - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strID As String + On Error GoTo Error_EH + + lstHeader.col = 0 + strID = lstHeader.ColText + strSQL = "SELECT * FROM tblARMaster WHERE Bill_id = " & strID + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ARMaster - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstHeader_Click() + + If lstHeader.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If + End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader + If mboolADD = True Then + .AddNew + mboolADD = False + End If + !Cust_NO = Field2Str(txtCustNo) + !Name = Field2Str(txtNAME) + !Address1 = Field2Str(txtAddress1) + !Address2 = Field2Str(txtAddress2) + !City = Field2Str(txtCity) + !State = Field2Str(txtSTATE) + !ZipCode = Field2Str(txtZIP) + !DueDate = Field2Str(txtDueDateInfo) + .Update + End With + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARMaster - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +End Sub + +Private Sub FormClear() + txtCustNo = "" + txtNAME = "" + txtAddress1 = "" + txtAddress2 = "" + txtCity = "" + txtSTATE = "" + txtZIP = "" +End Sub + +'Private Sub lstHeader2_Click() +'Dim strSQL As String, oRS As Recordset +'Dim strID As String + +' On Error GoTo Error_EH +' If lstHeader.ListIndex <> -1 Then +' lstHeader.col = 0 +' strID = lstHeader.ColText +' strSQL = "SELECT * FROM tblARMaster WHERE Bill_id = " & strID +' Set moRSHeader = New Recordset +' moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +' If Not moRSHeader.EOF Then +' txtSalesCode = Format(Field2Str(moRSHeader!TaxableSalesAmount), "#,#.00") +' txtDueDate = Field2Str(moRSHeader!JobNumber) +' txtInvDate = Field2Str(moRSHeader!InvoiceNumber) +' txtItemAmt = Field2Str2(moRSHeader!seqnumber) +' Else +' txtSalesCode = "" +' txtDueDate = "" +' txtInvDate = "" +' txtItemAmt = "" +' End If + +' End If + +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form ARMaster - Module lstHeader_Click" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True + txtNAME.SetFocus +End Sub + +Private Sub txtAddress1_GotFocus() + Call FieldSelect(txtAddress1) +End Sub + +Private Sub txtAddress1_LostFocus() + txtAddress1 = UCase(txtAddress1) +End Sub + +Private Sub txtAddress2_GotFocus() + Call FieldSelect(txtAddress2) +End Sub + +Private Sub txtAddress2_LostFocus() + txtAddress2 = UCase(txtAddress2) +End Sub + +Private Sub txtCity_GotFocus() + Call FieldSelect(txtCity) +End Sub + +Private Sub txtCity_LostFocus() + txtCity = UCase(txtCity) +End Sub + +Private Sub txtCustNo_GotFocus() + Call FieldSelect(txtCustNo) +End Sub + +Private Sub txtCustNo_LostFocus() +Dim lngPOS As Long + + txtCustNo = UCase(txtCustNo) + +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE CustomerNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + + strSELECT = "{ARN_InvHistoryHeader.CustomerNumber}= '" & strCUST & "' and {ARN_InvHistoryHeader.JobNumber} = ''" + crAR.ReportFileName = App.Path & "\arblanks.rpt" + crAR.ReplaceSelectionFormula (strSELECT) + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARMaster - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub txtDueDateInfo_LostFocus() +Dim strMSG As String + txtDueDateInfo = UCase(txtDueDateInfo) + strMSG = Trim(txtDueDateInfo) + MsgBox strMSG, vbOKOnly, "Invoice Due Dates" +End Sub + +Private Sub txtDueDateInfo_GotFocus() + txtDueDateInfo.SelStart = 1000 +End Sub + +Private Sub txtNAME_GotFocus() + Call FieldSelect(txtNAME) +End Sub + +Private Sub txtNAME_LostFocus() + txtNAME = UCase(txtNAME) +End Sub + +Private Sub txtState_GotFocus() + Call FieldSelect(txtSTATE) +End Sub + +Private Sub txtState_LostFocus() + txtSTATE = UCase(txtSTATE) +End Sub + +Private Sub txtZip_GotFocus() + Call FieldSelect(txtZIP) + txtZIP.ToolTipText = Trim(txtDueDateInfo) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frx new file mode 100644 index 0000000..d75bfa4 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmARMaster.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAbout.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAbout.frm new file mode 100644 index 0000000..19d311d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAbout.frm @@ -0,0 +1,233 @@ +VERSION 5.00 +Begin VB.Form frmAbout + BorderStyle = 3 'Fixed Dialog + Caption = "About MyApp" + ClientHeight = 3555 + ClientLeft = 2340 + ClientTop = 1935 + ClientWidth = 5730 + ClipControls = 0 'False + LinkTopic = "Form2" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 2453.724 + ScaleMode = 0 'User + ScaleWidth = 5380.766 + ShowInTaskbar = 0 'False + Begin VB.PictureBox picIcon + AutoSize = -1 'True + ClipControls = 0 'False + Height = 540 + Left = 240 + Picture = "frmAbout.frx":0000 + ScaleHeight = 337.12 + ScaleMode = 0 'User + ScaleWidth = 337.12 + TabIndex = 1 + Top = 240 + Width = 540 + End + Begin VB.CommandButton cmdOK + Cancel = -1 'True + Caption = "OK" + Default = -1 'True + Height = 345 + Left = 4245 + TabIndex = 0 + Top = 2625 + Width = 1260 + End + Begin VB.CommandButton cmdSysInfo + Caption = "&System Info..." + Height = 345 + Left = 4260 + TabIndex = 2 + Top = 3075 + Width = 1245 + End + Begin VB.Line Line1 + BorderColor = &H00808080& + BorderStyle = 6 'Inside Solid + Index = 1 + X1 = 84.515 + X2 = 5309.398 + Y1 = 1687.583 + Y2 = 1687.583 + End + Begin VB.Label lblDescription + Caption = "App Description" + ForeColor = &H00000000& + Height = 675 + Left = 1560 + TabIndex = 3 + Top = 1620 + Width = 3375 + End + Begin VB.Label lblTitle + Caption = "Application Title" + ForeColor = &H00000000& + Height = 480 + Left = 1050 + TabIndex = 5 + Top = 240 + Width = 3885 + End + Begin VB.Line Line1 + BorderColor = &H00FFFFFF& + BorderWidth = 2 + Index = 0 + X1 = 98.6 + X2 = 5309.398 + Y1 = 1697.936 + Y2 = 1697.936 + End + Begin VB.Label lblVersion + Caption = "Version" + Height = 225 + Left = 1050 + TabIndex = 6 + Top = 780 + Width = 3885 + End + Begin VB.Label lblDisclaimer + Caption = "Warning: ..." + ForeColor = &H00000000& + Height = 825 + Left = 255 + TabIndex = 4 + Top = 2625 + Width = 3870 + End +End +Attribute VB_Name = "frmAbout" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +' Reg Key Security Options... +Const READ_CONTROL = &H20000 +Const KEY_QUERY_VALUE = &H1 +Const KEY_SET_VALUE = &H2 +Const KEY_CREATE_SUB_KEY = &H4 +Const KEY_ENUMERATE_SUB_KEYS = &H8 +Const KEY_NOTIFY = &H10 +Const KEY_CREATE_LINK = &H20 +Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _ + KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _ + KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL + +' Reg Key ROOT Types... +Const HKEY_LOCAL_MACHINE = &H80000002 +Const ERROR_SUCCESS = 0 +Const REG_SZ = 1 ' Unicode nul terminated string +Const REG_DWORD = 4 ' 32-bit number + +Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location" +Const gREGVALSYSINFOLOC = "MSINFO" +Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO" +Const gREGVALSYSINFO = "PATH" + +Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long +Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long +Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long + + +Private Sub cmdSysInfo_Click() + Call StartSysInfo +End Sub + +Private Sub cmdOK_Click() + Unload Me +End Sub + +Private Sub Form_Load() + Me.Caption = "About " & App.Title + lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision + lblTitle.Caption = App.Title +End Sub + +Public Sub StartSysInfo() + On Error GoTo SysInfoErr + + Dim rc As Long + Dim SysInfoPath As String + + ' Try To Get System Info Program Path\Name From Registry... + If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then + ' Try To Get System Info Program Path Only From Registry... + ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then + ' Validate Existance Of Known 32 Bit File Version + If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then + SysInfoPath = SysInfoPath & "\MSINFO32.EXE" + + ' Error - File Can Not Be Found... + Else + GoTo SysInfoErr + End If + ' Error - Registry Entry Can Not Be Found... + Else + GoTo SysInfoErr + End If + + Call Shell(SysInfoPath, vbNormalFocus) + + Exit Sub +SysInfoErr: + MsgBox "System Information Is Unavailable At This Time", vbOKOnly +End Sub + +Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean + Dim i As Long ' Loop Counter + Dim rc As Long ' Return Code + Dim hKey As Long ' Handle To An Open Registry Key + Dim hDepth As Long ' + Dim KeyValType As Long ' Data Type Of A Registry Key + Dim tmpVal As String ' Tempory Storage For A Registry Key Value + Dim KeyValSize As Long ' Size Of Registry Key Variable + '------------------------------------------------------------ + ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...} + '------------------------------------------------------------ + rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key + + If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' Handle Error... + + tmpVal = String$(1024, 0) ' Allocate Variable Space + KeyValSize = 1024 ' Mark Variable Size + + '------------------------------------------------------------ + ' Retrieve Registry Key Value... + '------------------------------------------------------------ + rc = RegQueryValueEx(hKey, SubKeyRef, 0, _ + KeyValType, tmpVal, KeyValSize) ' Get/Create Key Value + + If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' Handle Errors + + If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then ' Win95 Adds Null Terminated String... + tmpVal = Left(tmpVal, KeyValSize - 1) ' Null Found, Extract From String + Else ' WinNT Does NOT Null Terminate String... + tmpVal = Left(tmpVal, KeyValSize) ' Null Not Found, Extract String Only + End If + '------------------------------------------------------------ + ' Determine Key Value Type For Conversion... + '------------------------------------------------------------ + Select Case KeyValType ' Search Data Types... + Case REG_SZ ' String Registry Key Data Type + KeyVal = tmpVal ' Copy String Value + Case REG_DWORD ' Double Word Registry Key Data Type + For i = Len(tmpVal) To 1 Step -1 ' Convert Each Bit + KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ' Build Value Char. By Char. + Next + KeyVal = Format$("&h" + KeyVal) ' Convert Double Word To String + End Select + + GetKeyValue = True ' Return Success + rc = RegCloseKey(hKey) ' Close Registry Key + Exit Function ' Exit + +GetKeyError: ' Cleanup After An Error Has Occured... + KeyVal = "" ' Set Return Val To Empty String + GetKeyValue = False ' Return Failure + rc = RegCloseKey(hKey) ' Close Registry Key +End Function diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frm new file mode 100644 index 0000000..02c28e8 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frm @@ -0,0 +1,1314 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmAck + Caption = "Daily Orders" + ClientHeight = 5595 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5595 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdTucson + Caption = "Tucson Checklist" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9990 + TabIndex = 33 + Top = -15 + Width = 1065 + End + Begin VB.CheckBox chkTUCSON + Caption = "Tucson Only" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 10005 + TabIndex = 32 + Top = 465 + Width = 1410 + End + Begin VB.CheckBox chkAPRpt + Caption = "Print AP Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8160 + TabIndex = 31 + Top = 480 + Width = 1815 + End + Begin VB.TextBox txtProcess + Alignment = 1 'Right Justify + Height = 315 + Left = 10080 + TabIndex = 30 + Top = 2760 + Width = 1755 + End + Begin VB.CheckBox chkPrintDate + Caption = "Use Print Date" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 6360 + TabIndex = 28 + Top = 480 + Width = 1695 + End + Begin VB.CheckBox chkPrtLBOnly + Caption = "Print Lath && Brown Only" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3720 + TabIndex = 27 + Top = 480 + Width = 2415 + End + Begin LpLib.fpList lstOrders + Height = 4680 + Left = 0 + TabIndex = 26 + Top = 720 + Width = 8535 + _Version = 196608 + _ExtentX = 15055 + _ExtentY = 8255 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmAck.frx":0000 + End + Begin VB.CheckBox chkSingle + Caption = "Print for Selected Supplier && Sequence Only" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3720 + TabIndex = 23 + Top = 0 + Width = 4575 + End + Begin VB.CheckBox chkPrint + Caption = "Print for SW" + Height = 375 + Left = 10560 + TabIndex = 22 + Top = 3840 + Width = 1155 + End + Begin VB.CommandButton cmdDeliver + Caption = "Delivery Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10800 + TabIndex = 21 + Top = 4800 + Width = 915 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update Supplier" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8760 + TabIndex = 20 + Top = 4800 + Width = 1935 + End + Begin VB.ComboBox cboSupplier + Height = 315 + ItemData = "frmAck.frx":04F8 + Left = 8760 + List = "frmAck.frx":04FA + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 19 + Top = 5340 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkSeperate + Caption = "Print Each Supplier on Separate Page" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3720 + TabIndex = 18 + Top = 240 + Width = 3615 + End + Begin Crystal.CrystalReport CRDaily + Left = 8040 + Top = -30 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10800 + TabIndex = 17 + Top = 4260 + Width = 915 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9780 + TabIndex = 16 + Top = 4260 + Width = 915 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8760 + TabIndex = 15 + Top = 4260 + Width = 915 + End + Begin VB.TextBox txtTime + Height = 315 + Left = 10080 + TabIndex = 3 + Top = 3120 + Width = 1755 + End + Begin VB.TextBox txtSequence + Height = 315 + Left = 10080 + TabIndex = 5 + Top = 3840 + Width = 375 + End + Begin VB.TextBox txtConfirm + Height = 315 + Left = 10080 + TabIndex = 4 + Top = 3480 + Width = 1755 + End + Begin VB.TextBox txtODate + Alignment = 1 'Right Justify + Height = 315 + Left = 10080 + TabIndex = 2 + Top = 2400 + Width = 1755 + End + Begin MSComCtl2.DTPicker dtpODate + Height = 315 + Left = 1560 + TabIndex = 1 + Top = 0 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 556 + _Version = 393216 + Format = 95485953 + CurrentDate = 43650 + End + Begin MSComCtl2.DTPicker dtpEODate + Height = 315 + Left = 1560 + TabIndex = 24 + Top = 360 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 556 + _Version = 393216 + Format = 95485953 + CurrentDate = 43650 + End + Begin VB.Label lblProcess + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Process Date: " + Height = 195 + Left = 8610 + TabIndex = 29 + Top = 2820 + Width = 1485 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Drop Date: " + Height = 195 + Left = 330 + TabIndex = 25 + Top = 480 + Width = 1170 + End + Begin VB.Label lblVWPPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP P.O.:" + Height = 195 + Left = 9360 + TabIndex = 14 + Top = 1740 + Width = 780 + End + Begin VB.Label lblDTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Time:" + Height = 195 + Left = 9000 + TabIndex = 13 + Top = 3180 + Width = 1005 + End + Begin VB.Label lblSequence + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Fax Sequence:" + Height = 195 + Left = 8940 + TabIndex = 12 + Top = 3900 + Width = 1080 + End + Begin VB.Label lblConfirm + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Confirmed By:" + Height = 195 + Left = 9060 + TabIndex = 11 + Top = 3540 + Width = 975 + End + Begin VB.Label lblOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Drop Date:" + Height = 195 + Left = 8850 + TabIndex = 10 + Top = 2460 + Width = 1215 + End + Begin VB.Label lblType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8640 + TabIndex = 9 + Top = 2040 + Width = 3195 + End + Begin VB.Label lblPO + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 10200 + TabIndex = 8 + Top = 1680 + Width = 1635 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8640 + TabIndex = 7 + Top = 1320 + Width = 3195 + End + Begin VB.Label lblSupplier + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8640 + TabIndex = 6 + Top = 960 + Width = 3195 + End + Begin VB.Label lblODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "First Drop Date: " + Height = 195 + Left = 345 + TabIndex = 0 + Top = 120 + Width = 1155 + End +End +Attribute VB_Name = "frmAck" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSORDER As Recordset +Dim moRS As Recordset, moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mlngORDERID As Long, mintBOOKMARK As Integer +Dim mstrPROJLOT As String, mboolAPRpt As Boolean + +Private Sub OrderLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String +Dim strTYPE As String, strFLAG As String +Dim strLine As String, lngRET As Long, aTabs(2) As Long + On Error GoTo Error_EH + +' aTabs(0) = 25 +' aTabs(1) = 120 +' aTabs(2) = 200 + If chkPrintDate Then + strSQL = "SELECT * from tblOrders WHERE PrintDate >= #" & CDate(dtpODate.Value) & "# and PrintDate <= #" & CDate(dtpEODate.Value) & "#" + Else + strSQL = "SELECT * from tblOrders WHERE Order_Date >= #" & CDate(dtpODate.Value) & "# and Order_Date <= #" & CDate(dtpEODate.Value) & "#" + End If +' strSQL = "SELECT Order_ID, lot_id, Supplier, M_Type, PO_Num from tblOrders WHERE Order_Date = #" & CDate(dtpODate.Value) & "#" ' and Order_Date =< #" & CDate(dtpEODate.Value) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' lngRET = SendMessage(lstOrders.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) + + lstOrders.Clear + + Do Until oRS.EOF +' If Not (oRS!m_type = "L" Or oRS!m_type = "B" Or oRS!m_type = "S" Or oRS!m_type = "T" Or oRS!m_type = "A") Then +' oRS.MoveNext +' Else + With lstOrders + strSql2 = "SELECT Lot_id, Lot_no FROM tblLotInfo WHERE lot_id = " & oRS!Lot_ID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS!m_type = "L" Then + strTYPE = "LATH " + ElseIf oRS!m_type = "B" Then + strTYPE = "BROWN " + ElseIf oRS!m_type = "S" Then + strTYPE = "SCRATCH " + ElseIf oRS!m_type = "T" Then + strTYPE = "TEXTURE " + ElseIf oRS!m_type = "A" Then + strTYPE = "SAND " + ElseIf oRS!m_type = "P" Then + strTYPE = "PRE-ORDER " + ElseIf oRS!m_type = "W" Then + strTYPE = "WORKORDER/PO " + ElseIf oRS!m_type = "R" Then + strTYPE = "PURCHASE ORDER" + Else + strTYPE = "UNKNOWN" + End If + + strLine = "" + strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRS!supplier) & vbTab & Field2Str(oRS!po_num) & vbTab + strLine = strLine & strTYPE & vbTab & Field2Str2(oRS!order_id) & vbTab & Field2Str2(oRS!order_date) & vbTab & Field2Str2(oRS!PrintDate) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext +' End If + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + lstOrders.col = 4 + mlngORDERID = lstOrders.ColText +' mlngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + Else + mlngORDERID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderLoadXX() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String +Dim strTYPE As String, strFLAG As String +Dim strLine As String, lngRET As Long, aTabs(2) As Long + On Error GoTo Error_EH + + aTabs(0) = 25 + aTabs(1) = 120 + aTabs(2) = 200 + + strSQL = "SELECT Order_ID, lot_id, Supplier, M_Type, PO_Num from tblOrders WHERE Order_Date = #" & CDate(dtpODate.Value) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstOrders.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) + + lstOrders.Clear + + Do Until oRS.EOF + With lstOrders + strSql2 = "SELECT Lot_id, Lot_no FROM tblLotInfo WHERE lot_id = " & oRS!Lot_ID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS!m_type = "L" Then + strTYPE = "LATH " + ElseIf oRS!m_type = "B" Then + strTYPE = "BROWN " + ElseIf oRS!m_type = "S" Then + strTYPE = "SCRATCH " + ElseIf oRS!m_type = "T" Then + strTYPE = "TEXTURE " + ElseIf oRS!m_type = "A" Then + strTYPE = "SAND " + ElseIf oRS!m_type = "P" Then + strTYPE = "PRE-ORDER " + ElseIf oRS!m_type = "R" Then + strTYPE = "PURCHASE ORDER" + Else + strTYPE = "UNKNOWN" + End If + + strLine = "" + strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRS!supplier) & vbTab & Field2Str(oRS!po_num) & vbTab + strLine = strLine & strTYPE ' & vbTab & strFLAG + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + mlngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + Else + mlngORDERID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module OrderLoadx" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub chkAPRpt_Click() + If chkAPRpt = vbChecked Then + mboolAPRpt = True + End If + If chkAPRpt = vbUnchecked Then + mboolAPRpt = False + End If +End Sub + +Private Sub chkPrint_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkPrintDate_Click() + Call OrderLoad +End Sub + +Private Sub cmdDeliver_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String + + On Error GoTo Error_EH + strMONTH = Format(Month(dtpODate.Value), "00") + strDAY = Format(Day(dtpODate.Value), "00") + strYEAR = Year(dtpODate.Value) + gintPRINT = 1 + frmReport.Show 1 + strSQL = "{tblORDERS.print} and {tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" + '{tblORDERS.ORDER_DATE} = Date (2001,09,06) +' If chkSeperate Then +' CRDaily.Formulas(0) = "flag = 1" +' End If + CRDaily.ReportFileName = App.Path & "\DeliverySheet.rpt" + CRDaily.ReplaceSelectionFormula (strSQL) + CRDaily.CopiesToPrinter = gintCOPY + CRDaily.Destination = gintDEST + CRDaily.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String +Dim strEMonth As String, strEYear As String, strEDay As String + On Error GoTo Error_EH + strMONTH = Format(Month(dtpODate.Value), "00") + strDAY = Format(Day(dtpODate.Value), "00") + strYEAR = Year(dtpODate.Value) + strEMonth = Format(Month(dtpEODate.Value), "00") + strEDay = Format(Day(dtpEODate.Value), "00") + strEYear = Year(dtpEODate.Value) + gintPRINT = 1 + frmReport.Show 1 + + If chkAPRpt = vbChecked Then + mboolAPRpt = True + End If + If chkAPRpt = vbUnchecked Then + mboolAPRpt = False + End If + + If chkSingle Then + strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + strSQL = strSQL & " and {tblORDERS.SUPPLIER}= '" & lblSupplier & "'and {tblORDERS.SEQ} = " & txtSequence + ' strSQL = "{tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" + ' strSQL = strSQL & " and {tblORDERS.SUPPLIER}= '" & lblSupplier & "'and {tblORDERS.SEQ} = " & txtSequence + ElseIf chkPrtLBOnly And chkPrintDate And chkTUCSON Then + strSQL = "{tblorders.PrintDate} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.PrintDate} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W') AND {tblPROJECT.PHX_TUS} = True" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence + ElseIf chkPrtLBOnly And chkPrintDate Then + strSQL = "{tblorders.PrintDate} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.PrintDate} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W')" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence + ElseIf chkPrtLBOnly Then + strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W')" ' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence + ElseIf chkAPRpt Then + strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + Else + strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and not ({tblORDERS.m_type}= 'P' or {tblORDERS.m_type}= 'R')" ' = " & txtSequence +' strSQL = "{tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" + End If + '{tblORDERS.ORDER_DATE} = Date (2001,09,06) + If chkSeperate Then + CRDaily.Formulas(0) = "flag = 1" + End If + + If mboolAPRpt Then + CRDaily.ReportFileName = App.Path & "\Dailyorders2.rpt" + ElseIf Not mboolAPRpt Then + CRDaily.ReportFileName = App.Path & "\Dailyorders.rpt" + End If + + CRDaily.ReplaceSelectionFormula (strSQL) + CRDaily.CopiesToPrinter = gintCOPY + CRDaily.Destination = gintDEST + CRDaily.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdTucson_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String +Dim strEMonth As String, strEYear As String, strEDay As String + On Error GoTo Error_EH + strMONTH = Format(Month(dtpODate.Value), "00") + strDAY = Format(Day(dtpODate.Value), "00") + strYEAR = Year(dtpODate.Value) + strEMonth = Format(Month(dtpEODate.Value), "00") + strEDay = Format(Day(dtpEODate.Value), "00") + strEYear = Year(dtpEODate.Value) + gintPRINT = 1 + frmReport.Show 1 + +' If chkAPRpt = vbChecked Then +' mboolAPRpt = True +' End If +' If chkAPRpt = vbUnchecked Then +' mboolAPRpt = False +' End If + +' If chkSingle Then +' strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' strSQL = strSQL & " and {tblORDERS.SUPPLIER}= '" & lblSupplier & "'and {tblORDERS.SEQ} = " & txtSequence + ' strSQL = "{tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" + ' strSQL = strSQL & " and {tblORDERS.SUPPLIER}= '" & lblSupplier & "'and {tblORDERS.SEQ} = " & txtSequence +' If chkPrtLBOnly And chkPrintDate And chkTUCSON Then + strSQL = "{tblorders.PrintDate} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.PrintDate} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" + strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W') AND {tblPROJECT.PHX_TUS} = True" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' ElseIf chkPrtLBOnly And chkPrintDate Then +' strSQL = "{tblorders.PrintDate} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.PrintDate} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W')" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' ElseIf chkPrtLBOnly Then +' strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'W')" ' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B') or {tblORDERS.m_type}= 'W'" ' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' ElseIf chkAPRpt Then +' strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' Else +' strSQL = "{tblorders.order_date} >= date (" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblorders.order_date} <= date (" & strEYear & "," & strEMonth & "," & strEDay & ")" '" +' strSQL = strSQL & " and ({tblORDERS.m_type}= 'L' or {tblORDERS.m_type}= 'B' or {tblORDERS.m_type}= 'S' or {tblORDERS.m_type}= 'A' or {tblORDERS.m_type}= 'T')" ' = " & txtSequence +' strSQL = strSQL & " and not ({tblORDERS.m_type}= 'P' or {tblORDERS.m_type}= 'R')" ' = " & txtSequence +' strSQL = "{tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" +' End If + '{tblORDERS.ORDER_DATE} = Date (2001,09,06) +' If chkSeperate Then +' CRDaily.Formulas(0) = "flag = 1" +' End If + +' If mboolAPRpt Then +' CRDaily.ReportFileName = App.Path & "\Dailyorders2.rpt" +' ElseIf Not mboolAPRpt Then + CRDaily.ReportFileName = App.Path & "\DailyTucson.rpt" +' End If + + CRDaily.ReplaceSelectionFormula (strSQL) + CRDaily.CopiesToPrinter = gintCOPY + CRDaily.Destination = gintDEST + CRDaily.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module cmdTucson_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstOrders.ListIndex + Call FormSave + cboSupplier.Visible = False + cmdSave.Enabled = False + lstOrders.Enabled = True + lstOrders.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdUpdate_Click() + + cboSupplier.Visible = True + If IsNull(moRSORDER!supplier) Then + cboSupplier.ListIndex = -1 + Else + Call CBFindString(cboSupplier, Field2Str(moRSORDER!supplier)) + End If + +End Sub + +Private Sub dtpEODate_Change() + If dtpEODate.Value < dtpODate.Value Then + MsgBox "Last Date Connot Be Less Than The First Date", vbOKOnly, "ReEnter Date" + dtpEODate.SetFocus + Exit Sub + End If + Call OrderLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + +End Sub + +Private Sub dtpODate_Change() + Call OrderLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Set moRSORDER = New Recordset + dtpODate.Value = Date + dtpEODate.Value = Date + + Call OrderLoad + Call SupplierLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE order_ID = " & mlngORDERID + + Set moRSORDER = New Recordset + moRSORDER.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSORDER.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSORDER!Lot_ID) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Ack - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String + + On Error GoTo Error_EH + mboolAPRpt = False + + lblProjLot.Caption = "" + lblSupplier.Caption = "" + lblType.Caption = "" + lblPO.Caption = "" + + mboolSHOW = True + strSQL = "Select * FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gintPROJID = Field2Str2(moRS!PROJ_ID) + + strSQL = "Select * FROM tblProject WHERE proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lblProjLot.Caption = Trim(Field2Str(moRSProj!Proj_Desc)) & " " & Field2Str(moRS!lot_no) + + With moRSORDER + txtODate = Field2Str(!order_date) + txtProcess = Field2Str(!PrintDate) + txtConfirm = Field2Str(!confirmed) + txtSequence = Field2Str(!seq) + txtTime = Field2Str(!del_time) + chkPrint = Field2CheckBox(!Print) + + If Field2Str(!m_type) = "L" Then + lblType.Caption = "LATH " + ElseIf Field2Str(!m_type) = "B" Then + lblType.Caption = "BROWN " + ElseIf Field2Str(!m_type) = "S" Then + lblType.Caption = "SCRATCH " + ElseIf Field2Str(!m_type) = "T" Then + lblType.Caption = "TEXTURE " + ElseIf Field2Str(!m_type) = "A" Then + lblType.Caption = "SAND " + ElseIf Field2Str(!m_type) = "P" Then + lblType.Caption = "PRE-ORDER " + ElseIf Field2Str(!m_type) = "R" Then + lblType.Caption = "PURCHASE ORDER" + Else + lblType.Caption = "" + End If + + lblSupplier.Caption = Field2Str(!supplier) + lblPO.Caption = Field2Str(!ponum) + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + With moRSORDER + !order_date = Str2Field(txtODate) + !del_time = Str2Field(txtTime) + !confirmed = Str2Field(txtConfirm) + !seq = Str2Field(txtSequence) + !Print = chkPrint + End With + + If cboSupplier.Visible Then + moRSORDER!supplier = cboSupplier.Text + End If + + moRSORDER.Update + + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If +' End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + Resume Next + End If + gstrMODULE = "Form Ack - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtODate = "" + txtTime = "" + txtSequence = "" + txtConfirm = "" + lblSupplier.Caption = "" + lblType.Caption = "" + lblPO.Caption = "" + lblProjLot.Caption = "" + chkPrint = vbUnchecked + chkSeperate = vbUnchecked + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + moRSORDER.Update + + Call OrderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + +End Sub + +Private Sub lstOrders_Click() + On Error GoTo Error_EH + + If lstOrders.ListIndex <> -1 Then + lstOrders.col = 4 + mlngORDERID = lstOrders.ColText + ' mlngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module lstOrders_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstOrders_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtConfirm_GotFocus() + Call FieldSelect(txtConfirm) +End Sub + +Private Sub txtODate_GotFocus() + Call FieldSelect(txtODate) +End Sub + +Private Sub txtODate_LostFocus() +Dim lngPOS As Long + If IsDate(txtODate) Then + Exit Sub + End If + lngPOS = InStr(1, txtODate, "/", 1) + If lngPOS = 0 Then + If Len(txtODate) > 0 Then + txtODate = Format(txtODate, "00/00/####") + If Not IsDate(txtODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtODate.SetFocus + End If + +End Sub + +Private Sub txtConfirm_LostFocus() + txtConfirm = UCase(txtConfirm) +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!PROJ_ID) +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + + Set moRSProj = New Recordset + + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + gintPROJID = moRSProj!PROJ_ID + mstrPROJLOT = Trim(Field2Str(moRSProj!Proj_Desc)) & " - " & Trim(Field2Str(moRS!lot_no)) +' lblProjectLot = mstrPROJLOT +End Sub + +Private Sub LotSelect() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_no, address, owner, lot_id FROM tblLotInfo WHERE proj_id = " & gintPROJID + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + + Do Until moRS.EOF + strLine = "" + strLine = Field2Str(moRS!lot_no) & vbTab & Field2Str(moRS!address) + moRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module LotSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ProjectSelect() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Proj_id, Proj_Desc FROM tblProject" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + + Do Until oRS.EOF + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module ProjectSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + + +Private Sub txtSequence_GotFocus() + Call FieldSelect(txtConfirm) +End Sub + +Private Sub txtTime_GotFocus() + Call FieldSelect(txtODate) +End Sub + +Private Sub txtTime_LostFocus() + txtTime = UCase(txtTime) +End Sub + +Private Sub SupplierLoad() +Dim oRS As Recordset +Dim strSQL As String, strFLAG As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSupplier" ' where type = '" & strFLAG & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If oRS!Type <> "S" Then + cboSupplier.AddItem oRS!supplier + cboSupplier.ItemData(cboSupplier.NewIndex) = Field2Long(oRS!sup_no) + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Ack - Module SupplierLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frx new file mode 100644 index 0000000..1a8b80f Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmAck.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBilling.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBilling.frm new file mode 100644 index 0000000..2a9883e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBilling.frm @@ -0,0 +1,1781 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmBilling + Caption = "Project Billing Information" + ClientHeight = 4425 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 12045 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4425 + ScaleWidth = 12045 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtTBase + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + TabIndex = 52 + Top = 1080 + Width = 1035 + End + Begin VB.Timer tmrPAUSE + Interval = 500 + Left = 6645 + Top = 435 + End + Begin VB.TextBox txtOWDlrs + Height = 315 + Left = 10590 + TabIndex = 50 + Top = 1620 + Visible = 0 'False + Width = 765 + End + Begin VB.TextBox txtOWPctg + Height = 315 + Left = 10590 + TabIndex = 49 + Top = 1290 + Width = 765 + End + Begin VB.CheckBox chkOWrap + Caption = "Wrap Ins." + Height = 225 + Left = 8580 + TabIndex = 46 + Top = 1260 + Width = 1305 + End + Begin VB.TextBox txtWrapDlrs + Height = 315 + Left = 2040 + TabIndex = 45 + Top = 4080 + Visible = 0 'False + Width = 765 + End + Begin VB.TextBox txtWrapPctg + Height = 315 + Left = 2040 + TabIndex = 42 + Top = 3780 + Width = 765 + End + Begin VB.CheckBox chkWrap + Caption = "Wrap Insurance" + Height = 270 + Left = 1395 + TabIndex = 41 + Top = 3540 + Width = 1500 + End + Begin VB.TextBox txtPNTFCode + Height = 315 + Left = 3300 + TabIndex = 12 + Top = 3195 + Width = 1035 + End + Begin VB.TextBox txtPNTFBill + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + TabIndex = 13 + Top = 3195 + Width = 1035 + End + Begin VB.CommandButton cmdUpDesc + Caption = "Update Option Desc" + Height = 540 + Left = 4410 + TabIndex = 39 + Top = 3570 + Width = 1035 + End + Begin VB.TextBox txtPNTEBill + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + TabIndex = 11 + Top = 2850 + Width = 1035 + End + Begin VB.TextBox txtPNTECode + Height = 315 + Left = 3300 + TabIndex = 10 + Top = 2850 + Width = 1035 + End + Begin VB.TextBox txtPNTBill + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + TabIndex = 9 + Top = 2505 + Width = 1035 + End + Begin VB.TextBox txtPNTCode + Height = 315 + Left = 3300 + TabIndex = 8 + Top = 2505 + Width = 1035 + End + Begin VB.CommandButton cmdUp + Caption = "Command1" + Height = 495 + Left = 3345 + TabIndex = 33 + Top = 3630 + Visible = 0 'False + Width = 855 + End + Begin VB.CommandButton cmdAddDate + Caption = "New Effective Date" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8580 + TabIndex = 32 + Top = 1545 + Width = 1335 + End + Begin VB.ComboBox cboEffDate + Height = 315 + Left = 3240 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 30 + Top = 420 + Width = 1635 + End + Begin VB.TextBox txtSTCode + Enabled = 0 'False + Height = 315 + Left = 3300 + MaxLength = 6 + TabIndex = 6 + Top = 2160 + Visible = 0 'False + Width = 1035 + End + Begin VB.TextBox txtSTBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 4380 + MaxLength = 10 + TabIndex = 7 + Top = 2160 + Visible = 0 'False + Width = 1035 + End + Begin VB.CheckBox chkOption + Alignment = 1 'Right Justify + Caption = "Bill Options with Stucco:" + Height = 255 + Left = 1620 + TabIndex = 28 + Top = 840 + Width = 2055 + End + Begin VB.TextBox txtOCode + Height = 315 + Left = 9840 + MaxLength = 6 + TabIndex = 21 + Top = 900 + Width = 1035 + End + Begin VB.TextBox txtSCode + Height = 315 + Left = 3300 + MaxLength = 6 + TabIndex = 4 + Top = 1800 + Width = 1035 + End + Begin VB.TextBox txtLCode + Height = 315 + Left = 3300 + MaxLength = 6 + TabIndex = 2 + Top = 1440 + Width = 1035 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Price List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8580 + TabIndex = 26 + TabStop = 0 'False + Top = 3345 + Width = 1335 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "Save &Option Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8580 + TabIndex = 23 + Top = 2760 + Width = 1335 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8580 + TabIndex = 24 + TabStop = 0 'False + Top = 3915 + Width = 1335 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Plan Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8580 + TabIndex = 14 + Top = 2160 + Width = 1335 + End + Begin VB.TextBox txtOptBill + Alignment = 1 'Right Justify + Height = 315 + Left = 10920 + MaxLength = 10 + TabIndex = 22 + Top = 900 + Width = 1035 + End + Begin VB.CheckBox chkBill + Alignment = 1 'Right Justify + Caption = "Bill Lath && Stucco Combined:" + Height = 255 + Left = 1320 + TabIndex = 1 + Top = 1140 + Width = 2355 + End + Begin VB.TextBox txtSBill + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + MaxLength = 10 + TabIndex = 5 + Top = 1800 + Width = 1035 + End + Begin VB.TextBox txtLBill + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + MaxLength = 10 + TabIndex = 3 + Top = 1440 + Width = 1035 + End + Begin VB.ListBox lstOptions + Height = 3375 + Left = 5505 + Sorted = -1 'True + TabIndex = 15 + Top = 885 + Width = 2895 + End + Begin VB.ListBox lstMod_Elv + Height = 3180 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 870 + Width = 1155 + End + Begin Crystal.CrystalReport crRepair + Left = 7920 + Top = 420 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.Label lblTTL + Alignment = 2 'Center + Caption = "Total Base" + Height = 225 + Left = 4380 + TabIndex = 53 + Top = 840 + Width = 1035 + End + Begin VB.Label lblStone + Caption = "Stone should be entered in Options with the Billing Code of STONE or WSTONE" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 885 + Left = 9960 + TabIndex = 51 + Top = 3375 + Width = 2085 + End + Begin VB.Label lblOWDlrs + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wrap $: " + Height = 195 + Left = 9990 + TabIndex = 48 + Top = 1680 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblOWPctg + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wrap %: " + Height = 195 + Left = 9915 + TabIndex = 47 + Top = 1350 + Width = 645 + End + Begin VB.Label lblWrapDlrs + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wrap $: " + Height = 195 + Left = 1440 + TabIndex = 44 + Top = 4140 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblWrapPctg + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wrap %: " + Height = 195 + Left = 1410 + TabIndex = 43 + Top = 3840 + Width = 645 + End + Begin VB.Label lblPaintFinal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Billing Final Code/Amt:" + Height = 195 + Left = 1305 + TabIndex = 40 + Top = 3270 + Width = 1995 + End + Begin VB.Label lblPaintEBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Billing Ext Code/Amt:" + Height = 195 + Left = 1410 + TabIndex = 38 + Top = 2940 + Width = 1890 + End + Begin VB.Label lblPaintBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Billing Int Code/Amt:" + Height = 195 + Left = 1455 + TabIndex = 37 + Top = 2565 + Width = 1845 + End + Begin VB.Label lblPOption + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 540 + Left = 9960 + TabIndex = 36 + Top = 2775 + Width = 2100 + WordWrap = -1 'True + End + Begin VB.Label lblOptUsed + Caption = "OPTION USED" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 240 + Left = 9990 + TabIndex = 35 + Top = 2190 + Visible = 0 'False + Width = 1440 + End + Begin VB.Label lblOptOrder + Height = 240 + Left = 9960 + TabIndex = 34 + Top = 2430 + Width = 2040 + End + Begin VB.Label lblEffDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price Effective Date:" + Height = 195 + Left = 1665 + TabIndex = 31 + Top = 480 + Width = 1470 + End + Begin VB.Label lblStoneBill + Alignment = 1 'Right Justify + Caption = "Stone Billing Code/Amt:" + Enabled = 0 'False + Height = 195 + Left = 1545 + TabIndex = 29 + Top = 2205 + Visible = 0 'False + Width = 1755 + End + Begin VB.Label lblDesc + BorderStyle = 1 'Fixed Single + Height = 735 + Left = 8400 + TabIndex = 27 + Top = 60 + Width = 3555 + End + Begin VB.Label txtProject + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 60 + TabIndex = 25 + Top = 0 + Width = 8280 + End + Begin VB.Label lblOptAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Code/Amt:" + Height = 195 + Left = 8520 + TabIndex = 20 + Top = 960 + Width = 1275 + End + Begin VB.Label lblStuccoBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Billing Code/Amt:" + Height = 195 + Left = 1530 + TabIndex = 19 + Top = 1845 + Width = 1770 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Billing Code/Amt:" + Height = 195 + Left = 1725 + TabIndex = 18 + Top = 1485 + Width = 1575 + End + Begin VB.Label lblOptions + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Options:" + Height = 195 + Left = 5580 + TabIndex = 17 + Top = 660 + Width = 585 + End + Begin VB.Label lblPlans + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Plans:" + Height = 195 + Left = 120 + TabIndex = 16 + Top = 660 + Width = 435 + End +End +Attribute VB_Name = "frmBilling" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSOpt As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolOPTUSED As Boolean +Dim mboolAdding As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer +Dim mstrType As String, mstrMODEL As String +Dim mintESTID As Integer, mintPROJID As Integer, mintESTID2 As Integer +Dim mintOPTID As Integer, mintLOTID As Integer +Dim mstrSQL As String +Dim mstrNewDate As String, mstrCopyDate As String +Dim mstrBLATH, mstrBSTUCCO, mstrBPI, mstrBPE, mstrBPF, mstrBOPT As String + +Private Sub cboEffDate_Change() + Call ListLoad +End Sub + +Private Sub cboEffDate_Click() + Call ListLoad + +End Sub + +Private Sub cmdAddDate_Click() +Dim strNewDate As String, strCopyDate As String, intYN As Integer +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset, lngPOS As Long + strNewDate = InputBox("Enter the New Effective Date for this Tract (MMDDYYYY)", "New Date", Date) +' If Not IsDate(strNewDate) Then +' MsgBox "A Valid Date Must Be Entered", vbOKOnly, "InValid Date" +' Exit Sub +' End If + lngPOS = InStr(1, strNewDate, "/", 1) + If Not IsDate(strNewDate) Then + If lngPOS = 0 Then + If Len(strNewDate) > 0 Then + strNewDate = Format(strNewDate, "00/00/####") + If Not IsDate(strNewDate) Then + MsgBox "A Valid Date Must Be Entered", vbOKOnly, "InValid Date" +' Call cmdExit_Click +' mboolBAD = True + Exit Sub + End If +' mstrSTARTDATE = strNewDate + Else + MsgBox "The Date You Entered is not Valid Now Exiting", vbOKOnly, "InValid Date" +' mboolBAD = True + Exit Sub +' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" +' Call cmdExit_Click +' mboolBAD = True + Exit Sub + End If +' Else +' mstrSTARTDATE = strNewDate + End If + + cboEffDate.AddItem strNewDate + mstrNewDate = strNewDate + strSQL = "Select * FROM tblProjDate" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = strNewDate + oRS.Update + End If + intYN = MsgBox("Do You Want To Copy Plans from A Previous Effective Date?", vbQuestion + vbYesNo, "Copy?") + If intYN = vbYes Then + strCopyDate = InputBox("What is the Old Effective Date to Use?", "Old Date", cboEffDate.Text) + If Not IsDate(strCopyDate) Then + MsgBox "A Valid Date Must Be Entered", vbOKOnly, "InValid Date" + Exit Sub + End If + mstrCopyDate = strCopyDate + strSQL = "SELECT * FROM tblPlanBill WHERE Proj_id = " & gintPROJID & " and effdate = #" & strCopyDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + strSql2 = "SELECT * FROM tblPlanBill" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + oRSS!est_id = oRS!est_id + mintESTID = oRS!est_id + oRSS!Mod_Elv = oRS!Mod_Elv + oRSS!l_bill = 0 + oRSS!s_bill = 0 + oRSS!Create = Date + oRSS!createuser = gstrLOGIN + oRSS!notes = oRS!notes + oRSS!l_code = oRS!l_code + oRSS!s_code = oRS!s_code + oRSS!st_bill = oRS!st_bill + oRSS!st_code = oRS!st_code + oRSS!effdate = strNewDate + oRSS!pnt_bill = oRS!pnt_bill + oRSS!pnt_ebill = oRS!pnt_ebill + oRSS!pnt_fbill = oRS!pnt_fbill + oRSS!PNT_FCODE = oRS!PNT_FCODE + oRSS!PNT_ECODE = oRS!PNT_ECODE + oRSS!PNT_CODE = oRS!PNT_CODE + oRSS!Wrap = oRS!Wrap + oRSS!WPctg = oRS!WPctg + oRSS.Update + Call CopyOption + oRS.MoveNext + Loop + Else + + End If +End Sub + +Private Sub CopyOption() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + strSQL = "SELECT * FROM tblPOptBill WHERE est_id = " & mintESTID & " and effdate = #" & mstrCopyDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + strSql2 = "SELECT * FROM tblPOptBill" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!OPTID = oRS!OPTID + oRSS!opt_no = oRS!opt_no + oRSS!Desc = oRS!Desc + oRSS!b_code = oRS!b_code + oRSS!created = Date + oRSS!C_USER = gstrLOGIN + oRSS!Amt = 0 + oRSS!Wrap = oRS!Wrap + oRSS!WPctg = oRS!WPctg + oRSS!effdate = mstrNewDate + oRSS.Update + oRS.MoveNext + Loop + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String +Dim strDate As String + + On Error GoTo Error_EH + strDate = cboEffDate.Text + strMONTH = Format(Mid(strDate, 1, 2), "00") + strDAY = Format(Mid(strDate, 4, 2), "00") + strYEAR = Format(Mid(strDate, 7, 4), "0000") + gintPRINT = 1 + frmReport.Show 1 +' strSQL = "{tblPlans.Proj_id} = " & gintPROJID 'date(" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblrepair.area} = '" & Left(cboArea.Text, 1) & "'" + strSQL = "{tblPlanBill.Proj_id} = " & gintPROJID & " and {tblPlanBill.EffDate} = date(" & strYEAR & "," & strMONTH & "," & strDAY & ")" ' and {tblrepair.area} = '" & Left(cboArea.Text, 1) & "'" + crRepair.ReportFileName = App.Path & "\PriceList.rpt" + crRepair.SelectionFormula = strSQL +' crRepair.Destination = crptToWindow + crRepair.CopiesToPrinter = gintCOPY + crRepair.Destination = gintDEST + crRepair.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim strSQL As String + + On Error GoTo Error_EH +' *********************************This does not save correctly - it creates a duplicate key - need to check this + moRSOpt!est_id = gintESTID + moRSOpt!Amt = Double2Field(txtOptBill) +' moRSOpt!billcode = Str2Field(txtOBillCode) +' moRSOpt!costcode = Str2Field(txtOCostCode) + moRSOpt!effdate = Field2Str(cboEffDate.Text) + moRSOpt!b_code = Str2Field(txtOCode) + moRSOpt!Wrap = Field2CheckBox(chkWrap) + moRSOpt!WPctg = Double2Field(txtOWPctg) +' moRSOpt!WDlrs = Double2Field(txtOWDlrs) + moRSOpt.Update + cmdSaveOpt.Enabled = False +' txtContract.Enabled = True + txtLBill.Enabled = True + txtSBill.Enabled = True + txtLCode.Enabled = True + txtSCode.Enabled = True +' txtBillCode.Enabled = True + lstMod_Elv.Enabled = True + lstOptions.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module cmdSaveOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + + +End Sub + +Private Sub cmdUp_Click() +Dim strSQL As String, oRS As Recordset +Dim strSql2 As String, oRSS As Recordset +' strSQL = "Select * from tblplanbill" ' where effdate = null" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' Do Until oRS.EOF +' If IsDate(oRS!effdate) Then + +' Else +' oRS!effdate = "01/01/2005" +' oRS.Update +' End If +' oRS.MoveNext +' Loop + strSQL = "SELECT * FROM tblPlanBill" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + strSql2 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Str(oRS!est_id) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + Do Until oRSS.EOF + oRSS!effdate = oRS!effdate + oRSS.Update + oRSS.MoveNext + Loop + End If + oRS.MoveNext + Loop + MsgBox "Update is Done" +End Sub + +Private Sub cmdUpDesc_Click() +Dim strSQL As String, strDESC As String, strOPTID As String +Dim strSQLL As String, strYN As String, intCNT As Integer +Dim oRS As Recordset, oRSS As Recordset + + intCNT = 0 + lstOptions.ListIndex = intCNT + + strSQLL = "SELECT est_id, optid, desc, effdate FROM tblPOptBill WHERE est_id = " & gintESTID & " and effdate = #" & cboEffDate.Text & "#" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRSS.EOF + lstOptions.ListIndex = intCNT + strOPTID = Field2Str2(oRSS!OPTID) + ' strOPTID = lstOptions.ItemData + + strSQL = "SELECT optid, Desc FROM tblPOPTION WHERE optid = " & CLng(strOPTID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + oRSS!Desc = Field2Str(oRS!Desc) + oRSS.Update + Else +' strYN = MsgBox("Are You Sure You Want To Delete this Option?", vbCritical + vbYesNo, "Delete?") +' If strYN = vbNo Then +' Exit Sub +' End If +' strSQL = "SELECT * FROM tblLOption WHERE opt_id = " & gintOPTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRS.EOF Then +' MsgBox "This Option Has Been Used With A Lot - No Delete Allowed", vbCritical + vbOKOnly, "No DELETE" +' Exit Sub +' End If +' strSQL = "DELETE * FROM tblPOptBill WHERE Optid = " & oRSS!optid 'lstLOptions.ItemData(lstLOptions.ListIndex) +' goConn.Execute strSQL +' Call OptLoad +' call "" + End If + intCNT = intCNT + 1 + oRSS.MoveNext + Loop + MsgBox "Option Descriptions Have Been Updated", vbOKOnly, "Done" + Call OptLoad +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strYN As String +Dim strOptDesc As String, intBOOKMARK As Integer + +' CTRL-A Update Option Description +' CTRL-D Delete an option +' CTRL-W +' CTRL-O +' CTRL-T +' CTRL-U + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +' If KeyCode = vbKeyA And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Show The Description From tblPOption + If KeyCode = vbKeyA And (gbytSECURITY < 3) Then ' Show The Description From tblPOption + If CtrlDown Then + strSQL = "SELECT * FROM tblPOption WHERE OPTID = " & gintOPTID & " AND EST_ID = " & Field2Str2(moRS!est_id) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + lblPOption.Visible = True + lblPOption = Field2Str(oRS!Desc) + strOptDesc = Field2Str(moRSOpt!Desc) + If Trim(strOptDesc) <> lblPOption Then + strYN = MsgBox("Do You Want To Change The Description?", vbYesNo, "Change Description?") + If strYN = vbYes Then + moRSOpt!Desc = lblPOption + moRSOpt.Update + Call OptLoad + End If + End If + Exit Sub + Else + lblPOption.Visible = True + lblPOption = "Not A Valid Option For This Plan" + End If +' strSQL = "DELETE * FROM tblPOptBill WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) +' goConn.Execute strSQL +' Call OptLoad + End If + End If + + If KeyCode = vbKeyD And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Delete An Option Out of the Billing Grid +' If KeyCode = vbKeyD And (gbytSECURITY < 3) Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then + strYN = MsgBox("Are You Sure You Want To Delete this Option?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + strSQL = "SELECT * FROM tblLOption WHERE opt_id = " & gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + MsgBox "This Option Has Been Used With A Lot - No Delete Allowed", vbCritical + vbOKOnly, "No DELETE" + Exit Sub + End If + strSQL = "DELETE * FROM tblPOptBill WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad +' Call UpStart +' Call AddBill2 + End If + End If + + If KeyCode = vbKeyW And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then + intBOOKMARK = lstMod_Elv.ListIndex + moRS!Wrap = moRSProj!Wrap + moRS!WPctg = moRSProj!WPctg + moRS.Update + Call ListLoad + lstMod_Elv.ListIndex = intBOOKMARK + End If + End If + + If KeyCode = vbKeyO And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then + intBOOKMARK = lstOptions.ListIndex + moRSOpt!Wrap = moRSProj!Wrap + moRSOpt!WPctg = moRSProj!WPctg + moRSOpt.Update + Call OptLoad + lstOptions.ListIndex = intBOOKMARK + End If + End If + + If KeyCode = vbKeyU And gbytSECURITY < 3 Then ' + If CtrlDown Then + Call Up_Codes + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + End If + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + End If + End If + + If KeyCode = vbKeyT And gbytSECURITY < 3 Then ' Delete An Option Out of the Billing Grid + If CtrlDown Then + Call Up_Codes2 + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + End If +' If lstMod_Elv.ListCount Then +' lstMod_Elv.ListIndex = 0 +' End If + End If + End If + + +' If Not cmdSave.Enabled Then +' Call DataHasChanged +' End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstMod_Elv.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstMod_Elv.Enabled = True + lstMod_Elv.ListIndex = mintBOOKMARK + lstOptions.Enabled = True + txtOptBill.Enabled = True + txtOCode.Enabled = True +' txtOBillCode.Enabled = True +' txtOCostCode.Enabled = True + mintBOOKMARK = 0 + lstMod_Elv.SetFocus +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSOpt = New Recordset + Set moRSProj = New Recordset + + Call ProjLoad + Call DateLoad '*/********** + If cboEffDate.ListCount > 0 Then + Call ListLoad + End If +' Call OptLoad + +End Sub + +Private Sub DateLoad() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblPROJDATE where Proj_ID = " & gintPROJID & " Order By STARTDATE Desc" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + cboEffDate.Clear + + Do Until oRS.EOF + cboEffDate.AddItem Format(Field2Str(oRS!startdate), "MM/DD/YYYY") + oRS.MoveNext + Loop + If cboEffDate.ListCount > 0 Then + cboEffDate.ListIndex = 0 + End If +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj.EOF Then + MsgBox "No Project Information Found - Select a Different Project", vbOKOnly, "InValid Project" + Unload Me + Else + mstrBLATH = Field2Str(moRSProj!LATH) + mstrBSTUCCO = Field2Str(moRSProj!Stucco) + mstrBPI = Field2Str(moRSProj!PAINTINT) + mstrBPE = Field2Str(moRSProj!PAINTEXT) + mstrBPF = Field2Str(moRSProj!PAINTFNL) + mstrBOPT = Field2Str(moRSProj!Option) + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ListLoad() +Dim oRS As Recordset, intYN As Integer +Dim strSQL As String, strProj As String, intResponse As Integer + On Error GoTo Error_EH + +' strSQL = "SELECT EST_ID, Mod_Elv, effdate from tblPLANbill WHERE Proj_ID = " & gintPROJID & " and effdate = #" & Field2Str(cboEffDate.Text) & "#" + strSQL = "SELECT EST_ID, Mod_Elv from tblPLANbill WHERE Proj_ID = " & gintPROJID & " and effdate = #" & Field2Str(cboEffDate.Text) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS("est_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + Else + Call FormClear + lstOptions.Clear + Call OptClear + gstrFLAG = "D" + Beep + intResponse = MsgBox("No Plan Information for the Selected Date", vbOKOnly + vbQuestion, "No Plans") + intYN = MsgBox("Do You Want To Delete This Date?", vbYesNo, "Delete Date") + If intYN = vbYes Then + strSQL = "DELETE * FROM tblProjDate WHERE proj_id = " & gintPROJID & " and StartDate = #" & cboEffDate.Text & "#" + goConn.Execute strSQL + Call DateLoad + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + + On Error GoTo Error_EH + mboolSHOW = True + gintESTID = moRS!est_id + txtProject = Trim$(Field2Str(moRSProj!PROJ_ID)) & " " & Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + chkBill = Field2CheckBox(moRSProj!bill) + chkOption = Field2CheckBox(moRSProj!opt) + With moRS + txtLBill = Format(Field2Str2(!l_bill), "#,#0.00") + txtSBill = Format(Field2Str2(!s_bill), "#,#0.00") + txtTBase = Format((CDbl(txtSBill) + CDbl(txtLBill)), "#,#0.00") + txtSTBill = Format(Field2Str2(!st_bill), "#,#0.00") + txtPNTBill = Format(Field2Str2(!pnt_bill), "#,#0.00") + txtPNTEBill = Format(Field2Str2(!pnt_ebill), "#,#0.00") + txtPNTFBill = Format(Field2Str2(!pnt_fbill), "#,#0.00") + txtPNTFCode = Field2Str(!PNT_FCODE) + txtPNTECode = Field2Str(!PNT_ECODE) + txtPNTCode = Field2Str(!PNT_CODE) + txtLCode = Field2Str(!l_code) + txtSCode = Field2Str(!s_code) + txtSTCode = Field2Str(!st_code) + chkWrap = Field2CheckBox(!Wrap) + txtWrapPctg = Format(Field2Str2(!WPctg), "#0.00##") + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOptBill = Format(Field2Str2(!Amt), "#,#0.00") + txtOWPctg = Format(Field2Str2(!WPctg), "#0.00##") + chkOWrap = Field2CheckBox(!Wrap) +' txtOBillCode = Field2Str2(!billcode) +' txtOCostCode = Field2Str2(!costcode) + txtOCode = Field2Str(!b_code) + lblOptOrder = "Option Number " & Trim(Field2Str(gintOPTID)) + If mboolOPTUSED Then + lblOptUsed.Visible = True + ElseIf mboolOPTUSED = False Then + lblOptUsed.Visible = False + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptClear() + + txtOptBill = "" + txtOCode = "" +' txtOBillCode = "" +' txtOCostCode = "" + +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + moRS.Update + moRSProj!bill = chkBill + moRSProj!opt = chkOption + moRSProj.Update + Call ListLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, intResponse As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPlanBill " + strSQL = strSQL & "WHERE est_ID = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) & " and effdate = #" & Field2Str(cboEffDate.Text) & "#" + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + intResponse = MsgBox("No Plan Information for The Selected Date?", vbOKOnly + vbQuestion, "No Plans") + lstMod_Elv.Enabled = False + FormFind = False + Call FormClear + Call OptClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Billing - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String +Dim strSQLL As String, oRSO As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOptBill " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + strSQL = strSQL & " and EffDate = #" & cboEffDate.Text & "#" + + Set moRSOpt = New Recordset + moRSOpt.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + If moRSOpt.EOF Then + FormFindOpt = False + Else + strSQLL = "SELECT * FROM tblLOPTION WHERE OPT_ID = " & lstOptions.ItemData(lstOptions.ListIndex) + Set oRSO = New Recordset + oRSO.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSO.EOF Then + mboolOPTUSED = True + Else + mboolOPTUSED = False + End If + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Billing - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstMod_Elv_Click() + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call OptLoad +' Call Up_Codes + End If + End If +End Sub + +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRS + !l_bill = Double2Field(txtLBill) + !s_bill = Double2Field(txtSBill) + !st_bill = Double2Field(txtSTBill) + !pnt_bill = Double2Field(txtPNTBill) + !pnt_ebill = Double2Field(txtPNTEBill) + !pnt_fbill = Double2Field(txtPNTFBill) + !PNT_FCODE = Str2Field(txtPNTFCode) + !PNT_ECODE = Str2Field(txtPNTECode) + !PNT_CODE = Str2Field(txtPNTCode) + !l_code = Str2Field(txtLCode) + !s_code = Str2Field(txtSCode) + !st_code = Str2Field(txtSTCode) + !Wrap = Field2CheckBox(chkWrap) + !WPctg = Double2Field(txtWrapPctg) +' !WDlrs = Double2Field(txtWrapDlrs) + !BUpdate = Date + !BUUser = gstrLOGIN + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Up_Codes() +Dim oRSPB As Recordset, oRSPOB As Recordset, oRS As Recordset +Dim strSQL, strSQLL As String, strSQLLL As String +Dim lngESTID As Long, lngOPTID As Long, lngOPTID2 As Long, lngSTART As Long + + lstMod_Elv.ListIndex = 0 + + Do Until lstMod_Elv.ListCount = lstMod_Elv.ListIndex + 1 + lngESTID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + strSQL = "SELECT * from tblPLANbill WHERE Est_ID = " & lngESTID & " and effdate = #" & Field2Str(cboEffDate.Text) & "#" + Set oRSPB = New Recordset + oRSPB.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSPB.EOF Then + 'need to make it check for options for the plan before trying to do this part + '***** need to slow down processing of options so it will process all options and not skip some + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + lngOPTID = lstOptions.ItemData(lstOptions.ListIndex) + + strSQLL = "SELECT Est_ID, OPTID, B_Code, effdate from tblPOptBill WHERE Est_ID = " & lngESTID & " and effdate = #" & cboEffDate.Text & "#" +' strSQL = "SELECT Est_ID, OPTID, Desc, effdate from tblPOptBill WHERE EST_ID = " & gintESTID & " and effdate = #" & cboEffDate.Text & "#" + Set oRSPOB = New Recordset + oRSPOB.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSPOB.EOF Then + lstOptions.ListIndex = 0 + + Do Until lstOptions.ListCount = lstOptions.ListIndex + 2 +' lstOptions.ListIndex = 0 + lngOPTID2 = lstOptions.ItemData(lstOptions.ListIndex) + + strSQLLL = "SELECT OPTID, B_Code, effdate FROM tblPOptBill WHERE OPTID = " & lngOPTID2 & " and effdate = #" & cboEffDate.Text & "#" + Set oRS = New Recordset + oRS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + If (Field2Str(oRS!b_code) = "STONE" Or Field2Str(oRS!b_code) = "WSTONE") Then +' If (Field2Str(oRSPOB!b_code) = "STONE" Or Field2Str(oRSPOB!b_code) = "WSTONE") Then + Else + If Field2Str(oRS!b_code) = "VOPT" Then + oRS!b_code = "STONE" + oRS.Update + Else + oRS!b_code = mstrBOPT + oRS.Update + End If + End If + End If + lstOptions.ListIndex = lstOptions.ListIndex + 1 + lngSTART = Timer + Do While Timer < lngSTART + 0.3 '0 + ' DoEvents ' Yield to other processes. + Loop + + Loop + End If + + oRSPB!l_code = mstrBLATH + oRSPB!s_code = mstrBSTUCCO + oRSPB!PNT_CODE = mstrBPI + oRSPB!PNT_ECODE = mstrBPE + oRSPB!PNT_FCODE = mstrBPF + oRSPB.Update + End If + End If + +'Dim mstrBLATH, mstrBSTUCCO, mstrBPI, mstrBPE, mstrBPF, mstrBOPT As String +' End If + lstMod_Elv.ListIndex = lstMod_Elv.ListIndex + 1 + Loop + +End Sub + +Private Sub Up_Codes2() +Dim oRSPB As Recordset, oRSPOB As Recordset, oRS As Recordset, intBOOKMARK As Integer +Dim strSQL, strSQLL As String, strSQLLL As String, intCOUNT As Integer +Dim lngESTID As Long, lngOPTID As Long, lngOPTID2 As Long, lngSTART As Long + +' lstMod_Elv.ListIndex = 0 + intCOUNT = 1 + intBOOKMARK = lstMod_Elv.ListIndex +' Do Until lstMod_Elv.ListCount = lstMod_Elv.ListIndex + 1 + lngESTID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + strSQL = "SELECT * from tblPLANbill WHERE Est_ID = " & lngESTID & " and effdate = #" & Field2Str(cboEffDate.Text) & "#" + Set oRSPB = New Recordset + oRSPB.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSPB.EOF Then + 'need to make it check for options for the plan before trying to do this part + '***** need to slow down processing of options so it will process all options and not skip some + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + lngOPTID = lstOptions.ItemData(lstOptions.ListIndex) + + strSQLL = "SELECT Est_ID, OPTID, B_Code, effdate from tblPOptBill WHERE Est_ID = " & lngESTID & " and effdate = #" & cboEffDate.Text & "#" +' strSQL = "SELECT Est_ID, OPTID, Desc, effdate from tblPOptBill WHERE EST_ID = " & gintESTID & " and effdate = #" & cboEffDate.Text & "#" + Set oRSPOB = New Recordset + oRSPOB.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSPOB.EOF Then + lstOptions.ListIndex = 0 + + Do Until lstOptions.ListCount = intCOUNT 'lstOptions.ListIndex ' + 2 +' lstOptions.ListIndex = 0 + If lstOptions.ListIndex = 0 Then + Else + lstOptions.ListIndex = lstOptions.ListIndex + 1 + End If + lngOPTID2 = lstOptions.ItemData(lstOptions.ListIndex) + + strSQLLL = "SELECT OPTID, B_Code, effdate FROM tblPOptBill WHERE OPTID = " & lngOPTID2 & " and effdate = #" & cboEffDate.Text & "#" + Set oRS = New Recordset + oRS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + If (Field2Str(oRS!b_code) = "STONE" Or Field2Str(oRS!b_code) = "WSTONE") Then +' If (Field2Str(oRSPOB!b_code) = "STONE" Or Field2Str(oRSPOB!b_code) = "WSTONE") Then + Else + If Field2Str(oRS!b_code) = "VOPT" Then + oRS!b_code = "STONE" + oRS.Update + Else + oRS!b_code = mstrBOPT + oRS.Update + End If + End If + End If +' If lstOptions.ListIndex < lstOptions.ListCount - 1 Then + If intCOUNT = 1 Then + lstOptions.ListIndex = lstOptions.ListIndex + 1 + End If + intCOUNT = intCOUNT + 1 +' lstOptions.ListIndex = lstOptions.ListIndex + 1 +' Else +' lstoptions.ListIndex= +' Exit Sub +' End If + lngSTART = Timer + Do While Timer < lngSTART + 0.3 '0 + ' DoEvents ' Yield to other processes. + Loop + + Loop + End If + + oRSPB!l_code = mstrBLATH + oRSPB!s_code = mstrBSTUCCO + oRSPB!PNT_CODE = mstrBPI + oRSPB!PNT_ECODE = mstrBPE + oRSPB!PNT_FCODE = mstrBPF + oRSPB.Update + Call ListLoad + End If + End If + lstMod_Elv.ListIndex = intBOOKMARK + +'Dim mstrBLATH, mstrBSTUCCO, mstrBPI, mstrBPE, mstrBPF, mstrBOPT As String +' End If +' lstMod_Elv.ListIndex = lstMod_Elv.ListIndex + 1 +' Loop + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan Information, Exit and Import From Takeoff?", vbOKOnly + vbQuestion, "No Plans") + Unload Me + Exit Sub + End If +End Sub + +Private Sub FormClear() + txtTBase = "" + txtLBill = "" + txtSBill = "" + txtSTBill = "" + txtPNTBill = "" + txtPNTCode = "" + txtOptBill = "" + txtOCode = "" + txtLCode = "" + txtSCode = "" + txtSTCode = "" + txtPNTECode = "" + txtPNTEBill = "" + txtPNTFCode = "" + txtPNTFBill = "" + txtPNTCode = "" + txtPNTBill = "" +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Est_ID, OPTID, Desc, effdate from tblPOptBill WHERE EST_ID = " & gintESTID & " and effdate = #" & cboEffDate.Text & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + strLine = Field2Str(oRS!Desc) + .AddItem strLine + .ItemData(.NewIndex) = oRS!OPTID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 +' lstOptions.Sorted + Else + txtOCode = "" +' txtOCostCode = "" + txtOptBill = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstMod_Elv_DblClick() + cmdSave.Enabled = True + lstOptions.Enabled = False + txtOptBill.Enabled = False +' txtOBillCode.Enabled = False +' txtOCostCode.Enabled = False + txtOCode.Enabled = False + txtLCode.SetFocus +End Sub + +Private Sub lstOptions_Click() + On Error GoTo Error_EH + lblPOption = "" +' lblPOption.Visible = False + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Else + lstOptions.Clear + txtOptBill = "0" +' txtOBillCode = "" +' txtOCostCode = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module lstOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True +' txtContract.Enabled = False + txtLCode.Enabled = False + txtSCode.Enabled = False + txtLBill.Enabled = False + txtSBill.Enabled = False +' txtBillCode.Enabled = False + lstMod_Elv.Enabled = False + txtOCode.SetFocus +End Sub + +Private Sub txtLBill_GotFocus() + Call FieldSelect(txtLBill) +End Sub + +Private Sub txtLCode_GotFocus() + Call FieldSelect(txtLCode) +End Sub + +Private Sub txtLCode_LostFocus() + txtLCode = UCase(txtLCode) +End Sub + +Private Sub txtOCode_GotFocus() + Call FieldSelect(txtOCode) +End Sub + +Private Sub txtOCode_LostFocus() + txtOCode = UCase(txtOCode) +End Sub + +Private Sub txtOptBill_GotFocus() + Call FieldSelect(txtOptBill) +End Sub + +Private Sub txtOWPctg_GotFocus() + Call FieldSelect(txtOWPctg) +End Sub + +Private Sub txtOWPctg_LostFocus() + txtOWPctg = Format(Field2Str2(txtOWPctg), "#0.00##") +End Sub + +Private Sub txtPNTBill_GotFocus() + Call FieldSelect(txtPNTBill) +End Sub + +Private Sub txtPNTCode_GotFocus() + Call FieldSelect(txtPNTCode) +End Sub + +Private Sub txtPNTEBill_GotFocus() + Call FieldSelect(txtPNTEBill) +End Sub + +Private Sub txtPNTECode_GotFocus() + Call FieldSelect(txtPNTECode) +End Sub + +Private Sub txtPNTFBill_GotFocus() + Call FieldSelect(txtPNTFBill) +End Sub + +Private Sub txtPNTFCode_GotFocus() + Call FieldSelect(txtPNTFCode) +End Sub + +Private Sub txtSBill_GotFocus() + Call FieldSelect(txtSBill) +End Sub + +Private Sub txtSCode_GotFocus() + Call FieldSelect(txtSCode) +End Sub + +Private Sub txtSCode_LostFocus() + txtSCode = UCase(txtSCode) +End Sub + +Private Sub txtPNTCode_LostFocus() + txtPNTCode = UCase(txtPNTCode) +End Sub + +Private Sub txtPNTECode_LostFocus() + txtPNTECode = UCase(txtPNTECode) +End Sub + +Private Sub txtPNTFCode_LostFocus() + txtPNTFCode = UCase(txtPNTFCode) +End Sub + +Private Sub txtSTBill_GotFocus() + Call FieldSelect(txtSTBill) +End Sub + +Private Sub txtSTCode_GotFocus() + Call FieldSelect(txtSTCode) +End Sub + +Private Sub txtSTCode_LostFocus() + txtSTCode = UCase(txtSTCode) +End Sub + +Private Sub txtWrapPctg_GotFocus() + Call FieldSelect(txtWrapPctg) +End Sub + +Private Sub txtWrapPctg_LostFocus() +'Dim dblWDlrs As Double, dblWPctg As Double, dblBilling As Double + + txtWrapPctg = Format(Field2Str2(txtWrapPctg), "#0.00##") +' dblWPctg = Field2Str(txtWrapPctg) / 100 +' dblBilling = "" + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus.frm new file mode 100644 index 0000000..9c158d3 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus.frm @@ -0,0 +1,597 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmBillingStatus + Caption = "Billing Status" + ClientHeight = 5835 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8385 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5835 + ScaleWidth = 8385 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdMark + Caption = "Mark All Shipped" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2970 + TabIndex = 10 + Top = 4860 + Width = 1035 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1560 + TabIndex = 9 + Top = 4860 + Width = 1035 + End + Begin Crystal.CrystalReport crShipped + Left = 4200 + Top = 5400 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7200 + TabIndex = 8 + Top = 4860 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5790 + TabIndex = 4 + Top = 4860 + Width = 1035 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4380 + TabIndex = 3 + Top = 4860 + Width = 1035 + End + Begin VB.CheckBox chkShipped + Alignment = 1 'Right Justify + Caption = "Order Shipped" + Height = 315 + Left = 120 + TabIndex = 1 + Top = 4980 + Width = 1395 + End + Begin VB.TextBox txtShippingDate + Height = 315 + Left = 1200 + MaxLength = 10 + TabIndex = 2 + Top = 5460 + Width = 2175 + End + Begin VB.ListBox lstShipping + Height = 3765 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 180 + Width = 8115 + End + Begin VB.Label lblAmount + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 120 + TabIndex = 7 + Top = 4440 + Width = 8115 + End + Begin VB.Label lblData + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 120 + TabIndex = 6 + Top = 4020 + Width = 8115 + End + Begin VB.Label lblDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipping Date:" + Height = 195 + Left = 75 + TabIndex = 5 + Top = 5520 + Width = 1050 + End +End +Attribute VB_Name = "frmBillingStatus" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSBill As Recordset, moRSInv As Recordset +Dim mlngTRANSID As Long, mstrType As String, mstrSDate As String +Dim mboolSHOW As Boolean, mintBOOKMARK As Integer, mintBOOKMARK18 As Integer +Dim mstrCHECK As String + +Private Sub BillingLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT trans_ID, lot_id, header, job_number, shipped, ship_date, Invoice_date, Inv_type, ProjLot FROM tblARInvoice WHERE header and not shipped" ' ORDER by ship_date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstShipping.Clear + + Do Until oRS.EOF + With lstShipping + gintLOTID = Field2Str2(oRS!Lot_id) + If oRS!inv_type = "L" Then + strTYPE = "LATH " + ElseIf oRS!inv_type = "S" Then + strTYPE = "STUCCO " + ElseIf oRS!inv_type = "V" Then + strTYPE = "STONE " + ElseIf oRS!inv_type = "C" Then + strTYPE = "COMPLETE" + ElseIf oRS!inv_type = "R" Then + strTYPE = "REPAIRS" + End If + strLine = "" + strLine = Field2Str(oRS!ship_date) & " " & strTYPE & vbTab + strLine = strLine & Format(Field2Str(oRS!job_number), "!@@@@@@@@@") & vbTab + strLine = strLine & Field2Str(oRS!ProjLot) + .AddItem strLine + .ItemData(.NewIndex) = oRS!Trans_ID + oRS.MoveNext + End With + + Loop + oRS.Close + + If lstShipping.ListCount Then + lstShipping.ListIndex = 0 + mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + Else + mlngTRANSID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module BillingLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub chkShipped_Click() + cmdSave.Enabled = True + lstShipping.Enabled = False + If chkShipped = vbChecked Then + mstrSDate = Date + Else + mstrSDate = "" + End If +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo Error_EH + + moRSBill!shipped = vbChecked + moRSBill!done = vbChecked + moRSBill.Update + gintLOTID = Field2Str(moRSBill!Lot_id) + Call LotChange(moRSBill!ProjLot, "Delete An Invoice") + Call BillingLoad + cmdDelete.Enabled = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module BillingLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdMark_Click() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + cmdMark.Enabled = False + lstShipping.Enabled = False + mintBOOKMARK18 = 0 + lstShipping.ListIndex = 0 + Do Until mintBOOKMARK18 + 1 > lstShipping.ListCount + lstShipping.ListIndex = mintBOOKMARK18 + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = DateAdd("d", 3, Str2Field(txtShippingDate)) + !ship_date = Str2Field(txtShippingDate) + !shipped = vbChecked +' !shipped = chkShipped + !sh_date = Date +' !sh_date = Str2Field(mstrSDate) + .Update + End With + oRS.MoveNext + Loop + If mintBOOKMARK18 + 1 < lstShipping.ListCount + 1 Then +' lstShipping.ListIndex = mintBOOKMARK18 + 1 + mintBOOKMARK18 = mintBOOKMARK18 + 1 + End If + Loop + + Call BillingLoad + Call FormClear + lstShipping.Enabled = True + lstShipping.ListIndex = -1 + +' If FormFind() Then +' Call FormShow +' Else +' Call FormClear +' End If + + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +' mintBOOKMARK18 = 0 +' lstPOItems.ListIndex = 0 +' Do Until mintBOOKMARK18 + 1 > lstPOItems.ListCount +' moRSUpdate!ready = vbChecked +' moRSUpdate.Update +' If mintBOOKMARK18 < lstPOItems.ListCount Then +' lstPOItems.ListIndex = mintBOOKMARK18 + 1 +' mintBOOKMARK18 = mintBOOKMARK18 + 1 +' End If +' Loop +' Call POLoad +' lstPOItems.ListIndex = lstPOItems.ListCount - 1 + +End Sub + +Private Sub cmdPrint_Click() +Dim strPDate As String, strSQL As String + + strPDate = InputBox("Enter The Invoice Release Date to Print - (MMDDYYYY)", "Print Invoice List") + + If Len(strPDate) > 0 Then + strPDate = Format(strPDate, "00/00/####") + If Not IsDate(strPDate) Then + MsgBox "The Date You Entered is not Valid & No Report Will Print - ReEnter", vbOKOnly, "Invalid Date" + Exit Sub + Else + gintPRINT = 9 + frmReport.Show 1 + ' strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblARINVOICE.SH_DATE}=Date (" & Format(strPDate, "YYYY,MM,DD") & ")" + + crShipped.ReportFileName = App.Path & "\InvoiceList.rpt" + crShipped.ReplaceSelectionFormula (strSQL) + ' crshipped.Destination = crptToWindow + ' crshipped.Destination = crptToPrinter + crShipped.Destination = gintDEST + crShipped.CopiesToPrinter = gintCOPY + crShipped.Action = 1 + Exit Sub + End If + End If +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstShipping.ListIndex + Call FormSave + cmdSave.Enabled = False + cmdDelete.Enabled = False + lstShipping.Enabled = True + lstShipping.ListIndex = CInt(mintBOOKMARK) - 1 +' lstShipping.ListIndex = mintBOOKMARK +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Call BillingLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE Trans_id = " & mlngTRANSID + Set moRSBill = New Recordset + moRSBill.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSBill.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSBill!Lot_id) + mstrType = Field2Str(moRSBill!inv_type) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim strTYPE As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + lblData.Caption = "" +' If gbytSECURITY = 7 Then +' chkShipped.Enabled = False +' txtShippingDate.Enabled = False +' End If + mboolSHOW = True + + txtShippingDate = Field2Str(moRSBill!ship_date) + If moRSBill!inv_type = "L" Then + strTYPE = "LATH" + ElseIf moRSBill!inv_type = "S" Then + strTYPE = "STUCCO" + ElseIf moRSBill!inv_type = "C" Then + strTYPE = "COMPLETE" + End If + lblData = Field2Str(moRSBill!ProjLot) & " - " & strTYPE + lblAmount = "Invoice Date - " & Field2Str(moRSBill!invoice_date) & " Inv. Amt. " & Format(Field2Str(moRSBill!non_tax_amt), "currency") + chkShipped = Field2CheckBox(moRSBill!shipped) + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = DateAdd("d", 3, Str2Field(txtShippingDate)) + !ship_date = Str2Field(txtShippingDate) + !shipped = chkShipped + !sh_date = Str2Field(mstrSDate) + .Update + End With + oRS.MoveNext + Loop + + Call BillingLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtShippingDate = "" + lblData = "" + lblAmount = "" + chkShipped = vbUnchecked +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + Call BillingLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSBill.State = adStateOpen Then + moRSBill.Close + End If + +End Sub + +Private Sub lstShipping_Click() + On Error GoTo Error_EH + + If lstShipping.ListIndex <> -1 Then + mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module lstShipping_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstShipping_DblClick() + If lstShipping.ListIndex <> -1 Then + If gbytSECURITY < 3 Then + cmdDelete.Enabled = True + mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + End If + End If +End Sub + +Private Sub txtShippingDate_GotFocus() + mstrCHECK = Field2Str(txtShippingDate) + Call FieldSelect(txtShippingDate) +End Sub + +Private Sub txtShippingDate_KeyPress(KeyAscii As Integer) + If mstrCHECK <> Field2Str(txtShippingDate) Then + cmdSave.Enabled = True + lstShipping.Enabled = False + End If +End Sub + +Private Sub txtShippingDate_LostFocus() +Dim lngPOS As Long + + If Not IsDate(txtShippingDate) Then + lngPOS = InStr(1, txtShippingDate, "/", 1) + If lngPOS = 0 Then + If Len(txtShippingDate) > 0 Then + txtShippingDate = Format(txtShippingDate, "00/00/####") + If Not IsDate(txtShippingDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtShippingDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtShippingDate.SetFocus + End If + End If + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus2.frx new file mode 100644 index 0000000..c4c89c2 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus22.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus22.frm new file mode 100644 index 0000000..076cabe --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBillingStatus22.frm @@ -0,0 +1,686 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmBillingStatus + Caption = "Billing Status" + ClientHeight = 5835 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8385 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5835 + ScaleWidth = 8385 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstShipping + Height = 3675 + Left = 120 + TabIndex = 11 + Top = 120 + Width = 8115 + _Version = 196608 + _ExtentX = 14314 + _ExtentY = 6482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmBillingStatus.frx":0000 + End + Begin VB.CommandButton cmdMark + Caption = "Mark All Invoices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1575 + TabIndex = 10 + Top = 4860 + Visible = 0 'False + Width = 1035 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2981 + TabIndex = 9 + Top = 4860 + Width = 1035 + End + Begin Crystal.CrystalReport crShipped + Left = 4200 + Top = 5400 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7200 + TabIndex = 8 + Top = 4860 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5793 + TabIndex = 4 + Top = 4860 + Width = 1035 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4387 + TabIndex = 3 + Top = 4860 + Width = 1035 + End + Begin VB.CheckBox chkShipped + Alignment = 1 'Right Justify + Caption = "Order Shipped" + Height = 315 + Left = 90 + TabIndex = 1 + Top = 4980 + Width = 1395 + End + Begin VB.TextBox txtShippingDate + Height = 315 + Left = 1200 + MaxLength = 10 + TabIndex = 2 + Top = 5460 + Width = 2175 + End + Begin VB.ListBox lstShipping2 + Height = 3180 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 975 + Width = 8115 + End + Begin VB.Label lblAmount + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 120 + TabIndex = 7 + Top = 4440 + Width = 8115 + End + Begin VB.Label lblData + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 120 + TabIndex = 6 + Top = 4020 + Width = 8115 + End + Begin VB.Label lblDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipping Date:" + Height = 195 + Left = 75 + TabIndex = 5 + Top = 5520 + Width = 1050 + End +End +Attribute VB_Name = "frmBillingStatus" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSBill As Recordset +Dim mlngTRANSID As Long, mstrType As String, mstrSDate As String +Dim mboolSHOW As Boolean, mintBOOKMARK As Integer +Dim mstrCHECK As String + +Private Sub BillingLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT trans_ID, lot_id, header, job_number, shipped, ship_date, Invoice_date, Inv_type, ProjLot FROM tblARInvoice WHERE header and not shipped" ' ORDER by ship_date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstShipping.Clear + + Do Until oRS.EOF + With lstShipping + gintLOTID = Field2Str2(oRS!Lot_id) + If oRS!inv_type = "L" Then + strTYPE = "LATH " + ElseIf oRS!inv_type = "S" Then + strTYPE = "STUCCO " + ElseIf oRS!inv_type = "V" Then + strTYPE = "STONE " + ElseIf oRS!inv_type = "C" Then + strTYPE = "COMPLETE" + End If +' strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!ship_date) & vbTab & strTYPE & vbTab + strLine = strLine & Format(Field2Str(oRS!job_number), "!@@@@@@@@@") & vbTab + strLine = strLine & Field2Str(oRS!ProjLot) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!trans_id + oRS.MoveNext + End With + + Loop + oRS.Close + + If lstShipping.ListCount Then + lstShipping.ListIndex = 0 + mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + Else + mlngTRANSID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module BillingLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub chkShipped_Click() + cmdSave.Enabled = True + lstShipping.Enabled = False + If chkShipped = vbChecked Then + mstrSDate = Date + Else + mstrSDate = "" + End If +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo Error_EH + + moRSBill!shipped = vbChecked + moRSBill!done = vbChecked + moRSBill.Update + gintLOTID = Field2Str(moRSBill!Lot_id) + Call LotChange(moRSBill!ProjLot, "Delete An Invoice") + Call BillingLoad + cmdDelete.Enabled = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module BillingLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdMark_Click() +Dim intCnt As Integer +Dim strSQL As String, oRS As Recordset + + mintBOOKMARK = 0 + lstShipping.ListIndex = 0 + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until mintBOOKMARK + 1 > lstShipping.ListCount + + Do Until oRS.EOF + With oRS + !invoice_date = DateAdd("d", 3, Str2Field(txtShippingDate)) + !ship_date = Str2Field(txtShippingDate) + !shipped = chkShipped + !sh_date = Str2Field(mstrSDate) + .Update + End With + oRS.MoveNext + Loop + + Call BillingLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + +''' moRSUpdate!ready = vbChecked +''' moRSUpdate.Update + +''' If mintBOOKMARK < lstPOItems.ListCount Then +''' lstPOItems.ListIndex = mintBOOKMARK + 1 +''' mintBOOKMARK = mintBOOKMARK + 1 + +''' End If + Loop +''' Call POLoad +''' lstPOItems.ListIndex = lstPOItems.ListCount - 1 + +'' mintBOOKMARK = lstShipping.ListIndex +'' lstShipping.ListIndex = 0 +'' Do Until lstShipping.ListIndex = lstShipping.ListCount - 1 +'' chkShipped = vbChecked + + +'' Loop +'' cmdSave.Enabled = False +'' cmdDelete.Enabled = False +'' lstShipping.Enabled = True +'' lstShipping.ListIndex = mintBOOKMARK + +End Sub + +Private Sub cmdPrint_Click() +Dim strPDate As String, strSQL As String + + strPDate = InputBox("Enter The Invoice Release Date to Print - (MMDDYYYY)", "Print Invoice List") + + If Len(strPDate) > 0 Then + strPDate = Format(strPDate, "00/00/####") + If Not IsDate(strPDate) Then + MsgBox "The Date You Entered is not Valid & No Report Will Print - ReEnter", vbOKOnly, "Invalid Date" + Exit Sub + Else + gintPRINT = 9 + frmReport.Show 1 + ' strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblARINVOICE.SH_DATE}=Date (" & Format(strPDate, "YYYY,MM,DD") & ")" + + crShipped.ReportFileName = App.Path & "\InvoiceList.rpt" + crShipped.ReplaceSelectionFormula (strSQL) + ' crshipped.Destination = crptToWindow + ' crshipped.Destination = crptToPrinter + crShipped.Destination = gintDEST + crShipped.CopiesToPrinter = gintCOPY + crShipped.Action = 1 + Exit Sub + End If + End If +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstShipping.ListIndex + Call FormSave + cmdSave.Enabled = False + cmdDelete.Enabled = False + lstShipping.Enabled = True + lstShipping.ListIndex = mintBOOKMARK +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Call BillingLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE Trans_id = " & mlngTRANSID + Set moRSBill = New Recordset + moRSBill.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSBill.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSBill!Lot_id) + mstrType = Field2Str(moRSBill!inv_type) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim strTYPE As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + lblData.Caption = "" +' If gbytSECURITY = 7 Then +' chkShipped.Enabled = False +' txtShippingDate.Enabled = False +' End If + mboolSHOW = True + + txtShippingDate = Field2Str(moRSBill!ship_date) + If moRSBill!inv_type = "L" Then + strTYPE = "LATH" + ElseIf moRSBill!inv_type = "S" Then + strTYPE = "STUCCO" + ElseIf moRSBill!inv_type = "C" Then + strTYPE = "COMPLETE" + End If + lblData = Field2Str(moRSBill!ProjLot) & " - " & strTYPE + lblAmount = "Invoice Date - " & Field2Str(moRSBill!invoice_date) & " Inv. Amt. " & Format(Field2Str(moRSBill!non_tax_amt), "currency") + chkShipped = Field2CheckBox(moRSBill!shipped) + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = DateAdd("d", 3, Str2Field(txtShippingDate)) + !ship_date = Str2Field(txtShippingDate) + !shipped = chkShipped + !sh_date = Str2Field(mstrSDate) + .Update + End With + oRS.MoveNext + Loop + + Call BillingLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtShippingDate = "" + lblData = "" + lblAmount = "" + chkShipped = vbUnchecked +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + Call BillingLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSBill.State = adStateOpen Then + moRSBill.Close + End If + +End Sub + +Private Sub lstShipping_Click() + On Error GoTo Error_EH + + If lstShipping.ListIndex <> -1 Then +' mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + lstShipping.col = 0 + mlngTRANSID = lstShipping.ColText + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form BillingStatus - Module lstShipping_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstShipping_DblClick() + If lstShipping.ListIndex <> -1 Then + If gbytSECURITY < 3 Then + cmdDelete.Enabled = True + mlngTRANSID = lstShipping.ItemData(lstShipping.ListIndex) + End If + End If +End Sub + +Private Sub txtShippingDate_GotFocus() + mstrCHECK = Field2Str(txtShippingDate) + Call FieldSelect(txtShippingDate) +End Sub + +Private Sub txtShippingDate_KeyPress(KeyAscii As Integer) + If mstrCHECK <> Field2Str(txtShippingDate) Then + cmdSave.Enabled = True + lstShipping.Enabled = False + End If +End Sub + +Private Sub txtShippingDate_LostFocus() +Dim lngPOS As Long + + If Not IsDate(txtShippingDate) Then + lngPOS = InStr(1, txtShippingDate, "/", 1) + If lngPOS = 0 Then + If Len(txtShippingDate) > 0 Then + txtShippingDate = Format(txtShippingDate, "00/00/####") + If Not IsDate(txtShippingDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtShippingDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtShippingDate.SetFocus + End If + End If + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.FRM new file mode 100644 index 0000000..5dc85e7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.FRM @@ -0,0 +1,279 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmBlackPaper + Caption = "Black Paper Types" + ClientHeight = 4410 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7155 + LinkTopic = "Form1" + ScaleHeight = 4410 + ScaleWidth = 7155 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 5700 + TabIndex = 8 + Top = 3300 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 3820 + TabIndex = 7 + Top = 3300 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 1940 + TabIndex = 6 + Top = 3300 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 3300 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 2880 + Picture = "frmBlackPaper.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 4020 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 3240 + Picture = "frmBlackPaper.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 4020 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 3585 + Picture = "frmBlackPaper.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 4020 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 3945 + Picture = "frmBlackPaper.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 4020 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 3135 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 7020 + _ExtentX = 12383 + _ExtentY = 5530 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Black Paper Type" + Columns(0).DataField= "bp_type" + Columns(0).DataWidth= 2 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 40 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 2 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=2" + Splits(0)._ColumnProps(1)= "Column(0).Width=2725" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=2646" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=8996" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=8916" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Named:id=33:Normal" + _StyleDefs(39) = ":id=33,.parent=0" + _StyleDefs(40) = "Named:id=34:Heading" + _StyleDefs(41) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(42) = ":id=34,.wraptext=-1" + _StyleDefs(43) = "Named:id=35:Footing" + _StyleDefs(44) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(45) = "Named:id=36:Selected" + _StyleDefs(46) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(47) = "Named:id=37:Caption" + _StyleDefs(48) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(49) = "Named:id=38:HighlightRow" + _StyleDefs(50) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(51) = "Named:id=39:EvenRow" + _StyleDefs(52) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(53) = "Named:id=40:OddRow" + _StyleDefs(54) = ":id=40,.parent=33" + _StyleDefs(55) = "Named:id=41:RecordSelector" + _StyleDefs(56) = ":id=41,.parent=34" + _StyleDefs(57) = "Named:id=42:FilterBar" + _StyleDefs(58) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmBlackPaper" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus + cmdExit.Caption = "&Cancel" +End Sub + +Private Sub cmdDelete_Click() + If TDBGLabor.Text = "" Then + TDBGLabor.Text = "aa" + moRS.Delete + cmdExit.Caption = "&Exit" + Else + moRS.Delete + cmdExit.Caption = "&Exit" + End If +End Sub + +Private Sub cmdExit_Click() + If cmdExit.Caption = "&Exit" Then + Unload Me + Else + moRS.CancelUpdate + cmdExit.Caption = "&Exit" + End If +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update + cmdExit.Caption = "&Exit" +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblBPType" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frm new file mode 100644 index 0000000..687676d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frm @@ -0,0 +1,448 @@ +VERSION 5.00 +Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" +Begin VB.Form frmBlackPaper1 + Caption = "Black Paper Options" + ClientHeight = 4245 + ClientLeft = 1110 + ClientTop = 345 + ClientWidth = 5745 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4245 + ScaleWidth = 5745 + Begin VB.PictureBox picButtons + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5745 + TabIndex = 7 + Top = 3645 + Width = 5745 + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 300 + Left = 1675 + TabIndex = 13 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update" + Height = 300 + Left = 290 + TabIndex = 12 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdClose + Caption = "&Close" + Height = 300 + Left = 4445 + TabIndex = 11 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Height = 300 + Left = 3060 + TabIndex = 10 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdEdit + Caption = "&Edit" + Height = 300 + Left = 1675 + TabIndex = 9 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 300 + Left = 290 + TabIndex = 8 + Top = 0 + Width = 1095 + End + End + Begin VB.PictureBox picStatBox + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5745 + TabIndex = 1 + Top = 3945 + Width = 5745 + Begin VB.CommandButton cmdLast + Height = 300 + Left = 4545 + Picture = "frmBlackPaper1.frx":0000 + Style = 1 'Graphical + TabIndex = 5 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4200 + Picture = "frmBlackPaper1.frx":0342 + Style = 1 'Graphical + TabIndex = 4 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 345 + Picture = "frmBlackPaper1.frx":0684 + Style = 1 'Graphical + TabIndex = 3 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 0 + Picture = "frmBlackPaper1.frx":09C6 + Style = 1 'Graphical + TabIndex = 2 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.Label lblStatus + BackColor = &H00FFFFFF& + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 690 + TabIndex = 6 + Top = 0 + Width = 3360 + End + End + Begin MSDataGridLib.DataGrid grdDataGrid + Align = 1 'Align Top + Height = 3495 + Left = 0 + TabIndex = 0 + Top = 0 + Width = 5745 + _ExtentX = 10134 + _ExtentY = 6165 + _Version = 393216 + AllowUpdate = -1 'True + AllowArrows = -1 'True + HeadLines = 1 + RowHeight = 15 + TabAction = 1 + AllowAddNew = -1 'True + AllowDelete = -1 'True + BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ColumnCount = 2 + BeginProperty Column00 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + BeginProperty Column01 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + SplitCount = 1 + BeginProperty Split0 + BeginProperty Column00 + EndProperty + BeginProperty Column01 + EndProperty + EndProperty + End +End +Attribute VB_Name = "frmBlackPaper1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim WithEvents adoPrimaryRS As Recordset +Attribute adoPrimaryRS.VB_VarHelpID = -1 +Dim mbChangedByCode As Boolean +Dim mvBookMark As Variant +Dim mbEditFlag As Boolean +Dim mbAddNewFlag As Boolean +Dim mbDataChanged As Boolean + +Private Sub Form_Load() + Dim db As Connection + Set db = New Connection + db.CursorLocation = adUseClient + db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\VWP\VWP.mdb;" + + Set adoPrimaryRS = New Recordset + adoPrimaryRS.Open "select BP_TYPE,DESC from BPTYPE Order by BP_TYPE", db, adOpenStatic, adLockOptimistic + + Set grdDataGrid.DataSource = adoPrimaryRS + + + mbDataChanged = False +End Sub + +Private Sub Form_Resize() + On Error Resume Next + 'This will resize the grid when the form is resized + grdDataGrid.Height = Me.ScaleHeight - 30 - picButtons.Height - picStatBox.Height + lblStatus.Width = Me.Width - 1500 + cmdNext.Left = lblStatus.Width + 700 + cmdLast.Left = cmdNext.Left + 340 +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + If mbEditFlag Or mbAddNewFlag Then Exit Sub + + Select Case KeyCode + Case vbKeyEscape + cmdClose_Click + Case vbKeyEnd + cmdLast_Click + Case vbKeyHome + cmdFirst_Click + Case vbKeyUp, vbKeyPageUp + If Shift = vbCtrlMask Then + cmdFirst_Click + Else + cmdPrevious_Click + End If + Case vbKeyDown, vbKeyPageDown + If Shift = vbCtrlMask Then + cmdLast_Click + Else + cmdNext_Click + End If + End Select +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Screen.MousePointer = vbDefault +End Sub + +Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This will display the current record position for this recordset + lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition) +End Sub + +Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This is where you put validation code + 'This event gets called when the following actions occur + Dim bCancel As Boolean + + Select Case adReason + Case adRsnAddNew + Case adRsnClose + Case adRsnDelete + Case adRsnFirstChange + Case adRsnMove + Case adRsnRequery + Case adRsnResynch + Case adRsnUndoAddNew + Case adRsnUndoDelete + Case adRsnUndoUpdate + Case adRsnUpdate + End Select + + If bCancel Then adStatus = adStatusCancel +End Sub + +Private Sub cmdAdd_Click() + On Error GoTo AddErr + adoPrimaryRS.MoveLast + adoPrimaryRS.AddNew + grdDataGrid.SetFocus + + Exit Sub +AddErr: + MsgBox Err.Description +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo DeleteErr + With adoPrimaryRS + .Delete + .MoveNext + If .EOF Then .MoveLast + End With + Exit Sub +DeleteErr: + MsgBox Err.Description +End Sub + +Private Sub cmdEdit_Click() + On Error GoTo EditErr + + lblStatus.Caption = "Edit record" + mbEditFlag = True + SetButtons False + Exit Sub + +EditErr: + MsgBox Err.Description +End Sub +Private Sub cmdCancel_Click() + On Error Resume Next + + SetButtons True + mbEditFlag = False + mbAddNewFlag = False + adoPrimaryRS.CancelUpdate + If mvBookMark > 0 Then + adoPrimaryRS.Bookmark = mvBookMark + Else + adoPrimaryRS.MoveFirst + End If + mbDataChanged = False + +End Sub + +Private Sub cmdUpdate_Click() + On Error GoTo UpdateErr + + adoPrimaryRS.UpdateBatch adAffectAll + + If mbAddNewFlag Then + adoPrimaryRS.MoveLast 'move to the new record + End If + + mbEditFlag = False + mbAddNewFlag = False + SetButtons True + mbDataChanged = False + + Exit Sub +UpdateErr: + MsgBox Err.Description +End Sub + +Private Sub cmdClose_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + On Error GoTo GoFirstError + + adoPrimaryRS.MoveFirst + mbDataChanged = False + + Exit Sub + +GoFirstError: + MsgBox Err.Description +End Sub + +Private Sub cmdLast_Click() + On Error GoTo GoLastError + + adoPrimaryRS.MoveLast + mbDataChanged = False + + Exit Sub + +GoLastError: + MsgBox Err.Description +End Sub + +Private Sub cmdNext_Click() + On Error GoTo GoNextError + + If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext + If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveLast + End If + 'show the current record + mbDataChanged = False + + Exit Sub +GoNextError: + MsgBox Err.Description +End Sub + +Private Sub cmdPrevious_Click() + On Error GoTo GoPrevError + + If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious + If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveFirst + End If + 'show the current record + mbDataChanged = False + + Exit Sub + +GoPrevError: + MsgBox Err.Description +End Sub + +Private Sub SetButtons(bVal As Boolean) + cmdAdd.Visible = bVal + cmdEdit.Visible = bVal + cmdUpdate.Visible = Not bVal + cmdCancel.Visible = Not bVal + cmdDelete.Visible = bVal + cmdClose.Visible = bVal + cmdNext.Enabled = bVal + cmdFirst.Enabled = bVal + cmdLast.Enabled = bVal + cmdPrevious.Enabled = bVal +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frx new file mode 100644 index 0000000..cd06a6e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmBlackPaper1.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCR3.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCR3.frm new file mode 100644 index 0000000..2bca7a2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCR3.frm @@ -0,0 +1,66 @@ +VERSION 5.00 +Object = "{C4847593-972C-11D0-9567-00A0C9273C2A}#2.2#0"; "CRVIEWER.DLL" +Begin VB.Form frmCR3 + Caption = "Form3" + ClientHeight = 3195 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4680 + LinkTopic = "Form3" + ScaleHeight = 3195 + ScaleWidth = 4680 + StartUpPosition = 3 'Windows Default + Begin CRVIEWERLibCtl.CRViewer CRViewer1 + Height = 7005 + Left = 60 + TabIndex = 0 + Top = 0 + Width = 5805 + DisplayGroupTree= -1 'True + DisplayToolbar = -1 'True + EnableGroupTree = -1 'True + EnableNavigationControls= -1 'True + EnableStopButton= -1 'True + EnablePrintButton= -1 'True + EnableZoomControl= -1 'True + EnableCloseButton= -1 'True + EnableProgressControl= -1 'True + EnableSearchControl= -1 'True + EnableRefreshButton= 0 'False + EnableDrillDown = -1 'True + EnableAnimationControl= 0 'False + EnableSelectExpertButton= 0 'False + EnableToolbar = -1 'True + DisplayBorder = 0 'False + DisplayTabs = -1 'True + DisplayBackgroundEdge= -1 'True + SelectionFormula= "" + EnablePopupMenu = -1 'True + EnableExportButton= 0 'False + EnableSearchExpertButton= 0 'False + End +End +Attribute VB_Name = "frmCR3" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim Report As New CrystalReport2 + +Option Explicit + +Private Sub Form_Load() +Screen.MousePointer = vbHourglass +CRViewer1.ReportSource = Report +CRViewer1.ViewReport +Screen.MousePointer = vbDefault + +End Sub + +Private Sub Form_Resize() +CRViewer1.Top = 0 +CRViewer1.Left = 0 +CRViewer1.Height = ScaleHeight +CRViewer1.Width = ScaleWidth + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frm new file mode 100644 index 0000000..717114c --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frm @@ -0,0 +1,911 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmCertified + Caption = "Certified Labor Rate Information" + ClientHeight = 4785 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9645 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4785 + ScaleWidth = 9645 + StartUpPosition = 3 'Windows Default + Begin Crystal.CrystalReport crEmpList + Left = 7980 + Top = -105 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print" + Height = 465 + Left = 1965 + TabIndex = 19 + Top = 630 + Visible = 0 'False + Width = 900 + End + Begin VB.ComboBox cboSort + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmCertified.frx":0000 + Left = 3885 + List = "frmCertified.frx":0010 + Style = 2 'Dropdown List + TabIndex = 18 + Top = 795 + Width = 2220 + End + Begin VB.TextBox txtSearch + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 17 + Top = 810 + Width = 3435 + End + Begin VB.TextBox txtWCCode + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4320 + TabIndex = 3 + Top = 0 + Width = 1035 + End + Begin VB.TextBox txtFName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5460 + TabIndex = 5 + Top = 300 + Width = 4140 + End + Begin VB.TextBox txtLName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 1035 + MaxLength = 30 + TabIndex = 4 + Top = 315 + Width = 3075 + End + Begin VB.TextBox txtEmpNo + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 2295 + MaxLength = 7 + TabIndex = 2 + Top = 0 + Width = 1035 + End + Begin VB.TextBox txtDept + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 705 + TabIndex = 1 + Top = 0 + Width = 480 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 465 + Left = 2895 + TabIndex = 8 + Top = 630 + Width = 900 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + Height = 465 + Left = 1035 + TabIndex = 6 + Top = 630 + Width = 900 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 465 + Left = 90 + TabIndex = 7 + Top = 630 + Width = 900 + End + Begin LpLib.fpList lstEmpList + Height = 3195 + Left = 30 + TabIndex = 0 + Top = 1215 + Width = 9570 + _Version = 196608 + _ExtentX = 16880 + _ExtentY = 5636 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 195 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCertified.frx":003D + End + Begin VB.Label lblSearch + AutoSize = -1 'True + Caption = "Enter Employee No Search Info:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6180 + TabIndex = 16 + Top = 585 + Width = 2280 + End + Begin VB.Label lblSort + AutoSize = -1 'True + Caption = "Sort Field:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3915 + TabIndex = 15 + Top = 585 + Width = 705 + End + Begin VB.Label lblIntr + Alignment = 2 'Center + Caption = "Double Click Hi-Lited Selection To Edit" + ForeColor = &H000000FF& + Height = 285 + Left = 60 + TabIndex = 14 + Top = 4470 + Width = 9540 + End + Begin VB.Label lblWCCode + AutoSize = -1 'True + Caption = "Labor Rate: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3420 + TabIndex = 13 + Top = 75 + Width = 885 + End + Begin VB.Label lblFName + AutoSize = -1 'True + Caption = "Labor Description: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 12 + Top = 375 + Width = 1335 + End + Begin VB.Label lblLName + AutoSize = -1 'True + Caption = "Project Desc: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 30 + TabIndex = 11 + Top = 375 + Width = 1005 + End + Begin VB.Label lblEmpNo + AutoSize = -1 'True + Caption = "Project Code: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1245 + TabIndex = 10 + Top = 75 + Width = 1005 + End + Begin VB.Label lblDept + AutoSize = -1 'True + Caption = "Proj ID: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 9 + Top = 75 + Width = 570 + End +End +Attribute VB_Name = "frmCertified" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mboolSHOW As Boolean, mboolADD As Boolean +Dim moRSEMP As Recordset, mintBOOKMARK As Integer +Dim mbytSort As Byte + +Private Sub FieldSave() +Dim oRS As Recordset, strSQL As String + + If mboolADD Then + strSQL = "SELECT * FROM tblCERTIFIED" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + + If Not oRS.EOF Then + oRS.AddNew + oRS!PROJ_ID = Field2Str(txtDept) + oRS!Proj_Code = Field2Str(txtEmpNo) + oRS!Proj_Desc = Field2Str(txtLName) + oRS!LaborDesc = Field2Str(txtFName) + oRS!Rate = Field2Str(txtWCCode) +' oRS!Terminated = Field2Str(txtStatus) +' oRS!SocialSecurityNumber = Field2Str(txtSS) + oRS.Update + mboolADD = False + End If + Exit Sub + End If + With moRSEMP + !PROJ_ID = Field2Str(txtDept) + !Proj_Code = Field2Str(txtEmpNo) + !Proj_Desc = Field2Str(txtLName) + !LaborDesc = Field2Str(txtFName) + !Rate = Field2Str(txtWCCode) +' !SocialSecurityNumber = Field2Str(txtSS) +' !Terminated = Field2Str(txtStatus) + .Update + End With + +End Sub + +Private Sub EmpLoad() +Dim oRS As Recordset, moRSEMP As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblCERTIFIED" + Set moRSEMP = New Recordset + moRSEMP.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstEmpList.Clear + + Do Until moRSEMP.EOF + With lstEmpList + strLine = Field2Str(moRSEMP!CertID) & vbTab & Field2Str(moRSEMP!PROJ_ID) & vbTab & Field2Str(moRSEMP!Proj_Code) + strLine = strLine & vbTab & Field2Str(moRSEMP!Proj_Desc) & vbTab & Format(Field2Str(moRSEMP!Rate), "#,#.00 ") & vbTab & Field2Str(moRSEMP!LaborDesc) ' & vbTab & Field2Str(moRSEMP!SocialSecurityNumber) + .AddItem strLine +' .ItemData(.NewIndex) = moRSEMP!emp_id + End With + + moRSEMP.MoveNext + Loop + moRSEMP.Close + + If lstEmpList.ListCount Then + lstEmpList.ListIndex = 0 + Else + lstEmpList.ListIndex = -1 +' cmdDelete.Enabled = False + End If + Exit Sub + + +Error_EH: + gstrMODULE = "Form CrewList - Module EmpLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cmdAdd_Click() +' mboolbookmark = lstEmpList.ListIndex + mboolADD = True + txtEmpNo.Enabled = True + cmdAdd.Enabled = False + cmdSave.Enabled = True + Call FormClear + txtDept.SetFocus +' lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub FormClear() + txtEmpNo.Enabled = True + txtDept = "" + txtEmpNo = "" + txtFName = "" + txtLName = "" + txtWCCode = "" + lstEmpList.Enabled = False +' txtSS = "" +' txtStatus = "" +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim intYN As Integer, strMSG As String + + strMSG = "Do You Want A Report Sorted By Certified Job Number" + intYN = MsgBox(strMSG, vbYesNo, "Sort By Job Number") + If intYN = vbYes Then + Call PrintEmpNo + ElseIf intYN = vbNo Then + intYN = MsgBox("Do You Want To Print A Report Sorted By Last Name", vbYesNo, "Sort By Last Name") + If intYN = vbYes Then + Call PrintLName + ElseIf intYN = vbNo Then + intYN = MsgBox("Do You Want To Print A Report Sorted By First Name?", vbYesNo, "Sorted By First Name") + If intYN = vbYes Then + Call PrintFName + ElseIf intYN = vbNo Then + Exit Sub + End If + End If + End If + +End Sub + +Private Sub PrintEmpNo() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpNo.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub PrintLName() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpLN.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub PrintFName() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpFN.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstEmpList.ListIndex + Call FieldSave + Call EmpLoad + cmdAdd.Enabled = True + cmdSave.Enabled = False + txtEmpNo.Enabled = False + lstEmpList.Enabled = True + lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub Form_Load() + + mboolADD = False + Call EmpLoad + cboSort.ListIndex = 0 + +End Sub + +Private Sub FormShow() + + On Error GoTo Error_EH +' mboolSHOW = True +' gintESTID = moRS!EST_id +' txtProject = Trim$(Field2Str(moRSProj!proj_id)) & " " & Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc +' chkBill = Field2CheckBox(moRSProj!bill) +' chkOption = Field2CheckBox(moRSProj!opt) + With moRSEMP + txtDept = Field2Str(!PROJ_ID) + txtEmpNo = Field2Str(!Proj_Code) + txtLName = Field2Str(!Proj_Desc) + txtFName = Field2Str(!LaborDesc) + txtWCCode = Field2Str(!Rate) +' txtSS = Field2Str(!SocialSecurityNumber) +' txtStatus = Field2Str(!Terminated) +' txtPNTCode = Field2Str(!pnt_code) +' txtLCode = Field2Str(!l_code) +' txtSCode = Field2Str(!s_code) +' txtSTCode = Field2Str(!st_code) + End With +' mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Billing - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstEmpList_Click() +Dim strSQL As String + If lstEmpList.ListIndex <> -1 Then + If FormFind() Then + Call FormShow +' Call OptLoad + End If + End If + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, intResponse As Integer, strEMPNO As String + On Error GoTo Error_EH + lstEmpList.col = 0 + strEMPNO = lstEmpList.ColText + + strSQL = "SELECT * FROM tblCERTIFIED WHERE CertID = " & strEMPNO ' & "'" + Set moRSEMP = New Recordset + moRSEMP.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSEMP.EOF Then + FormFind = False +' Call FormClear +' Call OptClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Certified - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstEmpList_DblClick() + lstEmpList.Enabled = False + cmdAdd.Enabled = False + cmdSave.Enabled = True + txtDept.SetFocus +End Sub + +Private Sub txtDept_GotFocus() + Call FieldSelect(txtDept) +' txtDept.SelStart = 0 + +' If lstCtrl.MaxLength > 0 Then +' lstCtrl.SelLength = lstCtrl.MaxLength +' Else +' txtDept.SelLength = 50 +' txtDept.SelText +' End If +End Sub + +Private Sub txtDept_LostFocus() + txtDept = UCase(txtDept) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtEmpNo_LostFocus() + txtEmpNo = UCase(txtEmpNo) +End Sub + +Private Sub txtFName_GotFocus() + Call FieldSelect(txtFName) +End Sub + +Private Sub txtFName_LostFocus() + txtFName = UCase(txtFName) +End Sub + +Private Sub txtLName_GotFocus() + Call FieldSelect(txtLName) +End Sub + +Private Sub txtLName_LostFocus() + txtLName = UCase(txtLName) +End Sub + +Private Sub txtWCCode_GotFocus() + Call FieldSelect(txtWCCode) +End Sub + +Private Sub txtWCCode_LostFocus() + txtWCCode = UCase(txtWCCode) +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cboSort_Click() +Dim intMIN As Integer + + On Error Resume Next +' mintCnt2 = mintCnt2 + 1 +' lblCount2 = mintCnt2 +' mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex +' cboSortOrder.ListIndex = 4 + + If cboSort.ListIndex = 0 Then +' If mbytSort <> cbolistindex Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 3 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone +' lstEmpList.col = 3 +' lstEmpList.ColSortSeq = -1 +' lstEmpList.ColSorted = SortedNone + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.Redraw = True + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True + lstEmpList.ColumnSearch = 1 + + txtSearch = "" + txtSearch.SetFocus + lblSearch.Caption = "Enter Employee Num. Search Info:" + ElseIf cboSort.ListIndex = 1 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 3 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True +' lstEmpList.ColumnSearch = 2 + lstEmpList.ColumnSearch = 3 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If +' txtSearch = "" + lblSearch.Caption = "Enter Last Name Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 2 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 2 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 3 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True + lstEmpList.ColumnSearch = 2 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If + lblSearch.Caption = "Enter First Name Search Information:" +' txtSearch.SetFocus +' End If + ElseIf cboSort.ListIndex = 3 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 0 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 6 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True +' lstEmpList.ColumnSearch = 2 + lstEmpList.ColumnSearch = 6 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If + lblSearch.Caption = "Enter SS Number Search Information:" +' txtSearch.SetFocus + End If + mbytSort = cboSort.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstEmpList.SearchText = txtSearch.Text +lstEmpList.SearchMethod = 2 +lstEmpList.Action = ActionSearch +lstEmpList.SearchIndex = -1 +lstEmpList.Action = 0 + + If lstEmpList.SearchIndex <> -1 Then + lstEmpList.TopIndex = lstEmpList.SearchIndex + lstEmpList.ListIndex = lstEmpList.SearchIndex + Else + lstEmpList.Action = 6 ' clear + End If + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frx new file mode 100644 index 0000000..d01e0c4 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCertified.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmChange.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmChange.frm new file mode 100644 index 0000000..49216c6 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmChange.frm @@ -0,0 +1,139 @@ +VERSION 5.00 +Begin VB.Form frmChange + Caption = "Change Log" + ClientHeight = 2745 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 3990 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 2745 + ScaleWidth = 3990 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtNotes2 + Height = 285 + Left = 960 + TabIndex = 5 + Top = 975 + Visible = 0 'False + Width = 1545 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 435 + Left = 2700 + TabIndex = 3 + Top = 600 + Width = 1095 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 120 + MultiLine = -1 'True + TabIndex = 2 + Top = 1260 + Width = 3735 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 4 + Top = 960 + Width = 570 + End + Begin VB.Label lblAction + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 120 + TabIndex = 1 + Top = 600 + Width = 2415 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 3675 + End +End +Attribute VB_Name = "frmChange" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Private Sub cmdExit_Click() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + If Len(txtNotes) = 0 Then + MsgBox "You Must Enter A Reason In The Notes", vbOKOnly, "Enter Reason" + txtNotes.SetFocus + Exit Sub + End If + strSQL = "SELECT * FROM tblLotChange WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + oRS.AddNew + oRS!reason = Field2Str(txtNotes) & " - " & Field2Str(txtNotes2) + oRS!User = gstrLOGIN + oRS!Lot_ID = gintLOTID + oRS!Action = Left(Field2Str(lblAction), 20) + oRS.Update + Unload Me + Exit Sub + +Error_EH: + Call ErrorHandler(oRS.ActiveConnection) + Exit Sub + +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + +' Call ProjLoad + +' lblProjLot = moRSProj!proj_code & " " & moRSProj!proj_desc + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor.frm new file mode 100644 index 0000000..a76b3b3 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor.frm @@ -0,0 +1,999 @@ +VERSION 5.00 +Begin VB.Form frmContractor + Caption = "Contractor Information" + ClientHeight = 5070 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10845 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5070 + ScaleWidth = 10845 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkShowAll + Caption = "Show All Contractors" + Height = 495 + Left = 9345 + TabIndex = 40 + Top = 3585 + Width = 1455 + End + Begin VB.CheckBox chkINACTIVE + Caption = "InActive Contractor" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 330 + Left = 7305 + TabIndex = 39 + Top = 3690 + Width = 2055 + End + Begin VB.TextBox txtBillPhone + Alignment = 1 'Right Justify + Height = 315 + Left = 8880 + TabIndex = 17 + Top = 4080 + Width = 1875 + End + Begin VB.TextBox txtBillContact + Height = 315 + Left = 6180 + TabIndex = 16 + Top = 4080 + Width = 2715 + End + Begin VB.TextBox txtPager + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + MaxLength = 10 + TabIndex = 14 + Top = 3360 + Width = 1635 + End + Begin VB.TextBox txtFAX + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + MaxLength = 10 + TabIndex = 12 + Top = 2640 + Width = 1635 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + MaxLength = 10 + TabIndex = 11 + Top = 2280 + Width = 1635 + End + Begin VB.TextBox txtZip + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9480 + TabIndex = 10 + Top = 1920 + Width = 975 + End + Begin VB.TextBox txtMAS90AR + Height = 315 + Left = 6180 + MaxLength = 7 + TabIndex = 15 + Top = 3720 + Width = 1080 + End + Begin VB.TextBox txtCell + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + MaxLength = 10 + TabIndex = 13 + Top = 3000 + Width = 1635 + End + Begin VB.TextBox txtState + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8940 + TabIndex = 9 + Top = 1920 + Width = 495 + End + Begin VB.TextBox txtCity + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 8 + Top = 1920 + Width = 2715 + End + Begin VB.TextBox txtAddress2 + Height = 315 + Left = 6180 + MaxLength = 30 + TabIndex = 7 + Top = 1560 + Width = 4575 + End + Begin VB.TextBox txtConSuper + Height = 315 + Left = 6180 + MaxLength = 20 + TabIndex = 5 + Top = 840 + Width = 2715 + End + Begin VB.TextBox txtAddress1 + Height = 315 + Left = 6180 + MaxLength = 30 + TabIndex = 6 + Top = 1200 + Width = 4575 + End + Begin VB.TextBox txtName + Height = 315 + Left = 6180 + MaxLength = 30 + TabIndex = 4 + Top = 480 + Width = 4575 + End + Begin VB.ListBox lstContractor + Height = 4935 + Left = 300 + Sorted = -1 'True + TabIndex = 1 + Top = 60 + Width = 4275 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9180 + TabIndex = 3 + TabStop = 0 'False + Top = 4440 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 4680 + TabIndex = 2 + TabStop = 0 'False + Top = 4440 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7680 + TabIndex = 0 + TabStop = 0 'False + Top = 4440 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6180 + TabIndex = 18 + Top = 4440 + Width = 1395 + End + Begin VB.Label lblBilling + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billing Contact/Ph:" + Height = 195 + Left = 4785 + TabIndex = 38 + Top = 4140 + Width = 1320 + End + Begin VB.Label lblLast + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8640 + TabIndex = 37 + Top = 120 + Width = 2115 + End + Begin VB.Label lblPCount + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7920 + TabIndex = 36 + Top = 120 + Width = 675 + End + Begin VB.Label lblProject + AutoSize = -1 'True + Caption = "Project Count:" + Height = 195 + Left = 6900 + TabIndex = 35 + Top = 180 + Width = 1005 + End + Begin VB.Label lblUDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7980 + TabIndex = 34 + Top = 3240 + Width = 2775 + End + Begin VB.Label lblCDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7980 + TabIndex = 33 + Top = 2580 + Width = 2775 + End + Begin VB.Label lblUpdate + AutoSize = -1 'True + Caption = "Last Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7980 + TabIndex = 32 + Top = 3000 + Width = 1215 + End + Begin VB.Label lblCreated + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7980 + TabIndex = 31 + Top = 2340 + Width = 735 + End + Begin VB.Label lblConId + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 30 + Top = 120 + Width = 675 + End + Begin VB.Label lblPager + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pager:" + Height = 195 + Left = 5640 + TabIndex = 29 + Top = 3420 + Width = 465 + End + Begin VB.Label lblFax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "FAX #:" + Height = 195 + Left = 5610 + TabIndex = 28 + Top = 2700 + Width = 495 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Telephone:" + Height = 195 + Left = 5295 + TabIndex = 27 + Top = 2340 + Width = 810 + End + Begin VB.Label lblMAS90AR + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS AR Code:" + Height = 195 + Left = 5025 + TabIndex = 26 + Top = 3780 + Width = 1080 + End + Begin VB.Label lblCell + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cell #:" + Height = 195 + Left = 5655 + TabIndex = 25 + Top = 3060 + Width = 450 + End + Begin VB.Label lblCSZ + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "City/State/Zip:" + Height = 195 + Left = 5055 + TabIndex = 24 + Top = 1980 + Width = 1050 + End + Begin VB.Label lblAdd2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address 2:" + Height = 195 + Left = 5355 + TabIndex = 23 + Top = 1620 + Width = 750 + End + Begin VB.Label lblConSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Purchasing Contact:" + Height = 195 + Left = 4665 + TabIndex = 22 + Top = 900 + Width = 1440 + End + Begin VB.Label lblAdd1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address 1:" + Height = 195 + Left = 5355 + TabIndex = 21 + Top = 1260 + Width = 750 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor #:" + Height = 195 + Left = 5175 + TabIndex = 20 + Top = 180 + Width = 930 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor Name:" + Height = 195 + Left = 4860 + TabIndex = 19 + Top = 540 + Width = 1245 + End +End +Attribute VB_Name = "frmContractor" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCont As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolDelete As Boolean +Dim mintCONTID As Integer + +Private Sub chkShowAll_Click() + Call ContractorLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False +' cmdDelete.Enabled = False + cmdExit.Enabled = False +' cmdFindCont.Visible = True + mboolAdding = True + lstContractor.Enabled = False + Call FormClear +End Sub + +Private Sub cmdDelete_Click() + mboolDelete = False + Call CheckLots + If mboolDelete = True Then + moRSCont.Delete + End If + Call ContractorLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + lstContractor.Enabled = True +' cmdDelete.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + cmdExit.Enabled = True + Call FormSave + lstContractor.SetFocus +End Sub + +Private Sub Form_Load() +Dim lngContId As Long + Call ContractorLoad + + If Not gbytSECURITY > 3 Then +' cmdDelete.Enabled = True + End If + If gintPAYID > 0 Then 'See if this form was called from the project notes form + lngContId = CLng(gintPAYID) + Call ListFindItem(lstContractor, lngContId) + End If +End Sub + +Private Sub ContractorLoad() + Dim oRS As Recordset, lngBOOKMARK As Long + Dim strSQL As String + Dim strLine As String + + lngBOOKMARK = 0 + + If chkShowAll Then + strSQL = "SELECT Cont_id, contrcr from tblConInfo" + Else + strSQL = "SELECT Cont_id, contrcr from tblConInfo WHERE NOT INACTIVE" + End If +' strSQL = "SELECT Cont_id, contrcr from tblConInfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' lngBOOKMARK = lstContractor.ListIndex + lstContractor.Clear + + Do Until oRS.EOF + With lstContractor + .AddItem oRS!contrcr + .ItemData(.NewIndex) = oRS!cont_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstContractor.ListCount Then + lstContractor.ListIndex = lngBOOKMARK + Else + lstContractor.ListIndex = 0 + End If + +End Sub + +Private Sub FormSave() +Dim intBOOKMARK As Integer + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCont.AddNew + moRSCont!C_USER = gstrLOGIN + Else + intBOOKMARK = lstContractor.ListIndex + End If + + Call FieldsSave + + moRSCont.Update + + + If mboolAdding Then + mboolAdding = False + intBOOKMARK = 0 + End If + + Call ContractorLoad + + lstContractor.ListIndex = intBOOKMARK + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCont.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormClear() + txtNAME = "" + txtConSuper = "" + txtAddress1 = "" + txtAddress2 = "" + txtCity = "" + txtSTATE = "" + txtZIP = "" + txtPhone = "" + txtFAX = "" + txtCell = "" + txtPager = "" + lblConId = "" + txtMAS90AR = "" + txtBillContact = "" + txtBillPhone = "" + chkINACTIVE = vbUnchecked +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblConInfo " + strSQL = strSQL & "WHERE Cont_id = " & mintCONTID + + Set moRSCont = New Recordset + + If moRSCont.State = adStateOpen Then + moRSCont.Close + End If + + moRSCont.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSCont.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSCont + !contrcr = Str2Field(txtNAME) + !contact = Str2Field(txtConSuper) + !add1 = Str2Field(txtAddress1) + !add2 = Str2Field(txtAddress2) + !City = Str2Field(txtCity) + !State = Str2Field(txtSTATE) + !zip = Str2Field(txtZIP) + !phone = Str2Field(txtPhone) + !fax = Str2Field(txtFAX) + !cell = Str2Field(txtCell) + !pager = Str2Field(txtPager) + !ar = Str2Field(txtMAS90AR) + !billing = Str2Field(txtBillContact) + !bill_ph = Str2Field(txtBillPhone) + !inactive = Field2CheckBox(chkINACTIVE) + !Update = Now() + !U_USER = gstrLOGIN + End With + + moRSCont.Update + Exit Sub +Error_EH: + gstrMODULE = " Form Contractor - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstContractor_Click() + If lstContractor.ListIndex <> -1 Then + mintCONTID = lstContractor.ItemData(lstContractor.ListIndex) + If FormFind() Then + Call FormShow +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + + End If + End If + +End Sub + +Private Sub FormShow() +Dim oRS As Recordset, strSQL As String, intPCount As Integer + + mboolSHOW = True + mintCONTID = moRSCont!cont_id + + strSQL = "SELECT Proj_id, Cont_id, Create FROM tblProject WHERE cont_id = " & mintCONTID & " ORDER BY Create DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + intPCount = oRS.RecordCount + + With moRSCont + txtNAME = Field2Str(!contrcr) + txtConSuper = Field2Str(!contact) + txtAddress1 = Field2Str(!add1) + txtAddress2 = Field2Str(!add2) + txtCity = Field2Str(!City) + txtSTATE = Field2Str(!State) + txtZIP = Field2Str(!zip) + txtPhone = Field2Str(!phone) + txtFAX = Field2Str(!fax) + txtCell = Field2Str(!cell) + txtPager = Field2Str(!pager) + lblConId = Field2Str2(!cont_id) + txtMAS90AR = Field2Str(!ar) + txtBillContact = Field2Str(!billing) + txtBillPhone = Field2Str2(!bill_ph) + lblCDate = Field2Str(!Create) + lblCDate = lblCDate & " - " & Field2Str(!C_USER) + lblUDate = Field2Str(!Update) + lblUDate = lblUDate & " - " & Field2Str(!U_USER) + lblPCount = intPCount + chkINACTIVE = Field2CheckBox(!inactive) + If intPCount > 0 Then + lblLast = oRS!Create + End If + End With + + mboolSHOW = False +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub lstContractor_DblClick() + cmdSave.Enabled = True + cmdAdd.Enabled = False +End Sub + +Private Sub txtBillContact_GotFocus() + Call FieldSelect(txtBillContact) +End Sub + +Private Sub txtBillContact_LostFocus() + txtBillContact = UCase(txtBillContact) +End Sub + +Private Sub txtBillPhone_GotFocus() + Call FieldSelect(txtBillPhone) +End Sub + +Private Sub txtConSuper_GotFocus() + Call FieldSelect(txtConSuper) +End Sub + +Private Sub txtConSuper_LostFocus() + txtConSuper = UCase(txtConSuper) +End Sub + +Private Sub txtNAME_GotFocus() + Call FieldSelect(txtNAME) +End Sub + +Private Sub txtNAME_LostFocus() + txtNAME = UCase(txtNAME) +End Sub + +Private Sub txtAddress1_GotFocus() + Call FieldSelect(txtAddress1) +End Sub + +Private Sub txtAddress1_LostFocus() + txtAddress1 = UCase(txtAddress1) +End Sub + +Private Sub txtAddress2_GotFocus() + Call FieldSelect(txtAddress2) +End Sub + +Private Sub txtAddress2_LostFocus() + txtAddress2 = UCase(txtAddress2) +End Sub + +Private Sub txtMAS90AR_GotFocus() + Call FieldSelect(txtMAS90AR) +End Sub + +Private Sub txtMAS90AR_LostFocus() + txtMAS90AR = UCase(txtMAS90AR) +End Sub + +Private Sub txtCity_GotFocus() + Call FieldSelect(txtCity) +End Sub + +Private Sub txtCity_LostFocus() + txtCity = UCase(txtCity) +End Sub + +Private Sub txtState_GotFocus() + Call FieldSelect(txtSTATE) +End Sub + +Private Sub txtState_LostFocus() + txtSTATE = UCase(txtSTATE) +End Sub + +Private Sub txtCell_GotFocus() + Call FieldSelect(txtCell) +End Sub + +Private Sub txtCell_LostFocus() + txtCell = UCase(txtCell) +End Sub + +Private Sub txtZip_GotFocus() + Call FieldSelect(txtZIP) +End Sub + +Private Sub txtPager_GotFocus() + Call FieldSelect(txtPager) +End Sub + +Private Sub txtPager_LostFocus() + txtPager = UCase(txtPager) +End Sub + +Private Sub txtFAX_GotFocus() + Call FieldSelect(txtFAX) +End Sub + +Private Sub txtFAX_LostFocus() + txtFAX = UCase(txtFAX) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPhone_LostFocus() +' If Len(txtPhone) > 0 Then +' txtPhone = Format(txtPhone, "### ### ####") +' End If +End Sub + +Private Sub CheckLots() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim oRSC As Recordset, strSql2 As String +Dim strSQL As String, intResponse As Integer, strMSG As String +Dim strSELECT As String, strGET As String, intID As Integer + + strSql2 = "SELECT Proj_id, Cont_id, Proj_desc FROM tblProject WHERE cont_id = " & mintCONTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockReadOnly + + Do Until oRSC.EOF + gintPROJID = oRSC!PROJ_ID + strSQL = "SELECT Lot_no FROM tblLotInfo where proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strMSG = "There have been Lots processed for this Subdivision." + strMSG = strMSG & vbCrLf & "You cannot delete this Project" + intResponse = MsgBox(strMSG, vbCritical & vbOKOnly, "Delete Error") + Exit Sub + End If + oRS.Close + + strSQL = "SELECT est_id FROM tblplans where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Plans in the database for this subdivision - " & oRSC!Proj_Desc + strMSG = strMSG & vbCrLf & "Do you want to Delete These Plans Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Plans Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!est_id + strGET = "SELECT optid FROM tblPOptions where estid = " & intID + Set oRSS = New Recordset + oRSS.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + If oRSS.RecordCount > 0 Then + Do Until oRSS.EOF + strGET = "DELETE * FROM tblPOMatrl where optid = " & oRSS!OPTID + goConn.Execute strGET + oRSS.MoveNext + Loop + End If + strGET = "DELETE * FROM tblPOptions where est_id = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblplanmat where est_id = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblPlans where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close +' Exit Sub + End If + End If + + + strSQL = "SELECT toid FROM tbltake where proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Takeoffs in the database for this subdivision - " & oRSC!Proj_Desc + strMSG = strMSG & vbCrLf & "Do you want to Delete These Takeoffs Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Takeoff Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!toid + strGET = "DELETE * FROM tbloption WHERE toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblOptMatrl where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblMeasure where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblTOMatrl where toid = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblTake where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close +' Exit Sub + End If + End If + oRSC.MoveNext + Loop + mboolDelete = True +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frm new file mode 100644 index 0000000..313ebce --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frm @@ -0,0 +1,457 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmContractor2 + Caption = "Contractor Information" + ClientHeight = 6240 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 6240 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 10380 + TabIndex = 8 + Top = 5640 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 6940 + TabIndex = 7 + Top = 5640 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3500 + TabIndex = 6 + Top = 5640 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 5640 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 5220 + Picture = "frmContractor2.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 5580 + Picture = "frmContractor2.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5925 + Picture = "frmContractor2.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 6285 + Picture = "frmContractor2.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5535 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 11700 + _ExtentX = 20638 + _ExtentY = 9763 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Contractor" + Columns(0).DataField= "contrcr" + Columns(0).DataWidth= 30 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Contact Person" + Columns(1).DataField= "contact" + Columns(1).DataWidth= 20 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Address 1" + Columns(2).DataField= "add1" + Columns(2).DataWidth= 20 + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Address2" + Columns(3).DataField= "add2" + Columns(3).DataWidth= 20 + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "City" + Columns(4).DataField= "city" + Columns(4).DataWidth= 20 + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "State" + Columns(5).DataField= "state" + Columns(5).DataWidth= 2 + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Zip" + Columns(6).DataField= "zip" + Columns(6).DataWidth= 5 + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 0 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "Office Phone" + Columns(7).DataField= "phone" + Columns(7).DataWidth= 13 + Columns(7).EditMask= "(###) ###-###" + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "FAX" + Columns(8).DataField= "fax" + Columns(8).DataWidth= 13 + Columns(8).EditMask= "(###) ###-####" + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(9)._VlistStyle= 0 + Columns(9)._MaxComboItems= 5 + Columns(9).Caption= "Cell" + Columns(9).DataField= "cell" + Columns(9).DataWidth= 13 + Columns(9).EditMask= "(###) ###-###" + Columns(9)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(10)._VlistStyle= 0 + Columns(10)._MaxComboItems= 5 + Columns(10).Caption= "Pager" + Columns(10).DataField= "pager" + Columns(10).DataWidth= 13 + Columns(10).EditMask= "(###) ###-###" + Columns(10)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(11)._VlistStyle= 0 + Columns(11)._MaxComboItems= 5 + Columns(11).Caption= "MAS90" + Columns(11).DataField= "ar" + Columns(11).DataWidth= 15 + Columns(11)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 12 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=12" + Splits(0)._ColumnProps(1)= "Column(0).Width=5054" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=4974" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=4445" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=4366" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=5054" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=4974" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=5424" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=5345" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=2725" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=2646" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=873" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=794" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1270" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1191" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1931" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1852" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1799" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1720" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits(0)._ColumnProps(37)= "Column(9).Width=1931" + Splits(0)._ColumnProps(38)= "Column(9).DividerColor=0" + Splits(0)._ColumnProps(39)= "Column(9)._WidthInPix=1852" + Splits(0)._ColumnProps(40)= "Column(9).Order=10" + Splits(0)._ColumnProps(41)= "Column(10).Width=1931" + Splits(0)._ColumnProps(42)= "Column(10).DividerColor=0" + Splits(0)._ColumnProps(43)= "Column(10)._WidthInPix=1852" + Splits(0)._ColumnProps(44)= "Column(10).Order=11" + Splits(0)._ColumnProps(45)= "Column(11).Width=1667" + Splits(0)._ColumnProps(46)= "Column(11).DividerColor=0" + Splits(0)._ColumnProps(47)= "Column(11)._WidthInPix=1588" + Splits(0)._ColumnProps(48)= "Column(11).Order=12" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(50) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(51) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(52) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(53) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(54) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(55) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(56) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(57) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(58) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(59) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(60) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(61) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(62) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(63) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(64) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(65) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(66) = "Splits(0).Columns(9).Style:id=74,.parent=13" + _StyleDefs(67) = "Splits(0).Columns(9).HeadingStyle:id=71,.parent=14" + _StyleDefs(68) = "Splits(0).Columns(9).FooterStyle:id=72,.parent=15" + _StyleDefs(69) = "Splits(0).Columns(9).EditorStyle:id=73,.parent=17" + _StyleDefs(70) = "Splits(0).Columns(10).Style:id=78,.parent=13" + _StyleDefs(71) = "Splits(0).Columns(10).HeadingStyle:id=75,.parent=14" + _StyleDefs(72) = "Splits(0).Columns(10).FooterStyle:id=76,.parent=15" + _StyleDefs(73) = "Splits(0).Columns(10).EditorStyle:id=77,.parent=17" + _StyleDefs(74) = "Splits(0).Columns(11).Style:id=82,.parent=13" + _StyleDefs(75) = "Splits(0).Columns(11).HeadingStyle:id=79,.parent=14" + _StyleDefs(76) = "Splits(0).Columns(11).FooterStyle:id=80,.parent=15" + _StyleDefs(77) = "Splits(0).Columns(11).EditorStyle:id=81,.parent=17" + _StyleDefs(78) = "Named:id=33:Normal" + _StyleDefs(79) = ":id=33,.parent=0" + _StyleDefs(80) = "Named:id=34:Heading" + _StyleDefs(81) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(82) = ":id=34,.wraptext=-1" + _StyleDefs(83) = "Named:id=35:Footing" + _StyleDefs(84) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(85) = "Named:id=36:Selected" + _StyleDefs(86) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(87) = "Named:id=37:Caption" + _StyleDefs(88) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(89) = "Named:id=38:HighlightRow" + _StyleDefs(90) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(91) = "Named:id=39:EvenRow" + _StyleDefs(92) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(93) = "Named:id=40:OddRow" + _StyleDefs(94) = ":id=40,.parent=33" + _StyleDefs(95) = "Named:id=41:RecordSelector" + _StyleDefs(96) = ":id=41,.parent=34" + _StyleDefs(97) = "Named:id=42:FilterBar" + _StyleDefs(98) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmContractor2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.AddNew + TDBGLabor.SetFocus + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Delete + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Update + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub Form_Load() + Err.Clear + On Error GoTo Error_EH + + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + Exit Sub + + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblConInfo ORDER by CONTRCR" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractor2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractorold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractorold.frm new file mode 100644 index 0000000..5bcc0b4 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmContractorold.frm @@ -0,0 +1,231 @@ +VERSION 5.00 +Begin VB.Form frmContractor1 + Caption = "Contractor Information" + ClientHeight = 5460 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9045 + LinkTopic = "Form1" + ScaleHeight = 5460 + ScaleWidth = 9045 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdCExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 7320 + TabIndex = 21 + Top = 4320 + Width = 1275 + End + Begin VB.CommandButton cmdCSave + Caption = "Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 5700 + TabIndex = 20 + Top = 4320 + Width = 1275 + End + Begin VB.CommandButton cmdCAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4140 + TabIndex = 19 + Top = 4320 + Width = 1275 + End + Begin VB.TextBox Text9 + Height = 315 + Left = 4800 + TabIndex = 18 + Top = 3720 + Width = 1635 + End + Begin VB.TextBox Text8 + Height = 315 + Left = 4800 + TabIndex = 17 + Top = 3300 + Width = 1635 + End + Begin VB.TextBox Text7 + Height = 315 + Left = 4800 + TabIndex = 16 + Top = 2880 + Width = 735 + End + Begin VB.TextBox Text6 + Height = 315 + Left = 4800 + TabIndex = 15 + Top = 2460 + Width = 3675 + End + Begin VB.TextBox txtCAdd2 + Height = 315 + Left = 4800 + TabIndex = 14 + Top = 2040 + Width = 3675 + End + Begin VB.TextBox txtCAdd1 + Height = 315 + Left = 4800 + TabIndex = 13 + Top = 1620 + Width = 3675 + End + Begin VB.TextBox txtCContact + Height = 315 + Left = 4800 + TabIndex = 12 + Top = 1200 + Width = 3675 + End + Begin VB.TextBox txtCName + Height = 315 + Left = 4800 + TabIndex = 11 + Top = 780 + Width = 3675 + End + Begin VB.TextBox txtCID + Height = 315 + Left = 4800 + TabIndex = 10 + Top = 360 + Width = 795 + End + Begin VB.ListBox lstContractor + Height = 4740 + Left = 240 + TabIndex = 0 + Top = 300 + Width = 3315 + End + Begin VB.Label lblCFAX + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "FAX Number:" + Height = 195 + Left = 3780 + TabIndex = 9 + Top = 3780 + Width = 945 + End + Begin VB.Label lblCOPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Office Phone:" + Height = 195 + Left = 3780 + TabIndex = 8 + Top = 3360 + Width = 975 + End + Begin VB.Label lblCState + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "State:" + Height = 195 + Left = 4320 + TabIndex = 7 + Top = 2940 + Width = 420 + End + Begin VB.Label lblCCity + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "City:" + Height = 195 + Left = 4380 + TabIndex = 6 + Top = 2460 + Width = 300 + End + Begin VB.Label lblCAdd2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address 2:" + Height = 195 + Left = 3960 + TabIndex = 5 + Top = 2100 + Width = 750 + End + Begin VB.Label lblCAdd1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address 1:" + Height = 195 + Left = 3960 + TabIndex = 4 + Top = 1680 + Width = 750 + End + Begin VB.Label lblCContact + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contact:" + Height = 195 + Left = 4140 + TabIndex = 3 + Top = 1260 + Width = 600 + End + Begin VB.Label lblCName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 4260 + TabIndex = 2 + Top = 780 + Width = 465 + End + Begin VB.Label lblCID + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ID:" + Height = 195 + Left = 4500 + TabIndex = 1 + Top = 420 + Width = 210 + End +End +Attribute VB_Name = "frmContractor1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frm new file mode 100644 index 0000000..95d3998 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frm @@ -0,0 +1,357 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmCrew + Caption = "Lath & Stucco Crews" + ClientHeight = 9195 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8025 + LinkTopic = "Form1" + ScaleHeight = 9195 + ScaleWidth = 8025 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 5220 + TabIndex = 8 + Top = 8280 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 3500 + TabIndex = 7 + Top = 8280 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 1780 + TabIndex = 6 + Top = 8280 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 8280 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 2640 + Picture = "frmCrew.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 8880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 3000 + Picture = "frmCrew.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 8880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 3345 + Picture = "frmCrew.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 8880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 3705 + Picture = "frmCrew.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 8880 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 8175 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 7860 + _ExtentX = 13864 + _ExtentY = 14420 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Crew #" + Columns(0).DataField= "Crew_id" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Crew Leader" + Columns(1).DataField= "crew_boss" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Phone" + Columns(2).DataField= "phone" + Columns(2).DataWidth= 10 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2).NumberFormat= "General Number" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 16 + Columns(3)._MaxComboItems= 5 + Columns(3).ValueItems(0)._DefaultItem= 0 + Columns(3).ValueItems(0).Value= "L" + Columns(3).ValueItems(0).Value.vt= 8 + Columns(3).ValueItems(0).DisplayValue= "Lath" + Columns(3).ValueItems(0).DisplayValue.vt= 8 + Columns(3).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems(1)._DefaultItem= 0 + Columns(3).ValueItems(1).Value= "S" + Columns(3).ValueItems(1).Value.vt= 8 + Columns(3).ValueItems(1).DisplayValue= "Stucco" + Columns(3).ValueItems(1).DisplayValue.vt= 8 + Columns(3).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems.Count= 2 + Columns(3).Caption= "Crew Type" + Columns(3).DataField= "type" + Columns(3).DataWidth= 1 + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 4 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=4" + Splits(0)._ColumnProps(1)= "Column(0).Width=1244" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1164" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=5741" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=5662" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1958" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1879" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=2725" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=2646" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(3)._MinWidth=24" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=50,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=47,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=48,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=49,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=28,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=25,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=26,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=27,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=32,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=29,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=30,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=31,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=46,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=43,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=44,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=45,.parent=17" + _StyleDefs(46) = "Named:id=33:Normal" + _StyleDefs(47) = ":id=33,.parent=0" + _StyleDefs(48) = "Named:id=34:Heading" + _StyleDefs(49) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(50) = ":id=34,.wraptext=-1" + _StyleDefs(51) = "Named:id=35:Footing" + _StyleDefs(52) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(53) = "Named:id=36:Selected" + _StyleDefs(54) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(55) = "Named:id=37:Caption" + _StyleDefs(56) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(57) = "Named:id=38:HighlightRow" + _StyleDefs(58) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(59) = "Named:id=39:EvenRow" + _StyleDefs(60) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(61) = "Named:id=40:OddRow" + _StyleDefs(62) = ":id=40,.parent=33" + _StyleDefs(63) = "Named:id=41:RecordSelector" + _StyleDefs(64) = ":id=41,.parent=34" + _StyleDefs(65) = "Named:id=42:FilterBar" + _StyleDefs(66) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmCrew" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.AddNew + TDBGLabor.SetFocus + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Delete + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Update + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub Form_Load() + Err.Clear + On Error GoTo Error_EH + + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + Exit Sub + + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblCrew" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrew.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewList.frm new file mode 100644 index 0000000..1549a0f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewList.frm @@ -0,0 +1,601 @@ +VERSION 5.00 +Begin VB.Form frmCrewList + Caption = "Payroll List" + ClientHeight = 5865 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9030 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 5865 + ScaleWidth = 9030 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtWCCODE + Height = 285 + Left = 7950 + TabIndex = 14 + Top = 4890 + Visible = 0 'False + Width = 510 + End + Begin VB.TextBox txtDept + Height = 375 + Left = 6480 + TabIndex = 13 + TabStop = 0 'False + Top = 5340 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtEmpName + Height = 315 + Left = 5100 + TabIndex = 12 + TabStop = 0 'False + Top = 4800 + Visible = 0 'False + Width = 1995 + End + Begin VB.CommandButton cmdAddName + Caption = "Add by Last Name" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 11 + TabStop = 0 'False + Top = 5280 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3300 + TabIndex = 5 + Top = 4620 + Width = 1275 + End + Begin VB.TextBox txtEmpId + Height = 375 + Left = 5100 + TabIndex = 8 + TabStop = 0 'False + Top = 5340 + Visible = 0 'False + Width = 1215 + End + Begin VB.ListBox lstCrew + Height = 3765 + Left = 4680 + Sorted = -1 'True + TabIndex = 6 + TabStop = 0 'False + Top = 780 + Width = 4215 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Member" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3300 + TabIndex = 4 + Top = 5280 + Width = 1275 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add by Number" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 3 + Top = 4620 + Width = 1275 + End + Begin VB.ListBox lstPayCrews + Height = 3765 + Left = 180 + TabIndex = 1 + Top = 780 + Width = 4455 + End + Begin VB.Label lblCrewName + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1320 + TabIndex = 10 + Top = 180 + Width = 2535 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 600 + TabIndex = 9 + Top = 180 + Width = 675 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired Crew Member listed below to add the Crew Member to the Crew List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5040 + TabIndex = 7 + Top = 60 + Width = 3435 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Crew Member List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 240 + TabIndex = 2 + Top = 540 + Width = 1515 + End + Begin VB.Label lblCrw + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 120 + TabIndex = 0 + Top = 240 + Width = 405 + End +End +Attribute VB_Name = "frmCrewList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset +Dim moRSMember As Recordset + +Dim mboolAdding As Boolean + +Private Sub GetCrew() +Dim strCREW As String +Dim oRS As Recordset + + strCREW = "SELECT * FROM tblCrew where CREW_id = " & gintCREWID + Set oRS = New Recordset + oRS.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + lblCrewId.Caption = gintCREWID + lblCrewName.Caption = oRS!Crew_Boss + Else + MsgBox "No Crew Was Found - Member Add Not Valid", vbOKOnly, "No Crew" + Unload Me + End If + +End Sub + +Private Sub GetMember() +Dim strCREW As String, strName As String +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + strName = Format(Field2Str(lstCrew.ItemData(lstCrew.ListIndex)), "0000000") + strCREW = "SELECT * FROM PR1_EmployeeMaster where EmployeeNumber = '" & strName & "'" +' strCREW = "SELECT Department, employeenumber, firstname, lastname, EmployeeStatus_AIT FROM PR1_EmployeeMaster where department = '52' and EmployeeNumber = '0004107'" '& strName & "'" + Set moRSMember = New Recordset + moRSMember.Open strCREW, goConn, adOpenKeyset, adLockOptimistic +' moRSMember.Open strCREW, goConn2, adOpenKeyset, adLockOptimistic + If moRSMember!Terminated <> "A" Then + MsgBox "This Employee is Terminated - Be Sure To Correct Before Entering Payroll", vbOKOnly, "Terminated Employee" + End If + + If moRSMember.EOF Then + MsgBox "Critial Error - No Crew Member Found - Call Darv", vbCritical + vbOKOnly, "Critical Error" + Unload Me + End If + +End Sub + +Private Sub cmdAdd_Click() +Dim intID As Double, strSQL As String, strID As String +Dim oRS As Recordset + cmdAdd.Enabled = False + cmdAddName.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = Field2Double(InputBox("Enter The Employee Number To Add", "Employee Number", 9999)) + If intID = 0 Then + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdAdd.SetFocus + Exit Sub + End If + If Len(intID) > 0 Then +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + strID = Format(intID, "0000000") +' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName, DefaultWCCode, Terminated FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Call CrewLoad + Else + txtEmpId = Field2Str(oRS!EmployeeNumber) + txtDept = Field2Str(oRS!department) + txtEmpName = Trim$(Field2Str(oRS!FirstName)) & " " & Trim$(Field2Str(oRS!LastName)) + txtWCCode = Field2Str(oRS!wc_code) + If oRS!Terminated <> "A" Then + MsgBox "This Employee is Terminated - Be Sure To Correct Before Entering Payroll", vbOKOnly, "Terminated Employee" + End If + Call FormSave + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdAdd.SetFocus + End If + + End If + +End Sub + +Private Sub cmdAddName_Click() +Dim strName As String, strSQL As String, strLine As String +Dim strSql2 As String, strSQL3 As String +Dim oRS As Recordset + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + cmdAdd.Enabled = False + cmdAddName.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + strName = InputBox("Enter The Employee Last Name To Add", "Employee Last Name") + If Len(strName) > 0 Then + strName = "lastname LIKE '" & Trim$(UCase(strName)) & "*'" + strSQL = "SELECT * FROM PR1_EmployeeMaster" +' strSQL = "SELECT Department, EmployeeNumber, LastName, DefaultWCCode, FirstName FROM PR1_EmployeeMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + oRS.Filter = strName + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + strLine = Trim$(Field2Str(oRS!FirstName)) & " " & Trim$(Field2Str(oRS!LastName)) + .AddItem strLine + .ItemData(.NewIndex) = oRS!EmployeeNumber + End With + oRS.MoveNext + Loop + + frmCrewList.Width = 9150 + Else + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + End If + +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblCrewList WHERE Crew_Id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + oRS.AddNew + End If + + + With oRS + !CREW_ID = Field2Str(lblCrewId) + !emp_dept = Field2Str(txtDept) + !Emp_ID = Field2Str(txtEmpId) + !EmpName = Left(Field2Str(txtEmpName), 30) + !wc_code = Field2Str(txtWCCode) + End With + + oRS.Update + + If mboolAdding Then + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form CrewList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + txtEmpId = "" + txtDept = "" + txtEmpName = "" + + Exit Sub + +Error_EH: + gstrMODULE = "Form CrewList - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() + +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblcrewlist WHERE crew_id = " & Field2Str(lblCrewId.Caption) & " ORDER BY emp_id" + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until moRSCREW.EOF + With lstPayCrews + strLine = Field2Str(moRSCREW!Emp_ID) & vbTab & Field2Str(moRSCREW!EmpName) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!Emp_ID + End With + + moRSCREW.MoveNext + Loop + moRSCREW.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + Else + lstPayCrews.ListIndex = -1 + cmdDelete.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form CrewList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + + strYN = MsgBox("Are You Sure You Want To Delete This Crew Member?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblcrewlist where Emp_id = '" & Format(lstPayCrews.ItemData(lstPayCrews.ListIndex), "0000000") & "' and crew_id = " & Field2Str(lblCrewId.Caption) + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "Form CrewList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + frmCrewList.Width = 4725 + Call GetCrew + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form CrewList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub CrewLoad() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + strSQL = "SELECT * FROM PR1_EmployeeMaster" +'' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName FROM PR1_EmployeeMaster" +' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName FROM PR1_EmployeeMaster Order BY LastName" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +'' moRSCREW.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + 'adOpenForwardOnly , adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + strLine = Trim$(Field2Str(moRSCREW!FirstName)) & " " & Trim$(Field2Str(moRSCREW!LastName)) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!EmployeeNumber + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmCrewList.Width = 9150 + frmCrewList.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form CrewList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_DblClick() + Call GetMember + txtEmpId = Field2Str(moRSMember!EmployeeNumber) + txtDept = Field2Str(moRSMember!department) + txtEmpName = Trim$(Field2Str(moRSMember!FirstName)) & " " & Trim$(Field2Str(moRSMember!LastName)) + txtWCCode = Field2Str(moRSMember!wc_code) + If moRSMember!Terminated <> "A" Then + MsgBox "This Employee is Terminated - Be Sure To Correct Before Entering Payroll", vbOKOnly, "Terminated Employee" + End If + frmCrewList.Width = 4725 + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + Call FormSave +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frm new file mode 100644 index 0000000..33905cd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frm @@ -0,0 +1,446 @@ +VERSION 5.00 +Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" +Begin VB.Form frmCrewOld + Caption = "Crew Information" + ClientHeight = 4245 + ClientLeft = 1110 + ClientTop = 345 + ClientWidth = 5745 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4245 + ScaleWidth = 5745 + Begin VB.PictureBox picButtons + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5745 + TabIndex = 7 + Top = 3645 + Width = 5745 + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 300 + Left = 1675 + TabIndex = 13 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update" + Height = 300 + Left = 290 + TabIndex = 12 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdClose + Caption = "&Close" + Height = 300 + Left = 4445 + TabIndex = 11 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Height = 300 + Left = 3060 + TabIndex = 10 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdEdit + Caption = "&Edit" + Height = 300 + Left = 1675 + TabIndex = 9 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 300 + Left = 290 + TabIndex = 8 + Top = 0 + Width = 1095 + End + End + Begin VB.PictureBox picStatBox + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5745 + TabIndex = 1 + Top = 3945 + Width = 5745 + Begin VB.CommandButton cmdLast + Height = 300 + Left = 4545 + Picture = "frmCrewold.frx":0000 + Style = 1 'Graphical + TabIndex = 5 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4200 + Picture = "frmCrewold.frx":0342 + Style = 1 'Graphical + TabIndex = 4 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 345 + Picture = "frmCrewold.frx":0684 + Style = 1 'Graphical + TabIndex = 3 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 0 + Picture = "frmCrewold.frx":09C6 + Style = 1 'Graphical + TabIndex = 2 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.Label lblStatus + BackColor = &H00FFFFFF& + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 690 + TabIndex = 6 + Top = 0 + Width = 3360 + End + End + Begin MSDataGridLib.DataGrid grdDataGrid + Align = 1 'Align Top + Height = 3495 + Left = 0 + TabIndex = 0 + Top = 0 + Width = 5745 + _ExtentX = 10134 + _ExtentY = 6165 + _Version = 393216 + AllowUpdate = -1 'True + HeadLines = 1 + RowHeight = 15 + AllowAddNew = -1 'True + AllowDelete = -1 'True + BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ColumnCount = 2 + BeginProperty Column00 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + BeginProperty Column01 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + SplitCount = 1 + BeginProperty Split0 + BeginProperty Column00 + EndProperty + BeginProperty Column01 + EndProperty + EndProperty + End +End +Attribute VB_Name = "frmCrewOld" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim WithEvents adoPrimaryRS As Recordset +Attribute adoPrimaryRS.VB_VarHelpID = -1 +Dim mbChangedByCode As Boolean +Dim mvBookMark As Variant +Dim mbEditFlag As Boolean +Dim mbAddNewFlag As Boolean +Dim mbDataChanged As Boolean + +Private Sub Form_Load() + Dim db As Connection + Set db = New Connection + db.CursorLocation = adUseClient + db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\VWP\VWP.mdb;" + + Set adoPrimaryRS = New Recordset + adoPrimaryRS.Open "select CREW_ID,CREW_BOSS,PHONE,TYPE from CREW Order by CREW_ID", db, adOpenStatic, adLockOptimistic + + Set grdDataGrid.DataSource = adoPrimaryRS + + + mbDataChanged = False +End Sub + +Private Sub Form_Resize() + On Error Resume Next + 'This will resize the grid when the form is resized + grdDataGrid.Height = Me.ScaleHeight - 30 - picButtons.Height - picStatBox.Height + lblStatus.Width = Me.Width - 1500 + cmdNext.Left = lblStatus.Width + 700 + cmdLast.Left = cmdNext.Left + 340 +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + If mbEditFlag Or mbAddNewFlag Then Exit Sub + + Select Case KeyCode + Case vbKeyEscape + cmdClose_Click + Case vbKeyEnd + cmdLast_Click + Case vbKeyHome + cmdFirst_Click + Case vbKeyUp, vbKeyPageUp + If Shift = vbCtrlMask Then + cmdFirst_Click + Else + cmdPrevious_Click + End If + Case vbKeyDown, vbKeyPageDown + If Shift = vbCtrlMask Then + cmdLast_Click + Else + cmdNext_Click + End If + End Select +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Screen.MousePointer = vbDefault +End Sub + +Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This will display the current record position for this recordset + lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition) +End Sub + +Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This is where you put validation code + 'This event gets called when the following actions occur + Dim bCancel As Boolean + + Select Case adReason + Case adRsnAddNew + Case adRsnClose + Case adRsnDelete + Case adRsnFirstChange + Case adRsnMove + Case adRsnRequery + Case adRsnResynch + Case adRsnUndoAddNew + Case adRsnUndoDelete + Case adRsnUndoUpdate + Case adRsnUpdate + End Select + + If bCancel Then adStatus = adStatusCancel +End Sub + +Private Sub cmdAdd_Click() + On Error GoTo AddErr + adoPrimaryRS.MoveLast + adoPrimaryRS.AddNew + grdDataGrid.SetFocus + + Exit Sub +AddErr: + MsgBox Err.Description +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo DeleteErr + With adoPrimaryRS + .Delete + .MoveNext + If .EOF Then .MoveLast + End With + Exit Sub +DeleteErr: + MsgBox Err.Description +End Sub + +Private Sub cmdEdit_Click() + On Error GoTo EditErr + + lblStatus.Caption = "Edit record" + mbEditFlag = True + SetButtons False + Exit Sub + +EditErr: + MsgBox Err.Description +End Sub +Private Sub cmdCancel_Click() + On Error Resume Next + + SetButtons True + mbEditFlag = False + mbAddNewFlag = False + adoPrimaryRS.CancelUpdate + If mvBookMark > 0 Then + adoPrimaryRS.Bookmark = mvBookMark + Else + adoPrimaryRS.MoveFirst + End If + mbDataChanged = False + +End Sub + +Private Sub cmdUpdate_Click() + On Error GoTo UpdateErr + + adoPrimaryRS.UpdateBatch adAffectAll + + If mbAddNewFlag Then + adoPrimaryRS.MoveLast 'move to the new record + End If + + mbEditFlag = False + mbAddNewFlag = False + SetButtons True + mbDataChanged = False + + Exit Sub +UpdateErr: + MsgBox Err.Description +End Sub + +Private Sub cmdClose_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + On Error GoTo GoFirstError + + adoPrimaryRS.MoveFirst + mbDataChanged = False + + Exit Sub + +GoFirstError: + MsgBox Err.Description +End Sub + +Private Sub cmdLast_Click() + On Error GoTo GoLastError + + adoPrimaryRS.MoveLast + mbDataChanged = False + + Exit Sub + +GoLastError: + MsgBox Err.Description +End Sub + +Private Sub cmdNext_Click() + On Error GoTo GoNextError + + If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext + If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveLast + End If + 'show the current record + mbDataChanged = False + + Exit Sub +GoNextError: + MsgBox Err.Description +End Sub + +Private Sub cmdPrevious_Click() + On Error GoTo GoPrevError + + If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious + If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveFirst + End If + 'show the current record + mbDataChanged = False + + Exit Sub + +GoPrevError: + MsgBox Err.Description +End Sub + +Private Sub SetButtons(bVal As Boolean) + cmdAdd.Visible = bVal + cmdEdit.Visible = bVal + cmdUpdate.Visible = Not bVal + cmdCancel.Visible = Not bVal + cmdDelete.Visible = bVal + cmdClose.Visible = bVal + cmdNext.Enabled = bVal + cmdFirst.Enabled = bVal + cmdLast.Enabled = bVal + cmdPrevious.Enabled = bVal +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frx new file mode 100644 index 0000000..cd06a6e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewold.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frm new file mode 100644 index 0000000..cc27212 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frm @@ -0,0 +1,2940 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmCrews + BorderStyle = 1 'Fixed Single + Caption = "Lath and Stucco Crews" + ClientHeight = 8490 + ClientLeft = 150 + ClientTop = 435 + ClientWidth = 15105 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8490 + ScaleWidth = 15105 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkPhxRate + Caption = "Phx Rate" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7395 + TabIndex = 67 + Top = 5115 + Visible = 0 'False + Width = 1125 + End + Begin VB.CheckBox chkTucRate + Caption = "Tucson Rate" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7395 + TabIndex = 66 + Top = 4857 + Visible = 0 'False + Width = 1395 + End + Begin VB.CheckBox chkBOTH + Caption = "Crew For Both" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 7395 + TabIndex = 65 + Top = 4568 + Visible = 0 'False + Width = 1380 + End + Begin VB.CheckBox chkPHX + Caption = "Phx Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 7395 + TabIndex = 64 + Top = 4339 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkTucson + Caption = "Tucson Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7395 + TabIndex = 63 + Top = 4065 + Visible = 0 'False + Width = 1305 + End + Begin VB.CheckBox chkHrly + Caption = "Hourly Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5145 + TabIndex = 62 + Top = 30 + Visible = 0 'False + Width = 1350 + End + Begin VB.TextBox txtTOTRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7410 + TabIndex = 57 + Top = 3780 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtTRRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7410 + TabIndex = 56 + Top = 3240 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPOTRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7410 + TabIndex = 55 + Top = 2670 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPRRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7410 + TabIndex = 54 + Top = 2130 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtBRN + Height = 285 + Left = 6390 + TabIndex = 50 + Top = 4620 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtTEXTURE + Height = 285 + Left = 6390 + TabIndex = 49 + Top = 4905 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSCR + Height = 285 + Left = 6390 + TabIndex = 48 + Top = 4335 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtProjCode + BackColor = &H8000000F& + Enabled = 0 'False + Height = 285 + Left = 6060 + MaxLength = 6 + TabIndex = 46 + Top = 1260 + Width = 930 + End + Begin VB.CheckBox chkAllRates + Caption = "All Proj Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7350 + TabIndex = 45 + Top = 5670 + Width = 1425 + End + Begin VB.CheckBox chkAllCrew + Caption = "All Crews" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7350 + TabIndex = 44 + Top = 5475 + Width = 1335 + End + Begin VB.CheckBox chkRateInactive + Caption = "Rate Inactive" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 7515 + TabIndex = 43 + Top = 45 + Width = 1380 + End + Begin VB.CommandButton cmdDelProj + Caption = "Delete Project" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 42 + Top = 5340 + Visible = 0 'False + Width = 990 + End + Begin VB.CommandButton cmdClose + Caption = "Close Project" + Enabled = 0 'False + Height = 555 + Left = 7455 + TabIndex = 41 + Top = 5910 + Width = 990 + End + Begin VB.CommandButton cmdSave2 + Caption = "Save Project" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 26 + Top = 5910 + Width = 990 + End + Begin VB.CommandButton cmdAddProj + Caption = "Add Project" + Enabled = 0 'False + Height = 555 + Left = 5070 + TabIndex = 38 + Top = 5910 + Width = 990 + End + Begin VB.CheckBox chkRates + Caption = "Show Project Rates" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7695 + TabIndex = 37 + Top = 945 + Value = 1 'Checked + Visible = 0 'False + Width = 720 + End + Begin LpLib.fpList lstProj + Height = 2055 + Left = 75 + TabIndex = 33 + Top = 6165 + Width = 4875 + _Version = 196608 + _ExtentX = 8599 + _ExtentY = 3625 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrews.frx":0000 + End + Begin VB.CheckBox chkINACTIVE + Caption = "Inactive Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 7515 + TabIndex = 32 + Top = 330 + Width = 1470 + End + Begin VB.TextBox txtEmpNo + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + TabIndex = 17 + Top = 1860 + Width = 975 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 7455 + TabIndex = 29 + TabStop = 0 'False + Top = 6480 + Width = 990 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Crew" + Enabled = 0 'False + Height = 555 + Left = 6270 + TabIndex = 27 + Top = 6480 + Width = 990 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + Enabled = 0 'False + Height = 555 + Left = 5070 + TabIndex = 28 + TabStop = 0 'False + Top = 6480 + Width = 990 + End + Begin VB.TextBox txtDA + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 24 + Top = 3780 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtQU + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 23 + Top = 3525 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSB + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 25 + Top = 4050 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMN + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 22 + Top = 3240 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSM + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 21 + Top = 2955 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSA + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 20 + Top = 2670 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 19 + Top = 2385 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6390 + MaxLength = 9 + TabIndex = 18 + Top = 2130 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6060 + MaxLength = 10 + TabIndex = 16 + Top = 960 + Width = 1575 + End + Begin VB.TextBox txtCrewBoss + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6060 + MaxLength = 30 + TabIndex = 15 + Top = 660 + Width = 3435 + End + Begin VB.ComboBox cboType + Height = 315 + ItemData = "frmCrews.frx":039F + Left = 3180 + List = "frmCrews.frx":03B5 + Style = 2 'Dropdown List + TabIndex = 2 + Top = 60 + Width = 1755 + End + Begin VB.ListBox lstCrew + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 5520 + Left = 75 + Sorted = -1 'True + TabIndex = 0 + Top = 495 + Width = 4875 + End + Begin LpLib.fpList lstCProj + Height = 6915 + Left = 8820 + TabIndex = 39 + Top = 1560 + Visible = 0 'False + Width = 6285 + _Version = 196608 + _ExtentX = 11086 + _ExtentY = 12197 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmCrews.frx":03ED + End + Begin VB.TextBox txtProjDesc + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6060 + TabIndex = 35 + Top = 1560 + Width = 3435 + End + Begin Crystal.CrystalReport crCrew + Left = -15 + Top = 45 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.Label lblTOTRate + AutoSize = -1 'True + Caption = "Tuc OT Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7410 + TabIndex = 61 + Top = 3570 + Visible = 0 'False + Width = 990 + End + Begin VB.Label lblTRRate + AutoSize = -1 'True + Caption = "Tuc Reg Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7410 + TabIndex = 60 + Top = 3000 + Visible = 0 'False + Width = 1065 + End + Begin VB.Label lblOTRate + AutoSize = -1 'True + Caption = "Phx OT Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7410 + TabIndex = 59 + Top = 2460 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblRegRate + AutoSize = -1 'True + Caption = "Phx Reg Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7410 + TabIndex = 58 + Top = 1920 + Visible = 0 'False + Width = 1050 + End + Begin VB.Label lblTCTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Three C Tex:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5370 + TabIndex = 53 + Top = 4950 + Visible = 0 'False + Width = 930 + End + Begin VB.Label lblTCBRN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Three C Brown:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5190 + TabIndex = 52 + Top = 4665 + Visible = 0 'False + Width = 1110 + End + Begin VB.Label lblTCSCR + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Three C Scratch:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5085 + TabIndex = 51 + Top = 4380 + Visible = 0 'False + Width = 1215 + End + Begin VB.Label lblProjCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Code:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5010 + TabIndex = 47 + Top = 1260 + Width = 960 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Select The Crew Type To Display A List:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 2865 + End + Begin VB.Label lblProjInst + BackColor = &H00C0FFFF& + Caption = $"frmCrews.frx":0784 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1245 + Left = 9645 + TabIndex = 40 + Top = 15 + Width = 5490 + End + Begin VB.Label lblProjName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5430 + TabIndex = 36 + Top = 1590 + Width = 540 + End + Begin VB.Label lblProjID + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7110 + TabIndex = 34 + Top = 1260 + Width = 1860 + End + Begin VB.Label lblEmpNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Employee No:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5310 + TabIndex = 31 + Top = 1920 + Width = 990 + End + Begin VB.Label lblInstructions + Caption = $"frmCrews.frx":086D + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1320 + Left = 5040 + TabIndex = 30 + Top = 7050 + Width = 4545 + End + Begin VB.Label lblDA + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Dash Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5520 + TabIndex = 14 + Top = 3840 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6435 + TabIndex = 13 + Top = 285 + Width = 975 + End + Begin VB.Label lblQU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quernavaca Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5010 + TabIndex = 12 + Top = 3585 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblSB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5235 + TabIndex = 11 + Top = 4110 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblMN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5190 + TabIndex = 10 + Top = 3300 + Visible = 0 'False + Width = 1140 + End + Begin VB.Label lblSmooth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Smooth Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5370 + TabIndex = 9 + Top = 3045 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5535 + TabIndex = 8 + Top = 2760 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5505 + TabIndex = 7 + Top = 2235 + Visible = 0 'False + Width = 825 + End + Begin VB.Label lblPrimRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5580 + TabIndex = 6 + Top = 2505 + Visible = 0 'False + Width = 750 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone #:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5325 + TabIndex = 5 + Top = 1020 + Width = 660 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Leader:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5055 + TabIndex = 4 + Top = 720 + Width = 945 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew #:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5820 + TabIndex = 3 + Top = 345 + Width = 555 + End +End +Attribute VB_Name = "frmCrews" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset, moRSPRATE As Recordset, moRSCREWRATE As Recordset +Dim mintCREW As Integer, mlngProj As Long, mlngRATE As Long +Dim mboolAdding As Boolean, mboolNEW As Boolean, mintNCREW As Integer +Dim mboolHOURLY As Boolean + +' lstCREW Height 3960 or 7470 +' need to make it so the save keys work for just crews and for projects. +' make sure that if there is a project labor rate then that displays not the +' default labor rate. +' + +Private Sub cboType_Click() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If + +End Sub + +Private Sub LoadCProj() +Dim strSQL As String, oRS As Recordset, strLine As String + + cmdAddProj.Enabled = False + cmdSave.Enabled = True + + strSQL = "SELECT Proj_ID,Proj_Code, Proj_Desc, Proj_Cont FROM tblProject WHERE GotBid and Not Complete" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + frmCrews.Left = 0 + frmCrews.Width = 15225 + + lstCProj.Clear + + Do Until oRS.EOF + strLine = Field2Str2(oRS!PROJ_ID) & vbTab & Field2Str(oRS!Proj_Code) & vbTab & Field2Str(oRS!Proj_Cont) & vbTab & Field2Str(oRS!Proj_Desc) + lstCProj.AddItem strLine + + oRS.MoveNext + + Loop + +End Sub + +Private Sub chkAllCrew_Click() + If chkAllCrew = vbChecked Then + chkAllCrew.BackColor = &HC0FFFF + chkAllCrew.ForeColor = &HFF& + If cboType.ListIndex <> -1 Then + Call CrewLoad + End If + Else + chkAllCrew.BackColor = &H8000000F + chkAllCrew.ForeColor = &H80000012 + If cboType.ListIndex <> -1 Then + Call CrewLoad + End If + End If +End Sub + +Private Sub chkAllRates_Click() + If chkAllRates = vbChecked Then + chkAllRates.BackColor = &HC0FFFF + chkAllRates.ForeColor = &HFF& + If cboType.ListIndex <> -1 Then + Call ProjLoad + End If + Else + chkAllRates.BackColor = &H8000000F + chkAllRates.ForeColor = &H80000012 + If cboType.ListIndex <> -1 Then + Call ProjLoad + End If + End If + +End Sub + +Private Sub chkRates_Click() +Dim intBOOKMARK As Integer + + If cboType.ListIndex <> -1 Then + intBOOKMARK = lstCrew.ListIndex + If chkRates = vbChecked Then +' lstCrew.Enabled = False + lstCrew.Height = 3960 + lstProj.Visible = True + txtProjCode.Visible = True + lblProjCode.Visible = True + txtProjDesc = "" + cmdAdd.Enabled = False + cmdAddProj.Enabled = True + Call ProjLoad + End If + + If chkRates = vbUnchecked Then + lstProj.ListIndex = -1 + lstCrew.Enabled = True + If cmdClose.Enabled = True Then + cmdClose.Enabled = False + Call FormShowCrew + End If + lstCProj.Visible = False + lblInstructions.Visible = True + cmdExit.Visible = True + frmCrews.Width = 9750 + lstCrew.Height = 7470 + lstProj.Visible = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "Default Pay Rates for This Crew" + cmdAdd.Enabled = True + cmdAddProj.Enabled = False + End If + + If lstCrew.Enabled <> False Or lstProj.ListCount = 0 Then + Call CrewLoad + End If + lstCrew.ListIndex = intBOOKMARK + Else + chkRates = vbUnchecked + MsgBox "Must Select A Crew Type Before Clicking Rate Checkbox", vbOKOnly, "Crew Type Required" + End If +' Call ProjLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + cmdAddProj.Enabled = False + cmdSave2 = False + mboolAdding = True + mboolNEW = True + Call FormClear +' Call FormClearP + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdAddProj_Click() +' frmCrews.Width = 0 + lstCProj.Visible = True + cmdAdd.Enabled = False + cmdSave.Enabled = False + cmdSave2.Enabled = True +' cmdExit.Visible = False + cmdExit.Visible = True + lblInstructions.Visible = False + cmdClose.Enabled = True + Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdClose_Click() +' frmCrews.Width = 0 + lstCProj.Visible = False + cmdExit.Visible = True + frmCrews.Width = 9750 + If lstProj.Visible <> True Then + lstCrew.Height = 5520 + Else + lstCrew.Height = 5520 + End If + lblInstructions.Visible = True + lstCProj.Clear + lstCrew.Enabled = True + lstCrew.SetFocus + cmdAdd.Enabled = True + cmdClose.Enabled = False + txtProjCode.Visible = False + lblProjCode.Visible = False + txtProjDesc = "" +' txtProjDesc = "Default Pay Rates for This Crew" + If lstProj.ListCount > 0 Then + Call lstProj_Click + Else + Call lstCrew_Click ' **** may need to change this to lstproj_click if lstproj.listcount > 0 + End If +' Call LoadCProj +' frmProjCur.Show +End Sub + +Private Sub cmdDelProj_Click() +Dim lngRATEID As Long, strSQLD As String +Dim intYN As Integer + lstProj.col = 0 + lngRATEID = CLng(lstProj.ColText) + + intYN = MsgBox("Do You Want To Delete This Project From This Crew (Y/N)?", vbYesNo, "Delete?") + If intYN = vbYes Then + strSQLD = "DELETE * FROM tblCREWRATE WHERE RATE_ID = " & lngRATEID + goConn.Execute strSQLD + cmdDelProj.Enabled = False + cmdSave2.Enabled = False + cmdAddProj.Enabled = True + Else + cmdDelProj.Enabled = False + cmdSave.Enabled = False + cmdAddProj.Enabled = True + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +'Private Sub cmdPrint_Click() +' lstCrew.Enabled = True +' cmdAdd.Enabled = True +' cmdSave.Enabled = False +' cmdPrint.Enabled = False +' lblPrintInfo.Visible = False +' lblBegDate.Visible = False +' lblEndDate.Visible = False +' txtBegDate.Visible = False +' txtEndDate.Visible = False +' Call PrintPay +'End Sub + +Private Sub cmdSave_Click() +Dim intBOOKMARK As Integer + + intBOOKMARK = lstCrew.ListIndex + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False +' cmdPrint.Enabled = False +' lblPrintInfo.Visible = False +' lblBegDate.Visible = False +' lblEndDate.Visible = False +' txtBegDate.Visible = False +' txtEndDate.Visible = False + Call FormSave + If lstCrew.ListCount >= intBOOKMARK + 1 Then + lstCrew.ListIndex = intBOOKMARK + End If +End Sub + +Private Sub cmdSave2_Click() +Dim intBOOKMARK As Integer + + intBOOKMARK = lstProj.ListIndex + lstProj.Enabled = True +' cmdAdd.Enabled = True +' cmdAddProj.Enabled = True + cmdAddProj.Enabled = False + cmdDelProj.Enabled = False + cmdSave2.Enabled = False +' cmdPrint.Enabled = False +' lblPrintInfo.Visible = False +' lblBegDate.Visible = False +' lblEndDate.Visible = False +' txtBegDate.Visible = False +' txtEndDate.Visible = False + txtMetal.Enabled = False + txtPrimRate.Enabled = False + txtSA.Enabled = False + txtSM.Enabled = False + txtMN.Enabled = False + txtQU.Enabled = False + txtDA.Enabled = False + txtSB.Enabled = False + Call FormSave2 + lstProj.ListIndex = intBOOKMARK + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + frmCrews.Width = 9750 + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + mboolAdding = False + mboolNEW = False + + frmCrews.Caption = "All Crews Except Repair - " & gstrLOGIN +' lstCrew.Height = 7470 +' lstProj.Visible = False +' txtProjDesc = "Default Pay Rates for This Crew" + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If chkAllCrew = vbChecked Then + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE type = '" & Left$(cboType, 1) & "'" + ElseIf chkAllCrew = vbUnchecked Then + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE Inactive = False and type = '" & Left$(cboType, 1) & "'" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + If (Field2Str2(oRS!CREW_ID) = 1049 Or Field2Str2(oRS!CREW_ID) = 1094) Then + + Else + If Len(Field2Str(oRS!Crew_Boss)) < 14 Then + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) + ElseIf Len(Field2Str(oRS!Crew_Boss)) > 20 Then + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) + Else + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!CREW_ID + End If + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim oRSS As Recordset +Dim strSQLR As String, intCREWID As Integer +Dim strLine As String, intTEST As Integer + + On Error GoTo Error_EH + + intCREWID = lstCrew.ItemData(lstCrew.ListIndex) + If chkAllRates = vbChecked Then + strSQLR = "SELECT rate_id, proj_id, proj_code, proj_desc, crew_id FROM tblCREWRATE WHERE crew_id = " & intCREWID + ElseIf chkAllRates = vbUnchecked Then + strSQLR = "SELECT rate_id, proj_id, proj_code, proj_desc, crew_id FROM tblCREWRATE WHERE not INACTIVE and crew_id = " & intCREWID + End If + Set oRSS = New Recordset + oRSS.Open strSQLR, goConn, adOpenForwardOnly, adLockReadOnly + + lstProj.Clear + + Do Until oRSS.EOF + With lstProj + strLine = Field2Str2(oRSS!Rate_id) & vbTab & " " & Field2Str(oRSS!Proj_Code) & vbTab & Field2Str(oRSS!Proj_Desc) & vbTab & Field2Str2(oRSS!PROJ_ID) ' & vbTab & Field2Str2(oRSS!Rate_id) + .AddItem strLine + + End With + + oRSS.MoveNext + Loop + + If lstProj.ListCount Then + lstProj.ListIndex = 0 + Else + lstProj.ListIndex = -1 + Call FormClearP + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCrew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + + If moRSCREW.EOF Then + FormFindCrew = False + mboolHOURLY = False + Else + FormFindCrew = True + If moRSCREW!Hourly Then + mboolHOURLY = True + Else + mboolHOURLY = False + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindProj() As Boolean +Dim strSQL As String, lngRATEID As Long + On Error GoTo Error_EH + +' strSQL = "SELECT * " +' strSQL = strSQL & "FROM tblCREWRATE " +' strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + +' Set moRSCREW = New Recordset +' moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + lstProj.col = 4 + lngRATEID = Field2Long(lstProj.ColText) + + strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID + Set moRSPRATE = New Recordset + moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + If moRSPRATE.EOF Then +' If moRSCREW.EOF Then + FormFindProj = False +' FormFindCrew = False + Else + FormFindProj = True +' FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowProj() +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH +' lstProj.col = 4 +' lngRATEID = Field2Long(lstProj.ColText) + +' strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID +' Set moRSPRATE = New Recordset +' moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSPRATE + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + lblSand.Caption = "Wrap:" + lblSmooth.Caption = "Wrap-Lath Rate:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = True + lblSmooth.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False +' if mboolhourly and + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + lblSand.Caption = "Sand:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + txtSCR.Visible = True + lblTCSCR.Visible = True + txtBRN.Visible = True + lblTCBRN.Visible = True + txtTEXTURE.Visible = True + lblTCTexture.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + ElseIf Left$(cboType, 1) = "Q" Then + lblPrimRate.Caption = "Rate:" + lblSand.Visible = False + txtSA.Visible = False +' lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False +' txtSA.Visible = True +' lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + ElseIf Left$(cboType, 1) = "X" Then + lblPrimRate.Caption = "Rate:" + lblSand.Visible = False + txtSA.Visible = False +' lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkPhxRate.Visible = True + chkTucRate.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False +' txtSA.Visible = True +' lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!CREW_ID) + txtCrewBoss = Field2Str(!Crew_Boss) +' txtPhone = Field2Str(!phone) +' txtEmpNo = Field2Str(!EmpNo) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtSCR = Format(Field2Str2(!scr), "#0.00") + txtBRN = Format(Field2Str2(!brn), "#0.00") + txtTEXTURE = Format(Field2Str2(!tex), "#0.00") +' txtPRRate = Format(Field2Str2(!PReg), "#0.00") +' txtPOTRate = Format(Field2Str2(!POT), "#0.00") +' txtTRRate = Format(Field2Str2(!TReg), "#0.00") +' txtTOTRate = Format(Field2Str2(!TOT), "#0.00") + txtProjCode = Field2Str(!Proj_Code) + txtProjDesc = Field2Str(!Proj_Desc) + chkRateInactive = Field2CheckBox(!inactive) + chkTucRate = Field2CheckBox(!TusR) + chkPhxRate = Field2CheckBox(!PHXR) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowProj" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowCrew() +Dim strSQL As String, lngRATEID As Long +Dim oRS As Recordset + + On Error GoTo Error_EH +' lstProj.col = 4 +' lngRATEID = Field2Long(lstProj.ColText) + +' strSQL = "SELECT * FROM tblCREWRATE WHERE Rate_ID = " & lngRATEID +' Set moRSPRATE = New Recordset +' moRSPRATE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + With moRSCREW + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + lblSand.Caption = "Wrap:" + lblSmooth.Caption = "Wrap-Lath Rate:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + lblSand.Visible = True + txtSA.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False +' txtSA.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + If mboolHOURLY Then + lblRegRate.Visible = True + txtPRRate.Visible = True + lblOTRate.Visible = True + txtPOTRate.Visible = True + lblTRRate.Visible = True + txtTRRate.Visible = True + lblTOTRate.Visible = True + txtTOTRate.Visible = True + Else + lblRegRate.Visible = False + txtPRRate.Visible = False + lblOTRate.Visible = False + txtPOTRate.Visible = False + lblTRRate.Visible = False + txtTRRate.Visible = False + lblTOTRate.Visible = False + txtTOTRate.Visible = False + End If + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + lblSand.Caption = "Sand:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + txtSCR.Visible = True + lblTCSCR.Visible = True + txtBRN.Visible = True + lblTCBRN.Visible = True + txtTEXTURE.Visible = True + lblTCTexture.Visible = True + If mboolHOURLY Then + lblRegRate.Visible = True + txtPRRate.Visible = True + lblOTRate.Visible = True + txtPOTRate.Visible = True + lblTRRate.Visible = True + txtTRRate.Visible = True + lblTOTRate.Visible = True + txtTOTRate.Visible = True + Else + lblRegRate.Visible = False + txtPRRate.Visible = False + lblOTRate.Visible = False + txtPOTRate.Visible = False + lblTRRate.Visible = False + txtTRRate.Visible = False + lblTOTRate.Visible = False + txtTOTRate.Visible = False + End If + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + If mboolHOURLY Then + lblRegRate.Visible = True + txtPRRate.Visible = True + lblOTRate.Visible = True + txtPOTRate.Visible = True + lblTRRate.Visible = True + txtTRRate.Visible = True + lblTOTRate.Visible = True + txtTOTRate.Visible = True + Else + lblRegRate.Visible = False + txtPRRate.Visible = False + lblOTRate.Visible = False + txtPOTRate.Visible = False + lblTRRate.Visible = False + txtTRRate.Visible = False + lblTOTRate.Visible = False + txtTOTRate.Visible = False + End If + End If + ElseIf Left$(cboType, 1) = "Q" Then + lblPrimRate.Caption = "Rate:" + lblSand.Visible = False + txtSA.Visible = False +' lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False +' txtSA.Visible = False +' lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + ElseIf Left$(cboType, 1) = "X" Then + lblPrimRate.Caption = "Rate:" + lblSand.Visible = False + txtSA.Visible = False +' lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + chkTucson.Visible = True + chkPHX.Visible = True + chkBOTH.Visible = True + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False +' txtSA.Visible = True +' lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + txtSCR.Visible = False + lblTCSCR.Visible = False + txtBRN.Visible = False + lblTCBRN.Visible = False + txtTEXTURE.Visible = False + lblTCTexture.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!CREW_ID) + txtCrewBoss = Field2Str(!Crew_Boss) + txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EmpNo) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + txtSCR = Format(Field2Str2(!scr), "#0.00") + txtBRN = Format(Field2Str2(!brn), "#0.00") + txtTEXTURE = Format(Field2Str2(!tex), "#0.00") +' txtPRRate = Format(Field2Str2(!PReg), "#0.00") +' txtPOTRate = Format(Field2Str2(!PReg), "#0.00") +' txtPRRate = Format(Field2Str2(!PReg), "#0.00") +' txtPRRate = Format(Field2Str2(!PReg), "#0.00") + txtProjDesc = "Default Pay Rates for This Crew" + chkINACTIVE = Field2CheckBox(!inactive) + chkTucson = Field2CheckBox(!Tucson) + chkPHX = Field2CheckBox(!PHX) + chkBOTH = Field2CheckBox(!BOTH) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClearC() ' ****Find Out Everwhere this sub is called + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtMetal = 0 + txtPrimRate = 0 + txtSA = 0 + txtSM = 0 + txtMN = 0 + txtQU = 0 + txtDA = 0 + txtSB = 0 + txtSCR = 0 + txtBRN = 0 + txtTEXTURE = 0 + txtPRRate = 0 + txtPOTRate = 0 + txtTRRate = 0 + txtTOTRate = 0 + txtProjCode = "" + txtProjDesc = "" + chkINACTIVE = vbUnchecked + chkRateInactive = vbUnchecked +End Sub + +Private Sub FormClearP() ' ****Find Out Everwhere this sub is called +' lblCrewId.Caption = "" +' txtCrewBoss = "" +' txtPhone = "" +' txtEmpNo = "" + txtMetal = 0 + txtPrimRate = 0 + txtSA = 0 + txtSM = 0 + txtMN = 0 + txtQU = 0 + txtDA = 0 + txtSB = 0 + txtSCR = 0 + txtBRN = 0 + txtTEXTURE = 0 + txtPRRate = 0 + txtPOTRate = 0 + txtTRRate = 0 + txtTOTRate = 0 + txtProjCode = "" + txtProjDesc = "" +' chkINACTIVE = vbUnchecked + chkRateInactive = vbUnchecked +End Sub + +Private Sub FormClear() ' ****Find Out Everwhere this sub is called + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtMetal = 0 + txtPrimRate = 0 + txtSA = 0 + txtSM = 0 + txtMN = 0 + txtQU = 0 + txtDA = 0 + txtSB = 0 + txtSCR = 0 + txtBRN = 0 + txtTEXTURE = 0 + txtPRRate = 0 + txtPOTRate = 0 + txtTRRate = 0 + txtTOTRate = 0 + txtProjCode = "" + txtProjDesc = "" + chkINACTIVE = vbUnchecked + chkRateInactive = vbUnchecked +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String +Dim oRSMAX As Recordset +Dim strSQL As String + + On Error GoTo 0 +' On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !Crew_Boss = Str2Field(txtCrewBoss) + !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !scr = Str2Field(txtSCR) + !brn = Str2Field(txtBRN) + !tex = Str2Field(txtTEXTURE) + !EmpNo = Format(Field2Str2(txtEmpNo), "0000000") + !inactive = chkINACTIVE + !Tucson = chkTucson + !PHX = chkPHX + !BOTH = chkBOTH +' !BiWeekly = chkBiWeekly + End With +' test = moRSCREW.EditMode + moRSCREW.Update + +' Call CrewLoad + + If mboolNEW Then + + strSQL = "SELECT Max(CREW_ID) as MAXCrewID from tblCrew" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintNCREW = oRSMAX!maxCrewID + oRSMAX.Close + + moRSPRATE.AddNew + moRSPRATE!C_USER = gstrLOGIN + moRSPRATE!Create = Date + moRSPRATE!PROJ_ID = 99999 + moRSPRATE!Proj_Code = "BASIC" + moRSPRATE!Proj_Desc = "DEFAULT PAY RATE" + moRSPRATE!CREW_ID = mintNCREW + moRSPRATE!U_USER = gstrLOGIN + moRSPRATE!Update = Date + moRSPRATE!Crew_Boss = Str2Field(txtCrewBoss) + moRSPRATE!Type = Left$(Str2Field(cboType), 1) + moRSPRATE!METAL = Str2Field(txtMetal) + moRSPRATE!lath_skip = Str2Field(txtPrimRate) + moRSPRATE!sand = Str2Field(txtSA) + moRSPRATE!qu = Str2Field(txtQU) + moRSPRATE!dash = Str2Field(txtDA) + moRSPRATE!Smooth = Str2Field(txtSM) + moRSPRATE!syn = Str2Field(txtSB) + moRSPRATE!mn = Str2Field(txtMN) + moRSPRATE!scr = Str2Field(txtSCR) + moRSPRATE!brn = Str2Field(txtBRN) + moRSPRATE!tex = Str2Field(txtTEXTURE) + moRSPRATE!EmpNo = Format(Field2Str2(txtEmpNo), "0000000") + moRSPRATE!inactive = chkRateInactive + moRSPRATE.Update + End If + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + Else + Call CrewLoad + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSaveP() +Dim strLOT As String, test As String + On Error GoTo 0 +' On Error GoTo Error_EH +' If mboolNEW Then +' moRSPRATE.AddNew +' moRSPRATE!C_USER = gstrLOGIN +' moRSPRATE!Create = Date +' moRSPRATE!PROJ_ID = 99999 +' moRSPRATE!PROJ_CODE = "BASIC" +' moRSPRATE!PROJ_DESC = "DEFAULT PAY RATE" +' moRSPRATE!CREW_ID = mintNCREW +' End If + With moRSPRATE + !U_USER = gstrLOGIN + !Update = Date + !Crew_Boss = Str2Field(txtCrewBoss) +' !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !scr = Str2Field(txtSCR) + !brn = Str2Field(txtBRN) + !tex = Str2Field(txtTEXTURE) + !EmpNo = Format(Field2Str2(txtEmpNo), "0000000") + !inactive = chkRateInactive + !TusR = chkTucRate + !PHXR = chkPhxRate +' !EMPNO = Format(Field2Str2(txtEmpNo), "0000000") +' !inactive = chkINACTIVE +' !BiWeekly = chkBiWeekly + End With +' test = moRSCREW.EditMode + moRSPRATE.Update + + Call ProjLoad + + If mboolAdding Then + Call ProjLoad + If FormFindProj() Then + Call FormShowProj + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Rate Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSaveP" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + If mboolNEW Then + mboolNEW = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormSave2() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSCREW.AddNew +' moRSCREW!C_USER = gstrLOGIN +' End If + + ' Store the controls to the recordset + Call FieldsSaveP + + +' If mboolAdding Then +' mboolAdding = False +' End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPRATE.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCProj_DblClick() +Dim strSQL As String, oRS As Recordset, intBOOKMARK As Integer +Dim strPROJID As String, strPROJCODE As String, strPROJDESC As String + + On Error GoTo Error_EH + strSQL = "SELECT * FROM tblCREWRATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + lstCProj.col = 1 + strPROJCODE = lstCProj.ColText + lstCProj.col = 0 + strPROJID = lstCProj.ColText + lstCProj.col = 3 + strPROJDESC = lstCProj.ColText + + If Not oRS.EOF Then + oRS.AddNew + oRS!CREW_ID = Field2Str2(moRSCREW!CREW_ID) + oRS!Crew_Boss = Field2Str(moRSCREW!Crew_Boss) + oRS!Type = Field2Str(moRSCREW!Type) + oRS!METAL = 0 + oRS!lath_skip = 0 + oRS!sand = 0 + oRS!Smooth = 0 + oRS!mn = 0 + oRS!dash = 0 + oRS!syn = 0 + oRS!qu = 0 + oRS!scr = 0 + oRS!brn = 0 + oRS!tex = 0 +' oRS!METAL = Field2Str2(moRSCREW!METAL) +' oRS!lath_skip = Field2Str(moRSCREW!lath_skip) +' oRS!sand = Field2Str2(moRSCREW!sand) +' oRS!Smooth = Field2Str2(moRSCREW!Smooth) +' oRS!mn = Field2Str2(moRSCREW!mn) +' oRS!dash = Field2Str2(moRSCREW!dash) +' oRS!syn = Field2Str2(moRSCREW!syn) +' oRS!qu = Field2Str2(moRSCREW!qu) + oRS!Current = Field2Str(moRSCREW!Current) + oRS!EmpNo = Field2Str2(moRSCREW!EmpNo) + oRS!Create = Date + oRS!C_USER = gstrLOGIN + oRS!PROJ_ID = strPROJID + oRS!Proj_Code = strPROJCODE + oRS!Proj_Desc = strPROJDESC + oRS.Update + End If + intBOOKMARK = lstProj.ListIndex + Call ProjLoad + lstProj.ListIndex = intBOOKMARK + Exit Sub + +Error_EH: + If Err = -2147467259 Then + MsgBox "This Project Is A Duplicate For This Crew - Select Again", vbOKOnly, "Duplicate Project" +' oRS.Close + Exit Sub + End If + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) +' If mboolHOURLY Then +' chkHrly.BackColor = &H8080FF +' Else +' chkHrly.BackColor = &H8000000F +' End If + Call ProjLoad + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() +' txtBegDate = "" +' txtEndDate = "" + cmdAdd.Enabled = True +' cmdAdd.Enabled = False + cmdAddProj.Enabled = False +' cmdPrint.Enabled = True + cmdSave.Enabled = True + cmdSave2.Enabled = False +' lblPrintInfo.Visible = True +' lblBegDate.Visible = True +' lblEndDate.Visible = True +' txtBegDate.Visible = True +' txtEndDate.Visible = True + txtCrewBoss.SetFocus +End Sub + +Private Sub lstProj_Click() + On Error GoTo Error_EH + + If lstProj.ListIndex <> -1 Then + If FormFindProj() Then + Call FormShowProj +' mintCREW = lstProj.ItemData(lstProj.ListIndex) + Else + lstProj.Clear + Call FormClearP + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstProj_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstProj_DblClick() +' txtBegDate = "" +' txtEndDate = "" +' cmdAddProj.Enabled = False + cmdAddProj.Enabled = True + cmdDelProj.Enabled = True + cmdSave2.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = False + txtMetal.Enabled = True + txtPrimRate.Enabled = True + txtSA.Enabled = True + txtSM.Enabled = True + txtMN.Enabled = True + txtQU.Enabled = True + txtDA.Enabled = True + txtSB.Enabled = True +' txtProjCode = "" +' txtProjDesc = "" +' lblPrintInfo.Visible = True +' lblBegDate.Visible = True +' lblEndDate.Visible = True +' txtBegDate.Visible = True +' txtEndDate.Visible = True +' txtCrewBoss.SetFocus + txtPrimRate.SetFocus + +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + +Private Sub txtDA_GotFocus() + Call FieldSelect(txtDA) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtMetal_GotFocus() + Call FieldSelect(txtMetal) +End Sub + +Private Sub txtMN_GotFocus() + Call FieldSelect(txtMN) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub txtQU_GotFocus() + Call FieldSelect(txtQU) +End Sub + +Private Sub txtSA_GotFocus() + Call FieldSelect(txtSA) +End Sub + +Private Sub txtSB_GotFocus() + Call FieldSelect(txtSB) +End Sub + +Private Sub txtSM_GotFocus() + Call FieldSelect(txtSM) +End Sub + +'Private Sub PrintPay() +'Dim strDate As String, strSQL As String, intSUP As Integer +'Dim oRS As Recordset, intYN As Integer +'Dim strSELECT As String +'Dim strBegDate As String, strEndDate As String +'Dim intBYear As String, intBMonth As String, intBDay As String +'Dim intEYear As String, intEMonth As String, intEDay As String +' On Error GoTo Error_EH + +' gboolPRINT = True +' intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") +' If gboolPRINT Then +' intBYear = Mid(txtBegDate, 7, 4) +' intBDay = Format(Mid(txtBegDate, 4, 2), "00") +' intBMonth = Format(Mid(txtBegDate, 1, 2), "00") +' intEYear = Mid(txtEndDate, 7, 4) +' intEDay = Format(Mid(txtEndDate, 4, 2), "00") +' intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + +' crCrew.ReportFileName = App.Path & "\CrewPayByDate.rpt" + +' crCrew.Formulas(3) = "Z_BegDate = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" +' crCrew.Formulas(4) = "Z_Crew = " & mintCREW +' crCrew.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + +' If intYN = vbYes Then +' crCrew.Destination = crptToPrinter +' Else +' crCrew.Destination = crptToWindow +' End If +' crCrew.Action = 1 + +' gboolPRINT = False +' End If + +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form Crew - Module PrintPay" +' Call ErrorHandler2 +' gstrMODULE = "" + +' Exit Sub +'End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frx new file mode 100644 index 0000000..43d721f Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrews.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frm new file mode 100644 index 0000000..1543d7d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frm @@ -0,0 +1,1133 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmCrewsOLD + Caption = "Lath and Stucco Crews" + ClientHeight = 7830 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7830 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdAddProj + Caption = "Add Project" + Height = 360 + Left = 10335 + TabIndex = 39 + Top = 5505 + Width = 990 + End + Begin VB.CheckBox chkBiWeekly + Caption = "Bi Weekly PR" + Height = 210 + Left = 9435 + TabIndex = 38 + Top = 375 + Width = 1500 + End + Begin VB.CheckBox chkINACTIVE + Caption = "Inactive Crew" + Height = 330 + Left = 9435 + TabIndex = 37 + Top = 600 + Width = 1470 + End + Begin Crystal.CrystalReport crCrew + Left = 4995 + Top = 30 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtEndDate + Height = 300 + Left = 9345 + TabIndex = 34 + Top = 2625 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 300 + Left = 9345 + TabIndex = 33 + Top = 2085 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Pay List" + Enabled = 0 'False + Height = 555 + Left = 9135 + TabIndex = 35 + ToolTipText = "Enter Dates Before Printing" + Top = 5895 + Width = 990 + End + Begin VB.TextBox txtEmpNo + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + TabIndex = 17 + Top = 1800 + Width = 975 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 10335 + TabIndex = 28 + TabStop = 0 'False + Top = 5895 + Width = 990 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + Height = 555 + Left = 7950 + TabIndex = 26 + Top = 5895 + Width = 990 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Enabled = 0 'False + Height = 555 + Left = 6750 + TabIndex = 27 + TabStop = 0 'False + Top = 5895 + Width = 990 + End + Begin VB.TextBox txtDA + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 24 + Top = 4320 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtQU + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 23 + Top = 3960 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSB + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 25 + Top = 4680 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMN + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 22 + Top = 3600 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSM + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 21 + Top = 3240 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSA + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 20 + Top = 2880 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 19 + Top = 2520 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Height = 315 + Left = 8160 + MaxLength = 9 + TabIndex = 18 + Top = 2160 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + Height = 285 + Left = 8160 + MaxLength = 10 + TabIndex = 16 + Top = 1440 + Width = 1575 + End + Begin VB.TextBox txtCrewBoss + Height = 315 + Left = 7800 + MaxLength = 30 + TabIndex = 15 + Top = 1020 + Width = 3435 + End + Begin VB.ComboBox cboType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmCrewsOLD.frx":0000 + Left = 3180 + List = "frmCrewsOLD.frx":0019 + Style = 2 'Dropdown List + TabIndex = 2 + Top = 75 + Width = 1755 + End + Begin VB.ListBox lstCrew + Height = 4935 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 525 + Width = 6465 + End + Begin VB.Label lblProjDesc + Height = 285 + Left = 7665 + TabIndex = 41 + Top = 5130 + Width = 3675 + End + Begin VB.Label lblProjCode + Height = 285 + Left = 6735 + TabIndex = 40 + Top = 5145 + Width = 795 + End + Begin VB.Label lblPrintInfo + Caption = $"frmCrewsOLD.frx":005C + ForeColor = &H000000FF& + Height = 1230 + Left = 9330 + TabIndex = 36 + Top = 2970 + Visible = 0 'False + Width = 1785 + End + Begin VB.Label lblEndDate + AutoSize = -1 'True + Caption = "Ending Print Date:" + Height = 195 + Left = 9345 + TabIndex = 32 + Top = 2415 + Visible = 0 'False + Width = 1290 + End + Begin VB.Label lblBegDate + AutoSize = -1 'True + Caption = "Beginning Print Date:" + Height = 195 + Left = 9345 + TabIndex = 31 + Top = 1845 + Visible = 0 'False + Width = 1500 + End + Begin VB.Label lblEmpNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Employee No:" + Height = 195 + Left = 7080 + TabIndex = 30 + Top = 1860 + Width = 990 + End + Begin VB.Label lblInstructions + Caption = $"frmCrewsOLD.frx":00F7 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1275 + Left = 6735 + TabIndex = 29 + Top = 6555 + Width = 4605 + End + Begin VB.Label lblDA + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Dash Rate:" + Height = 195 + Left = 7290 + TabIndex = 14 + Top = 4380 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8160 + TabIndex = 13 + Top = 600 + Width = 975 + End + Begin VB.Label lblQU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quernavaca Rate:" + Height = 195 + Left = 6780 + TabIndex = 12 + Top = 4020 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblSB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Rate:" + Height = 195 + Left = 7005 + TabIndex = 11 + Top = 4740 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblMN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey Rate:" + Height = 195 + Left = 6960 + TabIndex = 10 + Top = 3615 + Visible = 0 'False + Width = 1140 + End + Begin VB.Label lblSmooth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Smooth Rate:" + Height = 195 + Left = 7125 + TabIndex = 9 + Top = 3330 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Rate:" + Height = 195 + Left = 7290 + TabIndex = 8 + Top = 2970 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 7275 + TabIndex = 7 + Top = 2265 + Visible = 0 'False + Width = 825 + End + Begin VB.Label lblPrimRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Rate:" + Height = 195 + Left = 7350 + TabIndex = 6 + Top = 2625 + Visible = 0 'False + Width = 750 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone #:" + Height = 195 + Left = 7440 + TabIndex = 5 + Top = 1500 + Width = 660 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Leader:" + Height = 195 + Left = 6795 + TabIndex = 4 + Top = 1080 + Width = 945 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew #:" + Height = 195 + Left = 7545 + TabIndex = 3 + Top = 660 + Width = 555 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Select The Crew Type To Display A List:" + ForeColor = &H000000FF& + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 2865 + End +End +Attribute VB_Name = "frmCrewsOLD" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset +Dim mintCREW As Integer +Dim mboolAdding As Boolean + + +Private Sub cboType_Change() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If +End Sub + +Private Sub cboType_Click() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If + +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + mboolAdding = True + Call FormClear + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdAddProj_Click() + Call AddLot +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call PrintPay +End Sub + +Private Sub cmdSave_Click() +Dim intBOOKMARK As Integer + + intBOOKMARK = lstCrew.ListIndex + lstCrew.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdPrint.Enabled = False + lblPrintInfo.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + Call FormSave + lstCrew.ListIndex = intBOOKMARK +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE type = '" & Left$(cboType, 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + If Len(Field2Str(oRS!Crew_Boss)) < 14 Then + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) +' strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!Crew_ID) + ElseIf Len(Field2Str(oRS!Crew_Boss)) > 20 Then + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) +' strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!Crew_ID) + Else + strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!CREW_ID) +' strLine = Format(Field2Str(oRS!Crew_Boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!Crew_ID) + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!CREW_ID + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCrew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' adOpenKeyset , adLockOptimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + ElseIf Left$(cboType, 1) = "V" Then + lblPrimRate.Caption = "Stone:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "C" Then + lblPrimRate.Caption = "Up:" + lblSand.Caption = "Down:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + End If + lblCrewId.Caption = Field2Str(!CREW_ID) + txtCrewBoss = Field2Str(!Crew_Boss) + txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!EmpNo) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!Smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + chkINACTIVE = Field2CheckBox(!inactive) +' chkBiWeekly = Field2CheckBox(!BiWeekly) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtPrimRate = 0 + txtMetal = 0 + txtSA = 0 + txtSM = 0 + txtQU = 0 + txtDA = 0 + txtMN = 0 + txtSB = 0 + chkINACTIVE = vbUnchecked +' chkBiWeekly = vbUnchecked +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo 0 + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !Crew_Boss = Str2Field(txtCrewBoss) + !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !Smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !EmpNo = Format(Field2Str2(txtEmpNo), "0000000") + !inactive = chkINACTIVE +' !BiWeekly = chkBiWeekly + End With + test = moRSCREW.EditMode + moRSCREW.Update + + Call CrewLoad + + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + txtBegDate = "" + txtEndDate = "" + cmdAdd.Enabled = False +' cmdPrint.Enabled = True + cmdSave.Enabled = True + lblPrintInfo.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + txtCrewBoss.SetFocus +End Sub + +Private Sub txtBegDate_GotFocus() + Call FieldSelect(txtBegDate) +End Sub + +Private Sub txtBegDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBegDate, "/", 1) + If Not IsDate(txtBegDate) Then + If lngPOS = 0 Then + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBegDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBegDate.SetFocus + End If + End If + +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + +Private Sub txtDA_GotFocus() + Call FieldSelect(txtDA) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtEndDate_GotFocus() + Call FieldSelect(txtEndDate) +End Sub + +Private Sub txtEndDate_LostFocus() +Dim lngPOS As Long + If txtBegDate <> "" Or Len(txtBegDate) > 0 Then + If Not IsDate(txtBegDate) Then + MsgBox "You Must Enter A Valid Date In The Beginning Date Field", , "Invalid Date - ReEnter" + txtEndDate = "" + txtBegDate.SetFocus + Exit Sub + End If + End If + lngPOS = InStr(1, txtEndDate, "/", 1) + If Not IsDate(txtEndDate) Then + If lngPOS = 0 Then + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtEndDate.SetFocus + ElseIf txtEndDate < txtBegDate Then + MsgBox "Ending Date cannot be earlier than the Beginning Date" + txtEndDate.SetFocus + Else + cmdPrint.Enabled = True + cmdPrint.SetFocus + lstCrew.Enabled = False + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtEndDate.SetFocus + End If + End If + +' cmdPrint.Enabled = True +End Sub + +Private Sub txtMetal_GotFocus() + Call FieldSelect(txtMetal) +End Sub + +Private Sub txtMN_GotFocus() + Call FieldSelect(txtMN) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub txtQU_GotFocus() + Call FieldSelect(txtQU) +End Sub + +Private Sub txtSA_GotFocus() + Call FieldSelect(txtSA) +End Sub + +Private Sub txtSB_GotFocus() + Call FieldSelect(txtSB) +End Sub + +Private Sub txtSM_GotFocus() + Call FieldSelect(txtSM) +End Sub + +Private Sub PrintPay() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + intBYear = Mid(txtBegDate, 7, 4) + intBDay = Format(Mid(txtBegDate, 4, 2), "00") + intBMonth = Format(Mid(txtBegDate, 1, 2), "00") + intEYear = Mid(txtEndDate, 7, 4) + intEDay = Format(Mid(txtEndDate, 4, 2), "00") + intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crCrew.ReportFileName = App.Path & "\CrewPayByDate.rpt" + + crCrew.Formulas(3) = "Z_BegDate = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" + crCrew.Formulas(4) = "Z_Crew = " & mintCREW + crCrew.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crCrew.Destination = crptToPrinter + Else + crCrew.Destination = crptToWindow + End If + crCrew.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Crew - Module PrintPay" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub AddLot() +Dim strProj As String, strSQL As String, intPROJ As Integer +Dim strLine As String +Dim oRS As Recordset, oRSS As Recordset + + strProj = InputBox("Enter the Project Code 'JPAR' for the Lot Your Want To Add", "Enter Project Code") + If Len(strProj) > 0 Then + strProj = UCase(strProj) + strSQL = "SELECT proj_id FROM tblProject WHERE proj_code = '" & Field2Str(strProj) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + frmProjList.txtSearch = strProj + frmProjList.Show 1 + + Else + gintPROJID = Field2Long(oRS!PROJ_ID) + End If + strSQL = "SELECT Lot_No, Lot_id, Address FROM tblLotInfo where proj_id = " & gintPROJID + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' lstLots.Clear +' lstLots.Visible = True +' Do Until oRSS.EOF +' With lstLots +' strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRSS!address) +' .AddItem strLine +' .ItemData(.NewIndex) = oRSS!Lot_id +' End With + +' oRSS.MoveNext +' Loop +' If lstLots.ListCount Then +' lblSelect.Visible = True +' lblCtrl.Visible = True +' lstLots.ListIndex = 0 +' End If + +' lstLots.SetFocus + + Else + MsgBox "You Must Enter A Project Code", vbOKOnly, "No Project Code" +' cmdAddLot.SetFocus + Exit Sub + End If + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frx new file mode 100644 index 0000000..6ff926a Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmCrewsOLD.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEPElevNotUsed.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEPElevNotUsed.frm new file mode 100644 index 0000000..71cec77 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEPElevNotUsed.frm @@ -0,0 +1,128 @@ +VERSION 5.00 +Object = "{32B82FD1-3332-11D4-BF7C-E4453F764218}#1.0#0"; "EASYP.OCX" +Begin VB.Form frmEPElev + Caption = "Print Elevation" + ClientHeight = 1005 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4680 + LinkTopic = "Form1" + ScaleHeight = 1005 + ScaleWidth = 4680 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkFound + Caption = "Pics Found" + Height = 315 + Left = 1980 + TabIndex = 2 + Top = 480 + Visible = 0 'False + Width = 735 + End + Begin EasyP.EasyPrint epElevation + Left = 3960 + Top = 360 + _ExtentX = 847 + _ExtentY = 847 + ErrorMessagesOn = 0 'False + PrintingMethod = 4 + End + Begin VB.PictureBox picElevation + AutoRedraw = -1 'True + AutoSize = -1 'True + Height = 255 + Left = 360 + ScaleHeight = 195 + ScaleWidth = 795 + TabIndex = 0 + Top = 420 + Visible = 0 'False + Width = 855 + End + Begin VB.Label lblElevation + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Printing Lot Elevations Please Be Patient" + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 915 + Left = 120 + TabIndex = 1 + Top = 0 + Width = 4395 + End +End +Attribute VB_Name = "frmEPElev" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolJPG As Boolean +Dim moRSElev As Recordset + +Private Sub Form_Activate() + PrintJPG + Unload Me +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String, strFLAG As String + + strSQL = "SELECT * FROM tblLotElev where lot_id = " & gintLOTID +' strSQL = "SELECT * FROM tblElevation where Est_id = " & gintESTID + Set moRSElev = New Recordset + moRSElev.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSElev.EOF Then + chkFound = vbUnchecked + Else + PrintJPG + End If + +End Sub + +Private Sub picElevation_Change() + mboolJPG = True +End Sub + +Private Sub PrintJPG() +Dim strSQL As String, oRS As Recordset, strFile As String + + On Error GoTo Error_EH: + + mboolJPG = False + + Do Until moRSElev.EOF + strFile = App.Path & "\" & Field2Str(moRSElev!folder) & "\" & Field2Str(moRSElev!FileName) & ".jpg" + picElevation.Picture = LoadPicture(strFile) + epElevation.Margin(epTop) = 0.2 + Set epElevation.PictureSource = picElevation + epElevation.epPrint + moRSElev.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form EPElev - Module PrintJPG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmElevPicNotUsed.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmElevPicNotUsed.frm new file mode 100644 index 0000000..87db0a0 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmElevPicNotUsed.frm @@ -0,0 +1,473 @@ +VERSION 5.00 +Begin VB.Form frmElevPic + Caption = "Picture File Name" + ClientHeight = 3450 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 5910 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 3450 + ScaleWidth = 5910 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkPrimary + Caption = "Front Elevation" + Height = 315 + Left = 3360 + TabIndex = 1 + Top = 360 + Width = 1935 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 525 + Left = 4740 + TabIndex = 11 + TabStop = 0 'False + Top = 2880 + Width = 1035 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete File" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 525 + Left = 3360 + TabIndex = 10 + TabStop = 0 'False + Top = 2880 + Width = 1035 + End + Begin VB.CommandButton cmdSave + Caption = "&Save File" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 525 + Left = 4740 + TabIndex = 4 + Top = 2280 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add File" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 525 + Left = 3360 + TabIndex = 9 + TabStop = 0 'False + Top = 2280 + Width = 1035 + End + Begin VB.TextBox txtFileName + Height = 375 + Left = 3360 + TabIndex = 3 + Top = 1800 + Width = 2415 + End + Begin VB.TextBox txtFolder + Height = 375 + Left = 3360 + TabIndex = 2 + Top = 1080 + Width = 2415 + End + Begin VB.ListBox lstFile + Height = 2595 + Left = 120 + TabIndex = 0 + Top = 780 + Width = 2955 + End + Begin VB.Label lblFile + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "File Name:" + Height = 195 + Left = 3420 + TabIndex = 8 + Top = 1560 + Width = 750 + End + Begin VB.Label lblFolder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Folder Name:" + Height = 195 + Left = 3420 + TabIndex = 7 + Top = 840 + Width = 945 + End + Begin VB.Label lblPic + AutoSize = -1 'True + Caption = "File Name List" + Height = 195 + Left = 120 + TabIndex = 6 + Top = 480 + Width = 990 + End + Begin VB.Label lblModElev + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 120 + TabIndex = 5 + Top = 60 + Width = 1755 + End +End +Attribute VB_Name = "frmElevPic" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSFILE As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer +Dim mstrType As String, mstrMODEL As String +Dim mintESTID As Integer, mintFILEID As Integer +Dim mintOPTID As Integer, mintLOTID As Integer +Dim mstrSQL As String + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstFile.ListIndex + cmdExit.Enabled = True + cmdAdd.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstFile.Enabled = True + lstFile.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + cmdDelete.Enabled = False + mboolAdding = True + Call FormClear + txtFolder.SetFocus +End Sub + +Private Sub cmdDelete_Click() + cmdSave.Enabled = False + cmdDelete.Enabled = False + cmdAdd.Enabled = True + moRSFILE.Delete + Call FileLoad +End Sub + +Private Sub FileLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(2) As Long + + aTabs(0) = 10 + aTabs(1) = 200 +' aTabs(2) = 40 +' aTabs(3) = 90 +' aTabs(4) = 110 + + strSQL = "SELECT * from tblElevation WHERE Est_ID = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstFile.hwnd, LB_SETTABSTOPS, 2, 50) + + lstFile.Clear + lstFile.Visible = True + + Do Until oRS.EOF + With lstFile +' mintCREW = Field2Integer(oRS!crew_id) + strLine = oRS!folder & vbTab & oRS!FileName +' strLine = strLine & vbTab & oRS!paydt +' strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = oRS!file_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstFile.ListCount Then + lstFile.ListIndex = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Set moRSFILE = New Recordset + + Call FileLoad +' If FormFind() Then +' Call ProjectSelect +' Call LotSelect +' Call FormShow +' Else +' Call FormClear +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ElevPic - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblElevation " + strSQL = strSQL & "WHERE file_ID = " & mintFILEID 'lstFile.ItemData(lstFile.ListIndex) + + Set moRSFILE = New Recordset + moRSFILE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSFILE.EOF Then + FormFind = False + Else + FormFind = True +' gintLOTID = Field2Str2(moRSFILE!Lot_id) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ElevPic - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + mboolSHOW = True + strSQL = "Select * FROM tblPlans WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lblModElev.Caption = Trim(Field2Str(oRS!mod_elv)) + + With moRSFILE + txtFolder = Field2Str(!folder) + txtFileName = Field2Str(!FileName) + chkPrimary = Field2CheckBox(!Primary) + End With + + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form ElevPic - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strFile As String, strField As String +Dim strLOT As String + On Error GoTo Error_EH + + With moRSFILE + !folder = Str2Field(txtFolder) + !FileName = Str2Field(txtFileName) + !Primary = chkPrimary + End With + + moRSFILE.Update + If mboolAdding Then + 'strfile ='' + mintFILEID = FindMax("tblElevation", "file_id") + End If + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") +' If Len(strLOT) > 0 Then +' moRS!lot_no = Field2Str(strLOT) +' moRS.Update +' txtLotNo = Field2Str(strLOT) +' End If + Resume Next + End If + gstrMODULE = "Form ElevPic - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtFolder = "" + txtFileName = "" + chkPrimary = vbUnchecked + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSFILE.AddNew + moRSFILE!est_id = gintESTID + End If + + ' Store the controls to the recordset + Call FieldsSave + + moRSFILE.Update + + Call FileLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form ElevPic - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSFILE.State = adStateOpen Then + moRSFILE.Close + End If + +End Sub + +Private Sub lstFile_Click() + On Error GoTo Error_EH + + If lstFile.ListIndex <> -1 Then + mintFILEID = lstFile.ItemData(lstFile.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ElevPic - Module lstFile_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstFile_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + If lstFile.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tblElevation WHERE est_id = 1" + Set moRSFILE = New Recordset + moRSFILE.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAdd_Click + Else + Unload Me + End If + End If +End Sub + +Private Sub txtFileName_GotFocus() + Call FieldSelect(txtFileName) +End Sub + +Private Sub txtFileName_LostFocus() + txtFileName = UCase(txtFileName) +End Sub + +Private Sub txtFolder_GotFocus() + Call FieldSelect(txtFolder) +End Sub + +Private Sub txtFolder_LostFocus() + txtFolder = UCase(txtFolder) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frm new file mode 100644 index 0000000..bfb9c39 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frm @@ -0,0 +1,1515 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmEmployee + Caption = "Employee Information" + ClientHeight = 5445 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7545 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5445 + ScaleWidth = 7545 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtNewCMS + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 2220 + TabIndex = 36 + Top = 1470 + Width = 1035 + End + Begin VB.CheckBox chkRENUM + Caption = "Renum CMS" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3345 + TabIndex = 35 + Top = 1545 + Width = 1575 + End + Begin VB.TextBox txtCMS2 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5115 + TabIndex = 13 + Top = 2100 + Width = 585 + End + Begin VB.TextBox txtRTRate2 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6045 + TabIndex = 14 + Top = 2100 + Width = 600 + End + Begin VB.TextBox txtOTRate2 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6885 + TabIndex = 15 + Top = 2100 + Width = 600 + End + Begin VB.TextBox txtCMS1 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5115 + TabIndex = 10 + Top = 1770 + Width = 585 + End + Begin VB.CheckBox chkHrly + Alignment = 1 'Right Justify + Caption = "Hourly" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3090 + TabIndex = 9 + Top = 870 + Width = 765 + End + Begin VB.TextBox txtOTRate + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6870 + TabIndex = 12 + Top = 1770 + Width = 600 + End + Begin VB.TextBox txtRTRate + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6045 + TabIndex = 11 + Top = 1770 + Width = 600 + End + Begin VB.ComboBox cboWCCode + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmEmployee.frx":0000 + Left = 1935 + List = "frmEmployee.frx":0010 + Style = 2 'Dropdown List + TabIndex = 7 + Top = 300 + Width = 1035 + End + Begin Crystal.CrystalReport crEmpList + Left = 4335 + Top = 1935 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print" + Height = 465 + Left = 2235 + TabIndex = 31 + Top = 1845 + Width = 900 + End + Begin VB.TextBox txtSS + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4095 + MaxLength = 9 + TabIndex = 8 + Top = 585 + Width = 2595 + End + Begin VB.ComboBox cboSort + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmEmployee.frx":0038 + Left = 90 + List = "frmEmployee.frx":0048 + Style = 2 'Dropdown List + TabIndex = 29 + Top = 1095 + Width = 2220 + End + Begin VB.TextBox txtSearch + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3900 + TabIndex = 28 + Top = 1110 + Width = 3435 + End + Begin VB.TextBox txtStatus + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 585 + TabIndex = 6 + Top = 300 + Width = 480 + End + Begin VB.TextBox txtWCCode + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 2400 + TabIndex = 5 + Top = 1110 + Visible = 0 'False + Width = 1035 + End + Begin VB.TextBox txtFName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4095 + MaxLength = 20 + TabIndex = 4 + Top = 300 + Width = 3405 + End + Begin VB.TextBox txtLName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4095 + MaxLength = 50 + TabIndex = 3 + Top = 15 + Width = 3405 + End + Begin VB.TextBox txtEmpNo + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 1935 + MaxLength = 7 + TabIndex = 2 + Top = 15 + Width = 1035 + End + Begin VB.TextBox txtDept + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 585 + TabIndex = 1 + Top = 15 + Width = 480 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 465 + Left = 3315 + TabIndex = 18 + Top = 1845 + Width = 900 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + Height = 465 + Left = 1170 + TabIndex = 16 + Top = 1845 + Width = 900 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 465 + Left = 90 + TabIndex = 17 + Top = 1845 + Width = 900 + End + Begin LpLib.fpList lstEmpList + Height = 2565 + Left = 60 + TabIndex = 0 + Top = 2415 + Width = 7410 + _Version = 196608 + _ExtentX = 13070 + _ExtentY = 4524 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 195 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmEmployee.frx":0075 + End + Begin VB.Label lblNewCMS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New CMS Number:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 825 + TabIndex = 37 + Top = 1500 + Width = 1365 + End + Begin VB.Label lblCMSCd + AutoSize = -1 'True + Caption = "CMS Pay Cd" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4935 + TabIndex = 34 + Top = 1530 + Width = 900 + End + Begin VB.Label lblRTRate + AutoSize = -1 'True + Caption = "Reg Rate:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5970 + TabIndex = 33 + Top = 1530 + Width = 735 + End + Begin VB.Label lblOTRate + AutoSize = -1 'True + Caption = "OT Rate" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6870 + TabIndex = 32 + Top = 1530 + Width = 615 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "SS #: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3570 + TabIndex = 30 + Top = 660 + Width = 450 + End + Begin VB.Label lblSearch + AutoSize = -1 'True + Caption = "Enter Employee No Search Info:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3900 + TabIndex = 27 + Top = 885 + Width = 2280 + End + Begin VB.Label lblSort + AutoSize = -1 'True + Caption = "Sort Field:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 26 + Top = 885 + Width = 705 + End + Begin VB.Label lblIntr + Alignment = 2 'Center + Caption = "Double Click Hi-Lited Selection To Edit" + ForeColor = &H000000FF& + Height = 285 + Left = 180 + TabIndex = 25 + Top = 5070 + Width = 7215 + End + Begin VB.Label lblStatus + AutoSize = -1 'True + Caption = "A / I:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 180 + TabIndex = 24 + Top = 360 + Width = 360 + End + Begin VB.Label lblWCCode + AutoSize = -1 'True + Caption = "WC Code:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1155 + TabIndex = 23 + Top = 360 + Width = 735 + End + Begin VB.Label lblFName + AutoSize = -1 'True + Caption = "First Name:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3225 + TabIndex = 22 + Top = 360 + Width = 795 + End + Begin VB.Label lblLName + AutoSize = -1 'True + Caption = "Last Name:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3240 + TabIndex = 21 + Top = 75 + Width = 810 + End + Begin VB.Label lblEmpNo + AutoSize = -1 'True + Caption = "Emp No:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1275 + TabIndex = 20 + Top = 75 + Width = 615 + End + Begin VB.Label lblDept + AutoSize = -1 'True + Caption = "Dept:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 19 + Top = 75 + Width = 390 + End +End +Attribute VB_Name = "frmEmployee" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mboolSHOW As Boolean, mboolADD As Boolean +Dim moRSEMP As Recordset, mintBOOKMARK As Integer +Dim mbytSort As Byte + +Private Sub FieldSave() +Dim oRS As Recordset, strSQL As String + + If mboolADD Then + strSQL = "SELECT * FROM PR1_EmployeeMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + + If txtEmpNo = "" Then + MsgBox "You Must Enter Information To Add An Employee", vbOKOnly, "Missing Information" + cmdAdd.Enabled = True + cmdSave.Enabled = False + txtEmpNo.Enabled = False + lstEmpList.Enabled = True + Exit Sub + Else + If Not oRS.EOF Then + oRS.AddNew + oRS!department = Field2Str(txtDept) + oRS!EmployeeNumber = Field2Str(txtEmpNo) + oRS!FirstName = Field2Str(txtFName) + oRS!LastName = Field2Str(txtLName) + oRS!wc_code = cboWCCode.Text + ' oRS!wc_code = Field2Str(txtWCCode) + oRS!Terminated = Field2Str(txtStatus) + oRS!SocialSecurityNumber = Field2Str(txtSS) + oRS!ECODE = Right(txtEmpNo, 4) + oRS!Rate = Field2Str2(txtRTRate) + oRS!OTRate = Field2Str2(txtOTRate) + oRS!Rate = Field2Str2(txtRTRate) + oRS!OTRate2 = Field2Str2(txtOTRate2) + oRS!RegRate2 = Field2Str2(txtRTRate2) + oRS!RATECD1 = Field2Str2(txtCMS1) + oRS!RATECD2 = Field2Str2(txtCMS2) + oRS!Hourly = Field2CheckBox(chkHrly) + oRS!RENum = Field2CheckBox(chkRENUM) + oRS!NEWCMS = Field2Str(txtNewCMS) + oRS.Update + mboolADD = False + End If + End If + Exit Sub + End If + With moRSEMP + !department = Field2Str(txtDept) + !EmployeeNumber = Field2Str(txtEmpNo) + !FirstName = Field2Str(txtFName) + !LastName = Field2Str(txtLName) + !wc_code = cboWCCode.Text +' !wc_code = Field2Str(txtWCCode) + !SocialSecurityNumber = Field2Str(txtSS) + !Terminated = Field2Str(txtStatus) + !ECODE = Right(txtEmpNo, 4) + !Rate = Field2Str2(txtRTRate) + !OTRate = Field2Str2(txtOTRate) + !Hourly = Field2CheckBox(chkHrly) + !RENum = Field2CheckBox(chkRENUM) + !NEWCMS = Field2Str(txtNewCMS) + !OTRate2 = Field2Str2(txtOTRate2) + !RegRate2 = Field2Str2(txtRTRate2) + !RATECD1 = Field2Str2(txtCMS1) + !RATECD2 = Field2Str2(txtCMS2) + .Update + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Employhee - Module FieldSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetEmpNo() +Dim strSQL As String, oRS As Recordset, strMSG As String, intCOUNT As Integer, intTEST As Integer +Dim strSQLL As String, oRSS As Recordset, strLastEmpNo As String +Dim strSQLLL As String, oRSSS As Recordset +Dim strSQLLLL As String, oRSSSS As Recordset + + strSQL = "SELECT * FROM PR1_EMPLOYEEMASTER WHERE ECODE = '" & Right$(txtEmpNo, 4) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + intTEST = oRS.RecordCount + intCOUNT = 0 + If Not oRS.EOF Then + strMSG = "Employee Master" & vbCrLf ' & vbCrLf + If oRS.RecordCount > 0 Then + Do Until intCOUNT = oRS.RecordCount +' strMSG = "Employee Master" & vbCrLf & vbCrLf + strMSG = strMSG & Field2Str(oRS!EmployeeNumber) & " - " & Trim$(Field2Str(oRS!FirstName)) & " " & Trim$(Field2Str(oRS!LastName)) & vbCrLf + intCOUNT = intCOUNT + 1 + oRS.MoveNext + Loop + End If + End If + + strSQLL = "SELECT * FROM tblCREW WHERE right(EMPNO,4) = '" & Right$(txtEmpNo, 4) & "'" +' strSQLL = "SELECT * FROM tblCREW WHERE EMPNO = '" & txtEmpNo & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + + intTEST = oRSS.RecordCount + intCOUNT = 0 + If Not oRSS.EOF Then + strMSG = strMSG & vbCrLf & "Crew Leader" & vbCrLf ' & vbCrLf + If oRSS.RecordCount > 0 Then + Do Until intCOUNT = oRSS.RecordCount +' strMSG = "Employee Master" & vbCrLf & vbCrLf + strMSG = strMSG & Field2Str(oRSS!CREW_ID) & " -- " & Field2Str(oRSS!EmpNo) & " - " & Trim$(Field2Str(oRSS!Crew_Boss)) & vbCrLf + intCOUNT = intCOUNT + 1 + oRSS.MoveNext + Loop + End If + End If + + strSQLLL = "SELECT * FROM tblCREWLIST WHERE right$(EMP_ID,4) = '" & Right$(txtEmpNo, 4) & "'" +' strSQLLL = "SELECT * FROM tblCREWLIST WHERE EMP_ID = '" & txtEmpNo & "'" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenForwardOnly, adLockReadOnly + + intTEST = oRSSS.RecordCount + intCOUNT = 0 + If Not oRSSS.EOF Then + strMSG = strMSG & vbCrLf & "Crew List" & vbCrLf ' & vbCrLf + If oRSSS.RecordCount > 0 Then + Do Until intCOUNT = oRSSS.RecordCount +' strMSG = "Employee Master" & vbCrLf & vbCrLf + strMSG = strMSG & Field2Str(oRSSS!CREW_ID) & " -- " & Field2Str(oRSSS!Emp_ID) & " - " & Trim$(Field2Str(oRSSS!EmpName)) & vbCrLf + intCOUNT = intCOUNT + 1 + oRSSS.MoveNext + Loop + End If + End If + +' strSQLLLL = "SELECT * FROM tblPAYCREW WHERE EMP_ID = '" & txtEmpNo & "'" + strSQLLLL = "SELECT * FROM tblPAYCREW WHERE right$(EMP_ID,4) = '" & Right$(txtEmpNo, 4) & "' ORDER BY EMP_ID" + Set oRSSSS = New Recordset + oRSSSS.Open strSQLLLL, goConn, adOpenForwardOnly, adLockReadOnly + + intTEST = oRSSSS.RecordCount + intCOUNT = 0 + If Not oRSSSS.EOF Then + strLastEmpNo = "" + strMSG = strMSG & vbCrLf & "Pay Crew" & vbCrLf ' & vbCrLf + If oRSSSS.RecordCount > 0 Then + Do Until intCOUNT = oRSSSS.RecordCount + If strLastEmpNo <> oRSSSS!Emp_ID Then + ' strMSG = "Employee Master" & vbCrLf & vbCrLf + strMSG = strMSG & Field2Str(oRSSSS!Emp_ID) & " - " & Trim$(Field2Str(oRSSSS!EmpName)) & " " & Trim$(Field2Str(oRSSSS!Pay_Date)) & vbCrLf + ' strMSG = strMSG & Field2Str(oRSSSS!Emp_ID) & " - " & Trim$(Field2Str(oRSSSS!EmpName)) & " " & Trim$(Field2Str(oRSSSS!PayDate)) & vbCrLf +' intCOUNT = intCOUNT + 1 + strLastEmpNo = oRSSSS!Emp_ID + End If + intCOUNT = intCOUNT + 1 + oRSSSS.MoveNext + Loop + End If + End If + + MsgBox strMSG, vbOKOnly, "Current Employees" + oRS.Close +End Sub + +Private Sub EmpLoad() +Dim oRS As Recordset, moRSEMP As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT * from PR1_EmployeeMaster" ' WHERE crew_id = " & Field2Str(lblCrewId.Caption) & " ORDER BY emp_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstEmpList.Clear + + Do Until oRS.EOF + With lstEmpList + strLine = Field2Str(oRS!department) & vbTab & Field2Str(oRS!EmployeeNumber) & vbTab & Field2Str(oRS!FirstName) + strLine = strLine & vbTab & Field2Str(oRS!LastName) & vbTab & Field2Str(oRS!wc_code) & vbTab & Field2Str(oRS!Terminated) & vbTab & Field2Str(oRS!SocialSecurityNumber) + .AddItem strLine +' .ItemData(.NewIndex) = moRSEMP!emp_id + End With + + oRS.MoveNext + Loop + oRS.Close + +' Do Until moRSEMP.EOF +' With lstEmpList +' strLine = Field2Str(moRSEMP!department) & vbTab & Field2Str(moRSEMP!employeenumber) & vbTab & Field2Str(moRSEMP!firstname) +' strLine = strLine & vbTab & Field2Str(moRSEMP!lastname) & vbTab & Field2Str(moRSEMP!wc_code) & vbTab & Field2Str(moRSEMP!Terminated) & vbTab & Field2Str(moRSEMP!SocialSecurityNumber) +' .AddItem strLine +' .ItemData(.NewIndex) = moRSEMP!emp_id +' End With + +' moRSEMP.MoveNext +' Loop +' moRSEMP.Close + + If lstEmpList.ListCount Then + lstEmpList.ListIndex = 0 + Else + lstEmpList.ListIndex = -1 +' cmdDelete.Enabled = False + End If + Exit Sub + + +Error_EH: + gstrMODULE = "Form Employee - Module EmpLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub chkHrly_LostFocus() + If chkHrly = vbChecked Then + txtOTRate.Enabled = True + txtOTRate2.Enabled = True + txtRTRate.Enabled = True + txtRTRate2.Enabled = True + txtCMS1.Enabled = True + txtCMS2.Enabled = True + txtCMS1.SetFocus + ElseIf chkHrly = vbUnchecked Then + txtOTRate.Enabled = False + txtOTRate2.Enabled = False + txtRTRate.Enabled = False + txtRTRate2.Enabled = False + txtCMS1.Enabled = False + txtCMS2.Enabled = False + If cmdSave.Enabled = True Then + cmdSave.SetFocus + End If + End If +End Sub + +Private Sub cmdAdd_Click() +' mboolbookmark = lstEmpList.ListIndex + txtEmpNo.Enabled = True + mboolADD = True + cmdAdd.Enabled = False + cmdSave.Enabled = True + Call FormClear + txtDept.SetFocus + + lstEmpList.Enabled = False +' lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub FormClear() + txtEmpNo.Enabled = True + txtDept = "" + txtEmpNo = "" + txtFName = "" + txtLName = "" + cboWCCode.ListIndex = -1 +' txtWCCode = "" + txtSS = "" + txtStatus = "" + txtRTRate = "" + txtOTRate = "" + chkHrly = vbUnchecked +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim intYN As Integer, strMSG As String + + strMSG = "Do You Want To A Report Sorted By Employee Number" + intYN = MsgBox(strMSG, vbYesNo, "Sort By Employee Number") + If intYN = vbYes Then + Call PrintEmpNo + ElseIf intYN = vbNo Then + intYN = MsgBox("Do You Want To Print A Report Sorted By Last Name", vbYesNo, "Sort By Last Name") + If intYN = vbYes Then + Call PrintLName + ElseIf intYN = vbNo Then + intYN = MsgBox("Do You Want To Print A Report Sorted By First Name?", vbYesNo, "Sorted By First Name") + If intYN = vbYes Then + Call PrintFName + ElseIf intYN = vbNo Then + Exit Sub + End If + End If + End If + +End Sub + +Private Sub PrintEmpNo() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpNo.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub PrintLName() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpLN.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub PrintFName() +Dim intYN As Integer, strMSG As String + + intYN = MsgBox("Do You Want To Print To Screen?", vbYesNo, "Print To Screen") + If intYN = vbYes Then + crEmpList.Destination = crptToWindow + Else + crEmpList.Destination = crptToPrinter + End If + crEmpList.ReportFileName = App.Path & "\EmpListByEmpFN.rpt" +' crEmpList.Destination = crptToPrinter + 'EmpListByEmpLN + 'EmpListByEmpFN + crEmpList.Action = 1 + +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstEmpList.ListIndex + Call FieldSave + Call EmpLoad + cmdAdd.Enabled = True + cmdSave.Enabled = False + txtEmpNo.Enabled = False + lstEmpList.Enabled = True + lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub Form_Load() + + mboolADD = False + Call EmpLoad + cboSort.ListIndex = 0 + +End Sub + +Private Sub FormShow() +Dim strTEST As String + + On Error GoTo Error_EH + With moRSEMP + txtDept = Field2Str(!department) + txtEmpNo = Field2Str(!EmployeeNumber) + txtFName = Field2Str(!FirstName) + txtLName = Field2Str(!LastName) + cboWCCode = Field2Str(!wc_code) +' txtWCCode = Field2Str(!wc_code) + txtSS = Field2Str(!SocialSecurityNumber) + txtStatus = Field2Str(!Terminated) + txtRTRate = Format(Field2Str2(!Rate), "#,0.00") + txtOTRate = Format(Field2Str2(!OTRate), "#,0.00") + txtRTRate2 = Format(Field2Str2(!RegRate2), "#,0.00") + txtOTRate2 = Format(Field2Str2(!OTRate2), "#,0.00") + chkRENUM = Field2CheckBox(!RENum) + txtNewCMS = Field2Str(!NEWCMS) + txtCMS1 = Field2Str(!RATECD1) + txtCMS2 = Field2Str(!RATECD2) + If Field2Str(!Hourly) = True Then + chkHrly = vbChecked + txtOTRate.Enabled = True + txtOTRate2.Enabled = True + txtRTRate.Enabled = True + txtRTRate2.Enabled = True + txtCMS1.Enabled = True + txtCMS2.Enabled = True + ElseIf Field2Str(!Hourly) = False Then + chkHrly = vbUnchecked + txtOTRate.Enabled = False + txtOTRate2.Enabled = False + txtRTRate.Enabled = False + txtRTRate2.Enabled = False + txtCMS1.Enabled = False + txtCMS2.Enabled = False + End If + strTEST = Field2Str(!RENum) + If (!RENum) Then +' txtOTRate.Enabled = False +' txtOTRate2.Enabled = False +' txtRTRate.Enabled = False +' txtRTRate2.Enabled = False + txtCMS1.Enabled = False + txtCMS2.Enabled = False + txtDept.Enabled = False + txtEmpNo.Enabled = False + txtFName.Enabled = False + txtLName.Enabled = False + cboWCCode.Enabled = False + txtSS.Enabled = False + txtStatus.Enabled = False + chkRENUM.Enabled = False + txtNewCMS.Enabled = False + txtCMS1.Enabled = False + txtCMS2.Enabled = False + Else +' txtOTRate.Enabled = False +' txtOTRate2.Enabled = False +' txtRTRate.Enabled = False +' txtRTRate2.Enabled = False + txtCMS1.Enabled = True + txtCMS2.Enabled = True + txtDept.Enabled = True + txtEmpNo.Enabled = True + txtFName.Enabled = True + txtLName.Enabled = True + cboWCCode.Enabled = True + txtSS.Enabled = True + txtStatus.Enabled = True + chkRENUM.Enabled = True + txtNewCMS.Enabled = True + txtCMS1.Enabled = True + txtCMS2.Enabled = True + End If + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Employee - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstEmpList_Click() +Dim strSQL As String + If lstEmpList.ListIndex <> -1 Then + If FormFind() Then + Call FormShow +' Call OptLoad + End If + End If + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, intResponse As Integer, strEMPNO As String + On Error GoTo Error_EH + lstEmpList.col = 1 '****** + strEMPNO = lstEmpList.ColText + + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strEMPNO & "'" + Set moRSEMP = New Recordset + moRSEMP.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSEMP.EOF Then + FormFind = False +' Call FormClear +' Call OptClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Employee - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstEmpList_DblClick() + lstEmpList.Enabled = False + cmdAdd.Enabled = False + cmdSave.Enabled = True + txtDept.SetFocus +End Sub + +Private Sub txtCMS1_GotFocus() + Call FieldSelect(txtCMS1) +End Sub + +Private Sub txtCMS2_GotFocus() + Call FieldSelect(txtCMS2) +End Sub + +Private Sub txtDept_GotFocus() + Call FieldSelect(txtDept) +' txtDept.SelStart = 0 + +' If lstCtrl.MaxLength > 0 Then +' lstCtrl.SelLength = lstCtrl.MaxLength +' Else +' txtDept.SelLength = 50 +' txtDept.SelText +' End If +End Sub + +Private Sub txtDept_LostFocus() + txtDept = UCase(txtDept) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtEmpNo_LostFocus() +' txtEmpNo = UCase(txtEmpNo) + Call GetEmpNo +End Sub + +Private Sub txtFName_GotFocus() + Call FieldSelect(txtFName) +End Sub + +Private Sub txtFName_LostFocus() + txtFName = UCase(txtFName) +End Sub + +Private Sub txtLName_GotFocus() + Call FieldSelect(txtLName) +End Sub + +Private Sub txtLName_LostFocus() + txtLName = UCase(txtLName) +End Sub + +Private Sub txtNewCMS_LostFocus() + cmdSave.SetFocus +End Sub + +Private Sub txtOTRate_GotFocus() + Call FieldSelect(txtOTRate) +End Sub + +Private Sub txtOTRate_LostFocus() + txtOTRate = Format(txtOTRate, "#,#.00") +End Sub + +Private Sub txtOTRate2_GotFocus() + Call FieldSelect(txtOTRate2) +End Sub + +Private Sub txtRTRate_GotFocus() + Call FieldSelect(txtRTRate) +End Sub + +Private Sub txtRTRate_LostFocus() + txtRTRate = Format(txtRTRate, "#,#.00") +End Sub + +Private Sub txtRTRate2_GotFocus() + Call FieldSelect(txtRTRate2) +End Sub + +Private Sub txtStatus_GotFocus() + Call FieldSelect(txtStatus) +End Sub + +Private Sub txtStatus_LostFocus() + txtStatus = UCase(txtStatus) +End Sub + +'Private Sub txtWCCode_GotFocus() +' Call FieldSelect(txtWCCode) +'End Sub + +'Private Sub txtWCCode_LostFocus() +'Dim lngWC As Long, intYN As Integer, strMSG As String +'' txtWCCode = UCase(txtWCCode) +' If Len(txtWCCode) < 4 Then +' MsgBox "This WC Code Is Too Short - ReEnter A Valid WC Code", vbOKOnly, "Invalid WC Code" +' txtWCCode.SetFocus +' ElseIf Len(txtWCCode) = 4 Then +' txtWCCode = Format((txtWCCode), "0000000") +'' txtWCCode = Format("000####", CDbl(txtWCCode)) +' ElseIf Len(txtWCCode) = 5 Then +' txtWCCode = Format((txtWCCode), "0000000") +' ElseIf Len(txtWCCode) = 6 Then +' txtWCCode = Format((txtWCCode), "0000000") +' ElseIf Len(txtWCCode) = 7 Then +' txtWCCode = Format((txtWCCode), "0000000") +' End If + +'End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cboSort_Click() +Dim intMIN As Integer + + On Error Resume Next +' mintCnt2 = mintCnt2 + 1 +' lblCount2 = mintCnt2 +' mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex +' cboSortOrder.ListIndex = 4 + + If cboSort.ListIndex = 0 Then +' If mbytSort <> cbolistindex Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 3 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone +' lstEmpList.col = 3 +' lstEmpList.ColSortSeq = -1 +' lstEmpList.ColSorted = SortedNone + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.Redraw = True + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True + lstEmpList.ColumnSearch = 1 + + txtSearch = "" + txtSearch.SetFocus + lblSearch.Caption = "Enter Employee Num. Search Info:" + ElseIf cboSort.ListIndex = 1 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 3 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True +' lstEmpList.ColumnSearch = 2 + lstEmpList.ColumnSearch = 3 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If +' txtSearch = "" + lblSearch.Caption = "Enter Last Name Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 2 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 2 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 3 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True + lstEmpList.ColumnSearch = 2 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If + lblSearch.Caption = "Enter First Name Search Information:" +' txtSearch.SetFocus +' End If + ElseIf cboSort.ListIndex = 3 Then + If mbytSort = 6 Then +' Call InventoryLoad + End If + lstEmpList.col = 0 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 1 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.col = 6 + lstEmpList.ColSortSeq = 0 + lstEmpList.ColSorted = SortedAscending + lstEmpList.col = 2 + lstEmpList.ColSortSeq = -1 + lstEmpList.ColSorted = SortedNone + lstEmpList.Redraw = True + + lstEmpList.ColSortDataType = ColSortDataTypeTextNoCase + lstEmpList.SearchIgnoreCase = True +' lstEmpList.ColumnSearch = 2 + lstEmpList.ColumnSearch = 6 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If + lblSearch.Caption = "Enter SS Number Search Information:" +' txtSearch.SetFocus + End If + mbytSort = cboSort.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstEmpList.SearchText = txtSearch.Text +lstEmpList.SearchMethod = 2 +lstEmpList.Action = ActionSearch +lstEmpList.SearchIndex = -1 +lstEmpList.Action = 0 + + If lstEmpList.SearchIndex <> -1 Then + lstEmpList.TopIndex = lstEmpList.SearchIndex + lstEmpList.ListIndex = lstEmpList.SearchIndex + Else + lstEmpList.Action = 6 ' clear + End If + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frx new file mode 100644 index 0000000..91f67ff Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmEmployee.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmError.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmError.frm new file mode 100644 index 0000000..a0d4c24 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmError.frm @@ -0,0 +1,209 @@ +VERSION 5.00 +Begin VB.Form frmError + BorderStyle = 1 'Fixed Single + Caption = "An Error Has Occurred" + ClientHeight = 4890 + ClientLeft = 1050 + ClientTop = 855 + ClientWidth = 6945 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 4890 + ScaleWidth = 6945 + Begin VB.CommandButton cmdPrint + Caption = "&Print Form" + Height = 495 + Left = 4140 + TabIndex = 12 + Top = 3840 + Width = 975 + End + Begin VB.CommandButton cmdOK + Caption = "&OK" + Height = 495 + Left = 4140 + TabIndex = 10 + Top = 4380 + Width = 975 + End + Begin VB.Label lblLotId + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5280 + TabIndex = 16 + Top = 4380 + Width = 1575 + End + Begin VB.Label lblProjId + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5280 + TabIndex = 15 + Top = 3840 + Width = 1575 + End + Begin VB.Label txtModule + BorderStyle = 1 'Fixed Single + Height = 615 + Left = 1920 + TabIndex = 14 + Top = 2340 + Width = 4935 + WordWrap = -1 'True + End + Begin VB.Label lblModule + Caption = "Form/Module" + Height = 255 + Left = 120 + TabIndex = 13 + Top = 2340 + Width = 1575 + End + Begin VB.Label lblLabel + Caption = "Please print this screen, write down what you were doing when this error happened then call Darv." + Height = 780 + Index = 5 + Left = 60 + TabIndex = 11 + Top = 4140 + Width = 3825 + End + Begin VB.Label lblVersion + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 1920 + TabIndex = 9 + Top = 3780 + Width = 975 + End + Begin VB.Label lblAppName + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 1920 + TabIndex = 8 + Top = 3420 + Width = 3195 + End + Begin VB.Label lblLabel + AutoSize = -1 'True + Caption = "Version" + Height = 240 + Index = 4 + Left = 60 + TabIndex = 7 + Top = 3840 + Width = 960 + End + Begin VB.Label lblLabel + AutoSize = -1 'True + Caption = "App. Name" + Height = 240 + Index = 3 + Left = 60 + TabIndex = 6 + Top = 3480 + Width = 1275 + End + Begin VB.Label lblDateTime + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 1920 + TabIndex = 5 + Top = 3060 + Width = 3195 + End + Begin VB.Label lblLabel + AutoSize = -1 'True + Caption = "Date / Time" + Height = 240 + Index = 2 + Left = 60 + TabIndex = 4 + Top = 3120 + Width = 1410 + End + Begin VB.Label lblErrDesc + BorderStyle = 1 'Fixed Single + Height = 1935 + Left = 1920 + TabIndex = 3 + Top = 360 + Width = 4935 + WordWrap = -1 'True + End + Begin VB.Label lblErrNumber + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 1920 + TabIndex = 2 + Top = 60 + Width = 3195 + End + Begin VB.Label lblLabel + AutoSize = -1 'True + Caption = "Error Description" + Height = 240 + Index = 1 + Left = 60 + TabIndex = 1 + Top = 420 + Width = 1752 + End + Begin VB.Label lblLabel + AutoSize = -1 'True + Caption = "Error Number" + Height = 240 + Index = 0 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 1368 + End +End +Attribute VB_Name = "frmError" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Private moError As ErrObject + +Property Set ErrorObj(oErr As ErrObject) + Set moError = oErr +End Property + +Private Sub cmdOK_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() + Me.PrintForm +End Sub + +Private Sub Form_Load() + lblErrNumber.Caption = moError.Number + lblErrDesc.Caption = moError.Description +' If moError.Number = -2147467259 Then +' lblErrDesc.Caption = "Duplicate Record - This will not be saved" +' End If + txtModule.Caption = gstrMODULE + lblLotId = gintLOTID + lblProjId = gintPROJID + lblDateTime.Caption = Now + lblAppName.Caption = App.ProductName + lblVersion.Caption = App.Major & "." & _ + App.Minor & "." & _ + App.Revision +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam.frm new file mode 100644 index 0000000..45503c1 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam.frm @@ -0,0 +1,756 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" +Begin VB.Form frmFoam + Caption = "Foam Orders" + ClientHeight = 3540 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10965 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 3540 + ScaleWidth = 10965 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkDelivery + Caption = "Un-Delivered Orders Only" + Height = 315 + Left = 5700 + TabIndex = 17 + Top = 60 + Width = 2235 + End + Begin VB.CheckBox chkPreOrder + Caption = "PreOrders Only" + Height = 315 + Left = 3780 + TabIndex = 16 + Top = 60 + Width = 1695 + End + Begin Crystal.CrystalReport CRDaily + Left = 9060 + Top = 0 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9960 + TabIndex = 15 + Top = 2880 + Width = 915 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8940 + TabIndex = 14 + Top = 2880 + Width = 915 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7920 + TabIndex = 13 + Top = 2880 + Width = 915 + End + Begin VB.TextBox txtCutDate + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9120 + TabIndex = 4 + Top = 2100 + Width = 1755 + End + Begin VB.TextBox txtDelDate + Alignment = 1 'Right Justify + Height = 315 + Left = 9120 + TabIndex = 5 + Top = 2460 + Width = 1755 + End + Begin VB.TextBox txtODate + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9120 + TabIndex = 3 + Top = 1740 + Width = 1755 + End + Begin VB.ListBox lstOrders + Height = 2985 + Left = 120 + TabIndex = 2 + Top = 480 + Width = 7455 + End + Begin MSComCtl2.DTPicker dtpODate + Height = 315 + Left = 1320 + TabIndex = 1 + Top = 60 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 556 + _Version = 393216 + Format = 48824321 + CurrentDate = 37138 + End + Begin VB.Label lblVWPPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP P.O.:" + Height = 195 + Left = 8295 + TabIndex = 12 + Top = 1440 + Width = 780 + End + Begin VB.Label lblDTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cut Date:" + Height = 195 + Left = 8400 + TabIndex = 11 + Top = 2160 + Width = 675 + End + Begin VB.Label lblConfirm + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Date:" + Height = 195 + Left = 8070 + TabIndex = 10 + Top = 2520 + Width = 1005 + End + Begin VB.Label lblOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 8250 + TabIndex = 9 + Top = 1800 + Width = 825 + End + Begin VB.Label lblPO + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9120 + TabIndex = 8 + Top = 1380 + Width = 1755 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + Height = 495 + Left = 7860 + TabIndex = 7 + Top = 840 + Width = 3015 + End + Begin VB.Label lblSupplier + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7860 + TabIndex = 6 + Top = 480 + Width = 3015 + End + Begin VB.Label lblODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 330 + TabIndex = 0 + Top = 120 + Width = 825 + End +End +Attribute VB_Name = "frmFoam" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSORDER As Recordset +Dim moRS As Recordset, moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mlngORDERID As Long, mintBOOKMARK As Integer +Dim mstrPROJLOT As String + +Private Sub OrderLoad() +Dim oRS As Recordset, oRSS As Recordset, oRSP As Recordset +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim strTYPE As String, strFLAG As String +Dim strLine As String + On Error GoTo Error_EH + + If chkPreOrder Then + strSQL = "SELECT Order_ID, lot_id, order_date, Cut_date, Del_date, Foam from tblOrders WHERE Order_Date >= #" & CDate(dtpODate.Value) & "# AND foam AND preorder" + ElseIf chkDelivery Then + strSQL = "SELECT Order_ID, lot_id, order_date, Cut_date, Del_date, Foam from tblOrders WHERE Order_Date >= #" & CDate(dtpODate.Value) & "# AND foam and isnull(del_date)" + Else + strSQL = "SELECT Order_ID, lot_id, order_date, Cut_date, Del_date, Foam from tblOrders WHERE Order_Date >= #" & CDate(dtpODate.Value) & "# AND FOAM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOrders.Clear + + Do Until oRS.EOF + With lstOrders + strSql2 = "SELECT Proj_id, Lot_id, Lot_no FROM tblLotInfo WHERE lot_id = " & oRS!Lot_id + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSS.EOF Then + strSQL3 = "SELECT Proj_id, Proj_Desc FROM tblProject where Proj_id = " & oRSS!proj_id + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + End If + + strLine = "" + strLine = Field2Str(oRS!order_date) & vbTab & IIf(Len(Field2Str(oRS!cut_date)) > 0, Field2Str(oRS!cut_date), "PREORDER") + strLine = strLine & vbTab & IIf(Len(Field2Str(oRS!del_date)) > 0, Field2Str(oRS!del_date), " NOT DEL ") + strLine = strLine & vbTab & Field2Str(oRSP!proj_desc) & " " & Field2Str(oRSS!lot_no) + + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + mlngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + Else + mlngORDERID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub chkDelivery_Click() + Call OrderLoad + If FormFind() Then +' Call ProjectSelect +' Call LotSelect + Call FormShow + Else + Call FormClear + End If +End Sub + +Private Sub chkPreOrder_Click() + Call OrderLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String + + On Error GoTo Error_EH + strMONTH = Format(Month(dtpODate.Value), "00") + strDAY = Format(Day(dtpODate.Value), "00") + strYEAR = Year(dtpODate.Value) + gintPRINT = 1 + frmReport.Show 1 + strSQL = "{tblorders.order_date} = date (" & strYEAR & "," & strMONTH & "," & strDAY & ")" '" + '{tblORDERS.ORDER_DATE} = Date (2001,09,06) + CRDaily.ReportFileName = App.Path & "\Dailyorders.rpt" + CRDaily.GroupSelectionFormula = strSQL +' crdaily.Destination = crptToWindow + CRDaily.CopiesToPrinter = gintCOPY + CRDaily.Destination = gintDEST + CRDaily.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstOrders.ListIndex + Call FormSave + cmdSave.Enabled = False + lstOrders.Enabled = True + lstOrders.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub dtpODate_Change() + Call OrderLoad + If FormFind() Then +' Call ProjectSelect +' Call LotSelect + Call FormShow + Else + Call FormClear + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Set moRSORDER = New Recordset + dtpODate.Value = Date + + Call OrderLoad +' If FormFind() Then +' Call ProjectSelect +' Call LotSelect +' Call FormShow +' Else +' Call FormClear +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE order_ID = " & mlngORDERID + + Set moRSORDER = New Recordset + moRSORDER.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSORDER.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSORDER!Lot_id) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Foam - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String + + On Error GoTo Error_EH + lblProjLot.Caption = "" + lblSupplier.Caption = "" + lblPO.Caption = "" + + mboolSHOW = True + strSQL = "Select * FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gintPROJID = Field2Str2(moRS!proj_id) + + strSQL = "Select * FROM tblProject WHERE proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lblProjLot.Caption = Trim(Field2Str(moRSProj!proj_desc)) & " " & Field2Str(moRS!lot_no) + + With moRSORDER + txtODate = Field2Str(!order_date) + txtCutDate = Field2Str(!cut_date) + txtDelDate = Field2Str(!del_date) + lblSupplier.Caption = Field2Str(!supplier) + lblPO.Caption = Field2Str(!po_num) + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + With moRSORDER + !del_date = Str2Field(txtDelDate) + End With + + moRSORDER.Update + + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") +' If Len(strLOT) > 0 Then +' moRS!lot_no = Field2Str(strLOT) +' moRS.Update +' txtLotNo = Field2Str(strLOT) +' End If + Resume Next + End If + gstrMODULE = "Form Foam - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtODate = "" + txtCutDate = "" + txtDelDate = "" + lblSupplier.Caption = "" + lblPO.Caption = "" + lblProjLot.Caption = "" + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSORDER.AddNew +' moRSORDER!proj_id = gintPROJID +' moRSORDER!lot_id = gintLOTID +' moRSORDER!proj_lot = mstrPROJLOT +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRSORDER.Update + + Call OrderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If +' If moRS.State = adStateOpen Then +' moRS.Close +' End If +' If moRSProj.State = adStateOpen Then +' moRSProj.Close +' End If + +End Sub + +Private Sub lstOrders_Click() + On Error GoTo Error_EH + + If lstOrders.ListIndex <> -1 Then + mlngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module lstOrders_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstOrders_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtCutDate_GotFocus() + Call FieldSelect(txtCutDate) +End Sub + +Private Sub txtCutDate_LostFocus() +Dim lngPOS As Long + If IsDate(txtCutDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtCutDate, "/", 1) + If lngPOS = 0 Then + If Len(txtCutDate) > 0 Then + txtCutDate = Format(txtCutDate, "00/00/####") + If Not IsDate(txtCutDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtCutDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtCutDate.SetFocus + End If + +End Sub + +Private Sub txtDelDate_GotFocus() + Call FieldSelect(txtCutDate) +End Sub + +Private Sub txtDelDate_LostFocus() +Dim lngPOS As Long + If IsDate(txtDelDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtDelDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDelDate) > 0 Then + txtDelDate = Format(txtDelDate, "00/00/####") + If Not IsDate(txtDelDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDelDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDelDate.SetFocus + End If + +End Sub + +Private Sub txtODate_GotFocus() + Call FieldSelect(txtODate) +End Sub + +Private Sub txtODate_LostFocus() +Dim lngPOS As Long + If IsDate(txtODate) Then + Exit Sub + End If + lngPOS = InStr(1, txtODate, "/", 1) + If lngPOS = 0 Then + If Len(txtODate) > 0 Then + txtODate = Format(txtODate, "00/00/####") + If Not IsDate(txtODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtODate.SetFocus + End If + +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!proj_id) +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + + Set moRSProj = New Recordset + + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + gintPROJID = moRSProj!proj_id + mstrPROJLOT = Trim(Field2Str(moRSProj!proj_desc)) & " - " & Trim(Field2Str(moRS!lot_no)) +' lblProjectLot = mstrPROJLOT +End Sub + +Private Sub LotSelect() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_no, address, owner, lot_id FROM tblLotInfo WHERE proj_id = " & gintPROJID + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +' lstLot.Visible = True +' lstLot.Clear + + Do Until moRS.EOF + strLine = "" + strLine = Field2Str(moRS!lot_no) & vbTab & Field2Str(moRS!address) +' lstLot.AddItem strLine + ' lstLot.ItemData(lstLot.NewIndex) = Field2Long(moRS!lot_id) + moRS.MoveNext + Loop +' cboRCrew.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module LotSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ProjectSelect() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Proj_id, Proj_Desc FROM tblProject" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +' lstProject.Visible = True +' lstProject.Clear + + Do Until oRS.EOF +' lstProject.AddItem oRS!proj_desc +' lstProject.ItemData(lstProject.NewIndex) = Field2Long(oRS!proj_id) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Foam - Module ProjectSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frm new file mode 100644 index 0000000..7b524b8 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frm @@ -0,0 +1,782 @@ +VERSION 5.00 +Begin VB.Form frmFoam2 + Caption = "Lath and Stucco Crews" + ClientHeight = 7830 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9645 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7830 + ScaleWidth = 9645 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtEmpNo + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + TabIndex = 17 + Top = 1800 + Width = 975 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 8220 + TabIndex = 28 + TabStop = 0 'False + Top = 5280 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + Height = 555 + Left = 6600 + TabIndex = 26 + Top = 5280 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Enabled = 0 'False + Height = 555 + Left = 5040 + TabIndex = 27 + TabStop = 0 'False + Top = 5280 + Width = 1395 + End + Begin VB.TextBox txtDA + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 24 + Top = 4320 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtQU + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 23 + Top = 3960 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSB + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 25 + Top = 4680 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMN + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 22 + Top = 3600 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSM + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 21 + Top = 3240 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtSA + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 20 + Top = 2880 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 19 + Top = 2520 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + MaxLength = 9 + TabIndex = 18 + Top = 2160 + Visible = 0 'False + Width = 975 + End + Begin VB.TextBox txtPhone + Alignment = 1 'Right Justify + Height = 285 + Left = 6420 + MaxLength = 10 + TabIndex = 16 + Top = 1440 + Width = 1575 + End + Begin VB.TextBox txtCrewBoss + Height = 315 + Left = 6060 + MaxLength = 30 + TabIndex = 15 + Top = 1020 + Width = 3435 + End + Begin VB.ComboBox cboType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmFoam2.frx":0000 + Left = 3180 + List = "frmFoam2.frx":000A + Style = 2 'Dropdown List + TabIndex = 2 + Top = 60 + Width = 1755 + End + Begin VB.ListBox lstCrew + Height = 7275 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 480 + Width = 4875 + End + Begin VB.Label lblEmpNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Employee No:" + Height = 195 + Left = 5340 + TabIndex = 30 + Top = 1860 + Width = 990 + End + Begin VB.Label lblInstructions + Caption = $"frmFoam2.frx":001C + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1515 + Left = 5220 + TabIndex = 29 + Top = 6120 + Width = 4155 + End + Begin VB.Label lblDA + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Dash Rate:" + Height = 195 + Left = 5550 + TabIndex = 14 + Top = 4380 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6420 + TabIndex = 13 + Top = 600 + Width = 975 + End + Begin VB.Label lblQU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quernavaca Rate:" + Height = 195 + Left = 5040 + TabIndex = 12 + Top = 4020 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblSB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Rate:" + Height = 195 + Left = 5265 + TabIndex = 11 + Top = 4740 + Visible = 0 'False + Width = 1095 + End + Begin VB.Label lblMN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey Rate:" + Height = 195 + Left = 5220 + TabIndex = 10 + Top = 3615 + Visible = 0 'False + Width = 1140 + End + Begin VB.Label lblSmooth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Smooth Rate:" + Height = 195 + Left = 5385 + TabIndex = 9 + Top = 3330 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Rate:" + Height = 195 + Left = 5550 + TabIndex = 8 + Top = 2970 + Visible = 0 'False + Width = 810 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 5535 + TabIndex = 7 + Top = 2265 + Visible = 0 'False + Width = 825 + End + Begin VB.Label lblPrimRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Rate:" + Height = 195 + Left = 5610 + TabIndex = 6 + Top = 2625 + Visible = 0 'False + Width = 750 + End + Begin VB.Label lblPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone #:" + Height = 195 + Left = 5700 + TabIndex = 5 + Top = 1500 + Width = 660 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Leader:" + Height = 195 + Left = 5055 + TabIndex = 4 + Top = 1080 + Width = 945 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew #:" + Height = 195 + Left = 5805 + TabIndex = 3 + Top = 660 + Width = 555 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Select The Crew Type To Display A List:" + ForeColor = &H000000FF& + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 2865 + End +End +Attribute VB_Name = "frmFoam2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset + +Dim mboolAdding As Boolean + + +Private Sub cboType_Change() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If +End Sub + +Private Sub cboType_Click() + Call CrewLoad + If Len(cboType.Text) <> 0 Then + cmdAdd.Enabled = True + End If + +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + mboolAdding = True + Call FormClear + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + cmdAdd.Enabled = True + cmdSave.Enabled = False + Call FormSave +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT crew_id, crew_boss from tblCrew WHERE type = '" & Left$(cboType, 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + If Len(Field2Str(oRS!crew_boss)) < 14 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + ElseIf Len(Field2Str(oRS!crew_boss)) > 20 Then + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + Else + strLine = Format(Field2Str(oRS!crew_boss), "!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") & vbTab & Field2Str(oRS!crew_id) + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblCrew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' adOpenKeyset , adLockOptimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormCrews - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + If Left$(cboType, 1) = "L" Then + lblPrimRate.Caption = "Lath:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = True + lblMetal.Visible = True + txtDA.Visible = False + lblDA.Visible = False + txtQU.Visible = False + lblQU.Visible = False + txtSM.Visible = False + lblSmooth.Visible = False + txtSA.Visible = False + lblSand.Visible = False + txtSB.Visible = False + lblSB.Visible = False + txtMN.Visible = False + lblMN.Visible = False + End If + ElseIf Left$(cboType, 1) = "S" Then + lblPrimRate.Caption = "Skip:" + If gbytSECURITY = 1 Or gbytSECURITY = 10 Then + txtPrimRate.Visible = True + lblPrimRate.Visible = True + txtMetal.Visible = False + lblMetal.Visible = False + txtDA.Visible = True + lblDA.Visible = True + txtQU.Visible = True + lblQU.Visible = True + txtSM.Visible = True + lblSmooth.Visible = True + txtSA.Visible = True + lblSand.Visible = True + txtSB.Visible = True + lblSB.Visible = True + txtMN.Visible = True + lblMN.Visible = True + End If + End If + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!crew_boss) + txtPhone = Field2Str(!phone) + txtEmpNo = Field2Str(!empno) + txtPrimRate = Format(Field2Str2(!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(!METAL), "#0.00#") + txtSA = Format(Field2Str2(!sand), "#0.00") + txtSM = Format(Field2Str2(!smooth), "#0.00") + txtQU = Format(Field2Str2(!qu), "#0.00") + txtDA = Format(Field2Str2(!dash), "#0.00") + txtMN = Format(Field2Str2(!mn), "#0.00") + txtSB = Format(Field2Str2(!syn), "#0.00") + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormCrews - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblCrewId.Caption = "" + txtCrewBoss = "" + txtPhone = "" + txtEmpNo = "" + txtPrimRate = 0 + txtMetal = 0 + txtSA = 0 + txtSM = 0 + txtQU = 0 + txtDA = 0 + txtMN = 0 + txtSB = 0 +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo 0 + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !crew_boss = Str2Field(txtCrewBoss) + !phone = Str2Field(txtPhone) + !Type = Left$(Str2Field(cboType), 1) + !METAL = Str2Field(txtMetal) + !lath_skip = Str2Field(txtPrimRate) + !sand = Str2Field(txtSA) + !qu = Str2Field(txtQU) + !dash = Str2Field(txtDA) + !smooth = Str2Field(txtSM) + !syn = Str2Field(txtSB) + !mn = Str2Field(txtMN) + !empno = Format(Field2Str2(txtEmpNo), "0000000") + End With + test = moRSCREW.EditMode + moRSCREW.Update + + Call CrewLoad + + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormCrews - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + cmdAdd.Enabled = False + cmdSave.Enabled = True + txtCrewBoss.SetFocus +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + +Private Sub txtDA_GotFocus() + Call FieldSelect(txtDA) +End Sub + +Private Sub txtEmpNo_GotFocus() + Call FieldSelect(txtEmpNo) +End Sub + +Private Sub txtMetal_GotFocus() + Call FieldSelect(txtMetal) +End Sub + +Private Sub txtMN_GotFocus() + Call FieldSelect(txtMN) +End Sub + +Private Sub txtPhone_GotFocus() + Call FieldSelect(txtPhone) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub txtQU_GotFocus() + Call FieldSelect(txtQU) +End Sub + +Private Sub txtSA_GotFocus() + Call FieldSelect(txtSA) +End Sub + +Private Sub txtSB_GotFocus() + Call FieldSelect(txtSB) +End Sub + +Private Sub txtSM_GotFocus() + Call FieldSelect(txtSM) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frx new file mode 100644 index 0000000..19c478c Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmFoam2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frm new file mode 100644 index 0000000..d74022a --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frm @@ -0,0 +1,2545 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmGetPaySheet + Caption = "Select Pay Sheet To Pay" + ClientHeight = 6780 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8310 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6780 + ScaleWidth = 8310 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkBC + Caption = "B/C" + Height = 375 + Left = 7140 + TabIndex = 69 + Top = 5400 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtCrewType + Height = 285 + Left = 3960 + TabIndex = 68 + Top = 5100 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtCrewId + Height = 285 + Left = 2940 + TabIndex = 67 + Top = 5100 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtFin2Yds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 66 + Top = 1320 + Width = 750 + End + Begin VB.TextBox txtPercentDone + Height = 315 + Left = 1200 + TabIndex = 64 + Top = 5040 + Width = 750 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate &Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5280 + TabIndex = 61 + Top = 4200 + Width = 1455 + End + Begin VB.CheckBox chkPaid + Alignment = 1 'Right Justify + BackColor = &H00FFFF00& + Caption = "PaySheet Paid" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 6540 + TabIndex = 60 + Top = 60 + Visible = 0 'False + Width = 1695 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 915 + Left = 1020 + TabIndex = 20 + Top = 5820 + Width = 7215 + End + Begin VB.TextBox txtMDesc + Enabled = 0 'False + Height = 375 + Left = 1020 + MaxLength = 50 + TabIndex = 19 + Top = 5400 + Width = 5715 + End + Begin VB.CheckBox chkInvalid + BackColor = &H0080FFFF& + Caption = "Invalid PaySheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 255 + Left = 5640 + TabIndex = 57 + Top = 3840 + Visible = 0 'False + Width = 2175 + End + Begin VB.TextBox txtIFrames + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 54 + Top = 2760 + Width = 750 + End + Begin VB.TextBox txtFrames + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 53 + Top = 2760 + Width = 750 + End + Begin VB.TextBox txtIStYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 52 + Top = 1680 + Width = 750 + End + Begin VB.TextBox txtStYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 51 + Top = 1680 + Width = 750 + End + Begin Crystal.CrystalReport crPAY + Left = 5400 + Top = 240 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtMDollars + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 49 + Top = 3480 + Width = 750 + End + Begin VB.TextBox txtIStone + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 47 + Top = 2400 + Width = 750 + End + Begin VB.TextBox txtICMU + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 46 + Top = 2040 + Width = 750 + End + Begin VB.TextBox txtIMetal + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 45 + Top = 960 + Width = 750 + End + Begin VB.TextBox txtILYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 44 + Top = 600 + Width = 750 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 37 + Top = 600 + Width = 750 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 36 + Top = 960 + Width = 750 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6195 + TabIndex = 35 + Top = 2040 + Width = 750 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6195 + TabIndex = 34 + Top = 3120 + Width = 750 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6195 + TabIndex = 33 + Top = 2400 + Width = 750 + End + Begin VB.TextBox txtFtMetal + Enabled = 0 'False + Height = 315 + Left = 1020 + TabIndex = 18 + Top = 3240 + Width = 1695 + End + Begin VB.TextBox txtYdge + Enabled = 0 'False + Height = 315 + Left = 1020 + TabIndex = 17 + Top = 2880 + Width = 1695 + End + Begin VB.ComboBox cboType + Enabled = 0 'False + Height = 315 + ItemData = "frmGetPaySheet.frx":0000 + Left = 1020 + List = "frmGetPaySheet.frx":0016 + Style = 2 'Dropdown List + TabIndex = 16 + Top = 2160 + Width = 1695 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Pay Info" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6780 + TabIndex = 22 + Top = 4200 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6780 + TabIndex = 2 + Top = 4800 + Width = 1455 + End + Begin VB.ListBox lstPayInfo + Height = 1620 + Left = 120 + TabIndex = 0 + Top = 480 + Width = 5055 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1020 + TabIndex = 70 + Top = 2505 + Width = 2115 + _Version = 196608 + _ExtentX = 3731 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmGetPaySheet.frx":0053 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yds:" + Height = 195 + Left = 5220 + TabIndex = 65 + Top = 1380 + Width = 900 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percent Done:" + Height = 195 + Left = 0 + TabIndex = 63 + Top = 5100 + Width = 1035 + End + Begin VB.Label lblFINISH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2940 + TabIndex = 62 + Top = 2160 + Width = 2175 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + Caption = "TimeSheet Notes:" + Height = 435 + Left = 180 + TabIndex = 59 + Top = 5880 + Width = 795 + End + Begin VB.Label lblMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Desc." + Height = 195 + Left = 240 + TabIndex = 58 + Top = 5460 + Width = 735 + End + Begin VB.Label txtWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Work Type:" + Height = 195 + Left = 120 + TabIndex = 56 + Top = 2580 + Width = 840 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames:" + Height = 195 + Left = 5595 + TabIndex = 55 + Top = 2820 + Width = 555 + End + Begin VB.Label lblStucco + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yds:" + Height = 195 + Left = 5280 + TabIndex = 50 + Top = 1740 + Width = 870 + End + Begin VB.Label lblMisc + Alignment = 1 'Right Justify + Caption = "Misc. Pay Dollars" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5340 + TabIndex = 48 + Top = 3540 + Width = 1575 + End + Begin VB.Label lblOrder + Alignment = 2 'Center + Caption = "Orders / Issued" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6180 + TabIndex = 43 + Top = 360 + Width = 1575 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 5475 + TabIndex = 42 + Top = 660 + Width = 675 + End + Begin VB.Label lblMetalLI + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 5535 + TabIndex = 41 + Top = 1020 + Width = 615 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 5400 + TabIndex = 40 + Top = 2100 + Width = 720 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 5235 + TabIndex = 39 + Top = 3180 + Width = 915 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 5310 + TabIndex = 38 + Top = 2460 + Width = 840 + End + Begin VB.Label txtCrewName + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1860 + TabIndex = 32 + Top = 4680 + Width = 3255 + End + Begin VB.Label txtCrew + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 31 + Top = 4680 + Width = 795 + End + Begin VB.Label txtMetal + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 30 + Top = 4320 + Width = 1695 + End + Begin VB.Label txtYRate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 29 + Top = 3960 + Width = 1695 + End + Begin VB.Label txtAmount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 28 + Top = 3600 + Width = 1695 + End + Begin VB.Label txtRPDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 27 + Top = 4320 + Width = 1155 + End + Begin VB.Label txtRPId + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 26 + Top = 3960 + Width = 1155 + End + Begin VB.Label txtCDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 25 + Top = 3600 + Width = 1155 + End + Begin VB.Label txtLogin + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 24 + Top = 3240 + Width = 1155 + End + Begin VB.Label txtRPCount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 23 + Top = 2880 + Width = 1155 + End + Begin VB.Label txtPSNum + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4155 + TabIndex = 21 + Top = 2520 + Width = 1155 + End + Begin VB.Label lblRPCount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Reprint Count:" + Height = 195 + Left = 2895 + TabIndex = 15 + Top = 2940 + Width = 1020 + End + Begin VB.Label lblRPDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date RePrinted:" + Height = 195 + Left = 2775 + TabIndex = 14 + Top = 4380 + Width = 1140 + End + Begin VB.Label lblReprint + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "RePrinted By:" + Height = 195 + Left = 2940 + TabIndex = 13 + Top = 4020 + Width = 975 + End + Begin VB.Label lblCDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Created:" + Height = 195 + Left = 2925 + TabIndex = 12 + Top = 3660 + Width = 990 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CreatedBy:" + Height = 195 + Left = 3135 + TabIndex = 11 + Top = 3300 + Width = 780 + End + Begin VB.Label lblPSNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Sheet #:" + Height = 195 + Left = 3180 + TabIndex = 10 + Top = 2580 + Width = 930 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 585 + TabIndex = 9 + Top = 4740 + Width = 405 + End + Begin VB.Label lblMRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 165 + TabIndex = 8 + Top = 4380 + Width = 825 + End + Begin VB.Label lblYRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rate/Yard:" + Height = 195 + Left = 195 + TabIndex = 7 + Top = 4020 + Width = 795 + End + Begin VB.Label lblAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amt. Paid:" + Height = 195 + Left = 270 + TabIndex = 6 + Top = 3660 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 375 + TabIndex = 5 + Top = 3300 + Width = 615 + End + Begin VB.Label lblYardge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = 345 + TabIndex = 4 + Top = 2940 + Width = 645 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 180 + TabIndex = 3 + Top = 2220 + Width = 810 + End + Begin VB.Label lblPSheet + Caption = "Pay Sheets for " + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 1 + Top = 60 + Width = 7035 + End +End +Attribute VB_Name = "frmGetPaySheet" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim mintCREW As Integer, mstrCREW As String +Dim moRS As Recordset, moRSProj As Recordset, mboolAdding As Boolean +Dim mlngTIME As Long, mboolPRINT As Boolean, mboolSTOP As Boolean +Dim moRSPay As Recordset, mstrType As String +Dim mboolCALC As Boolean, mstrWDone As String, mstrWTYPE As String +Dim mstrPCrew As String, mstrPType As String +Dim moRSTIME As Recordset, moRSCREW As Recordset + +Private Sub SetInvalid() +Dim intBOOKMARK As Integer + If chkInvalid Then + MsgBox "This PaySheet has already been marked Invalid", vbOKOnly, "Invalid Option" + Exit Sub + End If + intBOOKMARK = lstPayInfo.ListIndex + If Not chkPaid = vbChecked Then + moRSPay!invalid = vbChecked + moRSPay.Update + Call PayLoad + Else + MsgBox "This PaySheet Has Already Been Paid", vbOKOnly, "Already Paid" + End If + lstPayInfo.ListIndex = intBOOKMARK +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE ' & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +'Private Sub cboType_LostFocus() +'Dim strTYPE As String + +' If cboType.ListIndex > -1 Then +' strTYPE = Left(Str2Field(cboType.Text), 1) +' End If + +' If strTYPE = "L" Then 'Or strTYPE = "R" Or strTYPE = "W" Then +' txtFtMetal.Enabled = True +' txtFtMetal.BackColor = &H80000005 +' Else +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' End If + +'End Sub + +Private Sub cboWorkType_LostFocus() +Dim strTYPE As String, strWTYPE As String, strMSG As String + + strTYPE = Left(Str2Field(cboType), 1) + mstrType = strTYPE + If cboWorkType.ListIndex > -1 Then + strWTYPE = Left(Str2Field(cboWorkType), 1) + mstrWTYPE = strWTYPE + End If + + If strTYPE = "S" Then + If strWTYPE = "Y" Or strWTYPE = "Z" Then +' If strWTYPE = "C" Or strWTYPE = "P" Or strWTYPE = "Y" Or strWTYPE = "Z" Then +' or strqtype="W" or strwtype = "F" or strwtypeThen + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "L" Then + If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ + strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If +'**** start here + +' ElseIf strTYPE = "L" Then +' If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ +' strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then +' MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" +' cboWorkType.SetFocus +' Exit Sub +' End If + ElseIf strTYPE = "V" Then + If strWTYPE <> "C" And strWTYPE <> "W" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "C" Then + lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "Y" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "Y" Or strWTYPE = "Z" Then + strMSG = "Invalid Work Type has been selected. Only 'T', 'B' or 'W' are allowed, Select a valid worktype" + MsgBox strMSG, vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "B" Or strWTYPE = "T" Then + ' lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "C" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "B" Or strWTYPE = "T" Then + MsgBox "Invalid Work Type has been selected. Only 'Y', 'Z' or 'W' are allowed. Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "Y" Or strWTYPE = "Z" Then + lblYardge.Caption = "Frames" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + End If + +End Sub + +Private Sub cmdCalc_Click() +Dim dblPAYAMT As Double +Dim strTYPE As String, strWTYPE As String + If txtPercentDone = "" Then + txtPercentDone = "100" + End If + If moRSPay.State = adStateOpen Then + strTYPE = Field2Str(moRSPay!Type) + strWTYPE = Field2Str(moRSPay!worktype) + ' If strTYPE = "S" Then + ' If strWTYPE = "C" Or strWTYPE = "P" Then + + ' ElseIf strWTYPE = "B" Or strWTYPE = "S" Or strWTYPE = "T" Then + + ' ElseIf strWTYPE = "W" Or strWTYPE = "R" Or strWTYPE = "U" Or strWTYPE = "F" Then + + ' End If + ' End If + + If strTYPE = "L" Then + If (Not strWTYPE = "W" Or strWTYPE = "R") Then + dblPAYAMT = (((Field2Str2(txtYRate) * Field2Str2(txtYdge)) * Field2Str2(txtPercentDone)) / 100) + dblPAYAMT = dblPAYAMT + (((Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) * Field2Str2(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + txtAmount = Format(dblPAYAMT, "##,##0.00") + Else + dblPAYAMT = Format(txtYdge, "##,##0.00") + txtAmount = Format(dblPAYAMT, "##,##0.00") + End If + End If + + If strTYPE = "V" Then + If (Not strWTYPE = "W" Or strWTYPE = "R") Then + dblPAYAMT = (((Field2Str2(txtYRate) * Field2Str2(txtYdge)) * Field2Str2(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (((Field2Str2(txtmetal) * Field2Str2(txtMetalFt)) * Field2Str(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + txtAmount = Format(dblPAYAMT, "##,##0.00") + Else + txtAmount = Format(txtYdge, "##,##0.00") + End If + End If + + If strTYPE = "C" Then + ' If Not (strWTYPE = "W" Or strWTYPE = "R") Then + ' dblPAYAMT = (((Field2Str2(txtYRate) * Field2Str2(txtStone)) * Field2Str2(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (((Field2Str2(txtmetal) * Field2Str2(txtMetalFt)) * Field2Str(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + ' txtAmount = Format(dblPAYAMT, "##,##0.00") + ' End If + MsgBox "Scaffolding Payroll is not available", vbOKOnly, "No Calc Allowed" + Exit Sub + End If + + If strTYPE = "S" Then + If strWTYPE = "U" Or strWTYPE = "W" Or strWTYPE = "R" Or strWTYPE = "F" Then + txtAmount = Format(txtYdge, "##,##0.00") +' txtAmount = Format((((Field2Str2(txtYRate) * (Field2Str2(txtCMUYds)) * Field2Str(txtPercentDone)) / 100)), "##,##0.00") + Else 'If Not (strWTYPE = "W" Or strWTYPE = "F") Then + If Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Or Field2Str(moRS!texture) = "SS" Or Field2Str(moRS!texture) = "QS" Then + dblPAYAMT = (((Field2Str2(txtYRate) * (Field2Str2(txtYdge) - Field2Str2(txtFin2Yds))) * Field2Str2(txtPercentDone)) / 100) + dblPAYAMT = dblPAYAMT + (((Field2Str2(txtMetal) * Field2Str2(txtFin2Yds)) * Field2Str2(txtPercentDone)) / 100) + txtAmount = Format(dblPAYAMT, "##,##0.00") + Else + dblPAYAMT = (((Field2Str2(txtYRate) * Field2Str2(txtYdge)) * Field2Str2(txtPercentDone)) / 100) + txtAmount = Format(dblPAYAMT, "##,##0.00") + End If + End If + End If + End If + mboolCALC = True +End Sub +Private Sub GetCrew() + Dim strSQL As String, lngFind As Long + mintCREW = Field2Str2(txtCrewId) + strSQL = "SELECT * from tblCrewRate WHERE crew_id = " & mintCREW +' strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not moRSCREW.EOF Then + mstrCREW = moRSCREW!Crew_Boss + If Field2Str(moRSCREW!Type) = "L" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(moRSCREW!METAL), "#0.00") + ' txtFin2Rate = 0 + ' cboCrewType = "LATH" + End If + If Field2Str(moRSCREW!Type) = "V" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ' txtFin2Rate.Visible = False + ' cboCrewType = "V_STONE" + End If + If Field2Str(moRSCREW!Type) = "C" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + txtMetal = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblYRate = "Up Rate:" + lblMtlRate = "Down Rate:" + ' txtMetal.Visible = False + ' txtFin2Rate = Field2Str2(moRSCREW!sand) + ' txtFin2Rate = 0 + ' cboCrewType = "C_SCAFFOLD" + ' cboWorkType = "Y_UP" + ' cmdScaffold.SetFocus + ' chkBC.Enabled = False + End If + If Field2Str(moRSCREW!Type) = "S" Then + If Field2Str(moRS!texture) = "SK" Or Field2Str(moRS!texture) = "CS" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + lblFinish = "SKIP" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "SM" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + lblFinish = "SMOOTH" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "SA" Then + txtYRate = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblFinish = "SAND" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "S2" Then + txtYRate = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblFinish = "SAND" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "S3" Then + txtYRate = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblFinish = "SAND" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "S4" Then + txtYRate = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblFinish = "SAND" + txtMetal = 0 + txtMetal.Visible = False + ElseIf Field2Str(moRS!texture) = "SB" Then + txtYRate = Format(Field2Str2(moRSCREW!syn), "#0.00") + lblFinish = "SYNTHETIC" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "QU" Then + txtYRate = Format(Field2Str2(moRSCREW!qu), "#0.00") + lblFinish = "QUERNAVACA" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "MN" Then + txtYRate = Format(Field2Str2(moRSCREW!mn), "#0.00") + lblFinish = "MONTERREY" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "DA" Then + txtYRate = Format(Field2Str2(moRSCREW!dash), "#0.00") + lblFinish = "DASH" + txtMetal = 0 + txtMetal.Visible = False + ' txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "SS" Then + txtYRate = Format(Field2Str2(moRSCREW!lath_skip), "#0.00") + lblFinish = "SKIP AND SAND" + txtMetal = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblMRate = "Finish 2 Rate:" + ' txtFin2Rate = Field2Str2(moRSCREW!sand) + ElseIf Field2Str(moRS!texture) = "MF" Then + txtYRate = Format(Field2Str2(moRSCREW!mn), "#0.00") + lblFinish = "MONTERREY AND SAND" + txtMetal = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblMRate = "Finish 2 Rate:" + ElseIf Field2Str(moRS!texture) = "QS" Then + txtYRate = Format(Field2Str2(moRSCREW!qu), "#0.00") + lblFinish = "QUERNAVACA AND SAND" + txtMetal = Format(Field2Str2(moRSCREW!sand), "#0.00") + lblMRate = "Finish 2 Rate:" + End If + ' cboCrewType = "STUCCO" + End If + End If + +End Sub + +Private Sub StoneFix() +Dim intResponse As Integer + + intResponse = InputBox("Enter The Correct Square Footage Of The Stone Veneer", "Correct Stone", 0) + moRS!ST_SQFT = Integer2Field(intResponse) + moRS.Update + Call FormShow + +End Sub + +Private Sub CMUFix() +Dim intResponse As Integer + + intResponse = InputBox("Enter The Correct Square Yardage Of The CMU", "Correct CMU Yardage", 0) + moRS!CMU = Integer2Field(intResponse) + moRS.Update + Call FormShow + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +' strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID +' Set moRSMemo = New Recordset +' moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' If moRSMemo.EOF Then +' strSql2 = "SELECT * FROM tblYardMemo" ' WHERE lot_id = " & gintLOTID +' Set moRSMemo = New Recordset +' moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' moRSMemo.AddNew +' moRSMemo!Lot_id = gintLOTID +' moRSMemo.Update +' strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID +' Set moRSMemo = New Recordset +' moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' End If + +End Sub +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + mstrPType = txtCrewType + aTabs(0) = 25 + aTabs(1) = 50 + aTabs(2) = 90 + aTabs(3) = 150 + aTabs(4) = 200 + +' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblPaySheet WHERE not paid and not invalid and type <> 'C' and lotid =" & gintLOTID & " and type = '" & mstrPType & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crewID) + Call GetCrew + strLine = oRS!Type & vbTab & oRS!worktype & vbTab & oRS!pay_ydge & vbTab & IIf(oRS!METAL = 0, "", oRS!METAL) + strLine = strLine & vbTab & IIf(oRS!paid, "Paid", (IIf(oRS!bc, "B/C", "Not Paid"))) + If oRS!paid Then + strLine = strLine & vbTab & oRS!crewID & vbTab & mstrCREW + End If + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!payid) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + Else + strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If + +End Sub + + +Private Sub cmdRePrint_Click() +Dim strTYPE As String, strREPORT As String, intCOUNT As Integer +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + strTYPE = Left(Str2Field(cboType.Text), 1) + + If strTYPE = "S" Then + strREPORT = App.Path & "\RPstuccopay.rpt" + ElseIf strTYPE = "L" Then + strREPORT = App.Path & "\RPLathpay.rpt" +' Exit Sub + ElseIf strTYPE = "B" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "T" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "H" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "R" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "W" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "F" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + ElseIf strTYPE = "U" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Exit Sub + End If + + strSQL = "{tblPAYSHEET.payid} = " & gintPAYID + crPAY.ReportFileName = strREPORT + crPAY.ReplaceSelectionFormula (strSQL) + crPAY.CopiesToPrinter = gintCOPY + crPAY.Destination = crptToWindow +' crpay.Destination = crptToPrinter + crPAY.Action = 1 + intCOUNT = Field2Integer(moRSPay!rpcount) + intCOUNT = intCOUNT + 1 + moRSPay!rpcount = intCOUNT + moRSPay!rpdate = Date + moRSPay!RPUSER = gstrLOGIN + moRSPay.Update + cmdRePrint.Enabled = False + cmdAddPS.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module cmdRePrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mboolSTOP = False +' Call AddPay + If Not mboolCALC Then + MsgBox "You Must Calculate the Pay before Saving", vbOKOnly, "Calc Required" + Exit Sub + End If + If Not mboolSTOP Then + Call FormSave + lstPayInfo.Enabled = True + cmdSave.Enabled = False +' cmdAddPS.Enabled = True + cmdExit.Enabled = True + txtMDesc.Enabled = False + txtNotes.Enabled = False +' frmPayHead.chkADD = vbUnchecked +' Call PrintPay + Else + cboType.SetFocus + End If +' Call PrintPay + Call cmdExit_Click + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + mboolCALC = False + + Call ProjLoad + Call LotLoad +' lblPSheet = "Pay Sheets for " & Trim$(moRSProj!proj_desc) & " Lot # " & Trim$(moRS!lot_no) + Call PayLoad + Call WTLoad +' Call SetTime + + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, You Cannot Pay", vbOKOnly + vbQuestion, "No Pay SHeets") + ' If intResponse = vbYes Then + ' Call cmdAddPS_Click + ' strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + ' Set moRSPay = New Recordset + ' moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + ' If moRSPay.EOF Then +' End If + ' Else + Unload Me + ' End If + End If +' If chkLook Then +' mboolLOOK = True +' End If +' If chkLook Then +' If mboolLOOK Then +' cmdSavePay.Enabled = False +' cmdDelPay.Enabled = False +' cmdAddPay.Enabled = False +' cmdFindCrew.Visible = False +' txtPercentDone.Enabled = False +' txtVerify.Enabled = False +' txtCrewNo.Enabled = False +' txtPayDate.Enabled = False +' txtCheckNo.Enabled = False +' txtPayAmt.Enabled = False +' txtNotes.Enabled = False +' txtOffice.Enabled = False + cboType.Enabled = False +' cboType.Enabled = False +' txtCrewName.Enabled = False +' End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyB Then ' Display key combinations. +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + Call MarkPaid + End If + Exit Sub + End If + If KeyCode = vbKeyY Then ' Display key combinations. + If CtrlDown Then +' txtYRate.Enabled = True + txtYRate = InputBox("Enter the New Rate Per Yard (#.##) For This Lot", "New Rate", 0#) +' txtYRate.Enabled = False + End If + Exit Sub + End If + If KeyCode = vbKeyM Then ' Display key combinations. + If CtrlDown Then +' txtYRate.Enabled = True + txtMetal = InputBox("Enter the New Rate Per Foot On Metal (#.##) For This Lot", "New Rate", 0#) +' txtYRate.Enabled = False + End If + Exit Sub + End If +' If Not cmdSave.Enabled Then +' cmdSave.Enabled = True +' End If + +End Sub + +Private Sub MarkPaid() +Dim intBOOKMARK As Integer + + intBOOKMARK = lstPayInfo.ListIndex +' moRSPay!pdamt = 0 + moRSPay!paid = vbChecked + moRSPay.Update + Call PayLoad + If lstPayInfo.ListIndex <> -1 Then + lstPayInfo.ListIndex = intBOOKMARK + Else + Call cmdExit_Click + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes +' Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() +' Set moRSProj = New Recordset + + mboolCALC = False + + Call ProjLoad + Call LotLoad +' lblPSheet = "Pay Sheets for " & Trim$(moRSProj!proj_desc) & " Lot # " & Trim$(moRS!lot_no) + Call PayLoad + Call SetTime + If FormFind() Then + Call FormShow + End If + +End Sub + +Private Sub SetTime() +Dim strSQL As String + + strSQL = "SELECT * FROM tblTIME WHERE idnum = 10" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPaySheet " + strSQL = strSQL & "WHERE payid = " & mlngTIME + + Set moRSPay = New Recordset +' If moRSTime.State = adStateOpen Then +' moRSTime.Close +' End If + + moRSPay.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function + +Private Sub FormClear() + txtCDate = "" + txtLogin = "" + txtRPDate = "" + txtRPId = "" + txtRPCount = "" + txtPSNum = "" + txtYdge = "" + txtFtMetal = "" + txtYRate = "" + txtMetal = "" + txtCrew = "" + txtCrewName = "" + txtAmount = "" + txtNotes = "" + txtMDesc = "" + txtFin2Yds = "" + txtPercentDone = "" + chkPaid = vbUnchecked + chkPaid.Visible = False + chkInvalid = vbUnchecked + chkInvalid.Visible = False + cboType.ListIndex = -1 + cboWorkType.ListIndex = -1 + +End Sub + +Private Sub FormSave() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTIME WHERE idnum = 10" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + moRSTIME.AddNew + End If + + ' Store the controls to the recordset + If Not moRS.EOF Then + Call FieldsSave + End If + +' moRSMemo!payroll = Str2Field(txtLotNotes) +' moRSMemo.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormShow() +Dim intLoop As Integer, strSTR As String, intLEN As Integer +Dim strWTYPE As String + + mboolSHOW = True +' txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtLathYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtStYds = Format((Field2Integer(moRS!s_yds)), "##,###") +' txtLathYds = Format((Field2Integer(moRS!sq_yd) - 19), "##,###") +' txtStYds = Format((Field2Integer(moRS!s_yds) -24), "##,###") + txtFrames = Format((Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10)), "##,###") + txtCMUYds = Format(Field2Integer(moRS!CMU), "##,###") + txtMatYds = Format(Field2Integer(moRS!sq_yd), "##,###") + txtMetalFt = Format(Field2Long(moRS!METAL), "##,###") + lblPSheet = "Pay Sheets for " & Trim$(moRSProj!Proj_Desc) & " Lot # " & Trim$(moRS!lot_no) & " " & Trim$(Field2Str(moRS!model)) +' txtModel = Field2Str(moRS!model) + txtStone = Format(Field2Str(moRS!ST_SQFT), "##,###") + txtIStone = Field2Str2(moRS!PMisc) + txtFin2Yds = Field2Str2(moRS!fin2) + txtCrew = Field2Integer(txtCrewId) + mintCREW = Field2Integer(txtCrewId) + + With moRSPay + If !bc Then + chkBC = vbChecked + Else + chkBC = vbUnchecked + End If + If !paid Then + chkPaid.Visible = True + chkPaid = vbChecked + Else + chkPaid.Visible = False + chkPaid = vbUnchecked + End If + If !invalid Then + chkInvalid.Visible = True + chkInvalid = vbChecked + Else + chkInvalid.Visible = False + chkInvalid = vbUnchecked + End If + txtCDate = FormatDateTime(Field2Str(!C_Date), 2) + txtLogin = Field2Str(!Create) + txtRPDate = Field2Str(!rpdate) + txtRPId = Field2Str(!RPUSER) + txtRPCount = Field2Str2(!rpcount) + txtPSNum = Field2Str(!sheet) + txtYdge = Format(Field2Str2(!pay_ydge), "##,###") +' txtAmount = Field2Str2(!amt) + txtFtMetal = Format(Field2Str2(!METAL), "##,###") + txtYRate = IIf(Field2Str2(!Y_Rate) > 0, Format(Field2Str2(!Y_Rate), "#.00"), "") + txtMetal = IIf(Field2Str2(!M_Rate) > 0, Format(Field2Str2(!M_Rate), "#.00"), "") + txtMDesc = Field2Str(!m_desc) +' txtCrew = Field2Integer(!crewid) +' mintCREW = Field2Integer(!crewid) + txtNotes = Field2Str(!notes) + Call GetCrew + txtCrewName = mstrCREW +' txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) +' txtCheckNo = Field2Str(!prcheck) + txtAmount = IIf(Field2Str2(!Amt) > 0, Format(Field2Str(!Amt), "##,###.00"), "") + +' If !pay_type = "L" Then +' cboType.Text = "LATH" +' ElseIf !pay_type = "S" Then +' cboType.Text = "STUCCO" +' ElseIf !pay_type = "R" Then +' cboCrewType.Text = "Repair/PO" +' ElseIf !pay_type = "V" Then +' cboCrewType.Text = "V_Stone" +' End If + + If !Type = "S" Then + cboType.Text = "Stucco" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + lblYardge = "Yardage:" + ElseIf !Type = "L" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80000005 + cboType.Text = "Lath" + lblYardge = "Yardage:" + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "V_Stone" + lblYardge = "Sq. Feet:" + ElseIf !Type = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Y_Synthetic" + lblYardge = "Yardage:" + ElseIf !Type = "C" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "C_Scaffold" + lblYardge = "Frames:" + ElseIf !Type = "X" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "X_Paint" + lblYardge = "Sq. Feet:" + End If + + strWTYPE = Field2Str(!worktype) +' intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + cboWorkType.col = 2 + strWTYPE = cboWorkType.ColText + + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + + + If !worktype = "B" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Brown" + ElseIf !worktype = "C" Then + If !Type = "L" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Complete" + ElseIf !worktype = "P" Then + If !Type = "L" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Partial" + ElseIf !worktype = "T" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Texture" + ElseIf !worktype = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Scratch" + ElseIf !worktype = "R" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Repair" + lblYardge = "Pay Amount:" +' txtFtMetal.Enabled = False + + ElseIf !worktype = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "WorkOrder/PO" + lblYardge = "Pay Amount:" + ElseIf !worktype = "F" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Fence" + lblYardge = "Pay Amount:" + ElseIf !worktype = "U" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "U_CMU" + lblYardge = "Pay Amount:" + ElseIf !worktype = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Y_UP" + lblYardge = "Frames:" + ElseIf !worktype = "Z" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Z_DOWN" + lblYardge = "Frames:" + ElseIf !Type = "X" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Z_DOWN" + lblYardge = "Pay Amount:" + Else + cboWorkType.ListIndex = -1 + End If + + End With + If mboolLOOK Then + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboType.Enabled = False + End If + txtILYds = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIStYds = IIf(Field2Str2(moRS!pystucco) > 0, Format(Field2Str2(moRS!pystucco), "##,###"), "") + txtIMetal = IIf(Field2Str2(moRS!pmetal) > 0, Format(Field2Str2(moRS!pmetal), "##,###"), "") + txtICMU = IIf(Field2Str2(moRS!pcmu) > 0, Format(Field2Str2(moRS!pcmu), "##,###"), "") + txtMDollars = IIf(Field2Str2(moRS!pmdollars) > 0, Format(Field2Str2(moRS!pmdollars), "##,###"), "") + mboolSHOW = False +End Sub + +Private Sub lstPayInfo_Click() + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + ' gintPAYID = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + +End Sub + +Private Sub cmdAddPS_Click() + Call FormClear + lstPayInfo.Enabled = False +' txtVerify = Date + cmdSave.Enabled = True + cmdAddPS.Enabled = False +' cmdFindCrew.Visible = True + mboolAdding = True + cboType.SetFocus +End Sub + +Private Sub AddPay() +Dim intLATH As Integer, intSTUCCO As Integer, intMETAL As Integer, strTYPE As String +Dim intPLATH As Integer, intPSTUCCO As Integer, intPMETAL As Integer, strMSG As String +Dim intPCMU As Integer, intPSTONE As Integer, intPDOLLARS As Integer, intCALC As Integer +Dim intCLATH As Integer, intCSTUCCO As Integer, intCMETAL As Integer, lngID As Long +Dim strWTYPE As String, intSTONE As Integer, intCSTONE As Integer +Dim intFRAMES As Integer, intCFRAMES As Integer, intPFRAMES As Integer +Dim strSQL As String, oRSM As Recordset + + strTYPE = Left(Str2Field(cboType.Text), 1) + strWTYPE = Left(Str2Field(cboWorkType.Text), 1) + + lngID = Field2Str2(moRS!Lot_ID) + intLATH = Field2Str2(moRS!l_yds) + intSTUCCO = Field2Str2(moRS!s_yds) + intMETAL = Field2Str2(moRS!METAL) + intSTONE = Field2Str2(moRS!ST_SQFT) + intFRAMES = Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10) + + intPLATH = Field2Str2(moRS!pylath) + intPSTUCCO = Field2Str2(moRS!pystucco) + intPMETAL = Field2Str2(moRS!pmetal) + intPCMU = Field2Str2(moRS!pcmu) + intPSTONE = Field2Str2(moRS!PMisc) + intPDOLLARS = Field2Str2(moRS!pmdollars) + + If strTYPE = "S" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCSTUCCO = intPSTUCCO + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards to High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + moRS!pystucco = intCSTUCCO + moRS.Update + ElseIf strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + ElseIf strWTYPE = "S" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Scratch Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) +' intCSTUCCO = intCALC + Field2Str2(txtYdge) +' If intCSTUCCO > intSTUCCO Then +' strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" +' MsgBox strMSG, vbOKOnly, "Yards to High" +' mboolSTOP = True +' mboolAdding = False +' Exit Sub +' End If + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + + End If +' moRS!pystucco = intCSTUCCO +' moRS.Update + ElseIf strTYPE = "L" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCLATH = intPLATH + Field2Str2(txtYdge) + intCMETAL = intPMETAL + Field2Str2(txtFtMetal) + If intCLATH > intLATH Then + strMSG = CStr(intCLATH) & " is greater than the " & CStr(intLATH) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + If intCMETAL > intMETAL Then + strMSG = CStr(intCMETAL) & " is greater than the " & CStr(intMETAL) & " metal feet allowed" + MsgBox strMSG, vbOKOnly, "Metal too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + moRS!pylath = intCLATH + moRS!pmetal = intCMETAL + moRS.Update + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + + ElseIf strTYPE = "V" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTONE = intPSTONE + Field2Str2(txtYdge) + If strWTYPE = "C" Then + If intCSTONE > intSTONE Then + strMSG = CStr(intCSTONE) & " Sq Feet of Stone is greater than the " & CStr(intSTONE) & " Sq Feet allowed" + MsgBox strMSG, vbOKOnly, "Square Footage to High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + moRS!PMisc = Field2Str2(intCSTONE) + moRS.Update + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "Y" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTUCCO = Field2Str2(txtYdge) + If strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + ElseIf strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "C" Then + strSQL = "SELECT SUM(pay_ydge) as MAXField FROM tblPaySHeet WHERE lotid = " & lngID + strSQL = strSQL & " and type = 'C' and worktype = '" & strWTYPE & "'" 'W'" + Set oRSM = New Recordset + oRSM.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSM.EOF Then + intCALC = Field2Integer(oRSM!maxfield) + Else + intCALC = 0 + End If + oRSM.Close +' intCALC = FindSum("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCFRAMES = intCALC + Field2Str2(txtYdge) + If strWTYPE = "Y" Or strWTYPE = "Z" Then + If intCFRAMES > intFRAMES Then + strMSG = CStr(intCFRAMES) & " Scaffold Frames is greater than the " & CStr(intFRAMES) & " frames allowed" + MsgBox strMSG, vbOKOnly, "Too Many Frames" + mboolSTOP = True +' mboolAdding = False + Exit Sub + End If + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + Exit Sub + End If +' moRS!PMisc = intCFRAMES +' moRS.Update + End If + +End Sub + +Private Sub FieldsSave() +Dim lngTIMEID As Long, strID As String, strWT As String, strDESC As String + + On Error GoTo Error_EH + With moRSTIME + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !lot_no = Str2Field(moRS!lot_no) + !paydt = Date + !pay_type = Left(Str2Field(cboType.Text), 1) +' cboWorkType.col = 0 +' strID = cboWorkType.ColText + cboWorkType.col = 1 + strWT = cboWorkType.ColText +' cboWorkType.col = 2 +' strDESC = cboWorkType.ColText +' !workdone = Left(Str2Field(cboWorkType.Text), 1) + !WorkDone = strWT + !C_USER = gstrLOGIN + !pct_done = Integer2Field(txtPercentDone) + !pay_id = gintPAYID + !proj_lot = Trim(Field2Str(moRSProj!Proj_Code)) & " " & Trim(Field2Str(moRS!lot_no)) + !yd_rate = Double2Field(txtYRate) + If Left(Str2Field(cboType.Text), 1) = "S" Then + !fin2_Rate = Double2Field(txtMetal) + ElseIf Left(Str2Field(cboType.Text), 1) = "L" Then + !mtl_Rate = Double2Field(txtMetal) + End If +' !bc = vbUnchecked + !ponum = 0 + !scafid = 0 + !up = vbUnchecked + !frames = 0 + !crew = Integer2Field(txtCrewId) +' !pay_amt = Str2Field(txtAmount) + !notes = Str2Field(txtMDesc) + If chkBC Then + !bc = vbChecked + !pay_amt = (Double2Field(txtAmount) * -1) +' !pay_amt = (Integer2Field(txtAmount) * -1) + Else + !bc = vbUnchecked + !pay_amt = (Double2Field(txtAmount)) +' !pay_amt = (Integer2Field(txtAmount)) + End If + + !office = Str2Field(txtNotes) + + !U_USER = gstrLOGIN + !Update = Date + End With + moRSTIME.Update + + lngTIMEID = FindMax("tblTIME", "IDNUM") + + With moRSPay +' !pdamt = Field2Str2(txtPayAmt) + !Amt = Field2Str2(txtAmount) + !GROSSPAY = Field2Str2(txtAmount) + !paid = vbChecked + !Y_Rate = Field2Str2(txtYRate) + !M_Rate = Field2Str2(txtMetal) + !crewID = Field2Str2(txtCrewId) + !timeid = lngTIMEID + End With + moRSPay.Update + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormScaffold - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPayInfo_DblClick() +Dim strPAYID As String + strPAYID = gintPAYID +' If chkInvalid Then +' MsgBox "Reprint of this PaySheet is not allowed", vbOKOnly, "No Reprint" +' Exit Sub +' End If +' cmdAddPS.Enabled = False +' cmdRePrint.Enabled = True + lstPayInfo.Enabled = False + mboolAdding = True + If cboWorkType.ListIndex = -1 Then + cboWorkType.Enabled = True + cboWorkType.SetFocus + Else + txtPercentDone.SetFocus + End If + txtNotes.Enabled = True + txtMDesc.Enabled = True + cmdSave.Enabled = True +End Sub + +Private Sub txtFtMetal_GotFocus() + Call FieldSelect(txtFtMetal) +End Sub + +'Private Sub PrintStuccoPay() +'Dim strSQL As String, i As Integer +'Dim intTOTAL As Integer, intYDS As Integer +' +' On Error GoTo Error_EH +' +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +'' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' intTOTAL = Int((gintCOPY / 2) + 0.99) +' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +' i = 1 +' If gintCOPY > 3 Then +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +' intTOTAL = Int((gintCOPY / 2) + 0.99) +' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +' i = 1 +' Do Until i = ((gintCOPY / 2) + 1) +' crOrder.Formulas(1) = "PaySheetCount = " & i +' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +' crOrder.CopiesToPrinter = gintCOPY / 2 +' crOrder.Action = 1 +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!pay_ydge = intYDS +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS!multipay = vbChecked +' moRS.Update +' i = i + 1 +' Loop +' Exit Sub +' Else +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Action = 1 +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!pay_ydge = intYDS +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS.Update +' End If +' Exit Sub +' +'Error_EH: +' gstrMODULE = "Form LotInfo - Module PrintStuccoPay" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub + +Private Sub txtMDesc_GotFocus() + Call FieldSelect(txtMDesc) +End Sub + +Private Sub txtMDesc_LostFocus() + txtMDesc = UCase(txtMDesc) +End Sub + +Private Sub txtNotes_GotFocus() + txtNotes.SelStart = 2000 +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtYdge_GotFocus() + Call FieldSelect(txtYdge) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frx new file mode 100644 index 0000000..6e359b3 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmGetPaySheet.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frm new file mode 100644 index 0000000..9b488a0 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frm @@ -0,0 +1,2514 @@ +VERSION 5.00 +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmHourList + Caption = "Daily Payroll for Hourly Employees" + ClientHeight = 7080 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8295 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 7080 + ScaleWidth = 8295 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtCombOTHrs + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6090 + TabIndex = 60 + Top = 5070 + Width = 615 + End + Begin VB.TextBox txtCombRTHrs + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5385 + TabIndex = 58 + Top = 5070 + Width = 615 + End + Begin LpLib.fpList lstPayCrews + Height = 3960 + Left = 165 + TabIndex = 57 + Top = 720 + Width = 3765 + _Version = 196608 + _ExtentX = 6641 + _ExtentY = 6985 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 10 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmHourList.frx":0000 + End + Begin VB.TextBox txtPC2 + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 2445 + TabIndex = 54 + Top = 6780 + Width = 615 + End + Begin VB.TextBox txtPayCD + Alignment = 2 'Center + Height = 285 + Left = 6330 + TabIndex = 20 + Top = 5835 + Width = 570 + End + Begin VB.TextBox txtPC1 + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 1770 + TabIndex = 53 + Top = 6780 + Width = 615 + End + Begin VB.TextBox txtOTRate2 + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6735 + TabIndex = 49 + Top = 4515 + Width = 615 + End + Begin VB.TextBox txtOT2 + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6090 + TabIndex = 48 + Top = 4515 + Width = 615 + End + Begin VB.TextBox txtRT2 + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5355 + TabIndex = 47 + Top = 4515 + Width = 615 + End + Begin VB.TextBox txtPayRate2 + Alignment = 1 'Right Justify + BackColor = &H8000000F& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4725 + TabIndex = 46 + Top = 4515 + Width = 615 + End + Begin VB.TextBox txtCMSCD2 + Alignment = 2 'Center + BackColor = &H8000000F& + Height = 285 + Left = 4110 + TabIndex = 45 + Top = 4515 + Width = 570 + End + Begin VB.TextBox txtCMSCD1 + Alignment = 2 'Center + BackColor = &H8000000F& + Height = 285 + Left = 4110 + TabIndex = 44 + Top = 4785 + Width = 570 + End + Begin VB.TextBox txtOTR + Height = 285 + Left = 3690 + TabIndex = 38 + Top = 60 + Visible = 0 'False + Width = 225 + End + Begin VB.TextBox txtWCCODE + Height = 285 + Left = 3300 + TabIndex = 36 + Top = 435 + Visible = 0 'False + Width = 240 + End + Begin VB.CommandButton cmdDelDaily + Caption = "Delete Daily Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1410 + TabIndex = 35 + Top = 6180 + Width = 1170 + End + Begin VB.TextBox txtNotes + Height = 825 + Left = 4050 + MultiLine = -1 'True + TabIndex = 21 + Top = 6165 + Width = 4170 + End + Begin VB.CheckBox chkDeduct + Caption = "Automatic Deductions" + Height = 255 + Left = 6240 + TabIndex = 33 + TabStop = 0 'False + Top = 345 + Visible = 0 'False + Width = 2025 + End + Begin VB.CheckBox chkDone + Caption = "Sent to CMS" + Height = 210 + Left = 6345 + TabIndex = 32 + TabStop = 0 'False + Top = 5625 + Width = 1680 + End + Begin VB.CheckBox chkReady + Caption = "Ready to Process" + Height = 255 + Left = 6345 + TabIndex = 31 + TabStop = 0 'False + Top = 5385 + Width = 1650 + End + Begin VB.TextBox txtRate + Height = 225 + Left = 3345 + TabIndex = 30 + Top = 180 + Visible = 0 'False + Width = 195 + End + Begin VB.CommandButton cmdMAS90 + Caption = "Setup Hrly for CMS" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 29 + Top = 6180 + Width = 1170 + End + Begin VB.ListBox lstCrew + Height = 2985 + Left = 4005 + Sorted = -1 'True + TabIndex = 4 + TabStop = 0 'False + Top = 735 + Visible = 0 'False + Width = 4200 + End + Begin VB.ListBox lstHours + Height = 3180 + Left = 3990 + Sorted = -1 'True + TabIndex = 22 + Top = 735 + Width = 4215 + End + Begin VB.TextBox txtHrsWorked + Alignment = 1 'Right Justify + Height = 285 + Left = 5145 + TabIndex = 19 + Top = 5850 + Width = 1110 + End + Begin VB.CommandButton cmdAddDaily + Caption = "Add Daily Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1410 + TabIndex = 18 + Top = 5025 + Width = 1170 + End + Begin VB.CommandButton cmdSave + Caption = "Save Daily Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1410 + TabIndex = 23 + Top = 5610 + Width = 1170 + End + Begin MSComCtl2.DTPicker dtpWorkDate + Height = 300 + Left = 4950 + TabIndex = 15 + Top = 5475 + Width = 1290 + _ExtentX = 2275 + _ExtentY = 529 + _Version = 393216 + Format = 94830593 + CurrentDate = 43396 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 345 + Left = 1155 + TabIndex = 10 + Top = 90 + Width = 1335 + _ExtentX = 2355 + _ExtentY = 609 + _Version = 393216 + Format = 94830593 + CurrentDate = 43396 + End + Begin VB.TextBox txtDept + Height = 225 + Left = 2610 + TabIndex = 9 + TabStop = 0 'False + Top = 435 + Visible = 0 'False + Width = 330 + End + Begin VB.TextBox txtEmpName + Height = 225 + Left = 2580 + TabIndex = 8 + TabStop = 0 'False + Top = -15 + Visible = 0 'False + Width = 540 + End + Begin VB.CommandButton cmdAddName + Caption = "Add by Emp Last Name" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 7 + TabStop = 0 'False + Top = 5610 + Width = 1170 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2610 + TabIndex = 3 + Top = 5025 + Width = 1170 + End + Begin VB.TextBox txtEmpId + Height = 225 + Left = 2580 + TabIndex = 6 + TabStop = 0 'False + Top = 195 + Visible = 0 'False + Width = 585 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Employee" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2610 + TabIndex = 2 + Top = 5610 + Width = 1170 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add by Emp Number" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 1 + Top = 5025 + Width = 1170 + End + Begin VB.Label txtTtlCD1 + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7365 + TabIndex = 62 + Top = 4785 + Width = 870 + End + Begin VB.Label txtTtlCD2 + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7365 + TabIndex = 61 + Top = 4515 + Width = 870 + End + Begin VB.Label lblComb + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Combined" + Height = 195 + Left = 4560 + TabIndex = 59 + Top = 5145 + Width = 705 + End + Begin VB.Label lblSlsh2 + AutoSize = -1 'True + Caption = "/" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 5985 + TabIndex = 56 + Top = 4485 + Width = 90 + End + Begin VB.Label lblSlach + AutoSize = -1 'True + Caption = "/" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 5985 + TabIndex = 55 + Top = 4740 + Width = 90 + End + Begin VB.Label lblVALIDCD + AutoSize = -1 'True + Caption = "Valid CMS Pay Codes: " + Height = 195 + Left = 135 + TabIndex = 52 + Top = 6825 + Width = 1635 + End + Begin VB.Label lblCMSRTCD + AutoSize = -1 'True + Caption = "CMS Pay Code: " + Height = 195 + Left = 6930 + TabIndex = 51 + Top = 5880 + Width = 1170 + End + Begin VB.Label lblCMS + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "CMS Cd" + Height = 195 + Left = 4080 + TabIndex = 50 + Top = 4275 + Width = 600 + End + Begin VB.Label lblRTRate + Caption = "R Rate" + Height = 195 + Left = 4740 + TabIndex = 43 + Top = 4275 + Width = 585 + End + Begin VB.Label lblRTHrs + Alignment = 1 'Right Justify + Caption = "R Hrs" + Height = 180 + Left = 5370 + TabIndex = 42 + Top = 4275 + Width = 555 + End + Begin VB.Label lblOTHrs + Alignment = 1 'Right Justify + Caption = "OT Hrs" + Height = 195 + Left = 6015 + TabIndex = 41 + Top = 4275 + Width = 615 + End + Begin VB.Label lblOTRate + AutoSize = -1 'True + Caption = "OT Rate" + Height = 195 + Left = 6720 + TabIndex = 40 + Top = 4275 + Width = 615 + End + Begin VB.Label lblTTL + AutoSize = -1 'True + Caption = "WK Total" + Height = 195 + Left = 7485 + TabIndex = 39 + Top = 4275 + Width = 675 + End + Begin VB.Label txtOTRate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6735 + TabIndex = 37 + Top = 4785 + Width = 615 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3480 + TabIndex = 34 + Top = 6690 + Width = 570 + End + Begin VB.Label txtOT + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 6090 + TabIndex = 28 + Top = 4785 + Width = 615 + End + Begin VB.Label txtTtlWage + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7365 + TabIndex = 27 + Top = 5070 + Width = 870 + End + Begin VB.Label txtRT + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 5370 + TabIndex = 26 + Top = 4785 + Width = 615 + End + Begin VB.Label txtPayRate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 4725 + TabIndex = 25 + Top = 4785 + Width = 615 + End + Begin VB.Label lblTotal + AutoSize = -1 'True + Caption = "Pay Period Totals:" + Height = 195 + Left = 2745 + TabIndex = 24 + Top = 4755 + Width = 1290 + End + Begin VB.Label lblHrsWrk + AutoSize = -1 'True + Caption = "Hours Worked:" + Height = 195 + Left = 4005 + TabIndex = 17 + Top = 5865 + Width = 1080 + End + Begin VB.Label lblWorkDate + AutoSize = -1 'True + Caption = "Work Date:" + Height = 195 + Left = 4065 + TabIndex = 16 + Top = 5520 + Width = 825 + End + Begin VB.Label lblDept + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 4035 + TabIndex = 14 + Top = 3945 + Width = 585 + End + Begin VB.Label lblEmpName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5565 + TabIndex = 13 + Top = 3960 + Width = 2655 + End + Begin VB.Label lblEmpId + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 4665 + TabIndex = 12 + Top = 3960 + Width = 870 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 195 + TabIndex = 11 + Top = 180 + Width = 900 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired Employee listed below to add the Employee to the Hourly List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3960 + TabIndex = 5 + Top = 90 + Visible = 0 'False + Width = 3435 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Hourly Employee List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 240 + TabIndex = 0 + Top = 540 + Width = 1785 + End +End +Attribute VB_Name = "frmHourList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mintBOOKMARK1 As Integer, mintBOOKMARK2 As Integer +Dim moRSCREW As Recordset +Dim moRSMember As Recordset +Dim moRSHour As Recordset, moRSDaily As Recordset + +Dim mstrNUMCDS As String, msglGRS, msglTGS1, msglTGS2, msglTOHR As Single +Dim msglTRHR As Single, msglOHR2, msglRHR2, msglOHR1, msglRHR1 As Single +Dim mstrCCD2, mstrCCD1 As String, msgl1HR, msgl2HR, msglTHR As Single +Dim msglORT2, msglRRT2, msglORT1, msglRRT1 As Single +Dim mlngPCID2 As Long, mstrEMPID As String + +Dim msglRTHRS As Single, msglOTHRS As Single +Dim mboolAdding As Boolean, mlngPCID As Long, mboolSHOW As Boolean +Dim mlngDAYID As Long, mdblSUMHRS As Double, mdblGROSS As Double +Private Sub FormClearHrs() + dtpWorkDate.Value = dtpPayDate.Value +' dtpWorkDate.Value = Date + txtHrsWorked = "" + txtNotes = "" +' chkDeduct = vbUnchecked + chkDone = vbUnchecked + chkReady = vbUnchecked +End Sub + +Private Sub FormClearEmp() + lblDept = "" + lblEmpId = "" + lblEmpName = "" + txtTtlWage = "" + txtPayRate = "" + txtOTRate = "" + txtOT = "" + txtRT = "" + txtPayRate2 = "" + txtOTRate2 = "" + txtOT2 = "" + txtRT2 = "" + txtCombRTHrs = "" + txtCombOTHrs = "" + txtCMSCD1 = "" + txtCMSCD2 = "" + txtPC1 = "" + txtPC2 = "" +End Sub + +Private Sub UpPayRate() +Dim strEMPID As String, strPAYDT As String +Dim oRS As Recordset, strSQL As String, oRSS As Recordset, strSQLL As String + + lstPayCrews.col = 1 + strEMPID = lstPayCrews.ColText + + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strEMPID & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + strPAYDT = dtpPayDate.Value + strSQLL = "SELECT EMP_ID, PAY_DATE, RATE, Reg_RT2, OT_Rate, OT_RT2 FROM tblHOURLIST WHERE EMP_ID = '" & strEMPID & "' AND PAY_DATE = #" & strPAYDT & "#" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSS.EOF Then + oRSS!Rate = Field2Str2(oRS!Rate) + oRSS!Reg_RT2 = Field2Str2(oRS!RegRate2) + oRSS!OT_Rate = Field2Str2(oRS!OTRate) + oRSS!OT_RT2 = Field2Str2(oRS!OTRate2) + oRSS.Update + Exit Sub + End If + End If +End Sub + +Private Sub GetMember() +Dim strCREW As String, strName As String +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + strName = Format(Field2Str(lstCrew.ItemData(lstCrew.ListIndex)), "0000000") + strCREW = "SELECT * FROM PR1_EmployeeMaster where EmployeeNumber = '" & strName & "'" +' strCREW = "SELECT Department, employeenumber, firstname, lastname, Rate, Terminated FROM PR1_EmployeeMaster where EmployeeNumber = '" & strName & "'" +' strCREW = "SELECT Department, employeenumber, firstname, lastname, Terminated FROM PR1_EmployeeMaster where department = '52' and EmployeeNumber = '0004107'" '& strName & "'" + Set moRSMember = New Recordset +' moRSMember.Open strCREW, goConn2, adOpenKeyset, adLockOptimistic + moRSMember.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + If moRSMember!Terminated <> "A" Then + MsgBox "This Employee is Terminated - Be Sure To Correct Before Entering Payroll", vbOKOnly, "Terminated Employee" + End If + + If moRSMember.EOF Then + MsgBox "Critial Error - No Crew Member Found - Call Darv", vbCritical + vbOKOnly, "Critical Error" + Unload Me + End If + +End Sub + +Private Sub cmdAdd_Click() +Dim intID As Double, strSQL As String, strID As String +Dim oRS As Recordset + cmdAdd.Enabled = False + cmdAddName.Enabled = False + cmdDelete.Enabled = False + cmdMAS90.Enabled = False + cmdAddDaily.Enabled = False + cmdSave.Enabled = False + cmdDelDaily.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = Field2Double(InputBox("Enter The Employee Number To Add", "Employee Number", 9999)) + If intID = 0 Then + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdMAS90.Enabled = True + cmdAddDaily.Enabled = True + cmdSave.Enabled = True + cmdDelDaily.Enabled = True + cmdAdd.SetFocus + Exit Sub + End If + If Len(intID) > 0 Then +' If Not gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + strID = Format(intID, "0000000") + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" +' strSQL = "SELECT Department, EmployeeNumber, LastName, DefaultWCCode, FirstName, PayRate1, Terminated FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Call CrewLoad + Else + txtRate = Format(Field2Str2(oRS!Rate), "#,#.00") +' txtRate = "0" + If txtRate > 50 Then + MsgBox "This Employee Appears to be Salaried", vbOKOnly, "Salaried Employee" + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdMAS90.Enabled = True + cmdAddDaily.Enabled = True + cmdSave.Enabled = True + cmdDelDaily.Enabled = True + cmdAdd.SetFocus + Exit Sub + End If + txtEmpId = Field2Str(oRS!EmployeeNumber) + txtDept = Field2Str(oRS!department) + txtEmpName = Trim$(Field2Str(oRS!FirstName)) & " " & Trim$(Field2Str(oRS!LastName)) + txtWCCode = Field2Str(oRS!wc_code) + txtRate = Field2Str2(oRS!Rate) + txtOTR = Field2Str2(oRS!OTRate) + If oRS!Terminated <> "A" Then + MsgBox "This Employee is Terminated - Be Sure To Correct Before Entering Payroll", vbOKOnly, "Terminated Employee" + End If + txtWCCode = Field2Str(oRS!wc_code) + chkReady = vbUnchecked + chkDone = vbUnchecked + Call FormSaveEmp + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdMAS90.Enabled = True + cmdAddDaily.Enabled = True + cmdSave.Enabled = False + cmdDelDaily.Enabled = True + cmdAdd.SetFocus + End If + + End If + +End Sub + +Private Sub cmdAddDaily_Click() + cmdAdd.Enabled = False + cmdDelete.Enabled = False + cmdAddDaily.Enabled = False + cmdMAS90.Enabled = False + cmdDelDaily.Enabled = False + cmdAddName.Enabled = False + cmdSave.Enabled = True + lstHours.Enabled = False + lstPayCrews.Enabled = False + cmdMAS90.Enabled = False + mboolAdding = True + Call FormClearHrs +End Sub + +Private Sub cmdAddName_Click() +Dim strName As String, strSQL As String, strLine As String +Dim strSql2 As String, strSQL3 As String +Dim oRS As Recordset + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + cmdAdd.Enabled = False + cmdAddName.Enabled = False + cmdDelete.Enabled = False + cmdAddDaily.Enabled = False + cmdDelDaily.Enabled = False + cmdSave.Enabled = False + cmdMAS90.Enabled = False + 'Code to Add a Crew + mboolAdding = True + strName = InputBox("Enter The Employee Last Name To Add", "Employee Last Name") + If Len(strName) > 0 Then + strName = "lastname LIKE '" & Trim$(UCase(strName)) & "*'" + strSQL = "SELECT * FROM PR1_EmployeeMaster" +' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName, PayRate1, Terminated FROM PR1_EmployeeMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + oRS.Filter = strName + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + strLine = Trim$(Field2Str(oRS!FirstName)) & " " & Trim$(Field2Str(oRS!LastName)) + .AddItem strLine + .ItemData(.NewIndex) = oRS!EmployeeNumber + End With + oRS.MoveNext + Loop + lstHours.Visible = False + lstCrew.Visible = True + lblCrewInstruct.Visible = True + Else + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + End If + +End Sub + +Private Sub FieldsSaveEmp() +Dim strSQL As String, strSQLM As String +Dim oRS As Recordset, oRSM As Recordset, strName As String + + On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblHourList" ' WHERE Crew_Id = 1" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSQLM = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & txtEmpId & "'" + Set oRSM = New Recordset + oRSM.Open strSQLM, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "SELECT * FROM tblHourList" ' WHERE Crew_Id = 1" + Set moRSHour = New Recordset + moRSHour.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + moRSHour.AddNew + End If + + + With moRSHour + !Pay_Date = Field2Str(dtpPayDate.Value) + !emp_dept = Field2Str(txtDept) + !Emp_ID = Field2Str(txtEmpId) + strName = Mid(Field2Str2(txtEmpName), 1, 30) + !EmpName = strName +' !EmpName = Field2Str(txtEmpName) + !Rate = Field2Str2(txtRate) + !wc_code = Field2Str(txtWCCode) + !OT_Rate = Field2Str2(txtOTR) + !OT_RT2 = oRSM!OTRate2 + !Reg_RT2 = oRSM!RegRate2 + !RATECD1 = oRSM!RATECD1 + !RATECD2 = oRSM!RATECD2 + !ready = chkReady + !done = chkDone +' If chkDeduct Then +' !autodeduct = "Y" +' End If + End With + + moRSHour.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form HourList - Module FieldsSaveEmp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSaveHrs() +Dim strSQL As String, lngPCID As Long +Dim oRS As Recordset +Dim intTEST As Integer + + + On Error GoTo Error_EH + + lstPayCrews.col = 0 + lngPCID = Field2Str2(lstPayCrews.ColText) + + intTEST = moRSDaily.State + If mboolAdding Then + moRSDaily.AddNew + End If + + + With moRSDaily + !Date = Field2Str(dtpWorkDate.Value) + !emp_no = Field2Str(lblEmpId) + !hours = Field2Str2(txtHrsWorked) + !notes = Field2Str(txtNotes) + !pc_id = lngPCID + !PAYCD = txtPayCD +' !pc_id = lstPayCrews.ItemData(lstPayCrews.ListIndex) + End With + + moRSDaily.Update + + moRSHour!ready = chkReady + moRSHour!done = chkDone + moRSHour.Update + + Exit Sub + +Error_EH: +' If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' Resume Next +' End If + gstrMODULE = "Form HourList - Module FieldsSaveHrs" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSaveEmp() +Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSaveEmp + + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + txtEmpId = "" + txtDept = "" + txtEmpName = "" + txtRate = 0 + txtWCCode = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module FormSaveEmp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSaveHrs() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSaveHrs + Call GetEmpHours + Call SumHours +' moRSHour!hours = mdblSUMHRS +' moRSHour!GROSS = mdblGROSS +' If Field2Str2(moRSHour!hours) > 40 Then +' txtRT = "40.00" +' txtOT = Format((Field2Str2(moRSHour!hours) - 40), "#.00") +' Else +' txtRT = Format(Field2Str2(moRSHour!hours), "#.00") +' txtOT = ".00" +' End If +' moRSHour!Reg_HRS = Field2Str2(txtRT) +' moRSHour!OT_HRS = Field2Str2(txtOT) +' moRSHour.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + +' txtEmpId = "" +' txtDept = "" +' txtEmpName = "" +' txtRate = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module FormSaveHrs" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() + +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblHourList WHERE Pay_Date = #" & dtpPayDate.Value & "# ORDER BY emp_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until oRS.EOF + With lstPayCrews + strLine = Field2Str(oRS!pc_id) & vbTab & Field2Str(oRS!Emp_ID) & vbTab & Field2Str(oRS!EmpName) + strLine = strLine & vbTab & Field2Str(oRS!RATECD1) & vbTab & Field2Str(oRS!RATECD2) & vbTab + strLine = strLine & Field2Str(oRS!Rate) & vbTab & Field2Str(oRS!Reg_RT2) & vbTab & Field2Str(oRS!OT_Rate) & vbTab + strLine = strLine & Field2Str(oRS!OT_RT2) & vbTab & Field2Str(oRS!gross) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!pc_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + Else + lstPayCrews.ListIndex = -1 + lstHours.Clear + Call FormClearHrs + Call FormClearEmp + cmdDelete.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub HoursLoad() + +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + +' strSQL = "SELECT * from tblHrDaily WHERE PC_ID = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) & " ORDER BY DATE" + strSQL = "SELECT * from tblHrDaily WHERE PC_ID = " & mlngPCID & " ORDER BY DATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHours.Clear + + Do Until oRS.EOF + With lstHours + strLine = Field2Str(oRS!Date) & vbTab & Format(Field2Str(oRS!hours), "#.00") & vbTab & oRS!PAYCD + .AddItem strLine + .ItemData(.NewIndex) = oRS!DAY_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHours.ListCount Then + lstHours.ListIndex = 0 + Else + strSQL = "SELECT * FROM tblHRDaily" + Set moRSDaily = New Recordset + moRSDaily.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + lstHours.ListIndex = -1 + cmdDelete.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module HoursLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + + strYN = MsgBox("Are You Sure You Want To Delete This Crew Member?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblHRDaily where PC_ID = " & mlngPCID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblhourlist where PC_id = " & mlngPCID '& "' and Pay_Date = #" & dtpPayDate & "#" + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + If (txtPayCD = "" Or IsNull(txtPayCD)) Then + If txtHrsWorked = "" Or txtHrsWorked = "0" Or IsNull(txtHrsWorked) Then + Else + MsgBox "CMS Pay Code Is Required", vbOKOnly, "Need Pay Code" + txtPayCD.SetFocus + Exit Sub + End If + End If + mintBOOKMARK1 = lstPayCrews.ListIndex + mintBOOKMARK2 = lstHours.ListIndex + cmdAdd.Enabled = True + cmdAddDaily.Enabled = True + cmdDelete.Enabled = True + lstPayCrews.Enabled = True + cmdMAS90.Enabled = True + lstHours.Enabled = True + cmdSave.Enabled = False + Call FormSaveHrs + lstPayCrews.ListIndex = mintBOOKMARK1 + lstHours.ListIndex = mintBOOKMARK2 +End Sub + +Private Sub cmdDelDaily_Click() +Dim strSQL As String + + strSQL = "DELETE * FROM tblHRDAILY WHERE DAY_ID = " & mlngDAYID + goConn.Execute strSQL + Call HoursLoad + Call GetEmpHours + Call SumHours + moRSHour!hours = mdblSUMHRS + moRSHour!gross = mdblGROSS + If Field2Str2(moRSHour!hours) > 40 Then + txtRT = "40.00" + txtOT = Format((Field2Str2(moRSHour!hours) - 40), "#.00") + Else + txtRT = Format(Field2Str2(moRSHour!hours), "#.00") + txtOT = ".00" + End If + moRSHour!reg_hrs = Field2Str2(txtRT) + moRSHour!OT_Hrs = Field2Str2(txtOT) + moRSHour.Update + cmdDelDaily.Enabled = False + cmdAddDaily.Enabled = True + cmdSave.Enabled = False +End Sub + +Private Sub dtpPayDate_Change() + Call PayLoad +End Sub + +Private Sub dtpPayDate_Click() + Call PayLoad +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + + If KeyCode = vbKeyU Then ' Update Pay Rates + If CtrlDown Then + Call UpPayRate + End If + Exit Sub + End If + + + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + + dtpPayDate = Date + dtpWorkDate = Date +' frmHourList.Width = 4140 +' frmHourList.Width = 4725 +' Call GetCrew + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindEmp() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblHourList WHERE PC_ID = " & mlngPCID + Set moRSHour = New Recordset + moRSHour.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + + If moRSHour.EOF Then + FormFindEmp = False + Else + FormFindEmp = True + '**** Load Module storage + With moRSHour + mlngPCID2 = Field2Str2(!pc_id) + mstrEMPID = Field2Str(!Emp_ID) + msglRRT1 = Field2Str2(!Rate) + msglORT1 = Field2Str2(!OT_Rate) + msglRRT2 = Field2Str2(!Reg_RT2) + msglORT2 = Field2Str2(!OT_RT2) + msglTHR = Field2Str2(!hours) + mstrCCD1 = Field2Str2(!RATECD1) + mstrCCD2 = Field2Str2(!RATECD2) + msglRHR1 = Field2Str2(!reg_hrs) + msglOHR1 = Field2Str2(!OT_Hrs) + msglRHR2 = Field2Str2(!Reg_HRS2) + msglOHR2 = Field2Str2(!OT_Hrs2) + msglTRHR = Field2Str2(!RTHours) + msglTRHR = Field2Str2(!OTHours) + msglTGS1 = Field2Str2(!GROSS_CD1) + msglTGS2 = Field2Str2(!GROSS_CD2) + msglGRS = Field2Str2(!gross) + mstrNUMCDS = Field2Str(!CODES) + End With + End If + Exit Function + +Error_EH: + gstrMODULE = "Form HourList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindHrs() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblHrDaily WHERE DAY_ID = " & mlngDAYID + Set moRSDaily = New Recordset + moRSDaily.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSDaily.EOF Then + FormFindHrs = False + Else + FormFindHrs = True +' mlngDAYID = moRSDaily!DAY_ID + End If + Exit Function + +Error_EH: + gstrMODULE = "Form HourList - Module FormFindHrs" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub ClearEmp() + + lblDept = "" + lblEmpId = "" + lblEmpName = "" + txtPayRate = 0 + txtPayRate2 = 0 + txtOTRate = 0 + txtOTRate2 = 0 + txtTtlWage = 0 + txtPC1 = "" + txtPC2 = "" + txtCMSCD1 = "" + txtCMSCD2 = "" + txtRT = ".00" + txtOT = ".00" + txtRT2 = ".00" + txtOT2 = ".00" + txtCombRTHrs = 0 + txtCombOTHrs = 0 + txtTtlCD1 = "" + txtTtlCD2 = "" + chkReady = vbUnchecked + chkDone = vbUnchecked + +End Sub + +Private Sub FormShowEmp() + On Error GoTo Error_EH + + mboolSHOW = True + With moRSHour + lblDept = Field2Str(!emp_dept) + lblEmpId = Field2Str(!Emp_ID) + lblEmpName = Field2Str(!EmpName) + txtPayRate = Format(Field2Str(!Rate), "#.00") + txtPayRate2 = Format(Field2Str(!Reg_RT2), "#.00") + txtOTRate = Format(Field2Str(!OT_Rate), "#.00") + txtOTRate2 = Format(Field2Str(!OT_RT2), "#.00") +' If Field2Str2(!hours) > 40 Then +' txtRT = "40.00" +' txtOT = Format((Field2Str2(!hours) - 40), "#.00") +' Else +' txtRT = Format(Field2Str2(!hours), "#.00") +' txtOT = ".00" +' End If + + txtTtlWage = Format(Field2Str2(!gross), "#,#.00") + txtPC1 = Field2Str(!RATECD1) + If txtPC1 = "0" Then + txtPC1 = "" + End If + txtCMSCD1 = Field2Str(!RATECD1) + txtPC2 = Field2Str(!RATECD2) + If txtPC2 = "0" Then + txtPC2 = "" + End If + txtRT = Format(Field2Str2(!reg_hrs), "#,#.00") + txtOT = Format(Field2Str2(!OT_Hrs), "#,#.00") + If txtPC2 = "" Then + txtCMSCD2 = "NONE" + txtRT2 = ".00" + txtOT2 = ".00" + Else + txtCMSCD2 = Field2Str(!RATECD2) + txtRT2 = Format(Field2Str2(!Reg_HRS2), "#,#.00") + txtOT2 = Format(Field2Str2(!OT_Hrs2), "#,#.00") + End If +' If Len(txtPC1) >= 1 Then +' !Codes = 1 +' .Update + If Len(txtPC1) >= 1 And Len(txtPC2) >= 1 Then + !CODES = 2 + .Update + ElseIf Len(txtPC1) >= 1 Then + !CODES = 1 + .Update + End If + txtCombRTHrs = Format(Field2Str2(!RTHours), "#,#.00") + txtCombOTHrs = Format(Field2Str2(!OTHours), "#,#.00") + txtTtlCD1 = Format(Field2Str2(!GROSS_CD1), "#,#.00") + txtTtlCD2 = Format(Field2Str2(!GROSS_CD2), "#,#.00") + chkReady = Field2CheckBox(!ready) + chkDone = Field2CheckBox(!done) + +' If !autodeduct = "Y" Then +' chkDeduct = vbChecked +' Else +' chkDeduct = vbUnchecked +' End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module FormShowEmp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowHrs() +Dim strRate_CD As String + + + On Error GoTo Error_EH + + mboolSHOW = True + With moRSDaily + strRate_CD = Field2Str(!PAYCD) + If strRate_CD = 1 Then + txtHrsWorked = Format(Field2Str(!hours), "#.00") + txtPayCD = strRate_CD + ElseIf strRate_CD > 2 Then + txtHrsWorked = Format(Field2Str(!hours), "#.00") + txtPayCD = strRate_CD + End If +' txtHrsWorked = Format(Field2Str(!hours), "#.00") + dtpWorkDate.Value = Field2Str(!Date) + txtNotes = Field2Str(!notes) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module FormShowHrs" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + lblCrewInstruct.Visible = True + strSQL = "SELECT * FROM PR1_EmployeeMaster" +' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName FROM PR1_EmployeeMaster" +'' strSQL = "SELECT Department, EmployeeNumber, LastName, FirstName FROM PR1_EmployeeMaster Order BY LastName" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' moRSCREW.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + 'adOpenForwardOnly , adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + strLine = Trim$(Field2Str(moRSCREW!FirstName)) & " " & Trim$(Field2Str(moRSCREW!LastName)) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!EmployeeNumber + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmHourList.Width = 9150 + frmHourList.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form HourList - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_DblClick() + Call GetMember '******Need to modify PR1_EmployeeMaster to include Type of pay (Hourly or Salary) + txtEmpId = Field2Str(moRSMember!EmployeeNumber) + txtDept = Field2Str(moRSMember!department) + txtEmpName = Trim$(Field2Str(moRSMember!FirstName)) & " " & Trim$(Field2Str(moRSMember!LastName)) + txtRate = Format(Field2Str2(moRSMember!Rate), "#,#.00") + txtWCCode = Field2Str(moRSMember!wc_code) + txtOTR = Format(Field2Str2(moRSMember!OTRate), "#.00") + If txtRate > 50 Then + MsgBox "This Employee Appears to be Salaried", vbOKOnly, "Salaried Employee" + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdAddDaily.Enabled = True + cmdSave.Enabled = False + cmdMAS90.Enabled = True + lstCrew.Visible = False + lstHours.Visible = True + lblCrewInstruct.Visible = False + Exit Sub + End If +' frmHourList.Width = 4140 +' frmHourList.Width = 4725 + cmdAdd.Enabled = True + cmdAddName.Enabled = True + cmdDelete.Enabled = True + cmdAddDaily.Enabled = True + cmdSave.Enabled = False + cmdMAS90.Enabled = True + lstCrew.Visible = False + lstHours.Visible = True + lblCrewInstruct.Visible = False + Call FormSaveEmp +End Sub + +Private Sub lstHours_Click() + If lstHours.ListIndex > -1 Then + + mlngDAYID = lstHours.ItemData(lstHours.ListIndex) + Else + mlngDAYID = 0 + End If + If FormFindHrs() Then + Call FormShowHrs +' Call HoursLoad + End If +End Sub + +Private Sub lstHours_DblClick() + cmdSave.Enabled = True + cmdDelDaily.Enabled = True + cmdAddDaily.Enabled = False +End Sub + +Private Sub lstPayCrews_Click() + + lstPayCrews.col = 0 + + If lstPayCrews.ListIndex > -1 Then + mlngPCID = Field2Str2(lstPayCrews.ColText) + Else + mlngPCID = 0 + End If + If FormFindEmp() Then + Call FormShowEmp + Call HoursLoad + End If +End Sub + +Private Sub lstPayCrews_DblClick() + cmdSave.Enabled = True + cmdDelete.Enabled = True +End Sub + +Private Sub txtHrsWorked_GotFocus() + Call FieldSelect(txtHrsWorked) +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub GetEmpHours() +Dim a + + +End Sub + +Private Sub SumHours() +Dim oRSH As Recordset, strSQLH As String ', oRSHL As Recordset, strSQLHL As String +Dim oRS As Recordset, oRSS As Recordset, dblRT As Double, dblOTRATE As Double +Dim strSQL As String, dblOT As Double, dblRTHours As Double +Dim dblRT2 As Double, dblOT2 As Double, dblOTRATE2 As Double, dblREGRATE2 As Double +Dim dblHOURS1 As Double, dblHOURS2 As Double, dblOTHours As Double + + On Error GoTo Error_EH + + strSQL = "SELECT SUM(Hours) as SUMHRS FROM tblHRDaily WHERE PC_ID = " & mlngPCID +' strSQL = "SELECT SUMHRS as SUM(Hours) FROM tblHRDaily where PC_ID = " & mlngPCID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + mdblSUMHRS = Field2Str2(oRS!SUMHRS) + Else + mdblSUMHRS = 0 + End If + + strSQL = "SELECT SUM(Hours) as SUMHRS1 FROM tblHRDaily WHERE PAYCD = 1 and PC_ID = " & mlngPCID + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + dblHOURS1 = Field2Str2(oRSS!SUMHRS1) + Else + dblHOURS1 = 0 + End If + + strSQL = "SELECT SUM(Hours) as SUMHRS2 FROM tblHRDaily WHERE PAYCD > 1 and PC_ID = " & mlngPCID + Set oRSH = New Recordset + oRSH.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSH.EOF Then + dblHOURS2 = Field2Str2(oRSH!sumhrs2) + Else + dblHOURS2 = 0 + End If + + If mstrNUMCDS = 1 Then + If mdblSUMHRS <= 40 Then + moRSHour!OTHours = 0 + moRSHour!OT_Hrs = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = Field2Str2(oRS!SUMHRS) + moRSHour!reg_hrs = Field2Str2(oRSS!SUMHRS1) + moRSHour!Reg_HRS2 = 0 +' moRSHour!Reg_HRS2 = Field2Str2(oRSH!SUMHRS2) + moRSHour!GROSS_CD1 = dblHOURS1 * Field2Str2(moRSHour!Rate) + moRSHour!GROSS_CD2 = 0 +' moRSHour!Gross_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!gross = CSng(Field2Str2(moRSHour!GROSS_CD1)) + CSng(Field2Str2(moRSHour!GROSS_CD2)) +' moRSHour!gross = Field2Single(moRSHour!GROSS_CD1) + Field2Single(moRSHour!GROSS_CD2) + ' morshours!GROSS = Field2Str2(oRSHL!GROSS_CD1) + Field2Str2(oRSHL!GROSS_CD2) + moRSHour.Update +' Exit Sub + ElseIf mdblSUMHRS > 40 Then + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = 40 + moRSHour!OTHours = Field2Str2(oRS!SUMHRS) - 40 + dblOTHours = Field2Str2(oRS!SUMHRS) - 40 + moRSHour!reg_hrs = 40 + moRSHour!OT_Hrs = dblOTHours + moRSHour!Reg_HRS2 = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!GROSS_CD1 = Field2Str2((moRSHour!RTHours * msglRRT1)) + (dblOTHours * msglORT1) +' moRSHour!Gross_CD1 = (dblHOURS1 * Field2Str2(moRSHour!Rate)) + (dblOTHours * Field2Str2(moRSHour!Rate)) + moRSHour!GROSS_CD2 = 0 + moRSHour!gross = Field2Str2((moRSHour!RTHours * msglRRT1)) + (dblOTHours * msglORT1) + moRSHour.Update + +''' If dblHOURS2 > dblOTHours Then +''' moRSHour!Reg_HRS2 = dblHOURS2 +''' moRSHour!OT_HRS = dblOTHours +''' moRSHour!Reg_HRS = dblHOURS1 - dblOTHours + End If + ElseIf mstrNUMCDS = 2 Then + If dblHOURS1 > 0 And dblHOURS2 = 0 Then + If mdblSUMHRS <= 40 Then + moRSHour!OTHours = 0 + moRSHour!OT_Hrs = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = Field2Str2(oRS!SUMHRS) + moRSHour!reg_hrs = CSng(Field2Str2(oRSS!SUMHRS1)) + moRSHour!Reg_HRS2 = 0 + ' moRSHour!Reg_HRS2 = Field2Str2(oRSH!SUMHRS2) + moRSHour!GROSS_CD1 = dblHOURS1 * Field2Str2(moRSHour!Rate) + moRSHour!GROSS_CD2 = 0 + ' moRSHour!Gross_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!gross = CSng(Field2Str2(moRSHour!GROSS_CD1)) + CSng(Field2Str2(moRSHour!GROSS_CD2)) + ' morshours!GROSS = Field2Str2(oRSHL!GROSS_CD1) + Field2Str2(oRSHL!GROSS_CD2) + moRSHour.Update + ' Exit Sub + ElseIf mdblSUMHRS > 40 Then + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = 40 + moRSHour!reg_hrs = 40 + txtRT = 40 + moRSHour!OTHours = Field2Str2(oRS!SUMHRS) - 40 + dblOTHours = Field2Str2(oRS!SUMHRS) - 40 + moRSHour!OT_Hrs = dblOTHours + moRSHour!Reg_HRS2 = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!GROSS_CD1 = Field2Str2((moRSHour!RTHours * msglRRT1)) + (dblOTHours * msglORT1) + ' moRSHour!Gross_CD1 = (dblHOURS1 * Field2Str2(moRSHour!Rate)) + (dblOTHours * Field2Str2(moRSHour!Rate)) + moRSHour!GROSS_CD2 = 0 + moRSHour!gross = Field2Str2((moRSHour!RTHours * msglRRT1)) + (dblOTHours * msglORT1) + moRSHour.Update + End If + ElseIf dblHOURS1 = 0 And dblHOURS2 > 0 Then + If mdblSUMHRS <= 40 Then + moRSHour!OTHours = 0 + moRSHour!OT_Hrs = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = Field2Str2(oRS!SUMHRS) + moRSHour!Reg_HRS2 = Field2Str2(oRSH!sumhrs2) +' moRSHour!Reg_HRS2 = Field2Str2(oRSS!SUMHRS1) + moRSHour!reg_hrs = 0 + ' moRSHour!Reg_HRS2 = Field2Str2(oRSH!SUMHRS2) + moRSHour!GROSS_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!GROSS_CD1 = 0 + ' moRSHour!Gross_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!gross = CSng(Field2Str2(moRSHour!GROSS_CD1)) + CSng(Field2Str2(moRSHour!GROSS_CD2)) + ' morshours!GROSS = Field2Str2(oRSHL!GROSS_CD1) + Field2Str2(oRSHL!GROSS_CD2) + moRSHour.Update + ' Exit Sub + ElseIf mdblSUMHRS > 40 Then + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = 40 + moRSHour!Reg_HRS2 = 40 + txtRT2 = 40 + moRSHour!OTHours = Field2Str2(oRS!SUMHRS) - 40 + dblOTHours = Field2Str2(oRS!SUMHRS) - 40 + moRSHour!OT_Hrs2 = dblOTHours + moRSHour!reg_hrs = 0 + moRSHour!OT_Hrs = 0 + moRSHour!GROSS_CD2 = Field2Str2((moRSHour!RTHours * msglRRT2)) + (dblOTHours * msglORT2) + ' moRSHour!Gross_CD1 = (dblHOURS1 * Field2Str2(moRSHour!Rate)) + (dblOTHours * Field2Str2(moRSHour!Rate)) + moRSHour!GROSS_CD1 = 0 + moRSHour!gross = Field2Str2((moRSHour!RTHours * msglRRT2)) + (dblOTHours * msglORT2) + moRSHour.Update + End If + +' End If + ElseIf dblHOURS1 > 0 And dblHOURS2 > 0 Then + If mdblSUMHRS <= 40 Then + moRSHour!OTHours = 0 + moRSHour!OT_Hrs = 0 + moRSHour!OT_Hrs2 = 0 + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = dblHOURS1 + dblHOURS2 + moRSHour!Reg_HRS2 = Field2Str2(oRSH!sumhrs2) +' moRSHour!Reg_HRS2 = Field2Str2(oRSS!SUMHRS1) + moRSHour!reg_hrs = Field2Str2(oRSS!SUMHRS1) + ' moRSHour!Reg_HRS2 = Field2Str2(oRSH!SUMHRS2) + moRSHour!GROSS_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!GROSS_CD1 = dblHOURS1 * Field2Str2(moRSHour!Rate) + ' moRSHour!Gross_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + moRSHour!gross = CSng(Field2Str2(moRSHour!GROSS_CD1)) + CSng(Field2Str2(moRSHour!GROSS_CD2)) + ' morshours!GROSS = Field2Str2(oRSHL!GROSS_CD1) + Field2Str2(oRSHL!GROSS_CD2) + moRSHour.Update + ' Exit Sub + ElseIf mdblSUMHRS > 40 Then + moRSHour!hours = Field2Str2(oRS!SUMHRS) + moRSHour!RTHours = 40 + moRSHour!OTHours = mdblSUMHRS - 40 ' - dblHOURS2 + dblOTHours = Field2Str2(oRS!SUMHRS) - 40 + + moRSHour!reg_hrs = dblHOURS1 - (dblOTHours) +' moRSHour!Reg_HRS2 = dblHOURS2 - (mdblSUMHRS - 40) +' moRSHour!Reg_HRS2 = 40 +' txtRT2 = 40 +' moRSHour!OTHours = Field2Str2(oRS!SUMHRS) - 40 + moRSHour!OT_Hrs = dblOTHours + moRSHour!Reg_HRS2 = dblHOURS2 + moRSHour!OT_Hrs2 = 0 + moRSHour!GROSS_CD2 = ((dblHOURS2 * msglRRT2)) + (Field2Str2(moRSHour!OT_Hrs2) * msglORT2) + moRSHour!GROSS_CD1 = ((dblHOURS1 - dblOTHours) * Field2Str2(moRSHour!Rate)) + (dblOTHours * Field2Str2(moRSHour!OT_Rate)) +' moRSHour!Gross_CD1 = 0 +' moRSHour!gross = Field2Str2((moRSHour!RTHours * msglRRT2)) + (dblOTHours * msglORT2) + moRSHour!gross = CSng(Field2Str2(moRSHour!GROSS_CD1)) + CSng(Field2Str2(moRSHour!GROSS_CD2)) + moRSHour.Update + End If + + End If + + End If + ''' moRSHour!Gross_CD1 = dblHOURS1 * Field2Str2(moRSHour!Rate) + ''' moRSHour!Gross_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + ''' moRSHour!GROSS = Field2Single(moRSHour!Gross_CD1) + Field2Single(moRSHour!Gross_CD2) + ''' moRSHour.Update + ' Exit Sub + ' moRSHour!Reg_HRS = "" + ' dblRTHours + '' If dblHOURS1 > dblOTHours Then + '' moRSHour!OT_HRS = dblOTHours + '' moRSHour!Reg_HRS = dblHOURS1 - dblOTHours + ' moRSHour!Reg_HRS2 = dblHOURS1 - dblOTHours + '' End If + ' moRSHour!OT_HRS = 0 + ' moRSHour!OT_HRS2 = 0 + ' moRSHour!hours = Field2Str2(oRS!SUMHRS) + ' moRSHour!RTHours = Field2Str2(oRS!SUMHRS) + '' moRSHour!Reg_HRS = Field2Str2(oRSS!SUMHRS1) + ' moRSHour!Reg_HRS2 = Field2Str2(oRSH!SUMHRS2) + '' moRSHour!GROSS_CD1 = dblHOURS1 * Field2Str2(moRSHour!Rate) + '' moRSHour!GROSS_CD2 = dblHOURS2 * Field2Str2(moRSHour!Reg_RT2) + '' moRSHour!GROSS = Field2Single(moRSHour!GROSS_CD1) + Field2Single(moRSHour!GROSS_CD2) + ' morshours!GROSS = Field2Str2(oRSHL!GROSS_CD1) + Field2Str2(oRSHL!GROSS_CD2) + '' moRSHour.Update + + ' Else + ''' dblRT = 40 * txtPayRate + ''' dblOTRATE = (1.5 * txtPayRate) + ''' dblOT = (mdblSUMHRS - 40) * dblOTRATE + ''' mdblGROSS = Format((dblRT + dblOT), "#,#.00") + ' End If + ' End If + + Exit Sub +Error_EH: +' If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' Resume Next +' End If + gstrMODULE = "Form HourList - Module SumHours" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMAS90XX_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset +Dim dblOT As Double, dblOTRATE As Double, dblOTWAGE As Double +Dim dblRT As Double, dblRTRATE As Double, dblRTWAGE As Double + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblHourList where Pay_Date = #" & dtpPayDate.Value & "# and ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF +' strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) +' Set oRT = New Recordset +' oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic +' Do Until oRT.EOF + With oRS +' If !hours > 80 Then +' dblRT = 80 +' dblOT = !hours - 80 + If !hours > 40 Then + dblRT = 40 + dblOT = !hours - 40 + dblRTRATE = !Rate + dblOTRATE = !Rate * 1.5 + dblRTWAGE = Format(Round((dblRT * dblRTRATE), 2), "#,#.00") + dblOTWAGE = Format(Round((dblOT * dblOTRATE), 2), "#,#.00") + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = dblRT + oRSS!amount = dblRTWAGE + oRSS!Rate = Field2Str(!Rate) + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS!earncode = "01" + oRSS!wc_code = !wc_code + oRSS.Update + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = dblOT + oRSS!amount = dblOTWAGE + oRSS!Rate = dblOTRATE + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS!earncode = "OT" + oRSS.Update + Else + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str(!gross) + oRSS!Rate = Field2Str(!Rate) + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS!earncode = "01" + oRSS!wc_code = !wc_code + oRSS.Update + End If + End With +' oRT.MoveNext +' Loop + oRS!ready = vbUnchecked + oRS!done = vbChecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into MAS90" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form HourList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdPRProcess2_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblHourList where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) + Set oRT = New Recordset + oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + Do Until oRT.EOF + With oRT + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str2(!gross) +' oRSS!amount = Field2Str2(!Reg_Wage) + oRSS!Rate = Field2Str2(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = "1" +' oRSS!earncode = "11" + oRSS!OT_Hours = Field2Str2(!OT_Hours) + oRSS!OT_Amt = Field2Str2(!OT_Wage) + oRSS!OT_TRANS = Field2Str2(!OT_Wage) / 1.5 + oRSS!REG_TRANS = Field2Str2(!REG_WAGE) +' oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End With + oRT.MoveNext + Loop + oRS!P_FLAG = vbUnchecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into CMS - Click On 'Move PR To CMS' to Setup Transfer File" +'' cmdMoveMAS90.SetFocus +' cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess2_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub CMSPRTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strREGWAGE, strOTWAGE, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strREGHOUR, strOTHOUR ', strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String, strINV_DUE_Date As String, strDISC_Date As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long, strHR As String +Dim strMONTH As String, strDAY As String, strSEC As String, strWCCODE As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strDISC_PCT As String, strDISCYN As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") +' strMIN = Format(Minute(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + strFile = "PREXT" & strMONTH & strDAY & strHR & strMIN + strSQLLL = "SELECT * FROM tblPAYROLL ORDER BY EMPLOYEE_NO" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".csv" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + + Do Until oRSSS.EOF + strCUSTNo = oRSSS!employee_no + strINVDATE = dtpPayDate.Value +' strTType = "1" +' strTType = "11" + strTType = oRSSS!earncode + strWCCODE = oRSSS!wc_code + strREGWAGE = oRSSS!REG_TRANS +' strREGWAGE = oRSSS!amount + strOTWAGE = oRSSS!OT_TRANS +' strOTWAGE = oRSSS!OT_Amt + strREGHOUR = oRSSS!HOURS_WAGES +' strOTHOUR = "2" + strOTHOUR = oRSSS!OT_Hours + + strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & strREGWAGE & "," & strOTWAGE & "," & "," & "," & "," & "," + strHEADER = strHEADER & "," & "," ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab +' strHEADER = strCUSTNo & vbTab & strINVDATE & vbTab & strTType & vbTab & strWCCODE & vbTab & strREGWAGE & vbTab & strOTWAGE & vbTab & vbTab & vbTab & vbTab & vbTab +' strHEADER = strHEADER & vbTab & vbTab ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + TStream.WriteLine (strHEADER) + +' strTType = "9" +' strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & "," & "," & "," & "," & "," & strREGHOUR & "," +' strHEADER = strHEADER & "," & "," & strOTHOUR ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab +' TStream.WriteLine (strHEADER) + + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Payroll and IMPORT DAILY using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + + cmdExit.SetFocus +End Sub + +Private Sub txtPayCD_GotFocus() + Call FieldSelect(txtPayCD) +End Sub + +'Private Sub cmdPRProcess_Click() +Private Sub cmdMAS90_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset +Dim strCODE As String, intYN As Integer + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblHourList where Pay_Date = #" & dtpPayDate.Value & "# and READY" +' strSQL = "SELECT * FROM tblHourList where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF +' strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) +' Set oRT = New Recordset +' oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic +' Do Until oRT.EOF + strCODE = Field2Str(oRS!CODES) + With oRS +' oRSS.AddNew + If strCODE = 1 Then + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!reg_hrs) + oRSS!amount = Field2Str2(!GROSS_CD1) + ' oRSS!amount = Field2Str2(!Reg_Wage) + oRSS!Rate = Field2Str2(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = Field2Str(!RATECD1) + ' oRSS!earncode = "1" + ' oRSS!earncode = "11" + oRSS!OT_Hours = Field2Str2(!OT_Hrs) + oRSS!OT_Amt = CSng(Field2Str2(!OT_Rate)) * CSng(Field2Str2(!OT_Hrs)) + oRSS!OT_TRANS = Field2Str2(!OT_Hrs) + oRSS!REG_TRANS = Field2Str(!reg_hrs) + ' oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + ElseIf strCODE = 2 Then + If Field2Str2(oRS!GROSS_CD1) > 0 Then + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!reg_hrs) + oRSS!amount = Field2Str2(!GROSS_CD1) + ' oRSS!amount = Field2Str2(!Reg_Wage) + oRSS!Rate = Field2Str2(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = Field2Str(!RATECD1) + ' oRSS!earncode = "1" + ' oRSS!earncode = "11" + oRSS!OT_Hours = Field2Str2(!OT_Hrs) + oRSS!OT_Amt = CSng(Field2Str2(!OT_Rate)) * CSng(Field2Str2(!OT_Hrs)) + oRSS!OT_TRANS = Field2Str2(!OT_Hrs) + oRSS!REG_TRANS = Field2Str(!reg_hrs) + ' oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End If + If Field2Str2(oRS!GROSS_CD2) > 0 Then + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!Reg_HRS2) + oRSS!amount = Field2Str2(!GROSS_CD2) + ' oRSS!amount = Field2Str2(!Reg_Wage) + oRSS!Rate = Field2Str2(!Reg_RT2) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = Field2Str(!RATECD2) + ' oRSS!earncode = "1" + ' oRSS!earncode = "11" + oRSS!OT_Hours = Field2Str2(!OT_Hrs2) + oRSS!OT_Amt = CSng(Field2Str2(!OT_RT2)) * CSng(Field2Str2(!OT_Hrs)) + oRSS!OT_TRANS = Field2Str2(!OT_Hrs2) + oRSS!REG_TRANS = Field2Str(!Reg_HRS2) + ' oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End If + End If + End With + oRS!ready = vbUnchecked + oRS!done = vbChecked + oRS.Update + oRS.MoveNext + Loop +' oRS!P_FLAG = vbUnchecked +' oRS.Update +' oRS.MoveNext +' Loop + + + Screen.MousePointer = vbDefault + intYN = MsgBox("Payroll Is Ready To Be Imported Into CMS - Select YES to Setup Transfer File", vbYesNo, "Transfer Setup") + If intYN = vbYes Then + Call CMSPRTransfer + ElseIf intYN = vbNo Then + + End If +' cmdMoveMAS90.SetFocus +' cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form HourList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frx new file mode 100644 index 0000000..ffd1433 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmHourList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frm new file mode 100644 index 0000000..d219174 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frm @@ -0,0 +1,866 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmInvPrice + Caption = "Supplier Inventory Prices" + ClientHeight = 5265 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5265 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstInv + Height = 2160 + Left = 120 + TabIndex = 16 + Top = 2910 + Visible = 0 'False + Width = 3075 + _Version = 196608 + _ExtentX = 5424 + _ExtentY = 3810 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 210 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInvPrice.frx":0000 + End + Begin LpLib.fpList lstInventory + Height = 4680 + Left = 3240 + TabIndex = 15 + Top = 435 + Width = 4170 + _Version = 196608 + _ExtentX = 7355 + _ExtentY = 8255 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 3 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 210 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInvPrice.frx":033A + End + Begin VB.CommandButton cmdPrint + Caption = "Print Inv List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7590 + TabIndex = 14 + Top = 2400 + Width = 1155 + End + Begin Crystal.CrystalReport crInvList + Left = 10290 + Top = -15 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9112 + TabIndex = 13 + Top = 2400 + Width = 1155 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 10635 + TabIndex = 12 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9112 + TabIndex = 10 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7590 + TabIndex = 11 + Top = 1740 + Width = 1155 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = 10965 + Picture = "frmInvPrice.frx":06BC + Style = 1 'Graphical + TabIndex = 7 + Top = 360 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 8235 + MaxLength = 8 + TabIndex = 9 + Top = 1260 + Width = 855 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 8235 + MaxLength = 30 + TabIndex = 8 + Top = 840 + Width = 3555 + End + Begin VB.TextBox txtInvNo + Height = 315 + Left = 8235 + MaxLength = 15 + TabIndex = 6 + Top = 420 + Width = 2625 + End + Begin VB.ListBox lstSupplier + Height = 2400 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 420 + Width = 3075 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Cost:" + Height = 195 + Left = 7440 + TabIndex = 5 + Top = 1305 + Width = 780 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Descptn:" + Height = 195 + Left = 7575 + TabIndex = 4 + Top = 900 + Width = 645 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invtry #:" + Height = 195 + Left = 7635 + TabIndex = 3 + Top = 480 + Width = 585 + End + Begin VB.Label lblInventory + Caption = "Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3300 + TabIndex = 2 + Top = 120 + Width = 1815 + End + Begin VB.Label lblSupplier + Caption = "Supplier" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 180 + TabIndex = 1 + Top = 120 + Width = 1095 + End +End +Attribute VB_Name = "frmInvPrice" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, Price from tblInvPrice WHERE sup_no = " & lstSupplier.ItemData(lstSupplier.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & Format$(Field2Str(oRS!price), "##,##0.00") & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub +Private Sub LoadSupplier() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSupplier WHERE type <> 'A'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstSupplier.Clear + + Do Until oRS.EOF + With lstSupplier + + strLine = oRS!Type & vbTab & oRS!supplier + .AddItem strLine + .ItemData(.NewIndex) = oRS!sup_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstSupplier.ListCount Then + lstSupplier.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As String +'*** FIX On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice.SetFocus + + End With + Else + lstInv.Visible = True + Call LoadMInventory + lngFind = Field2Str(txtInvNo) + Call ListFindItemS2(lstInv, lngFind) +' ListFindItemS2 + End If + oRS.Close + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String ', strInvNo As String +Dim strLine As String + On Error GoTo Error_EH +' lstInv.col = 0 +' strInvNo = lstInv.ColText + + strSQL = "SELECT Inv_no, Desc from tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInv.Clear + + Do Until oRS.EOF + With lstInv + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInv.ListCount Then + lstInv.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = "" + txtDesc = "" + txtPrice = "" +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + lstInventory.col = 0 + strINVNO = lstInventory.ColText + + strSQL = "SELECT * FROM tblInvPrice WHERE Sup_no = " & lstSupplier.ItemData(lstSupplier.ListIndex) & " AND INV_NO = '" & strINVNO & "'" + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + moRSMat.Update + Resume Next +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!price), "##,###.00") + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !inv_no = Str2Field(UCase(txtInvNo)) + !Desc = Str2Field(txtDesc) + !price = Str2Field(txtPrice) + !sup_no = lstSupplier.ItemData(lstSupplier.ListIndex) + !l_update = Now() + !LUUser = gstrLOGIN + + End With + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + Call FormClear + txtInvNo.SetFocus + cmdFindInv.Visible = True + +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMSG As String, strSql2 As String +Dim oRS As Recordset, intResponse As Integer + + strSQL = "SELECT * FROM tblInvPrice WHERE Sup_No = " & lstSupplier.ItemData(lstSupplier.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' intCount = oRS.RecordCount + strSql2 = "{tblinvprice.sup_no} = " & lstSupplier.ItemData(lstSupplier.ListIndex) + + strMSG = "Do you want to print to the Printer?" & vbLf & vbCr +' strMSG = strMSG & intCount & " Checks did not match - Do You Want A Report" + intResponse = MsgBox(strMSG, vbYesNo, "Print to Printer") + gintCOPY = 1 + crInvList.ReportFileName = App.Path & "\InvListByVendor.rpt" + crInvList.ReplaceSelectionFormula (strSql2) + + If intResponse = vbYes Then + crInvList.Destination = crptToPrinter + Else + crInvList.Destination = crptToWindow + End If + crInvList.CopiesToPrinter = gintCOPY + crInvList.WindowState = crptMaximized + crInvList.Action = 1 + crInvList.Reset +' Else +' Exit Sub +' End If + +End Sub + +Private Sub cmdSaveInv_Click() + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + cmdFindInv.Visible = False + Call FormSave + Call LoadInventory + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSaveInv.Enabled Then + cmdSaveInv.Enabled = True + cmdAddInv.Enabled = False + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + Set moRSMat = New Recordset + + Call LoadSupplier + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInv_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strM_INVNO As String + On Error GoTo Error_EH + lstInv.col = 0 + strM_INVNO = lstInv.ColText + + strSQL = "SELECT Inv_no, Desc FROM tblInvtry where Inv_no = '" & strM_INVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + End With + + oRS.Close + txtPrice.SetFocus + lstInv.Visible = False + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = True + cmdAddInv.Enabled = False +End Sub + +Private Sub lstSupplier_Click() + On Error GoTo Error_EH + + If lstSupplier.ListIndex <> -1 Then + Call LoadInventory + End If + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub + +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtInvNo_LostFocus() + txtInvNo = UCase(txtInvNo) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frx new file mode 100644 index 0000000..f47a707 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvPrice.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frm new file mode 100644 index 0000000..be2dfa7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frm @@ -0,0 +1,1231 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmInvTake + Caption = "Take Off Inventory List" + ClientHeight = 5130 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5130 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstInventory + Height = 4545 + Left = 3240 + TabIndex = 29 + Top = 330 + Width = 3645 + _Version = 196608 + _ExtentX = 6429 + _ExtentY = 8017 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 3 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInvTake.frx":0000 + End + Begin LpLib.fpList lstInv + Height = 4545 + Left = 0 + TabIndex = 28 + Top = 315 + Width = 3210 + _Version = 196608 + _ExtentX = 5662 + _ExtentY = 8017 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInvTake.frx":03EE + End + Begin VB.ComboBox cboInvTYpe + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0792 + Left = 9600 + List = "frmInvTake.frx":07A8 + Style = 2 'Dropdown List + TabIndex = 27 + Top = 60 + Width = 2175 + End + Begin VB.ComboBox cboMetal + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":07FC + Left = 7920 + List = "frmInvTake.frx":0806 + Style = 2 'Dropdown List + TabIndex = 11 + Top = 2580 + Width = 1215 + End + Begin VB.ComboBox cboMType + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":0817 + Left = 7920 + List = "frmInvTake.frx":0819 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 2220 + Width = 1215 + End + Begin VB.ComboBox cboDFlag + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmInvTake.frx":081B + Left = 7920 + List = "frmInvTake.frx":0825 + Style = 2 'Dropdown List + TabIndex = 9 + Top = 1860 + Width = 1215 + End + Begin VB.TextBox txtMLength + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 12 + Top = 2940 + Width = 855 + End + Begin VB.TextBox txtQty + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 8 + Top = 1500 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 10665 + TabIndex = 16 + TabStop = 0 'False + Top = 3360 + Width = 1155 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete TO Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 9395 + TabIndex = 15 + TabStop = 0 'False + Top = 3360 + Width = 1215 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save TO Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 8170 + TabIndex = 13 + Top = 3360 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add TO Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 6945 + TabIndex = 14 + TabStop = 0 'False + Top = 3345 + Width = 1155 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 8 + TabIndex = 7 + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtDesc + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 30 + TabIndex = 6 + Top = 780 + Width = 3855 + End + Begin VB.TextBox txtInvNo + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + MaxLength = 18 + TabIndex = 5 + Top = 420 + Width = 2625 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv. Type: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8880 + TabIndex = 26 + Top = 120 + Width = 765 + End + Begin VB.Label lblInstruct + Caption = "TakeOff Inventory CTRL S to Save CTRL A to Add CTRL D to Delete" + Height = 840 + Left = 10140 + TabIndex = 25 + Top = 1260 + Width = 1575 + End + Begin VB.Label lblLogin + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7920 + TabIndex = 24 + Top = 60 + Width = 855 + End + Begin VB.Label lblEstimator + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimator:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7200 + TabIndex = 23 + Top = 120 + Width = 690 + End + Begin VB.Label lblHelp + Caption = $"frmInvTake.frx":0839 + Height = 855 + Left = 6975 + TabIndex = 22 + Top = 4140 + Width = 4740 + End + Begin VB.Label lblMetalLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6915 + TabIndex = 21 + Top = 3000 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7110 + TabIndex = 20 + Top = 2640 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6885 + TabIndex = 19 + Top = 2280 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6930 + TabIndex = 18 + Top = 1920 + Width = 960 + End + Begin VB.Label lblTOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Qty:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7005 + TabIndex = 17 + Top = 1560 + Width = 885 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6930 + TabIndex = 4 + Top = 1200 + Width = 960 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7050 + TabIndex = 3 + Top = 840 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7035 + TabIndex = 2 + Top = 480 + Width = 855 + End + Begin VB.Label lblInventory + AutoSize = -1 'True + Caption = "Takeoff Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3300 + TabIndex = 1 + Top = 60 + Width = 2430 + End + Begin VB.Label lblInvList + AutoSize = -1 'True + Caption = "Full Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 180 + TabIndex = 0 + Top = 60 + Width = 1815 + End +End +Attribute VB_Name = "frmInvTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean +Dim mboolAdding As Boolean +Dim mdblQTY As Double, mintINDEX As Integer + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, TPrice from tblInvtake WHERE estimator = '" & gstrLOGIN & "'" & " AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & Format$(Field2Str(oRS!tprice), "##,##0.00") & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +'Private Sub LoadSupplier() +'Dim oRS As Recordset +'Dim strSQL As String +'Dim strLine As String +' On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblSupplier WHERE type <> 'A'" + +' Set oRS = New Recordset + +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstSupplier.Clear + +' Do Until oRS.EOF +' With lstSupplier + +' strLine = oRS!Type & vbTab & oRS!supplier +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!sup_no +' End With + +' oRS.MoveNext +' Loop +' oRS.Close + +' If lstSupplier.ListCount Then +' lstSupplier.ListIndex = 0 +' End If + +' Exit Sub + +'Error_EH: +' Call ErrorHandler2 +' Exit Sub +'End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInv.Clear + + Do Until oRS.EOF + With lstInv + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInv.ListCount Then + lstInv.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = 0 + txtDesc = "" + txtPrice = 0 + txtQty = 0 + txtMLength = 0 + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT * FROM tblInvPrice WHERE Sup_no = " & lstSupplier.ItemData(lstSupplier.ListIndex) & " AND INV_NO = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT * FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "' AND INV_NO = '" & strINVNO & "'" + Set moRSMat = New Recordset + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + strINVNO = Field2Str(moRSMat!inv_no) + End If + + Exit Function + +Error_EH: + gstrMODULE = "Form InvTake - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!tprice), "##,###.00") + txtQty = Field2Str2(!qty) + txtMLength = Field2Str2(!calc_amt) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) +' If !m_type = "L" Then +' cboMType.Text = "Lath" +' ElseIf !m_type = "B" Then +' cboMType.Text = "Brown" +' ElseIf !m_type = "S" Then +' cboMType.Text = "Scratch" +' ElseIf !m_type = "T" Then +' cboMType.Text = "Texture" +' ElseIf !m_type = "C" Then +' cboMType.Text = "CMU" +' ElseIf !m_type = "P" Then +' cboMType.Text = "PreOrder" +' End If + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + mboolSHOW = False + +' cboInvType.Enabled = True +' cboInvType.ListIndex = gbytInv_Type +' cboInvType.ListIndex = 1 +' cboInvType.Enabled = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !estimator = gstrLOGIN + !inv_no = Str2Field(txtInvNo) + !Desc = Str2Field(txtDesc) + !tprice = Str2Field(txtPrice) + !qty = Str2Field(txtQty) + !calc_amt = Str2Field(txtMLength) + !l_y_date = Now() + + !m_type = Left$(cboMType.Text, 1) + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + !inv_type = gbytINV_TYPE + + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + mboolUPDATE = False + Call FormClear + txtInvNo.SetFocus + +End Sub + +Private Sub cmdDeleteInv_Click() +Dim strINVNO As String + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + strINVNO = Field2Str(moRSMat!inv_no) + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSaveInv_Click() + mintINDEX = lstInventory.ListIndex + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + Call FormSave + Call LoadInventory + If (lstInventory.ListCount - 1) = mintINDEX Then + lstInventory.ListIndex = mintINDEX + Else + lstInventory.ListIndex = mintINDEX + 1 + End If + mboolUPDATE = True + lstInventory.SetFocus + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAddInv_Click + End If + Exit Sub + End If + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown Then + Call cmdDeleteInv_Click + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call cmdSaveInv_Click + End If + Exit Sub + End If + + If Not cmdSaveInv.Enabled Then + cmdSaveInv.Enabled = True + cmdAddInv.Enabled = False + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + Set moRSMat = New Recordset + cboInvType.ListIndex = gbytINV_TYPE + cboInvType.Enabled = False + lblLogin = gstrLOGIN + Call MTypeLoad(cboMType) + Call LoadInventory + Call LoadMInventory + mboolUPDATE = True +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInv_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strSql2 As String, strINVNO As String + On Error GoTo Error_EH + + lstInv.col = 0 + strINVNO = lstInv.ColText + strSQL = "SELECT * FROM tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSMat.State = adStateClosed Then + strSql2 = "SELECT * FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE + Set moRSMat = New Recordset + moRSMat.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + End If + + With oRS + moRSMat.AddNew + moRSMat!estimator = gstrLOGIN + moRSMat!inv_no = Field2Str(!inv_no) + moRSMat!calc_amt = Field2Str(!calc_amt) + moRSMat!Desc = Field2Str(!Desc) + moRSMat!d_flag = Field2Str(!d_flag) + moRSMat!m_type = Field2Str(!m_type) + moRSMat!calc_flag = Field2Str(!calc_flag) + moRSMat!l_y_date = Now() + moRSMat!tprice = Field2Str2(!tprice) + moRSMat!inv_type = Field2Str2(!inv_type) + moRSMat.Update + End With + + oRS.Close + + Call LoadInventory + + Exit Sub + +Error_EH: + gstrMODULE = "Form InvTake - Module lstInv_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + txtQty.SetFocus + Exit Sub + +Error_EH: + If Err = 5 Then + Resume Next + Else + gstrMODULE = "Form InvTake - Module lstInventory_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub + +Private Sub lstInventory_DblClick() + Call cmdDeleteInv_Click +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtQty_GotFocus() + Call FieldSelect(txtQty) + mdblQTY = Field2Str2(txtQty) +End Sub + +Private Sub txtMLength_GotFocus() + Call FieldSelect(txtMLength) +End Sub + +Private Sub txtQty_LostFocus() + If mboolUPDATE Then + If mdblQTY <> Field2Str2(txtQty) Then + cmdSaveInv.Enabled = True + cmdSaveInv.SetFocus + End If + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frx new file mode 100644 index 0000000..bdb7cf4 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvTake.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frm new file mode 100644 index 0000000..05be1de --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frm @@ -0,0 +1,77 @@ +VERSION 5.00 +Begin VB.Form frmInvType + Caption = "Inventory Type" + ClientHeight = 2475 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 3225 + LinkTopic = "Form1" + ScaleHeight = 2475 + ScaleWidth = 3225 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = 1000 + TabIndex = 2 + Top = 1900 + Width = 1200 + End + Begin VB.ComboBox cboInvType + Height = 315 + ItemData = "frmInvType.frx":0000 + Left = 90 + List = "frmInvType.frx":0016 + Style = 2 'Dropdown List + TabIndex = 1 + Top = 105 + Width = 3000 + End + Begin VB.Label lblInst + Alignment = 2 'Center + BackColor = &H00C0FFFF& + Caption = "The Type Shown Is The Current Default Type -- Select The New Desired Inventory Type Then Click Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1275 + Left = 300 + TabIndex = 0 + Top = 540 + Width = 2415 + End +End +Attribute VB_Name = "frmInvType" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Private Sub cboInvType_Click() + gbytINV_TYPE = cboInvType.ListIndex +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_Load() + + cboInvType.ListIndex = gbytINV_TYPE +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frx new file mode 100644 index 0000000..93b1670 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInvType.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frm new file mode 100644 index 0000000..c73bd2d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frm @@ -0,0 +1,949 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmInventory + Caption = "Inventory Prices" + ClientHeight = 3690 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8355 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 3690 + ScaleWidth = 8355 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstInventory + Height = 2835 + Left = 15 + TabIndex = 25 + Top = 510 + Width = 3495 + _Version = 196608 + _ExtentX = 6165 + _ExtentY = 5001 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 210 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmInventory.frx":0000 + End + Begin LpLib.fpCombo cboMType + Height = 315 + Left = 4680 + TabIndex = 24 + Top = 2235 + Width = 1215 + _Version = 196608 + _ExtentX = 2143 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "cboMType" + Columns = 1 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 0 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmInventory.frx":0332 + End + Begin VB.CommandButton cmdCopy + Caption = "Copy Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5880 + TabIndex = 23 + Top = 3000 + Visible = 0 'False + Width = 1155 + End + Begin VB.ComboBox cboInvType + Height = 315 + ItemData = "frmInventory.frx":0679 + Left = 4680 + List = "frmInventory.frx":068F + Style = 2 'Dropdown List + TabIndex = 22 + Top = 60 + Width = 2640 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update TO Cost" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5880 + TabIndex = 20 + Top = 1200 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtLength + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + TabIndex = 10 + Top = 2940 + Width = 855 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmInventory.frx":06E3 + Left = 4680 + List = "frmInventory.frx":06ED + Style = 2 'Dropdown List + TabIndex = 9 + Top = 2580 + Width = 1215 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmInventory.frx":06FE + Left = 4680 + List = "frmInventory.frx":0708 + Style = 2 'Dropdown List + TabIndex = 8 + Top = 1860 + Width = 1215 + End + Begin VB.TextBox txtTOCost + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + TabIndex = 7 + Top = 1500 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 14 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 13 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 11 + Top = 1800 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add Inventory" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7080 + TabIndex = 12 + TabStop = 0 'False + Top = 1200 + Width = 1155 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 4680 + MaxLength = 8 + TabIndex = 6 + Top = 1125 + Width = 855 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 4680 + MaxLength = 30 + TabIndex = 5 + Top = 780 + Width = 3555 + End + Begin VB.TextBox txtInvNo + Height = 315 + Left = 4680 + MaxLength = 15 + TabIndex = 4 + Top = 420 + Width = 2625 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory Type:" + Height = 195 + Left = 3465 + TabIndex = 21 + Top = 120 + Width = 1110 + End + Begin VB.Label lblLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = 3600 + TabIndex = 19 + Top = 3000 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = 3795 + TabIndex = 18 + Top = 2640 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 3570 + TabIndex = 17 + Top = 2280 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = 3615 + TabIndex = 16 + Top = 1920 + Width = 960 + End + Begin VB.Label lblTOCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff Cost:" + Height = 195 + Left = 3615 + TabIndex = 15 + Top = 1560 + Width = 960 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yard Cost:" + Height = 195 + Left = 3840 + TabIndex = 3 + Top = 1200 + Width = 735 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 3735 + TabIndex = 2 + Top = 840 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + Height = 195 + Left = 3720 + TabIndex = 1 + Top = 480 + Width = 855 + End + Begin VB.Label lblInventory + Caption = "Inventory Items" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 1815 + End +End +Attribute VB_Name = "frmInventory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mintBOOKMARK As Integer +Dim moRSYS As Recordset + +Private Sub LoadInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & cboInvType.ListIndex + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + ' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + Else + lstInventory.Clear + Call FormClear + End If + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = "" + txtDesc = "" + txtPrice = "" + txtTOCost = "" + txtLength = "" + cboDFlag.ListIndex = -1 +' cboMType.ListIndex = 0 +' cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + strSQL = "SELECT * FROM tblInvtry WHERE INV_NO = '" & strINVNO & "' AND INV_TYPE = " & cboInvType.ListIndex + + Set moRSMat = New Recordset + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Inventory - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSMat.AddNew + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() +Dim strTYPE As String, strINDEX As String + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!price), "##,###.00") + txtTOCost = Format$(Field2Str(!tprice), "##,###.00") + txtLength = Field2Str2(!calc_amt) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + +' If cboMType = "" Then + + If strTYPE = "L" Then +' cboMType.Index = 1 + cboMType.Text = "Lath" +' cboMType. +' ctlAny.List = "Lath" +' ctlAny.ListIndex = 0 + ElseIf strTYPE = "B" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Brown" + ElseIf strTYPE = "S" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Scratch" + ElseIf strTYPE = "T" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Texture" + ElseIf strTYPE = "C" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "CMU" + ElseIf strTYPE = "P" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "PreOrder" + ElseIf strTYPE = "V" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Veneer-Stone" + ElseIf strTYPE = "W" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Wrap Typar" + ElseIf strTYPE = "Z" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "Z-PreCast" + ElseIf strTYPE = "E" Then +' ctlAny.ListIndex = 1 + cboMType.Text = "E-Synthetic" + ElseIf strTYPE = "J" Then + cboMType.Text = "J-PaintPrep" + ElseIf strTYPE = "K" Then + cboMType.Text = "K-P-Interior" + ElseIf strTYPE = "N" Then + cboMType.Text = "N-P-Exterior" + ElseIf strTYPE = "M" Then + cboMType.Text = "M-PaintFinal" + Else + cboMType.ListIndex = -1 + End If + + ' Else +' Call FindType3(strINDEX, strTYPE) +' cboMType.ListIndex = CLng(strINDEX) +' Call FindType(cboMType, strTYPE) + ' End If + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !inv_no = Str2Field(UCase(txtInvNo)) + !Desc = Str2Field(txtDesc) + !price = Str2Field(txtPrice) + !tprice = Str2Field(txtTOCost) + !l_u_date = Now() + !LUUser = gstrLOGIN + !calc_amt = Str2Field(txtLength) + !m_type = Left$(cboMType.Text, 1) + !inv_type = cboInvType.ListIndex + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboInvType_Change() + Stop +' Call LoadInventory +End Sub + +Private Sub cboInvType_Click() + Call LoadInventory +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + mboolAdding = True + Call FormClear + txtInvNo.SetFocus + +End Sub + +Private Sub cmdCopy_Click() + If cboInvType.ListIndex = 5 Then + MsgBox "Cannot Copy From This Inventory", vbOKOnly, "No Copy" + Exit Sub + End If +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSaveInv_Click() + mintBOOKMARK = lstInventory.ListIndex + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + Call FormSave + Call LoadInventory + lstInventory.ListIndex = mintBOOKMARK + lstInventory.SetFocus +End Sub + +Private Sub cmdUpdate_Click() + txtTOCost = Round((Field2Str2(txtPrice) * Field2Str2(moRSYS!TOMMU)), 2) + Call cmdSaveInv_Click +End Sub + +Private Sub Form_Activate() + + + Call MTypeLoad(cboMType) + Call LoadInventory + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +' If Not cmdSaveInv.Enabled Then +' cmdSaveInv.Enabled = True +' cmdAddInv.Enabled = False +' End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String + + Set moRSMat = New Recordset + Set moRSYS = New Recordset + cboInvType.ListIndex = 0 + strSQL = "SELECT * FROM tblSYSInfo" + moRSYS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' Call MTypeLoad(cboMType) +' Call LoadInventory + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Inventory - Module lstInventory_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = True + cmdAddInv.Enabled = False +' cmdCopy.Enabled = True +' cmdCopy.Visible = True +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtInvNo_LostFocus() + txtInvNo = UCase(txtInvNo) +End Sub + +Private Sub txtLength_GotFocus() + Call FieldSelect(txtLength) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtPrice_LostFocus() + If Field2Str2(txtTOCost) = 0 Then + txtTOCost = Round((Field2Str2(txtPrice) * Field2Str2(moRSYS!TOMMU)), 2) + End If +End Sub + +Private Sub txtTOCost_GotFocus() + Call FieldSelect(txtTOCost) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frx new file mode 100644 index 0000000..ca30691 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frm new file mode 100644 index 0000000..e51688b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frm @@ -0,0 +1,359 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmYInventory + Caption = "Inventory Information" + ClientHeight = 6720 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10425 + LinkTopic = "Form1" + ScaleHeight = 6720 + ScaleWidth = 10425 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 8940 + TabIndex = 8 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5980 + TabIndex = 7 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3020 + TabIndex = 6 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 4500 + Picture = "frmInventory2.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4860 + Picture = "frmInventory2.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5205 + Picture = "frmInventory2.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 5565 + Picture = "frmInventory2.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5895 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 10320 + _ExtentX = 18203 + _ExtentY = 10398 + _LayoutType = 4 + _RowHeight = 14 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Inv #" + Columns(0).DataField= "inv_no" + Columns(0).DataWidth= 4 + Columns(0).NumberFormat= "General Number" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Qty" + Columns(2).DataField= "qty" + Columns(2).DataWidth= 4 + Columns(2).NumberFormat= "General Number" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 16 + Columns(3)._MaxComboItems= 5 + Columns(3).ValueItems(0)._DefaultItem= 0 + Columns(3).ValueItems(0).Value= "S" + Columns(3).ValueItems(0).Value.vt= 8 + Columns(3).ValueItems(0).DisplayValue= "Supplier" + Columns(3).ValueItems(0).DisplayValue.vt= 8 + Columns(3).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems(1)._DefaultItem= 0 + Columns(3).ValueItems(1).Value= "Y" + Columns(3).ValueItems(1).Value.vt= 8 + Columns(3).ValueItems(1).DisplayValue= "Yard" + Columns(3).ValueItems(1).DisplayValue.vt= 8 + Columns(3).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems.Count= 2 + Columns(3).Caption= "Delivery" + Columns(3).DataField= "d_flag" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 16 + Columns(4)._MaxComboItems= 5 + Columns(4).ValueItems(0)._DefaultItem= 0 + Columns(4).ValueItems(0).Value= "L" + Columns(4).ValueItems(0).Value.vt= 8 + Columns(4).ValueItems(0).DisplayValue= "Lath" + Columns(4).ValueItems(0).DisplayValue.vt= 8 + Columns(4).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(1)._DefaultItem= 0 + Columns(4).ValueItems(1).Value= "B" + Columns(4).ValueItems(1).Value.vt= 8 + Columns(4).ValueItems(1).DisplayValue= "Brown" + Columns(4).ValueItems(1).DisplayValue.vt= 8 + Columns(4).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(2)._DefaultItem= 0 + Columns(4).ValueItems(2).Value= "S" + Columns(4).ValueItems(2).Value.vt= 8 + Columns(4).ValueItems(2).DisplayValue= "Scratch" + Columns(4).ValueItems(2).DisplayValue.vt= 8 + Columns(4).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(3)._DefaultItem= 0 + Columns(4).ValueItems(3).Value= "T" + Columns(4).ValueItems(3).Value.vt= 8 + Columns(4).ValueItems(3).DisplayValue= "Texture" + Columns(4).ValueItems(3).DisplayValue.vt= 8 + Columns(4).ValueItems(3)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(4)._DefaultItem= 0 + Columns(4).ValueItems(4).Value= "P" + Columns(4).ValueItems(4).Value.vt= 8 + Columns(4).ValueItems(4).DisplayValue= "PreOrder" + Columns(4).ValueItems(4).DisplayValue.vt= 8 + Columns(4).ValueItems(4)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems.Count= 5 + Columns(4).Caption= "Type" + Columns(4).DataField= "m_type" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 5 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=5" + Splits(0)._ColumnProps(1)= "Column(0).Width=1217" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1138" + Splits(0)._ColumnProps(4)= "Column(0)._ColStyle=8196" + Splits(0)._ColumnProps(5)= "Column(0).Order=1" + Splits(0)._ColumnProps(6)= "Column(1).Width=7329" + Splits(0)._ColumnProps(7)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(8)= "Column(1)._WidthInPix=7250" + Splits(0)._ColumnProps(9)= "Column(1)._ColStyle=8196" + Splits(0)._ColumnProps(10)= "Column(1).Order=2" + Splits(0)._ColumnProps(11)= "Column(2).Width=979" + Splits(0)._ColumnProps(12)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(13)= "Column(2)._WidthInPix=900" + Splits(0)._ColumnProps(14)= "Column(2).Order=3" + Splits(0)._ColumnProps(15)= "Column(3).Width=1746" + Splits(0)._ColumnProps(16)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(17)= "Column(3)._WidthInPix=1667" + Splits(0)._ColumnProps(18)= "Column(3)._ColStyle=8196" + Splits(0)._ColumnProps(19)= "Column(3).Order=4" + Splits(0)._ColumnProps(20)= "Column(4).Width=1667" + Splits(0)._ColumnProps(21)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(22)= "Column(4)._WidthInPix=1588" + Splits(0)._ColumnProps(23)= "Column(4)._ColStyle=8196" + Splits(0)._ColumnProps(24)= "Column(4).Order=5" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13,.locked=-1" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13,.locked=-1" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=54,.parent=13,.locked=-1" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=51,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=52,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=53,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=58,.parent=13,.locked=-1" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=55,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=56,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=57,.parent=17" + _StyleDefs(50) = "Named:id=33:Normal" + _StyleDefs(51) = ":id=33,.parent=0,.locked=0" + _StyleDefs(52) = "Named:id=34:Heading" + _StyleDefs(53) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(54) = ":id=34,.wraptext=-1,.bold=-1,.fontsize=975,.italic=0,.underline=0" + _StyleDefs(55) = ":id=34,.strikethrough=0,.charset=0" + _StyleDefs(56) = ":id=34,.fontname=MS Sans Serif" + _StyleDefs(57) = "Named:id=35:Footing" + _StyleDefs(58) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(59) = "Named:id=36:Selected" + _StyleDefs(60) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(61) = "Named:id=37:Caption" + _StyleDefs(62) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(63) = "Named:id=38:HighlightRow" + _StyleDefs(64) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(65) = "Named:id=39:EvenRow" + _StyleDefs(66) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(67) = "Named:id=40:OddRow" + _StyleDefs(68) = ":id=40,.parent=33" + _StyleDefs(69) = "Named:id=41:RecordSelector" + _StyleDefs(70) = ":id=41,.parent=34,.bold=-1,.fontsize=1200,.italic=0,.underline=0" + _StyleDefs(71) = ":id=41,.strikethrough=0,.charset=0" + _StyleDefs(72) = ":id=41,.fontname=MS Sans Serif" + _StyleDefs(73) = "Named:id=42:FilterBar" + _StyleDefs(74) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmYInventory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblInvtry WHERE d_flag = 'Y' ORDER BY inv_no" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventory2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frm new file mode 100644 index 0000000..9018846 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frm @@ -0,0 +1,427 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmInventory + Caption = "Inventory Information" + ClientHeight = 6720 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10425 + LinkTopic = "Form1" + ScaleHeight = 6720 + ScaleWidth = 10425 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 8940 + TabIndex = 8 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5980 + TabIndex = 7 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3020 + TabIndex = 6 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 4500 + Picture = "frmInventory.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4860 + Picture = "frmInventory.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5205 + Picture = "frmInventory.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 5565 + Picture = "frmInventory.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5895 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 10320 + _ExtentX = 18203 + _ExtentY = 10398 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Inv #" + Columns(0).DataField= "inv_no" + Columns(0).DataWidth= 4 + Columns(0).NumberFormat= "General Number" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Qty" + Columns(2).DataField= "qty" + Columns(2).DataWidth= 4 + Columns(2).NumberFormat= "General Number" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Price" + Columns(3).DataField= "price" + Columns(3).DataWidth= 6 + Columns(3).NumberFormat= "Fixed" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 16 + Columns(4)._MaxComboItems= 5 + Columns(4).ValueItems(0)._DefaultItem= 0 + Columns(4).ValueItems(0).Value= "S" + Columns(4).ValueItems(0).Value.vt= 8 + Columns(4).ValueItems(0).DisplayValue= "Supplier" + Columns(4).ValueItems(0).DisplayValue.vt= 8 + Columns(4).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(1)._DefaultItem= 0 + Columns(4).ValueItems(1).Value= "Y" + Columns(4).ValueItems(1).Value.vt= 8 + Columns(4).ValueItems(1).DisplayValue= "Yard" + Columns(4).ValueItems(1).DisplayValue.vt= 8 + Columns(4).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems.Count= 2 + Columns(4).Caption= "Delivery" + Columns(4).DataField= "d_flag" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 16 + Columns(5)._MaxComboItems= 5 + Columns(5).ValueItems(0)._DefaultItem= 0 + Columns(5).ValueItems(0).Value= "L" + Columns(5).ValueItems(0).Value.vt= 8 + Columns(5).ValueItems(0).DisplayValue= "Lath" + Columns(5).ValueItems(0).DisplayValue.vt= 8 + Columns(5).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems(1)._DefaultItem= 0 + Columns(5).ValueItems(1).Value= "B" + Columns(5).ValueItems(1).Value.vt= 8 + Columns(5).ValueItems(1).DisplayValue= "Brown" + Columns(5).ValueItems(1).DisplayValue.vt= 8 + Columns(5).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems(2)._DefaultItem= 0 + Columns(5).ValueItems(2).Value= "S" + Columns(5).ValueItems(2).Value.vt= 8 + Columns(5).ValueItems(2).DisplayValue= "Scratch" + Columns(5).ValueItems(2).DisplayValue.vt= 8 + Columns(5).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems(3)._DefaultItem= 0 + Columns(5).ValueItems(3).Value= "T" + Columns(5).ValueItems(3).Value.vt= 8 + Columns(5).ValueItems(3).DisplayValue= "Texture" + Columns(5).ValueItems(3).DisplayValue.vt= 8 + Columns(5).ValueItems(3)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems(4)._DefaultItem= 0 + Columns(5).ValueItems(4).Value= "P" + Columns(5).ValueItems(4).Value.vt= 8 + Columns(5).ValueItems(4).DisplayValue= "PreOrder" + Columns(5).ValueItems(4).DisplayValue.vt= 8 + Columns(5).ValueItems(4)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems(5)._DefaultItem= 0 + Columns(5).ValueItems(5).Value= "V" + Columns(5).ValueItems(5).Value.vt= 8 + Columns(5).ValueItems(5).DisplayValue= "Stone Veneer" + Columns(5).ValueItems(5).DisplayValue.vt= 8 + Columns(5).ValueItems(5)._PropDict= "_DefaultItem,517,2" + Columns(5).ValueItems.Count= 6 + Columns(5).Caption= "Type" + Columns(5).DataField= "m_type" + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 16 + Columns(6)._MaxComboItems= 5 + Columns(6).ValueItems(0)._DefaultItem= 0 + Columns(6).ValueItems(0).Value= "M" + Columns(6).ValueItems(0).Value.vt= 8 + Columns(6).ValueItems(0).DisplayValue= "Metal" + Columns(6).ValueItems(0).DisplayValue.vt= 8 + Columns(6).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(6).ValueItems(1)._DefaultItem= 0 + Columns(6).ValueItems(1).Value= "N" + Columns(6).ValueItems(1).Value.vt= 8 + Columns(6).ValueItems(1).DisplayValue= "N" + Columns(6).ValueItems(1).DisplayValue.vt= 8 + Columns(6).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(6).ValueItems.Count= 2 + Columns(6).Caption= "Metal" + Columns(6).DataField= "calc_flag" + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 32 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "Length" + Columns(7).DataField= "calc_amt" + Columns(7).DataWidth= 2 + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "TO Price" + Columns(8).DataField= "tprice" + Columns(8).DataWidth= 6 + Columns(8).NumberFormat= "Fixed" + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 9 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=9" + Splits(0)._ColumnProps(1)= "Column(0).Width=1217" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1138" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=5689" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=5609" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=979" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=900" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=1455" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=1376" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=1746" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=1667" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=1667" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=1588" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1614" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1535" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1508" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1429" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1588" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1508" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(50) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(51) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(52) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(53) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(54) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(55) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(56) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(57) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(58) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(59) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(60) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(61) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(62) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(63) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(64) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(65) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(66) = "Named:id=33:Normal" + _StyleDefs(67) = ":id=33,.parent=0" + _StyleDefs(68) = "Named:id=34:Heading" + _StyleDefs(69) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(70) = ":id=34,.wraptext=-1" + _StyleDefs(71) = "Named:id=35:Footing" + _StyleDefs(72) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(73) = "Named:id=36:Selected" + _StyleDefs(74) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(75) = "Named:id=37:Caption" + _StyleDefs(76) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(77) = "Named:id=38:HighlightRow" + _StyleDefs(78) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(79) = "Named:id=39:EvenRow" + _StyleDefs(80) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(81) = "Named:id=40:OddRow" + _StyleDefs(82) = ":id=40,.parent=33" + _StyleDefs(83) = "Named:id=41:RecordSelector" + _StyleDefs(84) = ":id=41,.parent=34" + _StyleDefs(85) = "Named:id=42:FilterBar" + _StyleDefs(86) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmInventory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblInvtry ORDER BY inv_no" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmInventoryOld.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frm new file mode 100644 index 0000000..71f5db7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frm @@ -0,0 +1,2540 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmJCList + Caption = "Job Cost List" + ClientHeight = 6870 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9000 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6870 + ScaleWidth = 9000 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstLots + Height = 5220 + Left = 90 + TabIndex = 22 + Top = 1440 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 9208 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = 270 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmJCList.frx":0000 + End + Begin VB.CommandButton cmdFindLathDate + Caption = "Find By Project && Lath Date" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 855 + Left = 5820 + TabIndex = 21 + Top = 4800 + Width = 1515 + End + Begin VB.CommandButton cmdProcess2 + Caption = "Calc Project JC && Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 17 + Top = 5715 + Width = 1515 + End + Begin VB.CommandButton cmdTest2 + Caption = "Import AR" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 450 + Left = 6580 + TabIndex = 1 + Top = 5700 + Visible = 0 'False + Width = 755 + End + Begin VB.CommandButton cmdTest + Caption = "Import AP" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 450 + Left = 5820 + TabIndex = 2 + Top = 5700 + Visible = 0 'False + Width = 720 + End + Begin VB.TextBox txtProjCode + Height = 315 + Left = 7440 + TabIndex = 14 + Top = 2340 + Width = 1455 + End + Begin VB.CommandButton cmdFindProj + Caption = "Find by Project && Texture Date " + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 855 + Left = 5820 + TabIndex = 15 + Top = 3900 + Width = 1515 + End + Begin MSComCtl2.DTPicker dtpEDate + Height = 315 + Left = 7440 + TabIndex = 13 + Top = 1860 + Width = 1515 + _ExtentX = 2672 + _ExtentY = 556 + _Version = 393216 + Format = 92864513 + CurrentDate = 37413 + End + Begin MSComCtl2.DTPicker dtpBDate + Height = 315 + Left = 7440 + TabIndex = 12 + Top = 1500 + Width = 1515 + _ExtentX = 2672 + _ExtentY = 556 + _Version = 393216 + Format = 92864513 + CurrentDate = 37413 + End + Begin VB.CommandButton cmdProcess + Caption = "Calculate Lot JC && Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 16 + Top = 5100 + Width = 1515 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete 1 Lot" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 11 + Top = 4560 + Width = 1515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 10 + Top = 6315 + Width = 1515 + End + Begin VB.CommandButton cmdFlush + Caption = "&Flush List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 9 + Top = 3960 + Width = 1515 + End + Begin VB.CommandButton cmdSelectAll + Caption = "&Select All" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7380 + TabIndex = 8 + Top = 3360 + Width = 1515 + End + Begin VB.CommandButton cmdFind + Caption = "Find Lots by Date All Project" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5820 + TabIndex = 7 + Top = 3360 + Visible = 0 'False + Width = 1515 + End + Begin VB.ListBox lstLots2 + Height = 1425 + Left = 60 + TabIndex = 6 + Top = 5325 + Visible = 0 'False + Width = 5535 + End + Begin VB.CheckBox chkSelect + Alignment = 1 'Right Justify + BackColor = &H0000FFFF& + Caption = "Selected for Job Cost Run:" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 255 + Left = 5700 + TabIndex = 5 + Top = 2940 + Width = 3195 + End + Begin Crystal.CrystalReport crJobCost + Left = 8520 + Top = 900 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.Label lblBegTime + Caption = " " + Height = 285 + Left = 5820 + TabIndex = 20 + Top = 6240 + Width = 1335 + End + Begin VB.Label lblEndTime + Caption = " " + Height = 285 + Left = 5820 + TabIndex = 19 + Top = 6570 + Width = 1335 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "Enter the Desired Project Code to Find" + Height = 435 + Left = 5700 + TabIndex = 18 + Top = 2280 + Width = 1635 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Date:" + Height = 195 + Left = 6405 + TabIndex = 4 + Top = 1920 + Width = 930 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Date:" + Height = 195 + Left = 6180 + TabIndex = 3 + Top = 1560 + Width = 1140 + End + Begin VB.Label lblInstructions + Caption = $"frmJCList.frx":03C2 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1275 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 8895 + WordWrap = -1 'True + End +End +Attribute VB_Name = "frmJCList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSJC As Recordset, moRS As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean, mintSQYDS As Integer, mintMETAL As Integer +Dim mlngORDERID As Long, mintBOOKMARK As Integer, mstrRTYPE As String +Dim mstrPROJLOT As String, mboolPRINT As Boolean, mboolWINDOW As Boolean +Dim mboolREPORT, mstrWDone As String, mstrWTYPE As String + +Private Sub BuildList() +Dim oRS As Recordset, oRP As Recordset, oRJ As Recordset +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim strLOT As String, intPROJ As Integer + + On Error GoTo Error_EH + + strSQL3 = "SELECT * FROM tblJCList" + Set oRJ = New Recordset + oRJ.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + +' intPROJ = InputBox("Enter the Project Number Desired", "Select Project", 0) + +' strSQL = "SELECT * FROM tblLotInfo WHERE sorder >= #" & CDate(dtpBDate.Value) _ +' & "# and sorder <= #" & CDate(dtpEDate.Value) & "# and proj_id = " & intPROJ + + strSQL = "SELECT * FROM tblLotInfo WHERE sorder >= #" & CDate(dtpBDate.Value) _ + & "# and sorder <= #" & CDate(dtpEDate.Value) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSql2 = "SELECT * FROM tblProject WHERE proj_id = " & Field2Str(oRS!PROJ_ID) + Set oRP = New Recordset + oRP.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + strLOT = Field2Str(oRS!lot_no) + If IsNumeric(strLOT) Then + mstrPROJLOT = "Lot " & Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + Else + mstrPROJLOT = Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + End If + oRJ.AddNew + oRJ!Lot_id = Field2Str(oRS!Lot_id) + oRJ!PROJ_ID = Field2Str(oRP!PROJ_ID) + oRJ!proj_lot = mstrPROJLOT + oRJ!SORDER = Field2Str(oRS!SORDER) + oRJ.Update + + oRS.MoveNext + Loop + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module BuildList" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub BuildList2() +Dim oRS As Recordset, oRP As Recordset, oRJ As Recordset +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim strLOT As String, lngPROJ As Long + + On Error GoTo Error_EH + + strSQL3 = "SELECT * FROM tblJCList" + Set oRJ = New Recordset + oRJ.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblProject WHERE proj_code = " & """" & UCase(txtProjCode) & """" + Set oRP = New Recordset + oRP.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + lngPROJ = Field2Str2(oRP!PROJ_ID) + +' intPROJ = InputBox("Enter the Project Number Desired", "Select Project", 0) + + strSQL = "SELECT * FROM tblLotInfo WHERE sorder >= #" & CDate(dtpBDate.Value) _ + & "# and sorder <= #" & CDate(dtpEDate.Value) & "# and proj_id = " & lngPROJ + +' strSQL = "SELECT * FROM tblLotInfo WHERE Proj_ID = " & lngPROJ + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF +' strSql2 = "SELECT * FROM tblProject WHERE proj_id = " & Field2Str(oRS!proj_id) +' Set oRP = New Recordset +' oRP.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + strLOT = Field2Str(oRS!lot_no) + If IsNumeric(strLOT) Then + mstrPROJLOT = "Lot " & Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + Else + mstrPROJLOT = Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + End If + oRJ.AddNew + oRJ!Lot_id = Field2Str(oRS!Lot_id) + oRJ!PROJ_ID = lngPROJ +' oRJ!proj_id = Field2Str(oRP!proj_id) + oRJ!proj_lot = mstrPROJLOT + oRJ!SORDER = Field2Str2(oRS!SORDER) + oRJ.Update + + oRS.MoveNext + Loop + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module BuildList2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub BuildList3() +Dim oRS As Recordset, oRP As Recordset, oRJ As Recordset +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim strLOT As String, lngPROJ As Long + + On Error GoTo Error_EH + + strSQL3 = "SELECT * FROM tblJCList" + Set oRJ = New Recordset + oRJ.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblProject WHERE proj_code = " & """" & UCase(txtProjCode) & """" + Set oRP = New Recordset + oRP.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + lngPROJ = Field2Str2(oRP!PROJ_ID) + +' intPROJ = InputBox("Enter the Project Number Desired", "Select Project", 0) + + strSQL = "SELECT * FROM tblLotInfo WHERE Lorder >= #" & CDate(dtpBDate.Value) _ + & "# and Lorder <= #" & CDate(dtpEDate.Value) & "# and proj_id = " & lngPROJ + +' strSQL = "SELECT * FROM tblLotInfo WHERE Proj_ID = " & lngPROJ + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF +' strSql2 = "SELECT * FROM tblProject WHERE proj_id = " & Field2Str(oRS!proj_id) +' Set oRP = New Recordset +' oRP.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + strLOT = Field2Str(oRS!lot_no) + If IsNumeric(strLOT) Then + mstrPROJLOT = "Lot " & Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + Else + mstrPROJLOT = Field2Str(oRS!lot_no) & " - " & Field2Str(oRP!Proj_Desc) + End If + oRJ.AddNew + oRJ!Lot_id = Field2Str(oRS!Lot_id) + oRJ!PROJ_ID = lngPROJ +' oRJ!proj_id = Field2Str(oRP!proj_id) + oRJ!proj_lot = mstrPROJLOT + oRJ!SORDER = (oRS!SORDER) + oRJ!lorder = Field2Str2(oRS!lorder) + oRJ.Update + + oRS.MoveNext + Loop + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module BuildList3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotLoad() + +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String, strYN As String +Dim lngRET As Long, aTabs(1) As Long + On Error GoTo Error_EH + +' aTabs(0) = 25 +' aTabs(1) = 70 +' aTabs(2) = 200 + + strSQL = "SELECT * from tblJClist ORDER by Lot_id" 'WHERE crew_id = " & Field2Str(lblCrewId.Caption) & " ORDER BY emp_id" + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstLots.hwnd, LB_SETTABSTOPS, 2, aTabs(0)) + + lstLots.Clear + + Do Until oRS.EOF + With lstLots + If oRS!Selected Then + strYN = "YES" + Else + strYN = "NO" + End If + strLine = strYN & vbTab & Field2Str(oRS!lorder) & vbTab & Field2Str(oRS!SORDER) & vbTab & Field2Str(oRS!proj_lot) '& vbTab & Field2Str(ors!empname) + .AddItem strLine + .ItemData(.NewIndex) = oRS!JCid + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLots.ListCount Then + lstLots.ListIndex = 0 + cmdDelete.Enabled = True + Else + lstLots.ListIndex = -1 + cmdDelete.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module LotLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() +' dtpBDate.Value = "" +' dtpEDate.Value = "" + chkSelect = vbUnchecked + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblJCList " + strSQL = strSQL & "WHERE JCID = " & lstLots.ItemData(lstLots.ListIndex) +' strSQL = strSQL & "WHERE JCID = " & mlngORDERID + + Set moRSJC = New Recordset + moRSJC.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSJC.EOF Then + FormFind = False + Else + FormFind = True +' gintLOTID = Field2Str2(moRSJC!lot_id) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form JCList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String + + On Error GoTo Error_EH + + mboolSHOW = True +' strSQL = "Select * FROM tblLotInfo WHERE Lot_id = " & gintLOTID +' Set moRS = New Recordset +' moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' gintPROJID = Field2Str2(moRS!proj_id) + +' strSQL = "Select * FROM tblProject WHERE proj_id = " & gintPROJID +' Set moRSProj = New Recordset +' moRSProj.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' lblProjLot.Caption = Trim(Field2Str(moRSProj!proj_desc)) & " " & Field2Str(moRS!lot_no) + + With moRSJC + chkSelect = Field2CheckBox(!Selected) + + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String + + mintBOOKMARK = lstLots.ListIndex + strSQL = "DELETE * FROM tblJCLIST WHERE JCID = " & lstLots.ItemData(lstLots.ListIndex) + goConn.Execute strSQL + Call LotLoad + If mintBOOKMARK > (lstLots.ListCount - 1) Then + lstLots.ListIndex = mintBOOKMARK - 1 + Else + lstLots.ListIndex = mintBOOKMARK + End If + +End Sub + +Private Sub cmdFind_Click() + frmJCList.MousePointer = vbHourglass + Call BuildList + Call LotLoad + frmJCList.MousePointer = vbDefault +End Sub + +Private Sub cmdFindLathDate_Click() +Dim intYN + + intYN = MsgBox("Have you entered a Project Code Yet???", vbYesNo, "Project Code") + If intYN = vbNo Then + Exit Sub + End If + frmJCList.MousePointer = vbHourglass + Call BuildList3 + Call LotLoad + frmJCList.MousePointer = vbDefault + +End Sub + +Private Sub cmdFindProj_Click() +Dim intYN + + intYN = MsgBox("Have you entered a Project Code Yet???", vbYesNo, "Project Code") + If intYN = vbNo Then + Exit Sub + End If + frmJCList.MousePointer = vbHourglass + Call BuildList2 + Call LotLoad + frmJCList.MousePointer = vbDefault +End Sub + +Private Sub cmdFlush_Click() +Dim strSQL As String + + If lstLots.ListCount = 0 Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblJCLIST" + goConn.Execute strSQL + Call LotLoad +End Sub + +Private Sub cmdProcess_Click() +Dim oRS As Recordset, strYN As String +Dim strSQL As String + + On Error GoTo Error_EH + strYN = MsgBox("Do You Want To Print Report", vbYesNo, "Print?") + If strYN = vbYes Then + mboolREPORT = True + mboolWINDOW = False + Else + mboolWINDOW = True + mboolREPORT = False + End If + frmJCList.MousePointer = vbHourglass + Call ToggleButtons + strSQL = "SELECT * FROM tblJCList WHERE selected" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + gintLOTID = Field2Str(oRS!Lot_id) + gintPROJID = Field2Str(oRS!PROJ_ID) + + Call CalcJobCost +' If mboolREPORT Then + Call JCPrint +' End If + oRS.MoveNext + Loop + + Call ToggleButtons + MsgBox "Job Cost Report Processing is Complete", vbOKOnly, "Job Cost Reports" + frmJCList.MousePointer = vbDefault + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module cmdProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdProcess2_Click() +Dim oRS As Recordset, strYN As String +Dim strSQL As String + + On Error GoTo Error_EH + strYN = MsgBox("Do You Want To Print Report", vbYesNo, "Print?") + If strYN = vbYes Then + mboolREPORT = True + mboolWINDOW = False + Else + mboolWINDOW = True + mboolREPORT = False + End If + frmJCList.MousePointer = vbHourglass + Call ToggleButtons + strSQL = "SELECT * FROM tblJCList WHERE selected" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + gintLOTID = Field2Str(oRS!Lot_id) + gintPROJID = Field2Str(oRS!PROJ_ID) + + Call CalcJobCost2 + oRS.MoveNext + Loop + Call JCPrint2 + + Call ToggleButtons + MsgBox "Job Cost Report Processing is Complete", vbOKOnly, "Job Cost Reports" + frmJCList.MousePointer = vbDefault + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module cmdProcess2_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSelectAll_Click() +Dim oRS As Recordset +Dim strSQL As String + If lstLots.ListCount = 0 Then + Exit Sub + End If + strSQL = "SELECT * FROM tblJCList" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!Selected = vbChecked + oRS.Update + oRS.MoveNext + Loop + + Call LotLoad +End Sub + +Private Sub cmdTest_Click() +Dim strSQL As String + +' strSQL = "DELETE * FROM APH_JobDistDetail" ' WHERE Lot_id = " & gintLOTID +' goConn.Execute strSQL + + lblBegTime = "" + lblEndTime = "" + lblBegTime = Time + DoEvents +'' Call LoadMAS1 +' lblEndTime = Time +' DoEvents +End Sub + +Private Sub cmdTest2_Click() +Dim strSQL As String + +' strSQL = "DELETE * FROM ARN_InvHistoryHeader" ' WHERE Lot_id = " & gintLOTID +' goConn.Execute strSQL + + lblBegTime = "" + lblEndTime = "" + lblBegTime = Time + DoEvents +'' Call LoadMAS2 + +End Sub + +Private Sub dtpBDate_Change() + If dtpBDate.Value > dtpEDate.Value Then + dtpEDate.Value = dtpBDate.Value + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If gstrLOGIN = "DWW" Then +' cmdTest.Visible = True +' cmdTest2.Visible = True + End If + + mboolREPORT = vbFalse +' Set morsjc = New Recordset + dtpBDate.Value = Date + dtpEDate.Value = Date + + Call LotLoad +' Call SupplierLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLots_Click() + On Error GoTo Error_EH + + If lstLots.ListIndex <> -1 Then +' mlngORDERID = lstLots.ItemData(lstLots.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module lstLots_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLots_DblClick() + mintBOOKMARK = lstLots.ListIndex + +' If moRSJC!Selected = vbUnchecked Then + moRSJC!Selected = vbChecked +' Else +' moRSJC!Selected = vbUnchecked +' End If + moRSJC.Update + Call LotLoad + lstLots.ListIndex = mintBOOKMARK + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub GetWorkType() +Dim strSQL As String, oRSW As Recordset + + strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" + Set oRSW = New Recordset + oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSW.EOF Then + mstrWTYPE = Field2Str(oRSW!worktype) + End If + + oRSW.Close +End Sub + +Private Sub CalcJobCost() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset, oRSS As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double, strJC As String +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String +Dim strCont As String, strProj As String, strPROJCODE As String, strLOTNO As String +Dim strMODEL As String, strADD As String, strOWNER As String, dblPO As Double +Dim intYDS As Integer, intMETAL As Integer, strWORK As String, intCNT As Long + +'***************** need to add a calculation for total purchase orders and then calc the difference between +'***************** AP and PO and add it to the cost of the project/lot. + On Error GoTo Error_EH + +' Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If moRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(moRS!jobcost) Or moRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strCALC = "SELECT * FROM tblproject WHERE proj_id = " & Field2Long(moRS!PROJ_ID) + Set oRSC = New Recordset + oRSC.Open strCALC, goConn, adOpenForwardOnly, adLockReadOnly + strJOBCOST = Field2Str(moRS!jobcost) + strMODEL = Field2Str(moRS!model) + strADD = Field2Str(moRS!address) + strOWNER = Field2Str(moRS!Owner) + strLOTNO = Field2Str(moRS!lot_no) + strCont = Field2Str(oRSC!Proj_Cont) + strProj = Field2Str(oRSC!Proj_Desc) + strPROJCODE = Field2Str(oRSC!Proj_Code) + intYDS = Field2Integer(moRS!sq_yd) + intMETAL = Field2Integer(moRS!METAL) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT sum(orderamt) as SUMPO FROM tblORDERS WHERE D_Flag <> 'X' AND lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Purchase Order Information For This Lot", vbOKOnly, "No Purchase Orders" + Else + dblPO = Field2Str2(oRSC!sumpo) +' dblCALC = Field2Str2(oRSC!sumpo) + strCALC = "TOTAL PO's ISSUED" + intCALC = 1 +' moRS!pr = dblCALC +' moRS.Update +' GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblORDERS WHERE D_Flag <> 'X' AND lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + intCNT = oRSC.RecordCount + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" + ElseIf !m_type = "W" Then + oRSD!desc4 = "WRAP " +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" + End If + +' oRSD!date1 = Field2Str(!order_date) + oRSD!date1 = !order_date +' oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + moRS!pr = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + ElseIf !pay_type = "C" Then + oRSD!desc1 = "SCAFFOLD" + ElseIf !pay_type = "Y" Then + oRSD!desc1 = "SYNTHETIC" + ElseIf !pay_type = "V" Then + oRSD!desc1 = "STONE" + ElseIf !pay_type = "X" Then + oRSD!desc1 = "PAINT" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!Crew_Boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + mstrWDone = Field2Str(!WorkDone) + Call GetWorkType + strWORK = mstrWTYPE + + oRSD!desc3 = Mid(strWORK, 1, 17) + +' If !workdone = "C" Then +' oRSD!desc3 = "COMPLETE" +' ElseIf !workdone = "P" Then +' oRSD!desc3 = "PARTIAL" +' ElseIf !workdone = "T" Then +' oRSD!desc3 = "TEXTURE" +' ElseIf !workdone = "S" Then +' oRSD!desc3 = "SCRATCH" +' ElseIf !workdone = "B" Then +' oRSD!desc3 = "BROWN" +' ElseIf !workdone = "U" Then +' oRSD!desc3 = "CMU" +' ElseIf !workdone = "F" Then +' oRSD!desc3 = "FENCE" +' ElseIf !workdone = "W" Then +' oRSD!desc3 = "WORKORDER/REPAIR" +' ElseIf !workdone = "R" Then +' oRSD!desc3 = "REPAIR" +' ElseIf !workdone = "Y" Then +' oRSD!desc3 = "UP" +' ElseIf !workdone = "Z" Then +' oRSD!desc3 = "DOWN" +' End If + + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + moRS!ap = dblCALC +' moRS.Update + GoSub Save_Info + End If + + If dblPO > dblCALC Then + dblCALC = dblPO - dblCALC + strCALC = "TOTAL PO's ISSUES OVER AP" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + '*** watch out for duplicate amounts + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + moRS!bill = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + moRS!yard = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + + strJC = "SELECT * FROM tblSYSInfo" + Set oRSS = New Recordset + oRSS.Open strJC, goConn, adOpenForwardOnly, adLockReadOnly + + moRS!id1 = Round((Field2Str2(oRSS!tax_wc) * Field2Str2(moRS!sq_yd)), 2) + moRS!id2 = Round((Field2Str2(oRSS!scaf) * Field2Str2(moRS!sq_yd)), 2) + moRS!id3 = Round((Field2Str2(oRSS!ind_job) * Field2Str2(moRS!sq_yd)), 2) + moRS!id4 = Round((Field2Str2(oRSS!office) * Field2Str2(moRS!sq_yd)), 2) + moRS!ga1 = Round((Field2Str2(oRSS!ga) * Field2Str2(moRS!sq_yd)), 2) + moRS.Update + moRS.Close + oRSS.Close + + If oRS.State = adStateOpen Then + oRS.Close + Set oRS = Nothing + End If + If oRSF.State = adStateOpen Then + oRSF.Close + Set oRSF = Nothing + End If + If oRSD.State = adStateOpen Then + oRSD.Close + Set oRSD = Nothing + End If + If oRSC.State = adStateOpen Then + oRSC.Close + Set oRSC = Nothing + End If + + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_id = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form JCList - Module CalcJobCost" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcJobCost2() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset, oRSS As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double, strJC As String +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String +Dim strCont As String, strProj As String, strPROJCODE As String, strLOTNO As String +Dim strMODEL As String, strADD As String, strOWNER As String, dblPO As Double +Dim intYDS As Integer, intMETAL As Integer, strWORK As String + + + On Error GoTo Error_EH + +' Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If moRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(moRS!jobcost) Or moRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strCALC = "SELECT * FROM tblproject WHERE proj_id = " & Field2Long(moRS!PROJ_ID) + Set oRSC = New Recordset + oRSC.Open strCALC, goConn, adOpenForwardOnly, adLockReadOnly + strJOBCOST = Field2Str(moRS!jobcost) + strMODEL = Field2Str(moRS!model) + strADD = Field2Str(moRS!address) + strOWNER = Field2Str(moRS!Owner) + strLOTNO = Field2Str(moRS!lot_no) + strCont = Field2Str(oRSC!Proj_Cont) + strProj = Field2Str(oRSC!Proj_Desc) + strPROJCODE = Field2Str(oRSC!Proj_Code) + intYDS = Field2Integer(moRS!sq_yd) + intMETAL = Field2Integer(moRS!METAL) + mintSQYDS = intYDS + mintMETAL = intMETAL + End If + End If + +' strSQL = "DELETE * FROM tblJobCost WHERE create = '" & gstrLOGIN & "'" +' strSQL = "DELETE * FROM tblJobCost WHERE proj_id = " & gintPROJID + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + +' strSQL = "DELETE * FROM tblJobCost_Rpt WHERE create = '" & gstrLOGIN & "'" +' strSQL = "DELETE * FROM tblJobCost_Rpt WHERE proj_id = " & gintPROJID + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT sum(orderamt) as SUMPO FROM tblORDERS WHERE D_Flag <> 'X' AND lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Purchase Order Information For This Lot", vbOKOnly, "No Purchase Orders" + Else + dblPO = Field2Str2(oRSC!sumpo) +' dblCALC = Field2Str2(oRSC!sumpo) + strCALC = "TOTAL PO's ISSUED" + intCALC = 1 +' moRS!pr = dblCALC +' moRS.Update +' GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblORDERS WHERE D_Flag <> 'X' AND lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!PROJ_ID = gintPROJID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" + End If + +' oRSD!date1 = Field2Str(!order_date) + oRSD!date1 = !order_date +' oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + mstrRTYPE = 3 + moRS!pr = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!PROJ_ID = gintPROJID + oRSD!Type = 4 +' mstrRTYPE = 3 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + ElseIf !pay_type = "C" Then + oRSD!desc1 = "SCAFFOLD" + ElseIf !pay_type = "Y" Then + oRSD!desc1 = "SYNTHETIC" + ElseIf !pay_type = "V" Then + oRSD!desc1 = "STONE" + ElseIf !pay_type = "X" Then + oRSD!desc1 = "PAINT" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!Crew_Boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + mstrWDone = Field2Str(!WorkDone) + Call GetWorkType + strWORK = mstrWTYPE + + oRSD!desc3 = Mid(strWORK, 1, 17) + +' If !workdone = "C" Then +' oRSD!desc3 = "COMPLETE" +' ElseIf !workdone = "P" Then +' oRSD!desc3 = "PARTIAL" +' ElseIf !workdone = "T" Then +' oRSD!desc3 = "TEXTURE" +' ElseIf !workdone = "S" Then +' oRSD!desc3 = "SCRATCH" +' ElseIf !workdone = "B" Then +' oRSD!desc3 = "BROWN" +' ElseIf !workdone = "U" Then +' oRSD!desc3 = "CMU" +' ElseIf !workdone = "F" Then +' oRSD!desc3 = "FENCE" +' ElseIf !workdone = "W" Then +' oRSD!desc3 = "WORKORDER/REPAIR" +' ElseIf !workdone = "R" Then +' oRSD!desc3 = "REPAIR" +' ElseIf !workdone = "Y" Then +' oRSD!desc3 = "UP" +' ElseIf !workdone = "Z" Then +' oRSD!desc3 = "DOWN" +' End If + + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + mstrRTYPE = 4 + moRS!ap = dblCALC +' moRS.Update + GoSub Save_Info + End If + + If dblPO > dblCALC Then + dblCALC = dblPO - dblCALC + strCALC = "TOTAL PO's ISSUES OVER AP" + intCALC = 1 + mstrRTYPE = 5 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!PROJ_ID = gintPROJID + oRSD!Type = 2 +' mstrRTYPE = 4 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + mstrRTYPE = 2 + moRS!bill = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!PROJ_ID = gintPROJID + oRSD!Type = 5 +' mstrRTYPE = 2 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + mstrRTYPE = 6 + moRS!yard = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!PROJ_ID = gintPROJID + oRSD!Type = 3 +' mstrRTYPE = 5 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str(Mid(!Desc, 1, 30)) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + + strJC = "SELECT * FROM tblSYSInfo" + Set oRSS = New Recordset + oRSS.Open strJC, goConn, adOpenForwardOnly, adLockReadOnly + + moRS!id1 = Round((Field2Str2(oRSS!tax_wc) * Field2Str2(moRS!sq_yd)), 2) + moRS!id2 = Round((Field2Str2(oRSS!scaf) * Field2Str2(moRS!sq_yd)), 2) + moRS!id3 = Round((Field2Str2(oRSS!ind_job) * Field2Str2(moRS!sq_yd)), 2) + moRS!id4 = Round((Field2Str2(oRSS!office) * Field2Str2(moRS!sq_yd)), 2) + moRS!ga1 = Round((Field2Str2(oRSS!ga) * Field2Str2(moRS!sq_yd)), 2) + moRS.Update + moRS.Close + oRSS.Close + + If oRS.State = adStateOpen Then + oRS.Close + Set oRS = Nothing + End If +' If oRSF.State = adStateOpen Then +' oRSF.Close +' Set oRSF = Nothing +' End If + If oRSD.State = adStateOpen Then + oRSD.Close + Set oRSD = Nothing + End If + If oRSC.State = adStateOpen Then + oRSC.Close + Set oRSC = Nothing + End If + + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_id = gintLOTID + oRS!PROJ_ID = gintPROJID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!RType = mstrRTYPE + oRS!Create = gstrLOGIN + oRS!SQYDS = mintSQYDS + oRS!METAL = mintMETAL + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form JCList - Module CalcJobCost2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcJobCostOld() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset, oRSS As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double, strJC As String +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String +Dim strCont As String, strProj As String, strPROJCODE As String, strLOTNO As String +Dim strMODEL As String, strADD As String, strOWNER As String +Dim intYDS As Integer, intMETAL As Integer, strWORK As String + + +' On Error GoTo Error_EH + +' Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If moRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(moRS!jobcost) Or moRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strCALC = "SELECT * FROM tblproject WHERE proj_id = " & Field2Long(moRS!PROJ_ID) + Set oRSC = New Recordset + oRSC.Open strCALC, goConn, adOpenForwardOnly, adLockReadOnly + strJOBCOST = Field2Str(moRS!jobcost) + strMODEL = Field2Str(moRS!model) + strADD = Field2Str(moRS!address) + strOWNER = Field2Str(moRS!Owner) + strLOTNO = Field2Str(moRS!lot_no) + strCont = Field2Str(oRSC!Proj_Cont) + strProj = Field2Str(oRSC!Proj_Desc) + strPROJCODE = Field2Str(oRSC!Proj_Code) + intYDS = Field2Integer(moRS!sq_yd) + intMETAL = Field2Integer(moRS!METAL) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblORDERS WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" +' ElseIf !m_type = "T" Then +' oRSD!desc4 = "Texture" + End If + +' oRSD!date1 = Field2Str(!order_date) + oRSD!date1 = !order_date +' oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + moRS!pr = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + ElseIf !pay_type = "C" Then + oRSD!desc1 = "SCAFFOLD" + ElseIf !pay_type = "Y" Then + oRSD!desc1 = "SYNTHETIC" + ElseIf !pay_type = "V" Then + oRSD!desc1 = "STONE" + ElseIf !pay_type = "X" Then + oRSD!desc1 = "PAINT" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!Crew_Boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + mstrWDone = Field2Str(oRSD!WorkDone) + Call GetWorkType + strWORK = mstrWTYPE + + oRSD!desc3 = strWORK + +' If !workdone = "C" Then +' oRSD!desc3 = "COMPLETE" +' ElseIf !workdone = "P" Then +' oRSD!desc3 = "PARTIAL" +' ElseIf !workdone = "T" Then +' oRSD!desc3 = "TEXTURE" +' ElseIf !workdone = "S" Then +' oRSD!desc3 = "SCRATCH" +' ElseIf !workdone = "B" Then +' oRSD!desc3 = "BROWN" +' ElseIf !workdone = "U" Then +' oRSD!desc3 = "CMU" +' ElseIf !workdone = "F" Then +' oRSD!desc3 = "FENCE" +' ElseIf !workdone = "W" Then +' oRSD!desc3 = "WORKORDER/REPAIR" +' ElseIf !workdone = "R" Then +' oRSD!desc3 = "REPAIR" +' ElseIf !workdone = "Y" Then +' oRSD!desc3 = "UP" +' ElseIf !workdone = "Z" Then +' oRSD!desc3 = "DOWN" +' End If + + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + moRS!ap = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + moRS!bill = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + moRS!yard = dblCALC +' moRS.Update + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_id = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + + strJC = "SELECT * FROM tblSYSInfo" + Set oRSS = New Recordset + oRSS.Open strJC, goConn, adOpenForwardOnly, adLockReadOnly + + moRS!id1 = Round((Field2Str2(oRSS!tax_wc) * Field2Str2(moRS!sq_yd)), 2) + moRS!id2 = Round((Field2Str2(oRSS!scaf) * Field2Str2(moRS!sq_yd)), 2) + moRS!id3 = Round((Field2Str2(oRSS!ind_job) * Field2Str2(moRS!sq_yd)), 2) + moRS!id4 = Round((Field2Str2(oRSS!office) * Field2Str2(moRS!sq_yd)), 2) + moRS!ga1 = Round((Field2Str2(oRSS!ga) * Field2Str2(moRS!sq_yd)), 2) + moRS.Update + moRS.Close + oRSS.Close + + If oRS.State = adStateOpen Then + oRS.Close + Set oRS = Nothing + End If + If oRSF.State = adStateOpen Then + oRSF.Close + Set oRSF = Nothing + End If + If oRSD.State = adStateOpen Then + oRSD.Close + Set oRSD = Nothing + End If + If oRSC.State = adStateOpen Then + oRSC.Close + Set oRSC = Nothing + End If + + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_id = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form JCList - Module CalcJobCost2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMAS1() +Dim strSql2 As String, oRSC As Recordset +Dim strSQL3 As String, oRSA As Recordset + MsgBox "This Module Does Not Work. Contact Darv", vbOKOnly, "Does Not Work" + Exit Sub +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSQL3 = "SELECT * FROM APH_JobDistDetail" + Set oRSA = New Recordset + oRSA.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + +' strSQL2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + strSql2 = "SELECT * FROM APH_JobDistDetail" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If Not oRSC.EOF Then + Do Until oRSC.EOF + oRSA.AddNew + oRSA!Division = oRSC!Division + oRSA!VendorNumber = oRSC!VendorNumber + oRSA!InvoiceNumber = oRSC!InvoiceNumber + oRSA!JobNumber = oRSC!JobNumber + oRSA!CostCode = oRSC!CostCode + oRSA!CostType = oRSC!CostType + oRSA!distributionamount = oRSC!distributionamount + oRSA!RetentionAmount = oRSC!RetentionAmount + oRSA!Balance = oRSC!Balance + oRSA!AmountAppliedToday = oRSC!AmountAppliedToday + oRSA.Update + oRSC.MoveNext + Loop + End If + + lblEndTime = Time + DoEvents + + MsgBox "Job Distribution Detail Has Been Updated", vbOKOnly, "File Import" + +End Sub + +Private Sub LoadMAS2() +Dim strSql2 As String, oRSC As Recordset +Dim strSQL3 As String, oRSA As Recordset +Dim strINV As String * 7, strSEQ As String, strCUTOFF As String +Dim strSQL99 As String, oRS As Recordset, strINVDATE As String +Dim dteINVDT As Date, strMSG As String, dteSTART As Date + + MsgBox "This Module Does Not Work. Contact Darv", vbOKOnly, "Does Not Work" + Exit Sub +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + dteSTART = "01/01/2007" + strSQL3 = "SELECT * FROM ARN_InvHistoryHeader" + Set oRSA = New Recordset + oRSA.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + +' strSQL2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + strSql2 = "SELECT * FROM ARN_InvHistoryHeader" ' WHERE invoicedate > '20080101'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenDynamic, adLockOptimistic + + If Not oRSC.EOF Then + Do Until oRSC.EOF + strINV = oRSC!InvoiceNumber + strSEQ = oRSC!HeaderSeqNumber + dteINVDT = Field2Str2(oRSC!InvoiceDate) + If dteINVDT > dteSTART Then + + strSQL99 = "SELECT * FROM ARN_InvHistoryHeader WHERE InvoiceNumber = '" & strINV & "' AND SeqNumber = '" & strSEQ & "'" + Set oRS = New Recordset + oRS.Open strSQL99, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + + Else + oRSA.AddNew + oRSA!CustomerNumber = oRSC!CustomerNumber + oRSA!JobNumber = oRSC!JobNumber + oRSA!InvoiceNumber = oRSC!InvoiceNumber + oRSA!InvoiceDate = oRSC!InvoiceDate + oRSA!TaxableSalesAmount = oRSC!TaxableSalesAmount + oRSA!NonTaxableSalesAmount = oRSC!NonTaxableSalesAmount + oRSA!SalesTaxAmount = oRSC!SalesTaxAmount + oRSA!InvoiceType = oRSC!InvoiceType + oRSA!seqnumber = oRSC!HeaderSeqNumber + oRSA.Update + End If + End If + oRSC.MoveNext + Loop + + End If + + lblEndTime = Time + DoEvents + + MsgBox "Invoice History Header Has Been Updated", vbOKOnly, "File Import" + +End Sub + +Private Sub JCPrint() +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "{tblJOBCOST_RPT.LOT_ID} = " & gintLOTID + crJobCost.ReportFileName = App.Path & "\jobcost.rpt" + crJobCost.SelectionFormula = strSQL + crJobCost.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crJobCost.Destination = crptToWindow + End If + If mboolREPORT = True Then + crJobCost.Destination = crptToPrinter + End If + crJobCost.Action = 1 + + crJobCost.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crJobCost.ReportFileName = App.Path & "\jobcost2.rpt" + crJobCost.SelectionFormula = strSQL + crJobCost.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crJobCost.Destination = crptToWindow + End If + If mboolREPORT = True Then + crJobCost.Destination = crptToPrinter + End If + crJobCost.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module JCPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub JCPrint2() +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "{tblJOBCOST_RPT.PROJ_ID} = " & gintPROJID +' strSQL = "{tblJOBCOST_RPT.LOT_ID} = " & gintLOTID + crJobCost.ReportFileName = App.Path & "\jobcostProj.rpt" + crJobCost.SelectionFormula = strSQL + crJobCost.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crJobCost.Destination = crptToWindow + End If + If mboolREPORT = True Then + crJobCost.Destination = crptToPrinter + End If + crJobCost.Action = 1 + + crJobCost.Reset + + strSQL = "{tblLOTINFO.Proj_id} = " & gintPROJID +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crJobCost.ReportFileName = App.Path & "\jobcostProj2.rpt" + crJobCost.SelectionFormula = strSQL + crJobCost.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crJobCost.Destination = crptToWindow + End If + If mboolREPORT = True Then + crJobCost.Destination = crptToPrinter + End If + crJobCost.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form JCList - Module JCPrint2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ToggleButtons() +' cmdFind.Enabled = Not cmdFind.Enabled + cmdFlush.Enabled = Not cmdFlush.Enabled + cmdProcess.Enabled = Not cmdProcess.Enabled + cmdSelectAll.Enabled = Not cmdSelectAll.Enabled + cmdDelete.Enabled = Not cmdDelete.Enabled + cmdProcess2.Enabled = Not cmdProcess2.Enabled + cmdFindProj.Enabled = Not cmdFindProj.Enabled + cmdExit.Enabled = Not cmdExit.Enabled +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frx new file mode 100644 index 0000000..7b00441 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCPrint.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCPrint.frm new file mode 100644 index 0000000..8933f5e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmJCPrint.frm @@ -0,0 +1,35 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "CRYSTL32.OCX" +Begin VB.Form frmJCPrint + Caption = "Job Cost Print" + ClientHeight = 3195 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4680 + LinkTopic = "Form1" + ScaleHeight = 3195 + ScaleWidth = 4680 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtSQL + Height = 435 + Left = 1380 + TabIndex = 0 + Top = 1920 + Width = 1695 + End + Begin Crystal.CrystalReport crJobCost + Left = 1560 + Top = 1200 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End +End +Attribute VB_Name = "frmJCPrint" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frm new file mode 100644 index 0000000..5115413 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frm @@ -0,0 +1,327 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmLabor + Caption = "Labor Rates" + ClientHeight = 5265 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 5265 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Bindings = "frmLabor.frx":0000 + Height = 4095 + Left = 60 + TabIndex = 0 + Top = 120 + Width = 11775 + _ExtentX = 20770 + _ExtentY = 7223 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Finish" + Columns(0).DataField= "texture" + Columns(0).DataWidth= 2 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Stucco Rate" + Columns(1).DataField= "S_Rate" + Columns(1).DataWidth= 5 + Columns(1).DefaultValue= "0" + Columns(1).DefaultValue.vt= 8 + Columns(1).NumberFormat= "Fixed" + Columns(1).EditMaskUpdate= -1 'True + Columns(1).EditMaskRight= -1 'True + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Lath Rate" + Columns(2).DataField= "L_Rate" + Columns(2).DataWidth= 5 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2).NumberFormat= "fixed" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Metal Rate" + Columns(3).DataField= "M_Rate" + Columns(3).DataWidth= 5 + Columns(3).DefaultValue= "0" + Columns(3).DefaultValue.vt= 8 + Columns(3).NumberFormat= "fixed" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "CMU Rate" + Columns(4).DataField= "CMU" + Columns(4).DataWidth= 5 + Columns(4).DefaultValue= "0" + Columns(4).DefaultValue.vt= 8 + Columns(4).NumberFormat= "fixed" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "Mat. MarkUp" + Columns(5).DataField= "mtmu" + Columns(5).DataWidth= 5 + Columns(5).DefaultValue= "0" + Columns(5).DefaultValue.vt= 8 + Columns(5).NumberFormat= "fixed" + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Scaffold" + Columns(6).DataField= "scr" + Columns(6).DataWidth= 5 + Columns(6).DefaultValue= "0" + Columns(6).DefaultValue.vt= 8 + Columns(6).NumberFormat= "fixed" + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 0 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "OH Percent" + Columns(7).DataField= "ohp" + Columns(7).DataWidth= 5 + Columns(7).DefaultValue= "0" + Columns(7).DefaultValue.vt= 8 + Columns(7).NumberFormat= "fixed" + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "Tape/Plastic" + Columns(8).DataField= "tp" + Columns(8).DataWidth= 5 + Columns(8).DefaultValue= "0" + Columns(8).DefaultValue.vt= 8 + Columns(8).NumberFormat= "fixed" + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(9)._VlistStyle= 0 + Columns(9)._MaxComboItems= 5 + Columns(9).Caption= "Mark Up" + Columns(9).DataField= "mu" + Columns(9).DataWidth= 5 + Columns(9).DefaultValue= "0" + Columns(9).DefaultValue.vt= 8 + Columns(9).NumberFormat= "fixed" + Columns(9)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(10)._VlistStyle= 0 + Columns(10)._MaxComboItems= 5 + Columns(10).Caption= "Cmnt/Lime Adj." + Columns(10).DataField= "cladj" + Columns(10).DataWidth= 2 + Columns(10).DefaultValue= "0" + Columns(10).DefaultValue.vt= 8 + Columns(10).NumberFormat= "fixed" + Columns(10)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 11 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=11" + Splits(0)._ColumnProps(1)= "Column(0).Width=2302" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=2223" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=1931" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=1852" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1667" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1588" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=1799" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=1720" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=1799" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=1720" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=1931" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=1852" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1535" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1455" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1799" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1720" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1931" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1852" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits(0)._ColumnProps(37)= "Column(9).Width=1402" + Splits(0)._ColumnProps(38)= "Column(9).DividerColor=0" + Splits(0)._ColumnProps(39)= "Column(9)._WidthInPix=1323" + Splits(0)._ColumnProps(40)= "Column(9).Order=10" + Splits(0)._ColumnProps(41)= "Column(10).Width=2064" + Splits(0)._ColumnProps(42)= "Column(10).DividerColor=0" + Splits(0)._ColumnProps(43)= "Column(10)._WidthInPix=1984" + Splits(0)._ColumnProps(44)= "Column(10).Order=11" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(50) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(51) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(52) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(53) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(54) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(55) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(56) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(57) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(58) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(59) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(60) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(61) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(62) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(63) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(64) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(65) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(66) = "Splits(0).Columns(9).Style:id=74,.parent=13" + _StyleDefs(67) = "Splits(0).Columns(9).HeadingStyle:id=71,.parent=14" + _StyleDefs(68) = "Splits(0).Columns(9).FooterStyle:id=72,.parent=15" + _StyleDefs(69) = "Splits(0).Columns(9).EditorStyle:id=73,.parent=17" + _StyleDefs(70) = "Splits(0).Columns(10).Style:id=78,.parent=13" + _StyleDefs(71) = "Splits(0).Columns(10).HeadingStyle:id=75,.parent=14" + _StyleDefs(72) = "Splits(0).Columns(10).FooterStyle:id=76,.parent=15" + _StyleDefs(73) = "Splits(0).Columns(10).EditorStyle:id=77,.parent=17" + _StyleDefs(74) = "Named:id=33:Normal" + _StyleDefs(75) = ":id=33,.parent=0" + _StyleDefs(76) = "Named:id=34:Heading" + _StyleDefs(77) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(78) = ":id=34,.wraptext=-1" + _StyleDefs(79) = "Named:id=35:Footing" + _StyleDefs(80) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(81) = "Named:id=36:Selected" + _StyleDefs(82) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(83) = "Named:id=37:Caption" + _StyleDefs(84) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(85) = "Named:id=38:HighlightRow" + _StyleDefs(86) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(87) = "Named:id=39:EvenRow" + _StyleDefs(88) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(89) = "Named:id=40:OddRow" + _StyleDefs(90) = ":id=40,.parent=33" + _StyleDefs(91) = "Named:id=41:RecordSelector" + _StyleDefs(92) = ":id=41,.parent=34" + _StyleDefs(93) = "Named:id=42:FilterBar" + _StyleDefs(94) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmLabor" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub Form_Load() + Call LoadLabor + + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() + + Dim strSQL As String + Dim oRS As Recordset + + strSQL = "SELECT * FROM tblPrginfo" + + Set moRS = New Recordset + + If moRS.State = adStateOpen Then + moRS.Close + End If + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frx new file mode 100644 index 0000000..7efd61d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLaborold.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLogin.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLogin.frm new file mode 100644 index 0000000..e722b96 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLogin.frm @@ -0,0 +1,382 @@ +VERSION 5.00 +Begin VB.Form frmLogin + BorderStyle = 3 'Fixed Dialog + Caption = "Login" + ClientHeight = 1410 + ClientLeft = 1830 + ClientTop = 5040 + ClientWidth = 5805 + ClipControls = 0 'False + ControlBox = 0 'False + ForeColor = &H80000008& + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + PaletteMode = 1 'UseZOrder + ScaleHeight = 1410 + ScaleWidth = 5805 + Begin VB.ComboBox cboNames + Height = 300 + Left = 1200 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 0 + Top = 120 + Width = 3375 + End + Begin VB.CommandButton cmdOK + Caption = "&OK" + Enabled = 0 'False + Height = 315 + Left = 4680 + TabIndex = 2 + Top = 120 + Width = 1035 + End + Begin VB.CommandButton cmdCancel + Cancel = -1 'True + Caption = "&Cancel" + Height = 300 + Left = 4680 + TabIndex = 3 + Top = 540 + Width = 1035 + End + Begin VB.TextBox txtPassword + Height = 300 + IMEMode = 3 'DISABLE + Left = 1200 + MaxLength = 16 + PasswordChar = "*" + TabIndex = 1 + Top = 540 + Width = 3375 + End + Begin VB.Label lblAppName + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 120 + TabIndex = 6 + Top = 1020 + Width = 5595 + End + Begin VB.Label lblUserID + AutoSize = -1 'True + BackStyle = 0 'Transparent + Caption = "User ID" + Height = 192 + Left = 120 + TabIndex = 4 + Top = 180 + Width = 540 + End + Begin VB.Label lblPass + AutoSize = -1 'True + BackStyle = 0 'Transparent + Caption = "Password" + Height = 195 + Left = 120 + TabIndex = 5 + Top = 600 + Visible = 0 'False + Width = 690 + End +End +Attribute VB_Name = "frmLogin" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private mintTimesTried As Integer +Private mboolCancel As Boolean +Private mboolValidLogon As Boolean +Private mboolDisplayUsers As Boolean +Private mboolCheckUserTable As Boolean +Private mstrInitLoginID As String +Private mstrInitPassword As String +Private mboolError As Boolean +Private mstrAppName As String + +Private mlngTop As Long +Private mlngLeft As Long + +Private mstrInfoMsg As String + +Property Get InfoMsg() + InfoMsg = mstrInfoMsg +End Property + +Property Let appName(ByVal strValue As String) + mstrAppName = strValue +End Property + +Property Let InitTop(ByVal lngTop As Long) + mlngTop = lngTop +End Property + +Property Let InitLeft(ByVal lngLeft As Long) + mlngLeft = lngLeft +End Property + +Property Get DisplayUsers() As Boolean + DisplayUsers = mboolDisplayUsers +End Property + +Property Let DisplayUsers(ByVal boolValue As Boolean) + mboolDisplayUsers = boolValue +End Property + +Property Get CheckUserTable() As Boolean + CheckUserTable = mboolCheckUserTable +End Property + +Property Let CheckUserTable(ByVal boolValue As Boolean) + mboolCheckUserTable = boolValue +End Property + +Property Get Cancel() As Boolean + Cancel = mboolCancel +End Property + +Property Get ValidLogon() As Boolean + ValidLogon = mboolValidLogon +End Property + +Property Get InitLoginID() As String + InitLoginID = mstrInitLoginID +End Property + +Property Let InitLoginID(ByVal strValue As String) + mstrInitLoginID = strValue +End Property + +Property Get InitPassword() As String + InitPassword = mstrInitPassword +End Property + +Property Let InitPassword(ByVal strValue As String) + mstrInitPassword = strValue +End Property + +Property Let Password(ByVal strValue As String) + mstrInitPassword = strValue +End Property + +Private Function UserNameLoad() As Boolean +Dim strOldMsg As String +Dim strLine As String +Dim strSQL As String, strFIND As String +Dim oRS As Recordset + + Set oRS = New Recordset + strSQL = "SELECT * FROM tblUSERS WHERE not locked" + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strLine = oRS!LastName & ", " + strLine = strLine & oRS!FirstName & _ + Space$(100) & vbTab + strLine = strLine & oRS!loginid + + cboNames.AddItem strLine + cboNames.ItemData(cboNames.NewIndex) = oRS!userid + + ' Retrieve next record + oRS.MoveNext + Loop + UserNameLoad = True +End Function + +Private Sub cboNames_Click() +Dim strName As String + cmdOK.Enabled = True + ' strNAME = Mid(cboNames.Text, 1, 13) +' If RTrim$(cboNames.Text) = "Whipple, Darv" Then +' If RTrim$(strNAME) = "Whipple, Darv" Then +' lblPass.Visible = True +' txtPassword.Visible = True +' txtPassword.SetFocus +' End If +End Sub + +Private Sub cboNames_LostFocus() +Dim strName As String +Dim strSQL As String, lngUserID As Long + + If cboNames.ListIndex <> -1 Then + lngUserID = cboNames.ItemData(cboNames.ListIndex) + strSQL = "UserID = " & lngUserID + moRS.Find strSQL + gbytSECURITY = moRS!security + + strName = Mid(cboNames.Text, 1, 13) +' If RTrim$(cboNames.Text) = "Whipple, Darv" Then +' If gbytSECURITY = 1 Or gbytSECURITY = 3 Then +' If RTrim$(strNAME) = "Whipple, Darv" Then + lblPass.Visible = True + txtPassword.Visible = True + txtPassword.SetFocus +' End If + Else + Unload Me + End If +End Sub + +Private Sub cmdCancel_Click() + Unload Me +' mstrInfoMsg = "User Cancelled Login Process" +' mboolCancel = True +' Me.Hide +End Sub + +Private Sub cmdOK_Click() +Dim strLoginId As String +Dim lngUserID As Long +Dim strUserName As String +Dim strPassword As String +Dim boolPerform As Boolean +Dim strSQL As String + + On Error GoTo Error_EH + + mintTimesTried = mintTimesTried + 1 + mboolCancel = False + + ' Did they fill in name and password correctly + boolPerform = FormCheck() + + If boolPerform Then + ' Get Password from Text Box + strPassword = Trim$(txtPassword.Text) + + ' Set Properties of DataConnection Class + strLoginId = Trim$(cboNames.Text) + strLoginId = Mid$(strLoginId, InStr(strLoginId, vbTab) + 1) + strUserName = Trim$(Left$(cboNames.Text, InStr(cboNames.Text, vbTab) - 1)) + lngUserID = cboNames.ItemData(cboNames.ListIndex) + End If + + If boolPerform Then + moRS.MoveFirst + strSQL = "UserID = " & lngUserID + moRS.Find strSQL + If moRS.EOF Then + boolPerform = False + If Not boolPerform Then + MsgBox "Invalid User ID and/or Password" & vbCrLf & vbCrLf & "ReEnter", , "Security.Login" + End If + ElseIf Field2Str(moRS!Password) <> Field2Str(strPassword) Then + boolPerform = False + If Not boolPerform Then + MsgBox "Invalid User ID and/or Password" & vbCrLf & vbCrLf & "ReEnter", , "Security.Login" + txtPassword.SetFocus + End If + Else + gstrLOGIN = strLoginId + gbytSECURITY = moRS!security + If moRS!INVAdd Then + gboolAP = True + Else + gboolAP = False + End If + moRS!lastlogin = Now() + moRS.Update + gboolLOGIN = True + End If + End If + + If boolPerform Then + mboolValidLogon = True + Unload Me + Else + If mintTimesTried > 2 Then + MsgBox "Exceeded the number of tries to login", , "PDSASecurity.Login" + Unload Me + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Login - Module cmdOK" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() + cboNames.SetFocus + If mboolError Then + mboolValidLogon = False + Unload Me + End If +End Sub + +Private Sub Form_Initialize() + mlngTop = -1 + mlngLeft = -1 +End Sub + +Private Sub Form_Load() +Dim strSQL As String + + Screen.MousePointer = vbHourglass + + strSQL = "SELECT * FROM tblUSERS" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mlngTop = -1 Then + Me.Top = Screen.Height - Me.Height - 1000 + Else + Me.Top = mlngTop + End If + If mlngLeft = -1 Then + Me.Left = (Screen.Width / 2) - (Me.Width / 2) + Else + Me.Left = mlngLeft + End If + + lblAppName.Caption = mstrAppName + + mboolValidLogon = False + ' Load Combo Box of Users + If Not UserNameLoad() Then + mboolError = True + End If + + Screen.MousePointer = vbDefault +End Sub + +Private Function FormCheck() + Dim boolValid As Integer + boolValid = True + + If Trim$(cboNames.Text) = "" Then + MsgBox "Please Fill In Your User Name", , "PDSASecurity.Login" + cboNames.SetFocus + boolValid = False + End If + + FormCheck = boolValid +End Function + +Private Sub txtPassword_GotFocus() + Call FieldSelect(txtPassword) +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub txtPassword_LostFocus() + cmdOK.SetFocus +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotChLog.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotChLog.frm new file mode 100644 index 0000000..7491c0c --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotChLog.frm @@ -0,0 +1,371 @@ +VERSION 5.00 +Begin VB.Form frmLotChLog + Caption = "Changes Log" + ClientHeight = 4305 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9885 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4305 + ScaleWidth = 9885 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 6840 + TabIndex = 11 + TabStop = 0 'False + Top = 3660 + Width = 1395 + End + Begin VB.ListBox lstChange + Height = 4155 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 5055 + End + Begin VB.Label lblOType + BorderStyle = 1 'Fixed Single + Height = 1635 + Left = 6240 + TabIndex = 13 + Top = 1920 + Width = 3555 + WordWrap = -1 'True + End + Begin VB.Label lblODate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6240 + TabIndex = 12 + Top = 1560 + Width = 2955 + End + Begin VB.Label lblOrderType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Reason:" + Height = 195 + Left = 5550 + TabIndex = 10 + Top = 1980 + Width = 600 + End + Begin VB.Label lblOrderDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Change Date:" + Height = 195 + Left = 5160 + TabIndex = 9 + Top = 1620 + Width = 990 + End + Begin VB.Label lblSupplyName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6240 + TabIndex = 8 + Top = 1200 + Width = 2955 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "User:" + Height = 195 + Left = 5775 + TabIndex = 7 + Top = 1275 + Width = 375 + End + Begin VB.Label lblPONum + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6240 + TabIndex = 6 + Top = 840 + Width = 2955 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Action:" + Height = 195 + Left = 5655 + TabIndex = 5 + Top = 900 + Width = 495 + End + Begin VB.Label lblProjDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6240 + TabIndex = 4 + Top = 480 + Width = 3645 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7275 + TabIndex = 3 + Top = 120 + Width = 810 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6240 + TabIndex = 2 + Top = 120 + Width = 1005 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 5880 + TabIndex = 1 + Top = 180 + Width = 270 + End +End +Attribute VB_Name = "frmLotChLog" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCHANGE As Recordset + +Dim mboolAdding As Boolean + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "FormLotChangeLog - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + If lstChange.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormLotChangeLog - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT action, chgdate, change_id FROM tblLotChange WHERE lot_id = " & gintLOTID & " ORDER BY chgdate" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstChange.Clear + + Do Until oRS.EOF + With lstChange + strLine = Field2Str(oRS!Chgdate) & vbTab & Field2Str(oRS!Action) + .AddItem strLine + .ItemData(.NewIndex) = oRS!change_id + End With + + oRS.MoveNext + Loop + + If lstChange.ListCount Then + lstChange.ListIndex = 0 + Else + lstChange.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormLotChangeLog - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotChange " + strSQL = strSQL & "WHERE Change_Id = " & lstChange.ItemData(lstChange.ListIndex) + + Set moRSCHANGE = New Recordset + + moRSCHANGE.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSCHANGE.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormLotChangeLog - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + With moRSCHANGE + lblODate.Caption = Field2Str(!Chgdate) + lblSupplyName = Field2Str(!User) + lblPONum.Caption = Field2Str(!Action) + lblOType.Caption = Field2Str(!reason) + strSQL = "SELECT proj_id,Lot_no FROM tblLotInfo WHERE lot_id = " & Field2Str(!Lot_id) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSql2 = "SELECT proj_code, proj_desc FROM tblProject WHERE proj_id = " & Field2Str(oRS!proj_id) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + lblLotNo.Caption = Field2Str(oRS!lot_no) + lblProjCode.Caption = Field2Str(oRSS!proj_code) + lblProjDesc.Caption = Field2Str(oRSS!proj_desc) + End If + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormLotChangeLog - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblLotNo.Caption = "" + lblProjDesc.Caption = "" + lblProjCode.Caption = "" + lblOType.Caption = "" + lblODate.Caption = "" + lblPONum.Caption = "" + lblSupplyName.Caption = "" +End Sub + + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH +' If cmdSave.Enabled Then + +' strMSG = "Crew Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call FormSave + +' Case vbNo + +' Case vbCancel +' Cancel = True +' Exit Sub +' End Select +' End If + + If moRSCHANGE.State = adStateOpen Then + moRSCHANGE.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstChange_Click() + On Error GoTo Error_EH + + If lstChange.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstChange.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstChange_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frm new file mode 100644 index 0000000..389c963 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frm @@ -0,0 +1,22613 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotInfo + BorderStyle = 1 'Fixed Single + Caption = "Lot Information" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtStoneBill + Alignment = 1 'Right Justify + Height = 330 + Left = 8640 + TabIndex = 226 + TabStop = 0 'False + Top = 420 + Visible = 0 'False + Width = 540 + End + Begin VB.CheckBox chkFirst + Caption = "First Time" + Height = 315 + Left = 10680 + TabIndex = 211 + Top = 1500 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtESTID + Height = 375 + Left = 3120 + TabIndex = 207 + Top = 1680 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtOPEN + Height = 285 + Left = 10740 + TabIndex = 206 + Top = 1140 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtJC + Enabled = 0 'False + Height = 315 + Left = 2700 + MaxLength = 7 + TabIndex = 8 + Top = 2220 + Width = 915 + End + Begin VB.Timer tmrPause + Enabled = 0 'False + Interval = 500 + Left = 8700 + Top = 1020 + End + Begin Crystal.CrystalReport crOrder + Left = 120 + Top = 960 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtSand + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5160 + TabIndex = 28 + TabStop = 0 'False + Top = 780 + Width = 420 + End + Begin VB.ListBox lstPlans + Height = 2010 + Left = 9240 + Sorted = -1 'True + TabIndex = 26 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdFindPlan + Height = 435 + Left = 2565 + Picture = "frmLotInfo.frx":0000 + Style = 1 'Graphical + TabIndex = 7 + Top = 1410 + Width = 435 + End + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 24 + TabStop = 0 'False + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 22 + TabStop = 0 'False + Top = 45 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1020 + Left = 3900 + MultiLine = -1 'True + TabIndex = 11 + Top = 1515 + Width = 4635 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 3 + TabIndex = 10 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 20 + TabStop = 0 'False + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 19 + TabStop = 0 'False + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 2 + TabIndex = 9 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 18 + TabStop = 0 'False + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Enabled = 0 'False + Height = 315 + Left = 1440 + MaxLength = 5 + TabIndex = 5 + Top = 1140 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + MaxLength = 8 + TabIndex = 6 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + MaxLength = 15 + TabIndex = 4 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + MaxLength = 30 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 165 + TabIndex = 30 + TabStop = 0 'False + Top = 2850 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "&General Information" + TabPicture(0) = "frmLotInfo.frx":0442 + Tab(0).ControlEnabled= -1 'True + Tab(0).Control(0)= "lblDiana" + Tab(0).Control(0).Enabled= 0 'False + Tab(0).Control(1)= "lblYardMemo" + Tab(0).Control(1).Enabled= 0 'False + Tab(0).Control(2)= "lblMetal" + Tab(0).Control(2).Enabled= 0 'False + Tab(0).Control(3)= "lblLathBill" + Tab(0).Control(3).Enabled= 0 'False + Tab(0).Control(4)= "lblTextureO" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "lblBrownO" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "lblScratchO" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "lblSandO" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "lblLathO" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lblOrderDates" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtLotNotes" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "cmdShowChange" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "cmdPrintCMU" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cmdUpCMU" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "txtYardMemo" + Tab(0).Control(14).Enabled= 0 'False + Tab(0).Control(15)= "cmdEdit" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "cmdSuperRpt" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "txtMetal" + Tab(0).Control(17).Enabled= 0 'False + Tab(0).Control(18)= "cmdDelLot" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "cmdAddLot" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "txtLathBill" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "txtTextureO" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "txtBrownO" + Tab(0).Control(22).Enabled= 0 'False + Tab(0).Control(23)= "txtScratchO" + Tab(0).Control(23).Enabled= 0 'False + Tab(0).Control(24)= "txtSandO" + Tab(0).Control(24).Enabled= 0 'False + Tab(0).Control(25)= "txtLathO" + Tab(0).Control(25).Enabled= 0 'False + Tab(0).Control(26)= "cmdSaveLotInfo" + Tab(0).Control(26).Enabled= 0 'False + Tab(0).Control(27)= "cmdOrders" + Tab(0).Control(27).Enabled= 0 'False + Tab(0).Control(28)= "cmdExit" + Tab(0).Control(28).Enabled= 0 'False + Tab(0).Control(29)= "cmdCalc" + Tab(0).Control(29).Enabled= 0 'False + Tab(0).Control(30)= "cmdJCSetup" + Tab(0).Control(30).Enabled= 0 'False + Tab(0).Control(31)= "chkHoldOrders" + Tab(0).Control(31).Enabled= 0 'False + Tab(0).Control(32)= "chkHoldPO" + Tab(0).Control(32).Enabled= 0 'False + Tab(0).Control(33)= "chkSynthetic" + Tab(0).Control(33).Enabled= 0 'False + Tab(0).Control(34)= "cmdOrder" + Tab(0).Control(34).Enabled= 0 'False + Tab(0).Control(35)= "chkStone" + Tab(0).Control(35).Enabled= 0 'False + Tab(0).Control(36)= "cmdPrint" + Tab(0).Control(36).Enabled= 0 'False + Tab(0).Control(37)= "chkOthers" + Tab(0).Control(37).Enabled= 0 'False + Tab(0).Control(38)= "chkNoPay" + Tab(0).Control(38).Enabled= 0 'False + Tab(0).Control(39)= "chkPaint" + Tab(0).Control(39).Enabled= 0 'False + Tab(0).ControlCount= 40 + TabCaption(1) = "&Super's Orders" + TabPicture(1) = "frmLotInfo.frx":045E + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lstPreOrder" + Tab(1).Control(0).Enabled= 0 'False + Tab(1).Control(1)= "cmdPreOrderPrintPC" + Tab(1).Control(2)= "cmdIssue" + Tab(1).Control(3)= "cmdLFlag" + Tab(1).Control(4)= "txtTake138" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "txtSuperBB" + Tab(1).Control(6)= "txtSuper12" + Tab(1).Control(7)= "txtSuper783" + Tab(1).Control(8)= "txtSuper78" + Tab(1).Control(9)= "txtSuper38" + Tab(1).Control(10)= "txtSuper1383" + Tab(1).Control(11)= "txtSuperRL" + Tab(1).Control(12)= "txtSuperML" + Tab(1).Control(13)= "txtSuperDW" + Tab(1).Control(14)= "txtSuperSP" + Tab(1).Control(15)= "txtCalc138" + Tab(1).Control(15).Enabled= 0 'False + Tab(1).Control(16)= "cmdPreOrderPrintY" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cmdPreOrderPrintS" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "txtSuperNotes" + Tab(1).Control(19)= "cmdLathPay" + Tab(1).Control(20)= "cmdStuccoPay" + Tab(1).Control(21)= "cmdRePrintL" + Tab(1).Control(22)= "lblZMetal" + Tab(1).Control(23)= "lblBB" + Tab(1).Control(24)= "lblTake138" + Tab(1).Control(25)= "lblSuperBB" + Tab(1).Control(26)= "linSO" + Tab(1).Control(27)= "lblSuper12" + Tab(1).Control(28)= "lblSuper783" + Tab(1).Control(29)= "lblSuper78" + Tab(1).Control(30)= "lblSuper38" + Tab(1).Control(31)= "lblSuper138" + Tab(1).Control(32)= "lblSuperML" + Tab(1).Control(33)= "lblSuperRL" + Tab(1).Control(34)= "lblSuperDW" + Tab(1).Control(35)= "lblSuperSP" + Tab(1).Control(36)= "lblSupHelp" + Tab(1).Control(37)= "lblPreOrder" + Tab(1).Control(38)= "lblSuperNotes" + Tab(1).ControlCount= 39 + TabCaption(2) = "&Materials" + TabPicture(2) = "frmLotInfo.frx":047A + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblMatInst" + Tab(2).Control(1)= "lblOrderBalance" + Tab(2).Control(2)= "lblLMLength" + Tab(2).Control(3)= "lblLMetal" + Tab(2).Control(4)= "lblLMType" + Tab(2).Control(5)= "lblLMDFlag" + Tab(2).Control(6)= "lblQty" + Tab(2).Control(7)= "lblLMInvNo" + Tab(2).Control(8)= "lblLMDesc" + Tab(2).Control(9)= "chkChange" + Tab(2).Control(10)= "cmdFindInv" + Tab(2).Control(11)= "cmdInventory" + Tab(2).Control(11).Enabled= 0 'False + Tab(2).Control(12)= "txtLMBalance" + Tab(2).Control(12).Enabled= 0 'False + Tab(2).Control(13)= "cboLMMetal" + Tab(2).Control(14)= "cboLMType" + Tab(2).Control(15)= "cboLMDFlag" + Tab(2).Control(16)= "txtLMLength" + Tab(2).Control(17)= "txtLMQty" + Tab(2).Control(18)= "txtLMInvNo" + Tab(2).Control(19)= "txtLMDesc" + Tab(2).Control(20)= "cmdDelMatrl" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdSaveMatrl" + Tab(2).Control(22)= "cmdAddMatrl" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "lstInventory" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "lstLMaterial" + Tab(2).ControlCount= 25 + TabCaption(3) = "Op&tions" + TabPicture(3) = "frmLotInfo.frx":0496 + Tab(3).ControlEnabled= 0 'False + Tab(3).Control(0)= "lblBAmt" + Tab(3).Control(1)= "lblBillingAmt" + Tab(3).Control(2)= "lblSelectOpt" + Tab(3).Control(3)= "lblLOMLength" + Tab(3).Control(4)= "lblLOMetal" + Tab(3).Control(5)= "lblLOMType" + Tab(3).Control(6)= "lblLOMDFlag" + Tab(3).Control(7)= "lblLOMQty" + Tab(3).Control(8)= "lblLOMInvNo" + Tab(3).Control(9)= "lblLOMDesc" + Tab(3).Control(10)= "lblLOTexture" + Tab(3).Control(11)= "lblLOFAdj" + Tab(3).Control(12)= "lblLOFin2" + Tab(3).Control(13)= "lblLOYdge" + Tab(3).Control(14)= "lblLODesc" + Tab(3).Control(15)= "lblLOptions" + Tab(3).Control(16)= "lblPOptions" + Tab(3).Control(17)= "lblOStone" + Tab(3).Control(18)= "lblOptNum" + Tab(3).Control(19)= "txtNote" + Tab(3).Control(20)= "txtNote2" + Tab(3).Control(21)= "cboLOMetal" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "cboLOMType" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "cboLOMDFlag" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "txtLOMLength" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "txtLOMQty" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "txtLOMInvNo" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "txtLOMDesc" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "txtLOTexture" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "txtLOFoam" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "txtLOFin2" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "txtLOYdge" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "txtLODesc" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lstLOptions" + Tab(3).Control(34)= "cmdOptDel" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "cmdOptAdd" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lstPOptions" + Tab(3).Control(37)= "chkOStone" + Tab(3).Control(38)= "txtOSt_SqFt" + Tab(3).Control(39)= "lstOptMatrl" + Tab(3).ControlCount= 40 + TabCaption(4) = "&Lath Orders" + TabPicture(4) = "frmLotInfo.frx":04B2 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lstYard" + Tab(4).Control(0).Enabled= 0 'False + Tab(4).Control(1)= "lstLath" + Tab(4).Control(1).Enabled= 0 'False + Tab(4).Control(2)= "lblYardOrd" + Tab(4).Control(3)= "lblLathOrd" + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco &Orders" + TabPicture(5) = "frmLotInfo.frx":04CE + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lstScratch" + Tab(5).Control(0).Enabled= 0 'False + Tab(5).Control(1)= "lstBrown" + Tab(5).Control(1).Enabled= 0 'False + Tab(5).Control(2)= "lstTexture" + Tab(5).Control(2).Enabled= 0 'False + Tab(5).Control(3)= "lblScrOrd" + Tab(5).Control(4)= "lblBrnOrd" + Tab(5).Control(5)= "lblTexOrd" + Tab(5).ControlCount= 6 + TabCaption(6) = "&Purchase Orders" + TabPicture(6) = "frmLotInfo.frx":04EA + Tab(6).ControlEnabled= 0 'False + Tab(6).Control(0)= "lblPayYds" + Tab(6).Control(1)= "lblOptMatPrice" + Tab(6).Control(2)= "lblPODate" + Tab(6).Control(3)= "lblPOMType" + Tab(6).Control(4)= "lblPODFlag" + Tab(6).Control(5)= "lblPOQty" + Tab(6).Control(6)= "lblDescription" + Tab(6).Control(7)= "lblInvNo" + Tab(6).Control(8)= "lblPONum" + Tab(6).Control(9)= "lblDesc" + Tab(6).Control(10)= "lblPO" + Tab(6).Control(11)= "lblPONotes" + Tab(6).Control(12)= "lblPOMaterials" + Tab(6).Control(13)= "lblIssueTo" + Tab(6).Control(14)= "lblPOType" + Tab(6).Control(15)= "lblPayType" + Tab(6).Control(16)= "cmdPrintPOPay" + Tab(6).Control(17)= "txtPay" + Tab(6).Control(18)= "fraPO" + Tab(6).Control(19)= "cmdPrintForm" + Tab(6).Control(19).Enabled= 0 'False + Tab(6).Control(20)= "txtPOPrice" + Tab(6).Control(21)= "txtPODate" + Tab(6).Control(22)= "txtPODesc" + Tab(6).Control(23)= "txtPOMatDesc" + Tab(6).Control(24)= "cmdPrintPO" + Tab(6).Control(24).Enabled= 0 'False + Tab(6).Control(25)= "cmdDelPOMat" + Tab(6).Control(25).Enabled= 0 'False + Tab(6).Control(26)= "cmdSavePOMat" + Tab(6).Control(27)= "cmdAddPOMat" + Tab(6).Control(27).Enabled= 0 'False + Tab(6).Control(28)= "cmdFindPOMat" + Tab(6).Control(29)= "cboPOMType" + Tab(6).Control(30)= "cboPODFlag" + Tab(6).Control(31)= "txtPOQty" + Tab(6).Control(32)= "txtPOInvNo" + Tab(6).Control(33)= "cmdDelPO" + Tab(6).Control(33).Enabled= 0 'False + Tab(6).Control(34)= "cmdSavePO" + Tab(6).Control(35)= "cmdAddPO" + Tab(6).Control(35).Enabled= 0 'False + Tab(6).Control(36)= "txtIssueTo" + Tab(6).Control(37)= "txtPONum" + Tab(6).Control(37).Enabled= 0 'False + Tab(6).Control(38)= "txtPONotes" + Tab(6).Control(39)= "lstPO" + Tab(6).Control(40)= "cboPOType" + Tab(6).Control(41)= "txtPOType" + Tab(6).Control(41).Enabled= 0 'False + Tab(6).Control(42)= "txtPayType" + Tab(6).Control(43)= "lstLOOKUP" + Tab(6).Control(43).Enabled= 0 'False + Tab(6).Control(44)= "lstPOMaterial" + Tab(6).ControlCount= 45 + Begin LpLib.fpList lstPreOrder + Height = 1425 + Left = -69255 + TabIndex = 249 + Top = 2160 + Width = 5445 + _Version = 196608 + _ExtentX = 9604 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0506 + End + Begin LpLib.fpList lstPOMaterial + Height = 1260 + Left = -73785 + TabIndex = 248 + Top = 4245 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 2222 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 90 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0889 + End + Begin LpLib.fpList lstLOOKUP + Height = 2445 + Left = -67200 + TabIndex = 247 + Top = 2700 + Visible = 0 'False + Width = 3555 + _Version = 196608 + _ExtentX = 6271 + _ExtentY = 4313 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0C16 + End + Begin LpLib.fpList lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 246 + Top = 4680 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":0F13 + End + Begin LpLib.fpList lstLMaterial + Height = 4590 + Left = -74880 + TabIndex = 245 + Top = 810 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 8096 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":1326 + End + Begin LpLib.fpList lstInventory + Height = 2070 + Left = -66840 + TabIndex = 244 + Top = 2655 + Visible = 0 'False + Width = 3165 + _Version = 196608 + _ExtentX = 5583 + _ExtentY = 3651 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 225 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo.frx":172B + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 255 + Left = 540 + TabIndex = 238 + Top = 3345 + Width = 1155 + End + Begin VB.CommandButton cmdPreOrderPrintPC + Caption = "Print PreCast PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 236 + Top = 1380 + Width = 1335 + End + Begin VB.CommandButton cmdIssue + Caption = "RePrint &Yard Ticket" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 233 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkNoPay + Alignment = 1 'Right Justify + BackColor = &H00C0C0C0& + Caption = "No Pay Sheets Issued" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 2220 + TabIndex = 232 + Top = 3420 + Width = 2295 + End + Begin VB.CheckBox chkOthers + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 255 + Left = 2940 + TabIndex = 231 + Top = 3180 + Width = 1575 + End + Begin VB.CommandButton cmdPrint + Caption = "All Orders Printed" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3015 + TabIndex = 230 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 300 + Left = -64755 + TabIndex = 229 + Top = 675 + Width = 975 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 240 + Left = -68475 + TabIndex = 227 + Top = 735 + Width = 1890 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 3180 + TabIndex = 224 + Top = 2925 + Width = 1335 + End + Begin VB.TextBox txtPayType + Height = 315 + Left = -71895 + MaxLength = 1 + TabIndex = 55 + Top = 2295 + Width = 375 + End + Begin VB.CommandButton cmdOrder + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5520 + TabIndex = 219 + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtPOType + Height = 285 + Left = -70980 + TabIndex = 218 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 615 + End + Begin VB.ComboBox cboPOType + Height = 315 + ItemData = "frmLotInfo.frx":1A27 + Left = -72300 + List = "frmLotInfo.frx":1A37 + Style = 2 'Dropdown List + TabIndex = 52 + Top = 1200 + Width = 1995 + End + Begin VB.CheckBox chkSynthetic + Alignment = 1 'Right Justify + Caption = "Synthetic" + Height = 195 + Left = 2100 + TabIndex = 214 + Top = 2940 + Width = 975 + End + Begin VB.CommandButton cmdLFlag + Caption = "Set Lath Flags" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 213 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkHoldPO + Alignment = 1 'Right Justify + Caption = "Hold PO's" + Height = 255 + Left = 540 + TabIndex = 210 + Top = 3120 + Width = 1155 + End + Begin VB.CheckBox chkHoldOrders + Alignment = 1 'Right Justify + Caption = "Hold Orders" + ForeColor = &H00404040& + Height = 255 + Left = 540 + MaskColor = &H000000FF& + TabIndex = 209 + Top = 2880 + Width = 1155 + End + Begin VB.CommandButton cmdJCSetup + Caption = "Setup JC Record" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5520 + TabIndex = 208 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = -73080 + TabIndex = 134 + TabStop = 0 'False + Top = 1680 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 124 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = -73065 + MaxLength = 4 + TabIndex = 125 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 126 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 127 + Top = 4155 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 128 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 129 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 130 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 131 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 132 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 133 + Top = 4740 + Width = 795 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfo.frx":1A72 + Left = -74775 + List = "frmLotInfo.frx":1A79 + TabIndex = 123 + Top = 1035 + Width = 3095 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + TabIndex = 122 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 121 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 120 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 119 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -67320 + TabIndex = 118 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = -74760 + Sorted = -1 'True + TabIndex = 117 + Top = 1080 + Width = 885 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = -73800 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 57 + Top = 2700 + Width = 3915 + End + Begin VB.TextBox txtPONum + BackColor = &H00E0E0E0& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -72300 + TabIndex = 116 + TabStop = 0 'False + Top = 840 + Width = 975 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 53 + Top = 1560 + Width = 3735 + End + Begin VB.CommandButton cmdAddPO + Caption = "&New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 115 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdSavePO + Caption = "S&ave PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 59 + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdDelPO + Caption = "D&elete PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 114 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66240 + TabIndex = 113 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -64920 + TabIndex = 112 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 111 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 109 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 110 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68115 + MaxLength = 50 + TabIndex = 100 + Top = 705 + Width = 4275 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 101 + Top = 1065 + Width = 2625 + End + Begin VB.TextBox txtLMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 102 + Top = 1425 + Width = 915 + End + Begin VB.TextBox txtLMLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 2 + TabIndex = 106 + Top = 3060 + Width = 915 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfo.frx":1A8A + Left = -68100 + List = "frmLotInfo.frx":1A94 + Style = 2 'Dropdown List + TabIndex = 103 + Top = 1845 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfo.frx":1AA8 + Left = -68100 + List = "frmLotInfo.frx":1AAA + Style = 2 'Dropdown List + TabIndex = 104 + Top = 2265 + Width = 1215 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfo.frx":1AAC + Left = -68100 + List = "frmLotInfo.frx":1AB6 + Style = 2 'Dropdown List + TabIndex = 105 + Top = 2655 + Width = 1215 + End + Begin VB.TextBox txtLMBalance + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 107 + TabStop = 0 'False + Top = 3465 + Width = 915 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = -71640 + TabIndex = 99 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLODesc + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 94 + TabStop = 0 'False + Top = 1020 + Width = 2835 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 98 + TabStop = 0 'False + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 97 + TabStop = 0 'False + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 96 + TabStop = 0 'False + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOTexture + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 95 + TabStop = 0 'False + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOMDesc + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 93 + TabStop = 0 'False + Top = 3135 + Width = 4155 + End + Begin VB.TextBox txtLOMInvNo + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 92 + TabStop = 0 'False + Top = 3480 + Width = 2625 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 91 + TabStop = 0 'False + Top = 3810 + Width = 915 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 90 + TabStop = 0 'False + Top = 5160 + Width = 915 + End + Begin VB.ComboBox cboLOMDFlag + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 89 + TabStop = 0 'False + Text = "cboLOMDFlag" + Top = 4155 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmLotInfo.frx":1AC7 + Left = -68100 + List = "frmLotInfo.frx":1AC9 + TabIndex = 88 + TabStop = 0 'False + Text = "cboLOMType" + Top = 4500 + Width = 1155 + End + Begin VB.ComboBox cboLOMetal + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 87 + TabStop = 0 'False + Text = "cboLOMetal" + Top = 4830 + Width = 1155 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 86 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 85 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 84 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 83 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 82 + TabStop = 0 'False + Top = 4440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtLathO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 81 + TabStop = 0 'False + Top = 1080 + Width = 1335 + End + Begin VB.TextBox txtSandO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 80 + TabStop = 0 'False + Top = 1422 + Width = 1335 + End + Begin VB.TextBox txtScratchO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 79 + TabStop = 0 'False + Top = 1764 + Width = 1335 + End + Begin VB.TextBox txtBrownO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 78 + TabStop = 0 'False + Top = 2106 + Width = 1335 + End + Begin VB.TextBox txtTextureO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 77 + TabStop = 0 'False + Top = 2448 + Width = 1335 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = -65430 + Picture = "frmLotInfo.frx":1ACB + Style = 1 'Graphical + TabIndex = 76 + Top = 1035 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtLathBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + MaxLength = 10 + TabIndex = 75 + TabStop = 0 'False + Top = 2790 + Width = 1335 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add New Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 74 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdDelLot + Caption = "Delete Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 73 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtCalc138 + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -69720 + TabIndex = 72 + TabStop = 0 'False + Top = 2400 + Width = 435 + End + Begin VB.CheckBox chkChange + Alignment = 1 'Right Justify + Caption = "Recalc Flag:" + Height = 255 + Left = -69180 + TabIndex = 108 + Top = 3885 + Width = 1455 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 71 + Top = 3480 + Width = 1335 + End + Begin VB.TextBox txtPOInvNo + Height = 315 + Left = -68760 + MaxLength = 18 + TabIndex = 63 + Top = 2625 + Width = 2625 + End + Begin VB.TextBox txtPOQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + MaxLength = 4 + TabIndex = 66 + Top = 3360 + Width = 915 + End + Begin VB.ComboBox cboPODFlag + Height = 315 + ItemData = "frmLotInfo.frx":1F0D + Left = -68760 + List = "frmLotInfo.frx":1F17 + Style = 2 'Dropdown List + TabIndex = 67 + Top = 3720 + Width = 1215 + End + Begin VB.ComboBox cboPOMType + Height = 315 + ItemData = "frmLotInfo.frx":1F2B + Left = -68760 + List = "frmLotInfo.frx":1F2D + Style = 2 'Dropdown List + TabIndex = 68 + Top = 4080 + Width = 1215 + End + Begin VB.CommandButton cmdFindPOMat + Height = 435 + Left = -66090 + Picture = "frmLotInfo.frx":1F2F + Style = 1 'Graphical + TabIndex = 64 + Top = 2505 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdAddPOMat + Caption = "&Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 62 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdSavePOMat + Caption = "S&ave Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 70 + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdDelPOMat + Caption = "D&elete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 61 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPO + Caption = "P&rint PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 60 + TabStop = 0 'False + Top = 960 + Width = 1095 + End + Begin VB.TextBox txtPOMatDesc + Height = 315 + Left = -68760 + MaxLength = 50 + TabIndex = 65 + Top = 3000 + Width = 4275 + End + Begin VB.TextBox txtPODesc + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 54 + Top = 1920 + Width = 3735 + End + Begin VB.TextBox txtPODate + Alignment = 1 'Right Justify + Height = 315 + Left = -69600 + MaxLength = 10 + TabIndex = 58 + Top = 1200 + Width = 1035 + End + Begin VB.TextBox txtPOPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + TabIndex = 69 + Top = 4440 + Width = 975 + End + Begin VB.CommandButton cmdPrintForm + Caption = "Print Form" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 51 + TabStop = 0 'False + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSuperRpt + Caption = "Print Super's Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 50 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPreOrderPrintY + Caption = "Print Yard PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 49 + TabStop = 0 'False + Top = 720 + Width = 1335 + End + Begin VB.CommandButton cmdPreOrderPrintS + Caption = "Print Supplier PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 48 + TabStop = 0 'False + Top = 1380 + Width = 1335 + End + Begin VB.Frame fraPO + Height = 390 + Left = -68475 + TabIndex = 43 + Top = 2100 + Width = 4830 + Begin VB.OptionButton optStone + Caption = "Stone" + Height = 255 + Left = 3240 + TabIndex = 235 + Top = 120 + Width = 795 + End + Begin VB.OptionButton optPreOrder + Caption = "PreOrder" + Height = 255 + Left = 2280 + TabIndex = 222 + Top = 120 + Width = 975 + End + Begin VB.OptionButton optLath + Caption = "Lath" + Height = 255 + Left = 60 + TabIndex = 47 + Top = 120 + Width = 675 + End + Begin VB.OptionButton optStucco + Caption = "Stucco" + Height = 255 + Left = 720 + TabIndex = 46 + Top = 120 + Width = 855 + End + Begin VB.OptionButton optSand + Caption = "Sand" + Height = 255 + Left = 1560 + TabIndex = 45 + Top = 120 + Width = 735 + End + Begin VB.OptionButton optNone + Caption = "None" + Height = 255 + Left = 3990 + TabIndex = 44 + Top = 120 + Value = -1 'True + Width = 735 + End + End + Begin VB.TextBox txtSuperNotes + Height = 1275 + Left = -69240 + MaxLength = 255 + MultiLine = -1 'True + TabIndex = 144 + Top = 4200 + Width = 5445 + End + Begin VB.CommandButton cmdEdit + Caption = "Edit Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4260 + TabIndex = 42 + TabStop = 0 'False + Top = 2160 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtYardMemo + Height = 1575 + Left = 480 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 41 + Top = 3900 + Width = 5355 + End + Begin VB.CommandButton cmdUpCMU + Caption = "Update CMU Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4260 + TabIndex = 40 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPrintCMU + Caption = "Print CMU Pay Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4260 + TabIndex = 39 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtPay + Alignment = 1 'Right Justify + Height = 315 + Left = -70215 + TabIndex = 56 + Top = 2295 + Width = 675 + End + Begin VB.CommandButton cmdPrintPOPay + Caption = "Print Pay Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68760 + TabIndex = 38 + Top = 4785 + Width = 1035 + End + Begin VB.CommandButton cmdLathPay + Caption = "RePrint Lath Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 37 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdStuccoPay + Caption = "RePrint Stucco Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67980 + TabIndex = 36 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdRePrintL + Caption = "ReSet Lath Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67980 + TabIndex = 35 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdShowChange + Caption = "Show Change Log" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5520 + TabIndex = 34 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtNote2 + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 33 + Top = 3060 + Width = 5475 + End + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 32 + Top = 3840 + Width = 5475 + End + Begin VB.TextBox txtLotNotes + Height = 1575 + Left = 5880 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 31 + Top = 3900 + Width = 5355 + End + Begin VB.Label lblOptNum + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -70500 + TabIndex = 237 + Top = 720 + Width = 1680 + End + Begin VB.Label lblZMetal + Alignment = 2 'Center + Caption = "This House Uses Z-Metal" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = -74940 + TabIndex = 234 + Top = 5160 + Visible = 0 'False + Width = 5655 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Opt. SqFt:" + Height = 195 + Left = -66540 + TabIndex = 228 + Top = 750 + Width = 1740 + End + Begin VB.Label lblPayType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Type:" + Height = 195 + Left = -72690 + TabIndex = 223 + Top = 2370 + Width = 720 + End + Begin VB.Label lblPOType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Type:" + Height = 195 + Left = -73005 + TabIndex = 217 + Top = 1260 + Width = 675 + End + Begin VB.Label lblBB + Alignment = 2 'Center + Caption = "This House Uses R-Guard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 675 + Left = -72180 + TabIndex = 216 + Top = 1440 + Width = 2475 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = -74895 + TabIndex = 204 + Top = 1740 + Width = 1590 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard/R-Guard:" + Height = 195 + Left = -74835 + TabIndex = 203 + Top = 2400 + Width = 1530 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = -75000 + X2 = -69660 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = -74040 + TabIndex = 202 + Top = 3000 + Width = 735 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = -74160 + TabIndex = 201 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 200 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 199 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = -71880 + TabIndex = 198 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Enabled = 0 'False + Height = 195 + Left = -71580 + TabIndex = 197 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Enabled = 0 'False + Height = 195 + Left = -71460 + TabIndex = 196 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Enabled = 0 'False + Height = 195 + Left = -71340 + TabIndex = 195 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = -71700 + TabIndex = 194 + Top = 4800 + Width = 915 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = -73740 + TabIndex = 193 + Top = 1620 + Width = 1410 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -73800 + TabIndex = 192 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -73800 + TabIndex = 191 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -74760 + TabIndex = 190 + Top = 720 + Width = 1815 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 189 + Top = 840 + Width = 1200 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 188 + Top = 840 + Width = 1065 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Texture Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67260 + TabIndex = 187 + Top = 840 + Width = 1185 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 186 + Top = 900 + Width = 930 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Supplier Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 185 + Top = 900 + Width = 1665 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfo.frx":2371 + Height = 825 + Left = -74880 + TabIndex = 184 + Top = 630 + Width = 5370 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -68700 + TabIndex = 183 + Top = 1905 + Width = 2715 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69000 + TabIndex = 182 + Top = 765 + Width = 840 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 181 + Top = 1110 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 180 + Top = 1515 + Width = 630 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 179 + Top = 1905 + Width = 960 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 178 + Top = 2310 + Width = 1005 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 177 + Top = 2715 + Width = 780 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 176 + Top = 3120 + Width = 975 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipped So Far:" + Height = 195 + Left = -69285 + TabIndex = 175 + Top = 3525 + Width = 1140 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 174 + Top = 720 + Width = 1095 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71580 + TabIndex = 173 + Top = 720 + Width = 990 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68100 + TabIndex = 172 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = -68415 + TabIndex = 171 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -68265 + TabIndex = 170 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = -68475 + TabIndex = 169 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = -68415 + TabIndex = 168 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 167 + Top = 3135 + Width = 840 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 166 + Top = 3480 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = -68805 + TabIndex = 165 + Top = 3840 + Width = 660 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 164 + Top = 4185 + Width = 960 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 163 + Top = 4530 + Width = 1005 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68940 + TabIndex = 162 + Top = 4890 + Width = 780 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 161 + Top = 5220 + Width = 975 + End + Begin VB.Label lblMatInst + Caption = $"frmLotInfo.frx":2499 + Height = 1200 + Left = -66645 + TabIndex = 160 + Top = 1485 + Visible = 0 'False + Width = 2835 + End + Begin VB.Label lblOrderDates + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 9900 + TabIndex = 159 + Top = 780 + Width = 1275 + End + Begin VB.Label lblLathO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath:" + Height = 195 + Left = 9465 + TabIndex = 158 + Top = 1140 + Width = 360 + End + Begin VB.Label lblSandO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 9405 + TabIndex = 157 + Top = 1482 + Width = 420 + End + Begin VB.Label lblScratchO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch:" + Height = 195 + Left = 9225 + TabIndex = 156 + Top = 1824 + Width = 600 + End + Begin VB.Label lblBrownO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown:" + Height = 195 + Left = 9330 + TabIndex = 155 + Top = 2166 + Width = 495 + End + Begin VB.Label lblTextureO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 9240 + TabIndex = 154 + Top = 2508 + Width = 585 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone:" + Height = 195 + Left = 9360 + TabIndex = 153 + Top = 2850 + Width = 465 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Feet:" + Height = 195 + Left = 9000 + TabIndex = 152 + Top = 3540 + Width = 795 + End + Begin VB.Label lblSelectOpt + Caption = "Double Click the desired option to selected it for Add or Delete." + Height = 375 + Left = -66060 + TabIndex = 151 + Top = 2100 + Width = 2235 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = -73485 + TabIndex = 150 + Top = 1980 + Width = 1155 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO #:" + Height = 195 + Left = -72750 + TabIndex = 149 + Top = 900 + Width = 420 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = -69360 + TabIndex = 148 + Top = 2700 + Width = 525 + End + Begin VB.Label lblDescription + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69675 + TabIndex = 147 + Top = 3060 + Width = 840 + End + Begin VB.Label lblPOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -69465 + TabIndex = 146 + Top = 3420 + Width = 630 + End + Begin VB.Label lblPODFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69795 + TabIndex = 145 + Top = 3780 + Width = 1020 + End + Begin VB.Label lblPOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69780 + TabIndex = 143 + Top = 4140 + Width = 1005 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = -70260 + TabIndex = 142 + Top = 1260 + Width = 660 + End + Begin VB.Label lblBillingAmt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -64980 + TabIndex = 141 + Top = 2700 + Width = 915 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + Caption = "$:" + Height = 255 + Left = -65280 + TabIndex = 140 + Top = 2760 + Width = 195 + End + Begin VB.Label lblSuperNotes + AutoSize = -1 'True + Caption = "Notes to Super:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69240 + TabIndex = 139 + Top = 3960 + Width = 1350 + End + Begin VB.Label lblYardMemo + AutoSize = -1 'True + Caption = "Yard Order Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 540 + TabIndex = 138 + Top = 3600 + Width = 1830 + End + Begin VB.Label lblOptMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = -69540 + TabIndex = 137 + Top = 4500 + Width = 765 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = -71025 + TabIndex = 136 + Top = 2385 + Width = 765 + End + Begin VB.Label lblDiana + AutoSize = -1 'True + Caption = "Lot Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6000 + TabIndex = 135 + Top = 3600 + Width = 1065 + End + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Foam Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 243 + Top = 0 + Width = 1980 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Labor Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 242 + Top = 315 + Width = 1980 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Wire Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 241 + Top = 615 + Width = 1980 + End + Begin VB.Label lblStoneSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Stone Sq. Ft.:" + Height = 285 + Left = 6525 + TabIndex = 240 + Top = 915 + Width = 1980 + End + Begin VB.Label lblPaintSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Paint Sq Ft: " + Height = 285 + Left = 6525 + TabIndex = 239 + Top = 1230 + Width = 1980 + End + Begin VB.Label lblStone + Alignment = 2 'Center + Caption = "Stone Veneer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8640 + TabIndex = 225 + Top = 1440 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSandShip + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5580 + TabIndex = 221 + Top = 780 + Width = 420 + End + Begin VB.Label lblSZone + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6060 + TabIndex = 220 + Top = 780 + Width = 315 + End + Begin VB.Label lblSynthetic + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Synthetic Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8970 + TabIndex = 215 + Top = 1440 + Visible = 0 'False + Width = 2475 + End + Begin VB.Label lblFirst + Alignment = 2 'Center + Caption = "First Time This Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 8640 + TabIndex = 212 + Top = 1800 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 4620 + TabIndex = 205 + Top = 840 + Width = 480 + End + Begin VB.Label lblJC + Alignment = 1 'Right Justify + Caption = "Job Cost:" + Height = 375 + Left = 2280 + TabIndex = 29 + Top = 2160 + Width = 375 + End + Begin VB.Label lblPlan + AutoSize = -1 'True + Caption = "Double Click the Desired Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8700 + TabIndex = 27 + Top = 840 + Visible = 0 'False + Width = 2565 + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 9000 + TabIndex = 25 + Top = 2220 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 23 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " Plan Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3900 + TabIndex = 21 + Top = 1245 + Width = 1275 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 17 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 16 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 15 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 14 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 13 + Top = 1560 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 12 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1200 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSPOpt2 As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset +Dim moRSPO As Recordset +Dim moRSPOMAT As Recordset +Dim moRSMemo As Recordset +Dim moRSPay As Recordset +Dim moRSInvINFO As Recordset + +Dim mboolNOPRECAST As Boolean, mboolNOPREORDER As Boolean, mboolORCHARD As Boolean +Dim mboolNOTSUPPLIER As Boolean, mstrMTYPE As String, mstrORDERNUM As String, mintTPAYCREW As Integer +Dim mboolLATHC As Boolean, mboolSTUCCOC As Boolean, mintPAYCREW As Integer, mboolSTPAY As Boolean +Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String, mstrBEGQTY As String, mstrENDQTY As String +Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean +Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean +Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngARINVID As Long +Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mboolWRAP As Boolean +Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngINVID As Long, mstrTAXCODE As String +Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mintOpenPR As Integer +Dim mlngFind As Long, mintBOOKMARK As Integer, mstrWireAdj As String ', mboolNoPrice As Boolean +Dim mboolST_ADJ As Boolean, mintST_ADJ As Integer, mboolDNU As Boolean +Dim mintTake138 As Integer, mintPONUM As Long, mbool2Dates As Boolean, mboolSTONE3 As Boolean 'For Printing Invoices +Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String, mboolSTONE2 As Boolean +Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolCERTIFIED As Boolean, mboolHLNotes As Boolean +Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolPAINT As Boolean, mboolRPSTUCCO As Byte +Dim mboolADD As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String +Dim msglPAYRT1, msglPAYRT2 As Single, mstrTexture As String, mstrCREWTYPE As String, mstrWORK As String + +Private Sub CalcPayAMT() +Dim oRSPS, oRSL, oRSCR As Recordset +Dim strSQLPS, strSQLL, strSQLCR As String +Dim intPAYYDS As Integer, intMETAL As Integer, intFIN2 As Integer +Dim strFINISH As String, strTYPE As String, strWORK As String + + On Error GoTo Error_EH + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module CalcPayAMT" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub GetPONUM() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT Lot_ID, M_Type, D_Flag, PO_NUM FROM tblORDERS WHERE Lot_ID = " & gintLOTID & " AND D_Flag = 'Y' AND M_Type = '" & mstrMTYPE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrORDERNUM = Field2Str(oRS!po_num) + End If + + Exit Sub +End Sub + +Private Sub GetPayRates() +Dim oRSCR As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblCREWRATE WHERE not INACTIVE AND CREW_ID = " & mintPAYCREW & " AND PROJ_ID = " & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRSCR.EOF Then + strSQL = "SELECT * FROM tblCREWRATE WHERE CREW_ID = " & mintPAYCREW & " AND PROJ_ID = 99999" ' & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If +' Else + If Not oRSCR.EOF Then + If mstrCREWTYPE = "L" Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SK" Or mstrTexture = "RL" Or mstrTexture = "CS" Or mstrTexture = "RS") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SA" Or mstrTexture = "S2" Or mstrTexture = "S3" Or mstrTexture = "RD" Or mstrTexture = "S4") Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "DA" Then + msglPAYRT1 = Field2Str2(oRSCR!dash) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "MN" Or mstrTexture = "RM") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QU" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QS" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SM" Then + msglPAYRT1 = Field2Str2(oRSCR!Smooth) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "DF" Or mstrTexture = "SS" Or mstrTexture = "RF") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SC" Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "M2" Or mstrTexture = "M3" Or mstrTexture = "MF") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + +' If mstrCREWTYPE = "V" Then +' msglPAYRT1 = Field2Str2(oRSCR!Lath_Skip) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + + End If +' Else +' End If + +End Sub + +Private Sub SetStone() +Dim strSQL As String + +' moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbTrue + moRS!c_flg = vbTrue + moRS!t_flg = vbTrue + moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub SetPreOrder() +Dim strSQL As String + +' moRS!l_FLG = "P" + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null +' moRS!a_flg = vbTrue +' moRS!b_flg = vbTrue +' moRS!c_flg = vbTrue +' moRS!t_flg = vbTrue +' moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub PaintFix() +Dim strResponse As String + strResponse = Field2Str2(moRS!PNT_SQFT) + strResponse = Field2Str2(InputBox("Enter The Correct Square Footage For The Paint", "Correct Paint", strResponse)) + If strResponse = "" Or strResponse = 0 Then + Exit Sub + End If + moRS!PNT_SQFT = Field2Str2(strResponse) + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + moRS.Update + Call FormShow + +End Sub + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then + Do Until oRS.EOF + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + Loop +' End If + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub RePrintLath() 'Allows a lath order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint Lath") + + moRS!l_FLG = Null +' moRS!a_FLG = Null +' moRS!b_FLG = Null +' moRS!t_FLG = Null + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null + moRS!lorder = "12/31/2030" + moRS!Border = Null + moRS!TORDER = Null + moRS!forder = Null + moRS!corder = Null + moRS!SORDER = Null + moRS!VOrder = Null + moRS!PRNT_L = Null +' moRS!Prnt_S = Null + moRS!pmetal = 0 + moRS!pylath = 0 + moRS!pystucco = 0 + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!o_qty = 0 +' oRS!d_flag = "X" +' oRS!ar_trans = vbChecked +' oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID + goConn.Execute strSQL + + Call LotRePrinted +End Sub + +Private Sub cboPOType_LostFocus() + If cboPOType.ListIndex = -1 Then + cboPOType.ListIndex = 0 + End If + txtPOType = Left(cboPOType.Text, 1) + gstrPO = txtPOType + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + End Select + +End Sub + +Private Sub chkHoldOrders_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkHoldPO_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkOthers_Click() + cmdSaveLotInfo.Enabled = True + +End Sub + +Private Sub chkSplit_Click() + cmdSaveLotInfo.Enabled = True +' lblSynthetic.Visible = True + If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkPaint_Click() + If mboolFRMLOAD Then + cmdSaveLotInfo.Enabled = True + moRS!PNT_FLG = chkPaint + Call PaintFix + End If + mboolFRMLOAD = True +End Sub + +Private Sub chkStone_Click() + If chkStone Then + cmdSaveLotInfo.Enabled = True + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + lblStone.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblStone.Visible = False + lblStoneSqFt.Caption = "Stone Square Ft.: 0" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + End If + +End Sub + +Private Sub chkSynthetic_Click() + cmdSaveLotInfo.Enabled = True + If chkSynthetic Then + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = False + End If + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + End If + +End Sub + +Private Sub cmdAddPOMat_Click() + Call POMatClear + gconACTION = 0 + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPODate.Enabled = False + txtPODesc.Enabled = False + txtIssueTo.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + mboolAdding = True + txtPOInvNo.SetFocus + +End Sub + +Private Sub cmdBrownPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intSTUCCOTCREW As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String, intTCPAY As Integer +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mintPAYCREW = 0 + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + '**** If texture is S2 or SB the setup for two crew numbers otherwise just setup one crew number + '**** If texture is S2 or SB then only print brown pay sheet + If moRS!texture = "S2" Or moRS!texture = "SB" Then + intYNS = MsgBox("Do You Want To Use A Crew Number With The Brown PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Brown Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!BCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!BCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If +' Else +' intYNS = MsgBox("Do You Want To Use A Crew Number With The Texture PaySheet? Y or N)", vbYesNo, "Use Crew") +' If intYNS = vbYes Then +' intSTUCCOTCREW = InputBox("Enter The Texture Crew Number", "Stucco Crew", 0) + +' strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOTCREW +' Set oRSC = New Recordset +' oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSC.EOF Then +' strCrewType = oRSC!Type +' End If + +' If intSTUCCOTCREW = 0 Or IsNull(intSTUCCOTCREW) Or strCrewType <> "S" Then +' If strCrewType = "" Then +' MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" +' Exit Sub +' End If +' MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +' Exit Sub +' Else +' mintTPAYCREW = Field2Str2(intSTUCCOTCREW) +' moRS!TCREW = Field2Str2(intSTUCCOTCREW) +' moRS.Update +' mboolSTUCCOC = True +' End If +' Else +' moRS!TCREW = 0 +' moRS.Update +' mboolSTUCCOC = False +' End If + Else 'End If + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!BCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!BCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint '****** CALL 1 + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + '***** Moved to after printing stucco Pay Sheets -- REMOVE TWO ' MARKS TO USE THIS AGAIN +''' If chkSynthetic Then +'' If boolCOMPLETE Then +''' moRS!t_flg = vbTrue +''' moRS.Update +''' If Not moRS!Split Then +'' If Not mboolSPLIT Then +'' If Not moRSProj!bill Then +'' Call PrintStuccoInv +'' Else +'' Call PrintCompleteInv +'' End If +'' boolFPRINT = False +'' End If +'' End If +'' If boolFPRINT Then +''' moRS!t_flg = vbTrue +''' moRS.Update +'' If Not moRSProj!bill Then +'' Call PrintStuccoInv +'' Else +'' Call PrintCompleteInv +'' End If +'' End If +''' End If + + '***************Start of Print Stucco Pay Sheets copied from Lath Order + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then '**** Three Coat + If Field2Str2(txtTtlYdge) - 24 > 1200 Then 'If error for S2 and SB paysheets on large yardage, this logic needs to be tweeked + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +' gintCOPY = 1 + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay '****** + End If + crOrder.Reset + gintCOPY = 1 + Else + + If moRS!texture = "SB" Or moRS!texture = "S2" Then '*** This is to print Brown paysheets + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 +' If mboolST_ADJ Then + Call PrintStuccoPay3 +' Call PrintStuccoPay2 +' Else +' Call PrintStuccoPay +' End If + crOrder.Reset + gintCOPY = 1 + End If + If moRS!texture <> "SB" And moRS!texture <> "S2" Then +' If moRS!texture <> "SB" Then '***** Synthetic over OneKote +' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay + End If + crOrder.Reset + gintCOPY = 1 +''' ElseIf moRS!texture = "SF" Then +''' MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +''' gintCOPY = 1 +' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 +''' Call PrintStuccoStone +''' crOrder.Reset +''' gintCOPY = 1 +'? Else ' **************** This may need to be uncommented out for synthetic. Remove '? *********************** +'? MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'? MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'? gintCOPY = 1 +' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 +'? Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 + End If + End If + Else '** the logic below this is strictly for Three Coat + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 1 + intTCPAY = gintCOPY * 1 +' gintCOPY = intCOPY * 2 +' intTCPAY = gintCOPY * 3 + MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 +' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + +' If chkSynthetic Then + If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" + goConn.Execute strSQLUP + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_S = Now() + moRS.Update + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + +' If moRS!PNT_Print Then + If moRS!PNT_Print Then + MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" + cmdExit.Enabled = True + Exit Sub + Else + If mboolPAINT Then + MsgBox "Insert 1 White and The Necessary Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay + frmPaintPrtJobs.Show 1 + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRS!PNT_Print = vbChecked + moRS.Update + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + End If + + + gboolPRINT = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdBrownPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdPaintPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String +'***** If this procedure is activated, it will not print it again + + On Error GoTo Error_EH + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + +' If moRS!Split Then +'' If mboolSPLIT Then +'' strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID +'' Set oRS = New Recordset +'' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +'' intPERCENT = Field2Str2(oRS!SUMPercent) +'' If intPERCENT = 0 Then +'' boolFPRINT = True +'' Else +'' boolFPRINT = False +'' End If +'' gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) +'' If gintPERCENT = 0 Then +'' MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" +'' Exit Sub +'' End If +'' If (intPERCENT + gintPERCENT) > 100 Then +'' MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If +'' Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True +'' End If +' If (intPERCENT + gintPERCENT) = 100 Then +' boolCOMPLETE = True +' End If + + gboolPRINT = True + gstrPO = "L" '***** Need To Make The Next Three Lines Work With Paint + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + + gstrPONUM = Field2Str(oRS!po_num) + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then + +'' If mboolSPLIT Then +'' dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) +'' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) +'' strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf +'' strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf +'' strMSG = strMSG & "Qty For This Order -- " & dblOrder +'' dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) +'' dblCheck = oRS!o_qty + dblOrder +'' If dblCheck > oRS!qty Then +'' dblOrder = oRS!qty - oRS!o_qty + ' Else +'' End If +'' oRS!o_qty = oRS!o_qty + dblOrder +'' oRS.Update +'' Else + dblOrder = oRS!qty +'' End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue + End If + moRS.Update + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' If chkSynthetic Then + If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then ' ********** Deal with Paint PO, Invoice, and Pay Sheets + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + moRS!PRNT_S = Now() + moRS.Update + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + If moRS!PNT_Print Then + MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" + Exit Sub + Else + If mboolPAINT Then + MsgBox "Insert 1 White and 17 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Paint Pay " + + Call PrintPaintPay + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRS!PNT_Print = vbChecked + moRS.Update + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + End If + +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " +' moRS!PNT_Print = vbChecked +' moRS.Update +' moRSMemo!notes = UCase(Field2Str(txtYardMemo)) +' moRSMemo.Update + + gboolPRINT = False +' cmdBrownPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPaintPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdCalc_Click() +Dim strSQL As String + + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRS!texture = "DF" Or moRS!texture = "MF" Or moRS!texture = "QS" Or moRS!texture = "RF" Then + gbool2FIN = True + Else + gbool2FIN = False + End If + + If moRS!texture = "DW" Then + moRS!calcdate = Now +' moRS!calcdate = Date + moRS.Update + Else + If moRSProj!stype <> "T" Then + Call MatCalcOne + Call ConvertSuper + Call MatLoad + Call CalcMetal + Else + Call MatCalcThree + Call ConvertSuper + Call MatLoad + Call CalcMetal + End If + End If + MsgBox "Materials Calculation is Complete" + txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Now() & " BY " & gstrLOGIN & " " +' txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Date & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +End Sub + +Private Sub cmdDelLot_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Lot") + Unload Me + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdDelLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelPO_Click() +Dim strSQL As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPO.ListIndex + cmdDelPO.Enabled = False + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdPrintPO.Enabled = False + cmdAddPOMat.Enabled = True + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM + goConn.Execute strSQL + Call LotChange(mstrPROJLOT, "Delete PO") + Call POLoad + If lstPO.ListCount Then + If lstPO.ListCount > mintBOOKMARK Then + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPO.ListIndex = mintBOOKMARK - 1 + End If + Else + mintBOOKMARK = -1 + Call POMatClear + Call POClear + End If + gconACTION = 0 +End Sub + +Private Sub cmdDelPOMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPOMaterial.ListIndex + moRSPOMAT.Delete + Call LotChange(mstrPROJLOT, "Delete PO Material") + Call POMatLoad + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdAddPOMat.Enabled = True + If lstPOMaterial.ListCount Then + If lstPOMaterial.ListCount > mintBOOKMARK Then + lstPOMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 +End Sub + +Private Sub cmdEdit_Click() + gconACTION = 5 + cmdSaveMatrl.Enabled = True + cmdCalc.Enabled = True + cmdFindPlan.Visible = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdPrintCMU.Enabled = True + cmdUpCMU.Enabled = True + txtAddress.Enabled = True + txtOwner.Enabled = True + lstLOptions.Enabled = True + lstPOptions.Enabled = True +End Sub + +Private Sub cmdFindPOMat_Click() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + Else + lstLOOKUP.Visible = True + Call LoadILookUp + lngFind = Field2Long(txtPOInvNo) + Call ListFindItem2(lstLOOKUP, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub LoadILookUp() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOOKUP.Clear + + Do Until oRS.EOF + With lstLOOKUP + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOOKUP.ListCount Then + lstLOOKUP.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LoadLookUp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdIssue_Click() +Dim lngTIE As Long +Dim strSQL As String + + lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) + + + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Formulas(4) = 1 + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Formulas(4) = 1 + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + cmdIssue.Visible = False +End Sub + +Private Sub cmdJCSetup_Click() + Call JCSetup +End Sub + + +Private Sub cmdLathPay_Click() +Dim strPAY As String +Dim bytINFO As Byte + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) + If bytINFO = 1 Then + gintCOPY = 1 + ElseIf bytINFO = 2 Then + gintCOPY = 3 + ElseIf bytINFO = 3 Then + gintCOPY = 5 + ElseIf bytINFO = 4 Then + gintCOPY = 7 + ElseIf bytINFO = 5 Then + gintCOPY = 9 + End If + + Call LotChange(mstrPROJLOT, "RePrint Lath Pay") + Call PrintLathPay + cmdLathPay.Visible = False +End Sub + +Private Sub cmdLathPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNL As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intYNS As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String, strMSG2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean, intLATHCREW As Integer +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String, intSTUCCOCREW As Integer +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + mboolRPSTUCCO = False + mboolLATHC = False + mboolSTUCCOC = False + mintPAYCREW = 0 + +' If mstrPLANUP > Field2Str(moRS!CalcDate) Then +' strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" +' strMSG = strMSG & Chr(10) & Chr(13) +' strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" +' MsgBox strMSG, vbYesNo, "Recalculate Recommended" +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" +' If intResponse = vbYes Then +' Call cmdFindPlan_Click +' Call cmdCalc_Click +' End If +' Exit Sub +' End If + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If mboolPLANUP Then + If IsNull(moRS!calcdate) Then + MsgBox "Lot Must Be Calculated Before Printing Lath", vbOKOnly, "Calculate Lot" + Exit Sub + End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" + cmdExit.Enabled = True + Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic +' If moRSPay.EOF Then +' End If + gintCOPY = 1 +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + +' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then + MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + If Field2Str2(oRS!s_bill) = 0 Then + MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + + intYNL = MsgBox("Do You Want To Use A Crew Number With The Lath PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNL = vbYes Then + intLATHCREW = InputBox("Enter The Lath Crew Number", "Lath Crew", 0) + strSQLCREW = "SELECT * FROM tblcrew WHERE not INACTIVE AND Crew_ID = " & intLATHCREW +' strSQLCREW = "SELECT * FROM tblcrew WHERE Crew_ID = " & intLATHCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + If intLATHCREW = 0 Or IsNull(intLATHCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Lath Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Lath Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intLATHCREW) + moRS!LCREW = Field2Str2(intLATHCREW) + moRS.Update + mboolLATHC = True + End If + Else + moRS!LCREW = 0 + moRS.Update + End If + +'' intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") +'' If intYNS = vbYes Then +'' intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) +'' If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Then +'' MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +'' Exit Sub +'' Else +'' moRS!BCREW = Field2Str2(intSTUCCOCREW) +'' moRS.Update +'' mboolSTUCCOC = True +'' End If +'' Else +'' moRS!BCREW = 0 +'' moRS.Update +'' End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "L" + gstrTYPE = "Y" + + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) + moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then + '***************** need to move this to Issue and Make a unique identifier + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If +' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Lath PO" + 'glngORDERID + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" +' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + gintCOPY = 1 'Added 8/1/17 to make the report only print 1 copy + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + '***** commented this out to make it only print 1 copy of the order +'' If moRSProj!cocode = 0 Then +'' crOrder.ReportFileName = App.Path & "\NewLath.rpt" +'' ElseIf moRSProj!cocode = 1 Then +'' crOrder.ReportFileName = App.Path & "\NewLathM.rpt" +'' End If + +'' crOrder.ReplaceSelectionFormula (strSQL) +'' crOrder.Destination = crptToPrinter +'' crOrder.CopiesToPrinter = gintCOPY +'' crOrder.Action = 1 +'' crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" + goConn.Execute strSQLUP + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_L = Now() + moRS.Update + + If boolFPRINT Then + gstrMODULE = "Before Print Actual " + Call PrintActual + gintCOPY = 1 + crOrder.Reset + End If +' If boolFPRINT Then + gstrMODULE = "Before Print Issue Ticket " + Call PrintIssue + gintCOPY = 1 + crOrder.Reset +' End If + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " + Call PrintLathMat + crOrder.Reset + ' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then +' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + If mboolCERTIFIED Then + strMSG2 = "Insert " & gintCOPY & " Sheet of BABY BLUE Paper for the Lath Pay Sheets and then Press Enter" + Else + strMSG2 = "Insert " & gintCOPY & " Sheet of YELLOW Paper for the Lath Pay Sheets and then Press Enter" + End If + MsgBox strMSG2, vbOKOnly, "InsertPaper" +' gintCOPY = intCOPY * 2 +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If + '****XXXX Lath Pay + gstrMODULE = "Before Print Lath Pay " + Call PrintLathPay + +' If mboolPAINT Then +' MsgBox "Insert 1 White and 10 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 +' intCOPY = 0 +' crOrder.Reset +' gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay +' End If + + '***********Beginning of print stucco pay - moved to Print Brown Order --- REMOVE TWO TICK MARKS TO START USING AGAIN +'' gintCOPY = 1 +'' intCOPY = 0 +'' crOrder.Reset +'' gstrMODULE = "Before Print Stucco Pay " + +'' If moRSProj!stype <> "T" Then +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +''' gintCOPY = 1 +'' gintCOPY = intCOPY * 2 +'' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' ' gintCOPY = 4 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' If moRS!texture <> "SB" Then +''' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 1 +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' ElseIf moRS!texture = "SF" Then +'' MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 1 +''' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +''' gintCOPY = 2 +'' Call PrintStuccoStone +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 1 +''' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +''' gintCOPY = 2 +'' Call PrintStuccoSyn +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If +'' Else +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 1 +'' intTCPAY = gintCOPY * 1 +'' ' gintCOPY = intCOPY * 2 +''' intTCPAY = gintCOPY * 3 +'' MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 4 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 1 +''' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 2 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If + '****************** End of Print Stucco Pay moved to Print Brown Order + + gintCOPY = 1 + If Field2Integer(moRS!CMU) > 0 Then + intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") + If intYN = vbYes Then + Call cmdPrintCMU_Click + crOrder.Reset + End If + End If + End If + End If + '****** Print Stone Pay Sheet and Invoice + '****** Removed 06/27/05 per Rose +' If Not chkNoPay Then +' If moRS!ostone And Not moRS!otstone Then +' crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" +' gintCOPY = 2 +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' crOrder.ReportFileName = App.Path & "\StonePay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' crOrder.Action = 1 + +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If +' End If + + If moRS!Firsttime Then + MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" + End If + + If boolCOMPLETE Then +' gintCOPY = 1 +' crOrder.Reset +' If Not moRS!Split Then +' If Not moRSProj!bill Then +' Call PrintLathInv +' crOrder.Reset +' End If +' End If + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" +' cmdLathPrint.Enabled = False + End If + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If +' moRS!l_flg = "P" +' moRS!y_flg = "P" +' moRS!S_flg = "P" +' cmdLathPrint.Enabled = False + End If + End If + + If moRSProj!BagSand Then + moRS!Border = Field2Str(moRS!lorder) + moRS!a_flg = True + txtYardMemo = Field2Str(txtYardMemo) & " " & "THIS LOT USED BAG SAND - " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + moRS.Update + + gintCOPY = 1 + gboolPRINT = False +' cmdLathPrint.Enabled = False + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module cmdLathPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintLathPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String +Dim dblTEST1, dblTEST2, dblTEST3 As Double + + dblTEST1 = msglPAYRT1 + dblTEST2 = msglPAYRT2 + msglPAYRT1 = 0 + msglPAYRT2 = 0 + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID ' & " AND {tblLOTINFO.LCREW} = 7" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " AND {tblLOTINFO.LCREW} = 7" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " AND {tblLOTINFO.LCREW} = 7" + If moRSProj!cocode = 0 Then + If mboolLATHC Then +' crOrder.ReportFileName = App.Path & "\lathpay_17C.rpt" + crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpay.rpt" + Else + crOrder.ReportFileName = App.Path & "\lathpay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + End If +' Call GetPayRates + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to set to 1 if still printing multiple copies 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + If gintCOPY > 1 Then + intTOTAL = Int((gintCOPY / 2) + 0.99) + Else + intTOTAL = 1 + End If + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + mstrCREWTYPE = "L" + Call GetPayRates + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & dblGROSSPAY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + moRSPay!worktype = "P" +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!totalsheet = intTOTAL + moRSPay!texture = mstrTexture + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "Currency") +' dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "$ #,0.00") + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "$ #,0.00") +' crOrder.Formulas(4) = "Z_Gross = " & (CStr(dblGROSSPAY)) ', "$ #,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY ')) ', "$ #,0.00") + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + mstrWORK = "C" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 +' dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCover.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PINT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Int Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PEXT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS.Update +'*** End Prep Ext Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ISL = vbTrue + moRS.Update +'*** End IS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT1L = vbTrue + moRS.Update +'*** End BT1 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT2L = vbTrue + moRS.Update +'*** End BT2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ESL = vbTrue + moRS.Update +'*** End ES Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!TwoTL = vbTrue + moRS.Update +'*** End 2T Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FSL = vbTrue + moRS.Update +'*** End FS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!OHL = vbTrue + moRS.Update +'*** End OH Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG1L = vbTrue + moRS.Update +'*** End FG1 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!F2L = vbTrue + moRS.Update +'*** End F2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CCL = vbTrue + moRS.Update +'*** End CC Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG2L = vbTrue + moRS.Update +'*** End FG2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!POL = vbTrue + moRS.Update +'*** End PO Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CSL = vbTrue + moRS.Update +'*** End CS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!WHL = vbTrue + moRS.Update +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPrep() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPrep" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPINT() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PINT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep INT Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPINT" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPEXT() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PEXT" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep EXT Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPEXT" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPIS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End IS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPIS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPES() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +'Need To Complete the ability to print one + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End ES Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPES" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPP2T() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End 2T Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPP2T" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPOH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End OH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPOH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPF2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End F2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPF2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFG1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPFG2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End BT1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPBT1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End BT2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPBT2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPO() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End PO Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPCS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPWH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPWH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCC() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CC Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPPCC" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay() +Dim strSQL As String, i As Integer, intMETAL As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + + + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then +' crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 '******************WOrk here and in PRINTSTUCCOPAY3 to fix + End If '***** BROWN PAY SHEETS AND TEXTURE PAY SHEETS +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew '******* tblPAYSHEET Add Information + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" '******STUCCO PAY + mstrCREWTYPE = "S" '******STUCCO CREW + moRSPay!worktype = "P" '*******PARTIAL PAYMENT FOR THE LOT + moRSPay!pay_ydge = intYDS '****YARDAGE FOR THIS PORTION OF THE JOB + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW '***Add Crew to PaySheet + moRSPay!texture = mstrTexture '***TEXTURE FOR THIS JOB + moRSPay!totalsheet = intTOTAL + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' dblGROSSPAY = Round(dblGROSSPAY, 2) +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.CopiesToPrinter = 1 +' crOrder.CopiesToPrinter = gintCOPY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew '******* tblPAYSHEET Add New Paysheet + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" '***********STUCCO PAY + mstrCREWTYPE = "S" '*****STUCCO CREW + moRSPay!worktype = "C" '****COMPLETE PAY FOR THE JOB + moRSPay!pay_ydge = intYDS '****YARDAGE FOR THIS JOB + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW '******PayCrew Info + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + +'***FIX On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB2_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" + Exit Sub +' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +'' If gintCOPY > 3 Then +'' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +'' intTOTAL = Int((gintCOPY / 2) + 0.99) +'' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +'' i = 1 +'' Do Until i = ((gintCOPY / 2) + 1) +'' crOrder.Formulas(1) = "PaySheetCount = " & i +'' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +'' crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 +'' crOrder.Action = 1 + +'' moRSPay.AddNew +'' moRSPay!lotid = gintLOTID +'' moRSPay!Type = "S" +'' moRSPay!worktype = "P" +'' moRSPay!pay_ydge = intYDS +'' moRSPay!sheet = i +'' moRSPay!Create = gstrLOGIN +'' moRSPay!printed = vbChecked +'' moRSPay!totalsheet = intTOTAL +'' If moRSProj!cocode = 0 Then +'' moRSPay!cocode = 0 +'' ElseIf moRSProj!cocode = 1 Then +'' moRSPay!cocode = 1 +'' End If +'' moRSPay.Update +'' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +'' moRS!multipay = vbChecked +'' moRS.Update +'' i = i + 1 +'' Loop +'' crOrder.Reset +'' Exit Sub +'' Else +'**** This will Print the Pay Sheet for Brown + + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 +' crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +'This will print the Pay Sheet for Texture + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = (intYDS - mintST_ADJ) + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay3() ' This is to print Brown and Texture Paysheets for Sand Finish and EIFS over OneKote +Dim strSQL As String, i As Integer, strPAY As String +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + +'***FIX On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then +' crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopayB3_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" + Exit Sub +' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +'' If gintCOPY > 3 Then +'' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +'' intTOTAL = Int((gintCOPY / 2) + 0.99) +'' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +'' i = 1 +'' Do Until i = ((gintCOPY / 2) + 1) +'' crOrder.Formulas(1) = "PaySheetCount = " & i +'' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +'' crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 +'' crOrder.Action = 1 + +'' moRSPay.AddNew +'' moRSPay!lotid = gintLOTID +'' moRSPay!Type = "S" +'' moRSPay!worktype = "P" +'' moRSPay!pay_ydge = intYDS +'' moRSPay!sheet = i +'' moRSPay!Create = gstrLOGIN +'' moRSPay!printed = vbChecked +'' moRSPay!totalsheet = intTOTAL +'' If moRSProj!cocode = 0 Then +'' moRSPay!cocode = 0 +'' ElseIf moRSProj!cocode = 1 Then +'' moRSPay!cocode = 1 +'' End If +'' moRSPay.Update +'' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +'' moRS!multipay = vbChecked +'' moRS.Update +'' i = i + 1 +'' Loop +'' crOrder.Reset +'' Exit Sub +'' Else +'**** This will Print the Pay Sheet for Brown + + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 '******************WOrk here and in PRINTSTUCCOPAY3 to fix + End If '***** BROWN PAY SHEETS AND TEXTURE PAY SHEETS +' crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 +' crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" '*****STUCCO CREW + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW '******PayCrew Info + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +'This will print the Pay Sheet for Texture +' crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToPrinter +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Action = 1 +' crOrder.Reset + +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!worktype = "T" +' moRSPay!pay_ydge = (intYDS - mintST_ADJ) +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay!totalsheet = intTOTAL +' If moRSProj!cocode = 0 Then +' moRSPay!cocode = 0 +' ElseIf moRSProj!cocode = 1 Then +' moRSPay!cocode = 1 +' End If +' moRSPay.Update + +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay4() +Dim strSQL As String, i As Integer, intMETAL As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + +' Call GetPayRates + + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then +' crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew '******* tblPAYSHEET Add Information + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' dblGROSSPAY = Round(dblGROSSPAY, 2) +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.CopiesToPrinter = 1 +' crOrder.CopiesToPrinter = gintCOPY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew '******* tblPAYSHEET Add New Paysheet + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoThree() +Dim strSQL As String, i As Integer, strPAY As String +Dim intTOTAL As Integer, intYDS As Integer +Dim bytYNSC As Byte, bytYNBR As Byte, bytYNTX As Byte, bytYNALL As Byte + + + On Error GoTo Error_EH + If mboolRPSTUCCO = True Then + bytYNSC = MsgBox("Do You Want To Print A Scratch Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNSC = vbYes Then + + ElseIf bytYNSC = vbNo Then + bytYNBR = MsgBox("Do You Want To Print A Brown Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNBR = vbYes Then + + ElseIf bytYNBR = vbNo Then + bytYNTX = MsgBox("Do You Want To Print A Texture Pay Sheet?", vbYesNo, "Print Scratch PaySheets") + If bytYNTX = vbYes Then + + Else + bytYNALL = vbYes + End If + End If + End If + Else + bytYNALL = vbYes + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + If moRSPay.EOF Then + End If + + If bytYNSC = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayS_217.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + intTOTAL = (gintCOPY) + ' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + ' crOrder.Action = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + End If + + If bytYNBR = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayB_217.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If + End If + +' crOrder.Action = 1 + If bytYNTX = vbYes Or bytYNALL = vbYes Then + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayT_217.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" + ' crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + ' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop + ' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If + End If + mboolRPSTUCCO = False +' crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintStuccoSyn() +Dim strSQL As String, strSQLL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = 1 +' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayB_217.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = 1 +' intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoStone() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoStone" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssueHold() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!po_num = "ORIGINAL ORDER" + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssueHold" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssue() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean, strMType As String + On Error GoTo Error_EH + mstrMTYPE = "" + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + + If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = dblOrder + oRS!qtyIssue = dblOrder +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + + mstrMTYPE = Field2Str(oRSS!m_type) +' If mstrMTYPE <> "" Or Not IsNull(mstrMTYPE) Then + If mstrMTYPE = "P" Or mstrMTYPE = "Z" Then + Call GetPONUM + oRS!po_num = mstrORDERNUM + mstrORDERNUM = "" + mstrType = "" + End If + + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + + End If + oRSS.MoveNext + Loop + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issue2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issueM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssue" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintLathMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathmat.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) + gintCOPY = 1 'Changed to 1 on 8/1/17 to stop multiple copies + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" + crOrder.ReportFileName = App.Path & "\stuccomat.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to change this to 1 if printing more than 1 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ShowPrint() +Dim oRS As Recordset +Dim strSQL As String, lngPO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngPO = Field2Long(oRS!nextpo) + gstrMODULE = "Line 8" + lngPO = lngPO + 1 + If lngPO > 99999 Then + lngPO = 1 + End If + oRS!nextpo = lngPO + oRS.Update + gstrMODULE = gstrMODULE & " Line 15" + + Load frmPrint + gstrMODULE = gstrMODULE & " Line 18" + frmPrint.txtJobCost = Field2Str(moRS!jobcost) + frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) +' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) + gstrMODULE = gstrMODULE & " Line 20" + frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) +' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) + gstrMODULE = gstrMODULE & " Line 22" + frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "00000") +' gstrPONUM = gstrPONUM & Format(intPO, "0000") + gstrMODULE = gstrMODULE & " Line 24" + frmPrint.txtMFlag = gstrFLAG + gstrMODULE = gstrMODULE & " Line 26" + frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) +' gstrCREW = Left$(Field2Str(txtPODesc), 20) + gstrMODULE = gstrMODULE & gstrFLAG & " " + frmPrint.txtDFlag = gstrTYPE + gstrMODULE = gstrMODULE & " Line 30" + If mintSUPPLIER = 99 Then + frmPrint.txtPO = Field2Str2(moRSPO!ponum) +' gintPONUM = moRSPO!ponum + Else + frmPrint.txtPO = 0 +' gintPONUM = 0 + End If + gstrMODULE = gstrMODULE & " Line 35" + frmPrint.Show 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module ShowPrint" +' gstrMODULE = " Form LotInfo - Module ShowPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdAddPO_Click() + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" + End If + + Call POClear + gconACTION = 0 + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + mboolAdding = True + cboPOType.SetFocus +End Sub + +Private Sub cmdLFlag_Click() + moRS!y_FLG = "P" + moRS!l_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + Call cmdSaveLotInfo_Click + cmdLFlag.Visible = False + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If +End Sub + +Private Sub cmdOrder_Click() + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdPreOrderPrintY_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "Y" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + gboolPRINT = False + Call Form_Load + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPreOrderPrintY" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint_Click() + If cmdPrint.Caption = "Print Lath Order" Then + Call cmdLathPrint_Click + ElseIf cmdPrint.Caption = "Print Sand Order" Then + Call cmdSandPrint_Click + ElseIf cmdPrint.Caption = "Print Brown Order" Then + Call cmdBrownPrint_Click + ElseIf cmdPrint.Caption = "Print Scratch Order" Then + Call cmdScratchPrint_Click + ElseIf cmdPrint.Caption = "Print Texture Order" Then + Call cmdTexturePrint_Click + ElseIf cmdPrint.Caption = "Print Stone Order" Then + Call cmdStonePrint_Click + Else + '***CHeck to see why an invoice had an extra zero 002 instead of 02 + End If +End Sub + +Private Sub cmdPrintCMU_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\cmupay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN + Call FormSave + cmdPrintCMU.Enabled = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintCMU_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPOPay_Click() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + gintPRINT = 1 + frmReport.Show 1 + If gintPRINT Then + Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") + + strSQL = "{tblPOrder.ponum} = " & mintPONUM + crOrder.ReportFileName = App.Path & "\POpay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + ' crOrder.Destination = crptToWindow + ' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS!pay_flag = vbTrue + oRS.Update + cmdPrintPOPay.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPOPay_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPO_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, intResponse As Integer +Dim strSELECT As String + + mintBOOKMARK = lstPO.ListIndex + + On Error GoTo Error_EH + mboolSTONE2 = False + gboolPRINT = True + If optPreOrder Then + gstrFLAG = "P" + Else + gstrFLAG = "R" + End If + gintCOPY = 1 + If optLath Then + gstrTYPE = "Y" + ElseIf optStucco Then + gstrTYPE = "S" + ElseIf optSand Then + gstrTYPE = "A" + ElseIf optPreOrder Then + gstrTYPE = "Y" + ElseIf optStone Then + mboolSTONE2 = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + ElseIf optNone Then + gstrTYPE = "" + End If + mintSUPPLIER = 99 + Call ShowPrint + mintSUPPLIER = 0 + + If gboolPRINT And mboolSTONE2 Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) +' moRS!st_flg = vbTrue + moRS.Update + End If + End If + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS!p_flg = "P" Then + MsgBox "This PO has already been printed" + Exit Sub + End If + If Not oRS.EOF Then + crOrder.Reset + strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + If gstrPO <> "L" Then + crOrder.ReportFileName = App.Path & "\POMisc.rpt" + Else + Call POSetup + crOrder.ReportFileName = App.Path & "\purchase.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + oRS!p_flg = "P" + oRS.Update + End If + gboolPRINT = False + If gstrPO = "L" Then + intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") + If intResponse = vbOK Then + Call POInvoice + End If + End If + Call Form_Load + SSTLotInfo.Tab = 6 + Else + Call Form_Load + SSTLotInfo.Tab = 6 + End If + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub POSetup() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblOrder As Double + + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + dblOrder = Field2Str2(oRS!qty) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + +End Sub + +Private Sub cmdPreOrderPrintS_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintS_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPreOrderPrintPC_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + gintCOPY = 1 + gboolPRINT = True + gstrFLAG = "Z" + gstrTYPE = "Y" +' gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'Z'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" + crOrder.ReportFileName = App.Path & "\preorderPC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintPC_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintForm_Click() + Me.PrintForm +End Sub + + +Private Sub cmdRePrintL_Click() + Call RePrintLath + cmdRePrintL.Visible = False + Call FormShow +End Sub + +Private Sub cmdSandPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single +Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Field2Str2(moRS!zone) = 0 Then + MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" + Exit Sub + End If + + If chkHoldOrders Then + MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + cmdExit.Enabled = False +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If +' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "A" + gstrTYPE = "A" + gintCOPY = 1 + Call ShowPrint + gstrMODULE = "After SHOWPRINT " + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- Plaster Sand " & vbCrLf + strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf + If boolCOMPLETE Then + dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) + End If + strMSG = strMSG & "Tons For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = moRS!ORD_NO + dblOrder + If dblCheck > moRS!sand_ton Then + dblOrder = moRS!sand_ton - moRS!ORD_NO +' Else + End If + moRS!ORD_NO = moRS!ORD_NO + dblOrder + moRS.Update + Else + dblOrder = moRS!sand_ton + End If + + moRS!Border = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!a_flg = vbTrue + End If + moRS.Update + gstrMODULE = "After Update Delivery Date " +' glngORDERID = Field2Long(oRS!order_id) + + strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & field2str(moRS!zone) + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + If oRSSS.EOF Then + Else + oRSSS.MoveFirst + strFIND = "zone = " & Field2Str2(moRS!zone) + oRSSS.Find strFIND + sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") + End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Before Setup Materials " + With oRSS + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9999" + !Desc = "ICBO RIVER PLASTER SAND" + !x_flag = vbChecked + !o_qty = dblOrder + !a_qty = dblOrder + !price = sglSAND + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9994" + !Desc = "SPLIT CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 15 + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9993" + !Desc = "MINIMUM ORDER CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 40 + .Update + End With + crOrder.Reset + strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\sand.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\sandM.rpt" + End If + crOrder.Formulas(1) = "Sand = " & dblOrder + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + gboolPRINT = False +' cmdSandPrint.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module cmdSandPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdSavePO_Click() +Dim lngID As Long + If Not IsDate(txtPODate) Then + MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" + txtPODate.SetFocus + Exit Sub + End If + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - Talk to TERESA", vbOKOnly, "Plan Verified" + Call LotChange(mstrPROJLOT, "Chnge After Verified") + End If + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Chnge PO Information") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPO.ListIndex + If mboolAdding Then + If mintBOOKMARK = -1 Then + mintBOOKMARK = 0 + End If + End If + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + lstLOOKUP.Visible = False + Call POSave + Call POLoad + + If mboolAdding Then + mboolAdding = False + lngID = FindMax("tblPOrder", "PONum") + Call CBFindString(lstPO, CStr(lngID)) + cmdAddPOMat.SetFocus + mintBOOKMARK = lstPO.ListIndex + End If + + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePOMat_Click() +Dim intINVNO As String, lngID As Long + + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Change PO Material") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPOMaterial.ListIndex + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + lstLOOKUP.Visible = False + intINVNO = txtPOInvNo + Call POMatSave + Call POMatLoad + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + If mboolAdding Then + mboolAdding = False + Call CBFindString4(lstPOMaterial, CStr(intINVNO)) + cmdAddPOMat.SetFocus + mintBOOKMARK = 0 + Exit Sub + End If + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = CLng(mintBOOKMARK) +' lstPOMaterial.ListIndex = 5 + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = -1 + End If + mintBOOKMARK = 0 +End Sub + +Private Sub cmdScratchPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gboolPRINT = True + gintCOPY = 1 + + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!SCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!SCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + + gstrPO = "L" + gstrFLAG = "S" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!TORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!c_flg = vbTrue + End If + moRS.Update + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" + crOrder.ReportFileName = App.Path & "\NewScratch.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" + goConn.Execute strSQLUP + + gboolPRINT = False +' cmdScratchPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdScratchPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintActual() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actual.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintActual" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintActualJG() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, intYN As Integer +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actualJG.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + intYN = MsgBox("Do You Want To Print To The Printer", vbYesNo + vbDefaultButton2, "Printer or Screen") + If intYN = vbYes Then + crOrder.Destination = crptToPrinter + Else + crOrder.Destination = crptToWindow + End If + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintActualJG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdShowChange_Click() + frmLotChLog.Show 1 +End Sub + +Private Sub cmdStonePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean + + On Error GoTo Error_EH + boolNOSTONE = False + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!st_flg = vbTrue + End If + moRS.Update + End If + + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + boolNOSTONE = True + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' If oRSS.State = adStateOpen Then +' oRSS.Close +' End If + If Not boolNOSTONE Then + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + + crOrder.Reset + MsgBox "Insert 1 Sheet of Purple/Lavendar Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" + gintCOPY = 1 + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + crOrder.ReportFileName = App.Path & "\StonePay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + If boolCOMPLETE Then + Call PrintStoneInv '******* Print Invoice + crOrder.Reset + End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + Call Form_Load + End If +' cmdStonePrint.Enabled = False + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdStonePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub + +End Sub + + +Private Sub cmdStuccoPay_Click() +Dim strPAY As String + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") + + If chkSynthetic = vbChecked And moRSProj!stype <> "T" Then + MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 1 + Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 +' ElseIf moRSProj!stype <> "T" Then + ElseIf moRSProj!stype <> "T" Then + If moRS!texture = "S2" Or moRS!texture = "SB" Then + If Not mboolST_ADJ Then + mboolST_ADJ = True + End If + End If + gintCOPY = 1 + If mboolST_ADJ Then + Call PrintStuccoPay2 + Else + Call PrintStuccoPay + End If + Else + gintCOPY = 1 + Call PrintStuccoThree + End If + cmdStuccoPay.Visible = False +End Sub + +Private Sub cmdSuperRpt_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer + On Error GoTo Error_EH + + cmdExit.Enabled = False + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 0 + End If + + If (moRS!lorder) = #12/31/2030# Then +' If Not IsDate(moRS!SOrder) Then + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + Exit Sub + End If + End If + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + gintCOPY = 1 + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update + gintPRINT = 9 + frmReport.Show 1 + If gintPRINT = 0 Then + cmdExit.Enabled = True + Exit Sub + End If + strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + + crOrder.ReportFileName = App.Path & "\super.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdSuperRpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_Click() +'Dim strDate As String, strSQL As String, intSUP As Integer +'Dim oRS As Recordset, oRSS As Recordset +'Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer +Dim strDate As String, strSQL As String, intSUP As Integer, intSTUCCOTCREW As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + mintPAYCREW = 0 + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + +'***** LOGIC TO SETUP CREW NUMBERS FOR TEXTURE PAYSHEETS + If moRS!texture = "S2" Or moRS!texture = "SB" Then +'' intYNS = MsgBox("Do You Want To Use A Crew Number With The Brown PaySheet? Y or N)", vbYesNo, "Use Crew") +'' If intYNS = vbYes Then +'' intSTUCCOCREW = InputBox("Enter The Brown Crew Number", "Stucco Crew", 0) + +'' strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOCREW +'' Set oRSC = New Recordset +'' oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSC.EOF Then +'' strCrewType = oRSC!Type +'' End If + +'' If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then +'' If strCrewType = "" Then +'' MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" +'' Exit Sub +'' End If +'' MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +'' Exit Sub +'' Else +'' mintPAYCREW = Field2Str2(intSTUCCOCREW) +'' moRS!BCREW = Field2Str2(intSTUCCOCREW) +'' moRS.Update +'' mboolSTUCCOC = True +'' End If +'' Else +'' moRS!BCREW = 0 +'' moRS.Update +'' mboolSTUCCOC = False +'' End If +' Else + intYNS = MsgBox("Do You Want To Use A Crew Number With The Texture PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOTCREW = InputBox("Enter The Texture Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOTCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOTCREW = 0 Or IsNull(intSTUCCOTCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOTCREW) + moRS!TCREW = Field2Str2(intSTUCCOTCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!TCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + End If + + +'***** INSERTED TO PRINT TEXTURE PAYSHEETS FOR S2 and SB textures + + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then '**** Three Coat + If Field2Str2(txtTtlYdge) - 24 > 1200 Then 'If error for S2 and SB paysheets on large yardage, this logic needs to be tweeked + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +' gintCOPY = 1 + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + If mboolST_ADJ Then + Call PrintStuccoPay4 +' Call PrintStuccoPay2 + Else + Call PrintStuccoPay4 '****** +' Call PrintStuccoPay '****** + End If + crOrder.Reset + gintCOPY = 1 + Else + + If moRS!texture = "SB" Or moRS!texture = "S2" Then '*** This is to print Brown paysheets + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 +' If mboolST_ADJ Then + Call PrintStuccoPay4 +' Call PrintStuccoPay3 +' Call PrintStuccoPay2 +' Else +' Call PrintStuccoPay +' End If + crOrder.Reset + gintCOPY = 1 + End If + '***** Commenting this out so no texture pay sheets print for other textures +'' If moRS!texture <> "SB" And moRS!texture <> "S2" Then +' If moRS!texture <> "SB" Then '***** Synthetic over OneKote +' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' crOrder.Reset +'' gintCOPY = 1 +'' End If + End If + '*** Need To Decide if Three Coat should be included + '*** Remove double ' marks to turn back on +'' Else '** the logic below this is strictly for Three Coat +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 1 +'' intTCPAY = gintCOPY * 1 +' gintCOPY = intCOPY * 2 +' intTCPAY = gintCOPY * 3 +'' MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 1 +' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + +' If chkSynthetic Then +''' If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then +''' If Not mboolSPLIT Then +''' If Not moRSProj!bill Then +''' Call PrintStuccoInv +''' Else +''' Call PrintCompleteInv +''' End If +''' boolFPRINT = False +''' End If +''' End If +''' If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update +''' If Not moRSProj!bill Then +''' Call PrintStuccoInv +''' Else +''' Call PrintCompleteInv +''' End If +''' End If +' End If + + + +'***** END OF PROGRAM COPIED FROM cmdBrownPrint SO TEXTURE PAYSHEETS ARE GENERATED + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" + goConn.Execute strSQLUP + + moRS!PRNT_T = Now() + moRS.Update + + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_HOLD_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" + goConn.Execute strSQLUP + + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdUpCMU_Click() +Dim intCMU As Integer + + intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") + If intCMU > 0 Then + moRS!CMU = intCMU + moRS.Update + Call FormShow + End If +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer, lngLOTID As Long, lngPROJID As Long +Dim strSQL As String + + On Error GoTo Error_EH + + mboolADD = False + mboolBAD = False + +' mboolENTER = False + + If gintLOTID = 0 Then + intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") + If intResponse = vbYes Then + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAddLot_Click + If mboolBAD Then + Unload Me + End If + Else + Unload Me + End If +''' Else +''' lngLOTID = gintLOTID +''' lngPROJID = gintPROJID +''' Call GetPlanInfo +''' strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID +''' Set moRS = New Recordset +''' moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic +''' If moRS.EOF Then +' lngLOTID = gintLOTID +''' End If + ' If mboolPLANUP Then +''' If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then +''' MsgBox "Plan Information Has Been Updated - Plan will be ReLoaded and Lot Will Exit", vbOKOnly, "Must Update" +''' Call cmdFindPlan_Click +''' gintLOTID = lngLOTID +''' gintPROJID = lngPROJID +' Call cmdCalc_Click +''' Call cmdSaveLotInfo_Click +''' Call cmdExit_Click +''' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String +Dim strPAY As String, intYN As Integer, strMSG As String, lngOPTID As Long +Dim strSQLST As String, oRSST As Recordset, strSQLPST As String, oRSPST As Recordset + + mboolSTPAY = False +' E Print Stone Order +' Ctrl-5 Reset to allow Brown To Be Reprinted (B_Flg, BrownP, BrownD) +' L Allow Reprint of Lath Pay Sheets +' A Allow update of Address and Owner information on after Lot has been completed +' X Update Paint Square Footage +' T Print Paint Pay Sheets if not already done. +' S Reprint Stucco Pay Sheets +' M Resets the PO Flag to true +' W Update cost on the highlighted item in the Materials List +' Y Allow the reprint of the Lath Yard Order +' I Allow Lath Material Order to be reprinted +' F Turn On The Lath material +' R Turn on the RePrint Lath Button +' H ReSet The PreOrder info & Turn On The Print PreOrder Button +' D Turn on the Reprint PreorderY button +' G Print the Actual Report for Jesse +' N Turn on the Save Lot Info BUtton +' U Set flag for Stucco Cert +' Q Mark a lot option for Stone +' A Print a Stone Invoice +' Ctrl-1 Set The PO Type to Stone +' Ctrl-2 Turn The Add Option Button for Orchard Heights +' O Update Stone Options to No Invoice + + If Shift = 4 Then + Exit Sub + End If + + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKey5 And gbytSECURITY < 3 Then ' Lath Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + moRS!b_flg = False + moRS!BrownP = False + moRS!BrownD = False + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyO And gbytSECURITY < 3 Then ' Mark No Invoice for STONE + If CtrlDown Then + Call UpInvoice + End If + Exit Sub + End If + + If KeyCode = vbKeyE And gbytSECURITY < 3 Then ' Allow Print of Stone + If chkStone And moRS!st_flg Then + strMSG = "Either Stone Has Already Been Printed OR " & vbCrLf + strMSG = strMSG & "There Is No Stone Required On This Lot" + MsgBox strMSG, vbOKOnly, "No Stone" +' Exit Sub + Else + cmdPrint.Caption = "Print Stone Order" + cmdPrint.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Allow RePrint of Lath Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyA And gbytSECURITY < 3 Then ' Allow RePrint of Stone Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 6 Then + mboolSTPAY = True + Call POInvoice + ' cmdLathPay.Visible = True + End If + Exit Sub + End If + +'' If KeyCode = vbKeyQ And gbytSECURITY < 7 Then ' Allow setting up the Stone in options - Orders or less +'' If CtrlDown And SSTLotInfo.Tab = 3 Then +'' If lstLOptions.ListCount = 0 Then +'' MsgBox "No Lot Options - Stone Update Not Allowed", vbOKOnly, "Select A Stone Option" +'' Exit Sub +'' End If +'' If lstLOptions.ListIndex = -1 Then +'' MsgBox "No Lot Options Selected", vbOKOnly, "Select A Stone Option" +'' Exit Sub +'' End If +'' lngOPTID = Val(lstLOptions. +'' strSQLST = "SELECT * FROM tblLOption WHERE OPT_ID = " & lngOPTID +'' Set oRSST = New Recordset +'' oRSST.Open strSQLST, goConn, adOpenForwardOnly, adLockOptimistic +'' oRSST!ostone = True +'' oRSST.Update +'' End If +'' Exit Sub +'' End If + +''' If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Allow Update of Address, and Owner information +''' If CtrlDown And SSTLotInfo.Tab = 0 Then +''' txtAddress.Enabled = True +''' txtOwner.Enabled = True +''' cmdSaveLotInfo.Enabled = True +''' End If +''' Exit Sub +''' End If + + If KeyCode = vbKeyX Then ' Update the Paint Square Footage + If CtrlDown Then + Call PaintFix + End If + Exit Sub + End If + + If KeyCode = vbKey1 Then ' Update the Paint Square Footage + If CtrlDown Then + optStone.Value = True + Call POSave + End If + Exit Sub + End If + + If KeyCode = vbKey2 And gintPROJID = 6534 Then ' Turn On the ADD OPTION button + If CtrlDown Then + If SSTLotInfo.Tab = 3 And lstPOptions.ListIndex <> -1 Then + cmdOptAdd.Enabled = True + Else + MsgBox "Must Have Plan Option Available and Selected", vbOKOnly + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyU Then ' Make the Flag that Shows Stucco Cert Done - True + If CtrlDown Then + moRS!SCert = vbTrue + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyT And gbytSECURITY <= 6 Then ' Print Paint Pay Sheets +' If KeyCode = vbKeyT And gbytSECURITY <= 3 Then ' Print Paint Pay Sheets + If CtrlDown Then + If Not mboolPAINT Then + MsgBox "This Lot Does Not Have Paint - PaySheets Will Not Be Printed", vbOKOnly, "Not A Paint Lot" + Exit Sub + End If +' ElseIf moRS!PNT_Print Then +' ElseIf moRS!PNT_FLG Or moRS!PNT_Print Then +' MsgBox "Paint Pay Has Already Been Printed", vbOKOnly, "Print Denied" +' Exit Sub +' Else + intYN = MsgBox("Are You Sure You Want To Print Paint PaySheets?", vbYesNo, "Print Paint PaySheets") + + If intYN = vbYes Then + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + frmPaintPrtJobs.Show 1 +' Call LotChange(mstrPROJLOT, "Print Paint Pay") +' Call PrintPaintPay ' **** need to watch this + End If + intYN = MsgBox("Do You Want To Print Paint Invoices?", vbYesNo, "Print Paint Invoices") + If intYN = vbYes Then + Call PrintPaintIInv 'Needs to be added to LOTINFO5 + Call PrintPaintEInv 'Needs to be added to LOTINFO5 + Call PrintPaintFInv 'Needs to be added to LOTINFO5 + moRS!PNT_Print = vbChecked + moRS.Update + End If +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If +' End If + Exit Sub + End If + + If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' Allow REprint of Stucco Pay SHeets + If CtrlDown And SSTLotInfo.Tab = 1 Then + MsgBox "The RePrint Stucco Paysheet does not work - Use CTRL-T on the Main Screen", vbOKOnly, "Not Functioning" +' mboolRPSTUCCO = True +' cmdStuccoPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyM And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 6 Then + moRSPO!POFlag = vbTrue + moRSPO.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm + If CtrlDown And SSTLotInfo.Tab = 2 Then + strINVNO = lstLMaterial.ItemData(lstLMaterial.ListIndex) + strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & strINVNO + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) + oRS!price = Field2Str2(strCOST) + oRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call PrintLathMat + gintCOPY = 1 + End If + Exit Sub + End If + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLFlag.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Turn on the Reprint Lath Button + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdRePrintL.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' ReSet The PreOrder info & Turn On The Print PreOrder Button + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call RePrintPreCast + cmdPreOrderPrintPC.Enabled = True 'eVisible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyD And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintY.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "TLB" Or gstrLOGIN = "TB") Then ' Print Special Report for Jesse +' Dim intYN As Integer + If CtrlDown And SSTLotInfo.Tab = 1 Then + intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") + If intYN = vbNo Then + Exit Sub + End If + Call PrintActualJG + End If + Exit Sub + End If +' If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6 Or gbytSECURITY = 7) Then ' Display key combinations. + If KeyCode = vbKeyN And (gbytSECURITY < 8) Then ' Display key combinations. + If CtrlDown Then + cmdSaveLotInfo.Enabled = True + cmdSaveLotInfo.SetFocus + End If + Exit Sub + End If + + If Field2Str(moRS!l_FLG) <> "P" Then + If Not cmdSaveLotInfo.Enabled Then + Call DataHasChanged + End If + End If +End Sub + +Private Sub DataHasChanged() + + cmdSaveLotInfo.Enabled = True + cmdAddLot.Enabled = False + +End Sub + +Private Sub RePrintPreCast() 'Allows a PreCast order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint PreCast") + + moRS!z_FLG = Null + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - PRECAST PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'Z' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + +' Call LotRePrinted +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtLMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + txtLMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtLMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindInv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFindPlan_Click() +Dim strSTARTDATE As String, lngPOS As Long +Dim oRS As Recordset, oRSSS As Recordset +Dim strSQL As String, lngFind As Long, strTEST As String +Dim strSql2 As String + On Error GoTo Error_EH + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If (mstrPLNELEV = "HOLD" And txtModel <> "HOLD") And Not mboolPLNCHANGE Then + mboolPLNCHANGE = True + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub + ' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + + End If + + Call SetPreOrder + + If Not mboolAdding Then + txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + + If oRS.RecordCount > 0 Then + + With oRS + +' txtTtlYdge = Field2Integer(!TO_TTLYDS) 'This May have to be changed to be Mat_YDS + Openings + txtTtlYdge = Field2Integer(!mat_yds) ' Changed back per Jesse 07/09/2018 + txtModel = Field2Str(!Mod_Elv) + txtCMUYdge = Field2Integer(!CMUYDS) + If !HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If +' chkHLNotes = Field2CheckBox(!HLNotes) + txtNotes = Field2Str(!notes) +' txtFoamAdj = Field2Integer(!f_adj) + mstrFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Integer(!opening) + chkStone = Field2CheckBox(!stone) +' chkPaint = Field2CheckBox(!Paint) +' txtStone = Field2Str2(!ST_SQFT) + mstrStone = Field2Str2(!ST_SQFT) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) ' & "'" + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) ' & "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) ' & "'" + mintST_ADJ = Field2Integer(!st_adj) + If mintST_ADJ > 0 Then + mboolST_ADJ = True + Else + mboolST_ADJ = False + End If + txtStoneBill = Field2Str2(!st_bill) + moRS!Scaf6 = Field2Str2(!Scaf6) + moRS!scaf10 = Field2Str2(!scaf10) + moRS!TWOSTORY = !TWOSTORY + moRS!UPDTPLAN = Now + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + If Not !Firsttime Then + !Firsttime = vbChecked + chkFirst = vbChecked + .Update + End If + + gintESTID = !est_id + If Not mboolAdding Then + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + End If + Call FieldsSave + End With + ' oRS.Update + 'clear materials and get correct for model + 'update materials and yardage for options + Else + Call PlanLoad + cmdFindPlan.Visible = False + If lstPlans.ListCount = 0 Then + MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" + cmdSaveLotInfo.Enabled = False + gstrFLAG = "P" + Unload Me + Exit Sub + Else + lstPlans.ListIndex = 0 + lstPlans.SetFocus + oRS.Close + Exit Sub + End If + End If + oRS.Close + If mboolAdding Then + Call ElevLoad + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad + mboolAdding = False + Else + Call ElevLoad + Call DelLotMat + Call PlanMatLoad + Call ReloadOptMat + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call cmdSaveLotInfo_Click + Call UpInvoice + Call cmdExit_Click + End If + Exit Sub + +Error_EH: + Call ErrorHandler(oRSSS.ActiveConnection) +' gstrMODULE = "Form LotInfo - Module cmdFindPlan_Click" +' Call ErrorHandler2 +' gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DelLotMat() +Dim strSQL As String + + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked + goConn.Execute strSQL + +End Sub + +Private Sub ReloadOptMat() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + mintOPTID = Field2Long(oRS!Opt_ID) + Call UpLotInfo + Call UpLMat + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: +' Call ErrorHandler(oRSS.ActiveConnection) + gstrMODULE = "Form LotInfo - Module ReloadOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdAddLot_Click() +Dim strSTARTDATE As String, lngPOS As Long + + mboolADD = True + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub +' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + mboolAdding = True + gconACTION = 0 + gintLOTID = 0 + txtJC.Enabled = True + cmdCalc.Enabled = False + cmdDelLot.Enabled = False + cmdAddLot.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptAdd.Enabled = False + cmdOptDel.Enabled = False + txtLotNo.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + Call LotNew + Call FormClear + Call MatClear + + If Not mboolADD Then + txtAddress.SetFocus + End If +End Sub + +Private Sub cmdAddMatrl_Click() +' lstLMaterial.ListIndex = -1 + lstLMaterial.Enabled = False +' moRSMat.Update +' moRSMat.Close + Call MatClear + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdInventory.Visible = True + lblMatInst.Visible = True + txtLMDesc.SetFocus + mboolAdding = True + +End Sub + +Private Sub cmdDelMatrl_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstLMaterial.ListIndex + moRSMat.Delete + Call LotChange(mstrPROJLOT, "Delete Material") + Call MatLoad + If lstLMaterial.ListCount Then + If lstLMaterial.ListCount > mintBOOKMARK Then + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstLMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False +End Sub + +Private Sub cmdInventory_Click() + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub UpInvoice() +Dim strSQL As String, strSQLP As String +Dim oRS As Recordset, oRSP As Recordset +Dim lngOPTID As Long, OPTCNT As Integer, CNT As Integer + + CNT = 0 + OPTCNT = lstLOptions.ListCount + If lstLOptions.ListCount <> 0 Then + Do Until CNT = OPTCNT + strSQL = "SELECT * FROM tblLOption WHERE Opt_ID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " AND LOT_ID = " & gintLOTID +' strSQL = "SELECT * FROM tblLOption WHERE Opt_ID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + strSQLP = "SELECT * FROM tblPOption WHERE OptID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSP.EOF And oRSP!invoice Then +' If oRSP!invoice Then + oRS!invoice = vbTrue + oRS.Update +' End If + End If + + End If + If lstLOptions.ListIndex + 1 <> OPTCNT Then + lstLOptions.ListIndex = lstLOptions.ListIndex + 1 + End If + CNT = CNT + 1 + Loop + + End If + +End Sub + +Private Sub cmdOptAdd_Click() +Dim strSQL As String +Dim strSql2 As String, oRS As Recordset + + On Error GoTo Error_EH + + If moRSLOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblLOption" +' strSQL = "SELECT * FROM tblLOption where opt_id = 1" + Set moRSLOpt = New Recordset + moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + End If + + If moRSLOpt.EOF Then + + End If + + strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!Lot_ID = gintLOTID + moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) + mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt!C_USER = gstrLOGIN + If oRS!ostone Then + moRSLOpt!ostone = vbChecked + moRSLOpt!invoice = vbChecked +' moRSLOpt.Update + End If + moRSLOpt.Update + lstPOptions.Enabled = True + Call UpLotInfo + Call UpLMat + Call LOptLoad + Call FieldsSave + Call MatSave + Call MatLoad + lstPOptions.ListIndex = -1 + cmdOptAdd.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdOptAdd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOptDel_Click() +Dim strSQL As String + gconACTION = 3 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Call LotChange(mstrPROJLOT, "Delete Lot Option") + Call UpdateLotInfo + Call UpdateLMat + Call MatSave + Call MatLoad + Call FieldsSave + strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call LOptLoad + cmdOptDel.Enabled = False + gconACTION = 0 +End Sub + +Private Sub UpLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + oRSSS.AddNew + oRSSS!Lot_ID = gintLOTID + oRSSS!inv_no = Field2Str(oRSS!inv_no) + oRSSS!Desc = Field2Str(oRSS!Desc) + oRSSS!d_flag = Field2Str(oRSS!d_flag) + oRSSS!m_type = Field2Str(oRSS!m_type) + oRSSS!calc_flag = Field2Str(oRSS!calc_flag) + oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) + oRSSS!qty = Field2Str(oRSS!qty) + oRSSS.Update +' oRSSS.Close + Else + oRSSS!qty = (oRSSS!qty + oRSS!qty) + oRSSS.Update + ' oRSSS.Close + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + + oRS.Close + oRSS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = " & oRSS!inv_no & " and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + Else + oRSSS!qty = (oRSSS!qty - oRSS!qty) + If oRSSS!qty <= 0 Then + oRSSS.Delete + Else + oRSSS.Update + End If + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + If Err = -2147217885 Then + Resume Next + Else + gstrMODULE = "Form LotInfo - Module UpdateLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub +Private Sub UpdateLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String +Dim strSQL As String, strSql2 As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + moRS!sq_yd = moRS!sq_yd - oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 - oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj - oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + strSQL = "SELECT Texture " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + moRS!texture = Field2Str(oRSS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + + If moRS!texture <> "SB" Then + chkSynthetic = vbUnchecked + lblSynthetic.Visible = False + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + + strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID + Set oRSSE = New Recordset + oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSE.EOF Then + oRSE!FileName = oRSSE!FileName + oRSE.Update + oRSE.Close + End If + oRSSE.Close + End If + If oRS!ostone Then +' moRS!stone = vbUnchecked + chkStone = vbUnchecked + moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt + txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(moRS!ST_SQFT) + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(moRS!PNT_SQFT) +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbUnchecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpdateLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub UpLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim strSQL As String, strMSG As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If oRS.RecordCount = 0 Then + strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" + Exit Sub + End If + moRS!sq_yd = moRS!sq_yd + oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 + oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj + oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + moRS!texture = Field2Str(oRS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + If moRS!texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSE.EOF Then + oRSE!FileName = oRS!FileName + oRSE.Update + oRSE.Close + End If + End If + If oRS!ostone Then +' moRS!stone = vbChecked + chkStone = vbChecked + moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt +' = Val(txtStoneBill) + Field2Double(oRS!amt) + txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & "'" & Field2Str2(moRS!ST_SQFT) & "'" +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbChecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If mboolCRITICAL Then + Exit Sub + End If + If gstrFLAG <> "D" Then + If gstrFLAG <> "P" Then + If cmdSaveLotInfo.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + End If + End If + + If moRS.State = adStateOpen Then + moRS.Update + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If +' gintLOTID = 0 'This May Need To Be Turned Back On if LotID is wrong + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cmdSaveLotInfo_Click() + + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSaveMatrl_Click() + + If gconACTION = 6 Then + Call LotChange2(mstrPROJLOT, "Change Lot Material", txtLMDesc, mstrBEGQTY, mstrENDQTY) +' Call LotChange(mstrPROJLOT, "Change Lot Material") + gconACTION = 0 +' End If + ElseIf gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + On Error GoTo Error_EH + mintBOOKMARK = lstLMaterial.ListIndex + + + ' Store the controls to the recordset + Call MatSave + + Call MatLoad + +' mintINVNO = Field2Str2(moRSMat!inv_no) + If mboolAdding Then + mboolAdding = False + Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) +' Call ListFindItem(lstLMaterial, CLng(mintINVNO)) + mintBOOKMARK = lstLMaterial.ListIndex + End If + + cmdInventory.Visible = False + lblMatInst.Visible = False + If gconACTION <> 5 Then + If moRS!l_FLG <> "P" Then + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + Else + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + End If + End If + + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + lstLMaterial.SetFocus + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() +Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long +Dim strSQLS As String, oRSST As Recordset + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + Set moRSPO = New Recordset + Set moRSPOMAT = New Recordset + Set moRSMemo = New Recordset + mboolSTONE3 = False + mboolST_ADJ = False + mintST_ADJ = 0 + mboolORCHARD = False + + On Error GoTo Error_EH + + mboolHLNotes = False + mboolPLNCHANGE = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + +' strSQLS = "SELECT * FROM tblP" + + 'Need to set a flag that tells when a lot is marked for stone but has not stone setup in the billing grid + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 20 + + strSQLL = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + + lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) + mlngINVID = lngINVID + lngINVID = lngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID + moRSInvINFO.Update + + mboolFRMLOAD = False + mboolSPLIT = False + mboolStone = False + gstrFLAG = "" + gstrPO = "L" +' gbytSECURITY = 1 + SSTLotInfo.Tab = 0 + mboolCRITICAL = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + ' if + Call MTypeLoad(cboPOMType) + Call MTypeLoad(cboLMType) + Call MTypeLoad(cboLOMType) + Call ProjLoad + + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + + If FormFind() Then + Call PlanFind +' Call SetPreOrder + If mboolCRITICAL Then + Unload Me + Exit Sub + End If + If mboolStone Then + Call SetStone + End If + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad +' Call POMatLoad + End If + If mboolNOTSUPPLIER Then + moRS!s_FLG = "P" + moRS.Update + End If + If mboolNOPREORDER Then + moRS!y_FLG = "P" + moRS.Update + End If + If mboolNOPRECAST Then + moRS!z_FLG = "P" + moRS.Update + End If + If gintLOTID <> 0 Then + If IsNull(moRS!y_FLG) Or moRS!y_FLG = "" Then + cmdPreOrderPrintY.Enabled = True + End If + If IsNull(moRS!s_FLG) Or (moRS!s_FLG) = "" Then + cmdPreOrderPrintS.Enabled = True + End If + If IsNull(moRS!z_FLG) Or (moRS!z_FLG) = "" Then + cmdPreOrderPrintPC.Enabled = True + End If + +' If IsNull(moRS!l_flg) Then +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then +' cmdSandPrint.Enabled = True +' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!b_flg Then +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdStonePrint.Enabled = True +' End If + + If moRS!t_flg And chkStone And Not moRS!st_flg Then + cmdPrint.Caption = "Print Stone Order" + cmdPrint.Enabled = True +' cmdStonePrint.Enabled = True + ElseIf IsNull(moRS!l_FLG) Then + cmdPrint.Caption = "Print Lath Order" + cmdPrint.Enabled = True +' cmdLathPrint.Enabled = True + ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then + cmdPrint.Caption = "Print Sand Order" + cmdPrint.Enabled = True +' cmdSandPrint.Enabled = True + ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +' ElseIf moRS!a_flg And Not moRS!b_flg Then + cmdPrint.Caption = "Print Scratch Order" +' cmdPrint.Caption = "Print Brown Order" + cmdPrint.Enabled = True +' cmdScratchPrint.Enabled = True + ElseIf moRS!a_flg And Not moRS!b_flg Then +' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then + cmdPrint.Caption = "Print Brown Order" +' cmdPrint.Caption = "Print Scratch Order" + cmdPrint.Enabled = True +' cmdBrownPrint.Enabled = True + ElseIf moRS!b_flg And Not moRS!t_flg Then + cmdPrint.Caption = "Print Texture Order" + cmdPrint.Enabled = True +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdPrint.Caption = "Print Stone Order" +' cmdPrint.Enabled = True +' cmdStonePrint.Enabled = True + Else + cmdPrint.Caption = "All Orders Printed" + cmdPrint.Enabled = False + End If + + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If + End If + If gbytSECURITY <= 6 Then + cmdEdit.Visible = True + cmdEdit.Enabled = True + End If + If chkHoldOrders Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + Else + chkHoldOrders.Enabled = True + chkHoldOrders.BackColor = &H80FFFF + End If + Else + chkHoldOrders.Enabled = True + End If +' If chkSplit Then +' cmdSaveLotInfo.Enabled = False +' If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF +' Else +' chkSplit.Enabled = True +' chkSplit.BackColor = &H80FFFF +' End If +' Else +' chkSplit.Enabled = True +' End If + If chkHoldPO Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + Else + chkHoldPO.Enabled = True + chkHoldPO.BackColor = &H80FFFF + End If + Else + chkHoldPO.Enabled = True + End If + If chkSynthetic Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + Else + chkSynthetic.Enabled = True + chkSynthetic.BackColor = &H80FFFF + End If + + End If + If chkStone Then + cmdSaveLotInfo.Enabled = False + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + Else + chkStone.Enabled = True + chkStone.BackColor = &H80FFFF + End If + + End If +' If gbytSECURITY = 6 And lstPO.ListCount > 4 Then + If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdAddPOMat.Enabled = False + End If + mboolFRMLOAD = True +' Call ListChanges + +' cmdExit.Enabled = True + Exit Sub + + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSProj!stone Then + mboolStone = True + End If + mstrWIRE = Field2Str(moRSProj!wire) + If moRSProj!twodates Then + mbool2Dates = True + + End If + If moRSProj!certpr Then + mboolCERTIFIED = True + Else + mboolCERTIFIED = False + End If + + If moRSProj!Apt Then + mboolCOMM = True + Else + mboolCOMM = False + End If + mstrTAXCODE = Field2Str(moRSProj!taxcode) + + gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PlanLoad() +Dim oRS As Recordset +Dim strSQL As String, strTEST As String + On Error GoTo Error_EH + + strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPlans.Clear + + Do Until oRS.EOF + With lstPlans + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS!est_id + End With + lstPlans.Visible = True + lblPlan.Visible = True + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PlanLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + If moRSProj!bb Then + lblBB.Caption = "This House Uses Blackboard" + Else + lblBB.Caption = "This House Uses R-Guard" + End If + If moRSProj!zmetal Then + lblZMetal.Visible = True + Else + lblZMetal.Visible = False + End If + + With moRS + lblSZone = Field2Str2(!zone) + lblSandShip = Field2Str2(!ORD_NO) + txtTake138 = Field2Integer(!jmb138) + txtCalc138 = Field2Integer(!jmb138) + txtTtlYdge = Field2Integer(!sq_yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!Owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Integer(!CMU) + txtNotes = Field2Str(!notes) + If !HLNotes And Len(txtNotes) > 0 Then + txtNotes.ForeColor = &HFF& + txtNotes.BackColor = &H80FFFF + Else + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + End If + txtSuperNotes = Field2Str(!supernotes) + txtLotNotes = Field2Str(!lotnotes) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) '& "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) '& "'" + mstrFoamAdj = Field2Integer(!f_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrStone = Field2Str2(!ST_SQFT) +' txtFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) +' txtStone = Field2Str2(!ST_SQFT) + mintST_ADJ = Field2Integer(!st_adj) + If mintST_ADJ > 0 Then + mboolST_ADJ = True + Else + mboolST_ADJ = False + End If + txtFin2 = Field2Integer(!fin2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Str2(!opening) + chkFirst = Field2CheckBox(!Firsttime) + txtMetal = Field2Double(!METAL) + txtSand = Field2Integer(!sand_ton) + txtSuperBB = Field2Integer(!SUP_BB) + txtSuper12 = Field2Integer(!SUP_FD12) + txtSuper1383 = Field2Integer(!SUP_138) + If CInt(txtSuper1383) < 0 Then + txtSuper1383 = 0 + End If +' txtSuper1383 = 0 + txtSuper783 = Field2Integer(!SUP_783) + txtSuper78 = Field2Integer(!SUP_78) + txtSuper38 = Field2Integer(!SUP_38) + txtSuperRL = Field2Integer(!SUP_RL) + txtSuperML = Field2Integer(!SUP_ML) + txtSuperDW = Field2Integer(!SUP_DW) + txtSuperSP = Field2Integer(!SUP_SP) + txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + If txtLathO = "" Then + txtLathO = "12/31/2030" + End If + txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) + txtStoneBill = Field2Str2(!st_bill) + txtJC = Field2Str(!jobcost) + chkHoldOrders = Field2CheckBox(!hold_stucco) + chkHoldPO = Field2CheckBox(!hold_po) + chkPaint = Field2CheckBox(!PNT_FLG) + chkSynthetic = Field2CheckBox(!syn_flag) + chkStone = Field2CheckBox(!stone) + chkOthers = Field2CheckBox(!otstone) + chkNoPay = Field2CheckBox(!nopayissue) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + End With + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "C" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "San Man" + End If + + If moRS!l_FLG = "P" Then + txtTtlYdge.Enabled = False + txtCMUYdge.Enabled = False +' txtStone.Enabled = False + txtLotNo.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptDel.Enabled = False + cmdDelLot.Enabled = False + cmdSaveLotInfo.Enabled = False + cmdFindPlan.Enabled = False + cmdOrders.Enabled = False + cmdCalc.Enabled = False +' txtYardMemo.Enabled = False + txtYardMemo.Enabled = True + txtYardMemo.Locked = True + cmdUpCMU.Enabled = False + cmdPrintCMU.Enabled = False + Call LotPrinted + End If + If moRS!Firsttime Then + lblFirst.Visible = True + End If + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotPrinted() + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtNotes.Enabled = False +' txtFoamAdj.Enabled = False +' txtLaborAdj.Enabled = False +' txtWireAdj.Enabled = False +' txtFin2.Enabled = False + txt28Foam.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False + lblLathPrint.Visible = True + cmdPreOrderPrintY.Enabled = False + cmdPreOrderPrintS.Enabled = False + +End Sub + +Private Sub LotRePrinted() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True +' txtFin2.Enabled = True + txt28Foam.Enabled = True +' txtSuperBB.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + lblLathPrint.Visible = False + cmdPreOrderPrintY.Enabled = True + cmdPreOrderPrintS.Enabled = True + cmdPrint.Enabled = True +End Sub + +Private Sub LotNew() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True +' txtSuperBB.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + lblLathPrint.Visible = False + lblFirst.Visible = False + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!qty) + If CInt(txtLMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLMQty.ForeColor = &HFF& + txtLMQty.FontBold = True + Else + txtLMQty.ForeColor = &H0& + txtLMQty.FontBold = False + End If + txtLMLength = Field2Integer(!calc_amt) + txtLMBalance = Field2Str(!o_qty) + chkChange = Field2CheckBox(!ch_flag) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + Call FindType(cboLMType, strTYPE) + + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt + txtLOYdge = Field2Integer(!Yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Integer(!fin2) + txtLOFoam = Field2Integer(!f_adj) + lblBillingAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + Call FindTexture2(Field2Str(!texture), strTYPE) + txtLOTexture = strTYPE +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt2 + txtNote2 = Field2Str(!notes) + If Left(Field2Str(!Desc), 3) = "DNU" Then + mboolDNU = True + Else + mboolDNU = False + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPO() +Dim bytPOType As Byte + + On Error GoTo Error_EH + + + mboolSHOW = True + + With moRSPO + gintPONUM = Field2Long(!ponum) + txtPONum = Field2Long(!ponum) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + txtPODate = Field2Str(!Date) + txtPay = Field2Str2(!yards) + txtPayType = Field2Str(!payflag) + txtPOType = Field2Str(!potype) + gstrPO = txtPOType + bytPOType = Field2Str2(!Opt_Type) + End With + + If bytPOType = 1 Then + optLath = True + ElseIf bytPOType = 2 Then + optStucco = True + ElseIf bytPOType = 3 Then + optSand = True + ElseIf bytPOType = 4 Then + optPreOrder = True + ElseIf bytPOType = 5 Then + optStone = True + ElseIf bytPOType = 6 Or bytPOType = 0 Then + optNone = True + End If + If moRSPO!p_flg = "P" Then + cmdPrintPO.Enabled = False + Else + cmdPrintPO.Enabled = True + End If + mboolSHOW = False + If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then + cmdPrintPOPay.Enabled = True + Else + cmdPrintPOPay.Enabled = False + End If + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + End Select + + Call CBFindString1(cboPOType, txtPOType) + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!qty) + txtLOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboLOMType, strTYPE) + + If !calc_flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOQty = Field2Str(!qty) + txtPOPrice = Format(Field2Str2(!price), "#,#.00") + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If IsNull(txtModel) Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + ElseIf Trim$(txtModel) = "" Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + End If + +' If mboolAdding Then +' moRS.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled +' cmdAddLot.Enabled = Not cmdAddLot.Enabled + cmdDelLot.Enabled = Not cmdDelLot.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSaveLotInfo.Enabled Then + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String +Dim strSQLB As String, oRSB As Recordset + + On Error GoTo Error_EH + + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount > 0 Then + txtYardMemo = Field2Str(moRSMemo!notes) + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = "" + moRSMemo.Update + txtYardMemo = "" + End If + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + + mstrTexture = moRS!texture + If moRS!HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If + mboolSTONE3 = False + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + mstrPLNELEV = Field2Str(moRS!model) + If moRS!Split Then + mboolSPLIT = False '*** Changed from True to False 7/21/2017 because no longer processing Split Qty + Else + mboolSPLIT = False + End If + strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!PROJ_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSB = New Recordset + oRSB.Open strSQLB, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSB.EOF Then + If IsNull(oRSB!st_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False + End If + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub PlanFind() +Dim oRS As Recordset +Dim strSQL As String, strPlan As String, strTEST As String + On Error GoTo Open_EH + mintOpenPR = 0 + +' strSQL = "SELECT * " + strSQL = "SELECT est_id, verified, update, OpenPR " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If Not moRSPlan.EOF Then + mintOpenPR = Field2Integer(moRSPlan!openpr) + mboolVERIFIED = moRSPlan!verified + gintESTID = moRSPlan!est_id + If moRSProj!FHA Then + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" + Else + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" + End If + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + If oRS.EOF Then + mintTake138 = 0 + Else + moRS!jmb138 = oRS!qty +' mintTake138 = oRS!qty + End If + oRS.Close + Else + MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" + mboolCRITICAL = True + End If + Exit Sub + +Open_EH: + gstrMODULE = "Form LotInfo - Module PlanFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindPOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOpt2() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT notes, optid, desc " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) + + Set moRSPOpt2 = New Recordset + + moRSPOpt2.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt2.EOF Then + FormFindPOpt2 = False + Else + FormFindPOpt2 = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) + + If moRSPO.State = adStateOpen Then + + moRSPO.Close + End If + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindLOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + Set moRSLOpt = New Recordset + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!Opt_ID + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindLOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = '" & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) & "'" + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + If moRSPOMAT.State = adStateOpen Then + moRSPOMAT.Close + End If + + moRSPOMAT.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstLMaterial.col = 4 + strINVNO = lstLMaterial.ColText + + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' intTest = moRSMat.RecordCount + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub cmdExit_Click() + + Unload Me +End Sub +Private Sub FieldsSave() +Dim strLOT As String, strTYPE As String, int1383 As Integer +Dim dblOPEN As Double, intDELETE As Integer + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS!startdate = Str2Field(mstrSTARTDATE) + End If + + If mboolPLNCHANGE Then + moRS!startdate = Str2Field(mstrSTARTDATE) + mboolPLNCHANGE = False + End If + +'***COMMENTING THIS OUT BECAUSE I DO NOT THINK IT NEEDS IT - Messes up the labor calcuations +'****** If there are problems remove the single comments +' If Field2Integer(moRS!sq_yd) > 1 Then +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) +' If moRSProj!use_open Then +' If Field2Integer(moRS!sq_yd) > 500 Then +'' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 +' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - intDELETE +' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE +' Else +'' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 15 'Change per Jesse 08/22/05 +''' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +' End If +' Else +' If Field2Integer(moRS!sq_yd) > 500 Then +'' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +'' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 +' moRS!l_yds = Field2Integer(moRS!sq_yd) - intDELETE +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE +' Else +'' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 +' moRS!l_yds = Field2Integer(moRS!sq_yd) - 10 +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 15 +'' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +'' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +' End If +' End If +' End If + + With moRS + If mboolHLNotes Then + !HLNotes = vbChecked + Else + !HLNotes = vbUnchecked + End If + !zone = Integer2Field(moRSProj!zone) + !sq_yd = Integer2Field(txtTtlYdge) + !address = Str2Field(txtAddress) + !Owner = Str2Field(txtOwner) + !model = Str2Field(txtModel) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtNotes) + !supernotes = Str2Field(txtSuperNotes) + !lotnotes = Str2Field(txtLotNotes) + !st_adj = mintST_ADJ +' !f_adj = Integer2Field(txtFoamAdj) +' !l_adj = Integer2Field(txtLaborAdj) + !f_adj = Field2Str2(mstrFoamAdj) + !l_adj = Field2Str2(mstrLaborAdj) + !w_adj = Field2Str2(mstrWireAdj) + !fin2 = Integer2Field(txtFin2) + !lot_no = Str2Field(txtLotNo) + !foam = Field2Str2(txt28Foam) +' !foam = Integer2Field(txt28Foam) + !lorder = Date2Field(txtLathO) + !SUP_BB = Integer2Field(txtSuperBB) + !SUP_FD12 = Integer2Field(txtSuper12) + !SUP_783 = Integer2Field(txtSuper783) + !SUP_78 = Integer2Field(txtSuper78) + !SUP_38 = Integer2Field(txtSuper38) + int1383 = Integer2Field(txtSuper1383) + If int1383 < 0 Then + !SUP_138 = 0 + Else + !SUP_138 = Integer2Field(txtSuper1383) + End If + !SUP_RL = Integer2Field(txtSuperRL) + !SUP_ML = Integer2Field(txtSuperML) + !SUP_DW = Integer2Field(txtSuperDW) + !SUP_SP = Integer2Field(txtSuperSP) + !opening = Integer2Field(txtOPEN) + !openpr = mintOpenPR + !sand_ton = Integer2Field(txtSand) + !SORDER = Str2Field(txtTextureO) + !Border = Str2Field(txtSandO) + !TORDER = Str2Field(txtScratchO) + !forder = Str2Field(txtBrownO) + !VOrder = Str2Field(txtLathBill) + !st_bill = Integer2Field(txtStoneBill) + !jobcost = Str2Field(txtJC) + !hold_stucco = chkHoldOrders + !hold_po = chkHoldPO + !PNT_FLG = chkPaint + !LUUser = gstrLOGIN + !Update = Date '*** This is just using the current date for updating + !Firsttime = chkFirst + !syn_flag = chkSynthetic + !stone = chkStone + !otstone = chkOthers +' !ST_SQFT = Integer2Field(txtStone) + + Call FindTexture(txtFinish, strTYPE) + !texture = strTYPE + + End With + moRS.Update + + If mboolAdding Then + Call GetLotID + Call PlanMatLoad + Call POptLoad + Call JCSetup + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If + mboolAdding = False + End If + moRSMemo!notes = Field2Str(txtYardMemo) + moRSMemo.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") + If Len(strLOT) > 0 Then + moRS!lot_no = Field2Str(strLOT) + txtLotNo = Field2Str(strLOT) + txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") + moRS!jobcost = Field2Str(txtJC) + moRS.Update + End If + Resume Next + End If + gstrMODULE = "Form LotInfo - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetLotID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintLOTID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPlanInfo() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + mboolPLANUP = False + + strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrPLANUP = Field2Str(oRS!Update) +' mboolVERIFIED = oRS!verified + If mstrPLANUP > Field2Str(moRS!import) Then + mboolPLANUP = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetPlanInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POSave() +Dim strSQL As String, strMAX As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset ', oRSI As Recordset +Dim bytPOType As Byte + + On Error GoTo Error_EH + If optLath Then + bytPOType = 1 + ElseIf optStucco Then + bytPOType = 2 + ElseIf optSand Then + bytPOType = 3 + ElseIf optPreOrder Then + bytPOType = 4 + ElseIf optStone Then + bytPOType = 5 + Else + bytPOType = 6 + End If + + If moRSPO.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRS.EOF Then + + End If + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Opt_Type = bytPOType + !Date = Str2Field(txtPODate) + !User = gstrLOGIN + !Up_User = gstrLOGIN + !Update = Date + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + oRS.Update + + strMAX = FindMax("tblPOrder", "PONum") + glngPO_NUM = Val(strMAX) + + strSQLL = "" + oRS.Close + Call POLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPO.AddNew + moRSPO!User = gstrLOGIN + End If + + With moRSPO + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !Opt_Type = bytPOType + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Update = Date + !Up_User = gstrLOGIN + !Date = Str2Field(txtPODate) + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + moRSPO.Update + + strMAX = FindMax("tblPOrder", "PONum") + glngPO_NUM = Val(strMAX) + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPO.ActiveConnection) + Exit Sub +End Sub + +Private Sub POMatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSPOMAT.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) +' !price = Str2Field(txtPOPrice) + + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + oRS.Update + + oRS.Close + Call OptMatLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPOMAT.AddNew + End If + + With moRSPOMAT + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + moRSPOMAT.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPOMAT.ActiveConnection) + Exit Sub + + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + Exit Sub + End If + + + With moRSMat + + If mboolAdding Then + .AddNew + !Lot_ID = gintLOTID + End If + !inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !qty = Str2Field(txtLMQty.Text) + !calc_amt = Integer2Field(txtLMLength.Text) + !o_qty = Integer2Field(txtLMBalance.Text) + !ch_flag = chkChange + !m_type = Left$(cboLMType.Text, 1) + + If cboLMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + .Update + End With + mintINVNO = Field2Str(txtLMInvNo) + moRSMat.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + moRSMemo.Close + txtLotNotes = "" + txtYardMemo = "" + txtSuperNotes = "" + txtTtlYdge = 0 + txtAddress = "" + txtOwner = "" + txtModel = "" + txtCMUYdge = 0 + chkFirst = vbUnchecked + txtNotes = "" + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + mboolPAINT = False + lblFoamAdj.Caption = "Form Adj. Yardage: " + lblLaborAdj.Caption = "Labor Adj. Yardage: " + lblWireAdj.Caption = "Wire Adj. Yardage: " + lblPaintSqFt.Caption = "Paint Square Ft.: " + lblStoneSqFt.Caption = "Stone Square Ft.: " + txtFin2 = 0 + txtLotNo = "" + txt28Foam = 0 + txtLathO = "12/31/2030" + txtMetal = 0 + txtOPEN = 0 + txtSuperBB = 0 + txtSuper12 = 0 + txtSuper783 = 0 + txtSuper78 = 0 + txtSuper38 = 0 + txtSuper1383 = 0 + txtSuperRL = 0 + txtSuperML = 0 + txtSuperDW = 0 + txtSuperSP = 0 +' txtLathO = "" + txtSandO = "" + txtScratchO = "" + txtBrownO = "" + txtTextureO = "" + txtLathBill = "" + txtStoneBill = 0 + txtFinish.Text = "" + txtTake138 = 0 + txtOneKote.Text = "" + lstLath.Clear + lstYard.Clear + lstPreOrder.Clear + lstLMaterial.Clear + lstInventory.Clear + lstPOptions.Clear + lstLOptions.Clear + lstOptMatrl.Clear + lstPO.Clear + lstPOMaterial.Clear + lstBrown.Clear + lstScratch.Clear + lstTexture.Clear + txtLOYdge = 0 + txtLODesc = "" + txtLOFin2 = 0 + txtLOFoam = 0 + txtLOMInvNo = 0 + txtLOMDesc = "" + txtLOMQty = "" + txtSand = 0 + txtLOMLength = 0 + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + gintOPTID = 0 +' txtLODate.Enabled = False + chkHoldOrders = vbUnchecked + chkHoldOrders.Enabled = True + chkHoldPO = vbUnchecked + chkHoldPO.Enabled = True + chkPaint = vbUnchecked + chkSynthetic = vbUnchecked + chkSynthetic.Enabled = True + chkStone = vbUnchecked + chkOthers = vbUnchecked + chkNoPay = vbUnchecked + chkStone.Enabled = True + lblFirst.Visible = False + lblSZone = "" + lblSandShip = "" + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = Field2Str(oRS("inv_no")) + + If mboolAdding Then +' intINVNO = Field2Integer(txtPOInvNo) + If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then + mintBOOKMARK = .ListIndex + End If + End If + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, intCOUNT As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + intCOUNT = oRS.RecordCount + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + intCOUNT = oRSS.RecordCount + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str2(oRS!qty) +' oRSS!price = 0 + oRSS!price = Field2Str2(oRS!price) + oRSS.Update + If moRSProj!FHA Then + If Field2Str(oRS!inv_no) = "1570" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + Else + If Field2Str(oRS!inv_no) = "1130" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If +' Resume Next + +End Sub +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String, strSELECT As String +Dim strLine As String + + On Error GoTo Error_EH + If lstLOptions.ListIndex = -1 Then + lstOptMatrl.ListIndex = -1 + Exit Sub + End If + strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + lstOptMatrl.ListIndex = -1 + End If + Exit Sub + +Error_EH: + If Err = 381 Then + strSELECT = 0 + cmdOptDel.Enabled = False + Resume Next + End If + +End Sub +Private Sub POptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + + .AddItem oRS!ponum + .ItemData(.NewIndex) = oRS!ponum + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPO.ListCount Then + lstPO.ListIndex = 0 + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LOptLoad() +Dim oRS As Recordset +Dim strSQL As String, intLoop As Integer, intPos As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!Opt_ID + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Else + lstLOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LOptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboLMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_DblClick() + mboolAdding = False + cmdAddMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdDelMatrl.Enabled = True +End Sub + +Private Sub lstLookup_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstLOOKUP.col = 0 + strINVNO = lstLOOKUP.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = " & lstLOOKUP.ItemData(lstLOOKUP.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLookup_dblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_Click() + On Error GoTo Error_EH + + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "0" + txtLODesc = "" + txtLOFin2 = "0" + txtLOFoam = "0" + txtLOTexture = "" + End If + If FormFindLOpt() Then +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + + End If + Else + cmdOptDel.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptDel.Enabled = True + cmdOptAdd.Enabled = False + End If + +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_Click() + On Error GoTo Error_EH + + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" +' cboLMDFlag.Text = "" +' cboLMType.Text = "" + cboLMMetal.ListIndex = -1 + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + txtLMBalance = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + End If +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_Click() + On Error GoTo Error_EH + + If lstPO.ListIndex <> -1 Then + If FormFindPO() Then + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + Else + lstPO.Clear + txtPONum = "0" + txtPODesc = "" + txtIssueTo = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OrderLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strSELECT As String + On Error Resume Next + + mboolNOTSUPPLIER = True + mboolNOPREORDER = True + mboolNOPRECAST = True + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'S' and M_Type = 'P'" + + oRS.Filter = strSELECT + lstPreOrder.Clear + lstPreOrder.Redraw = True + + Do Until oRS.EOF + With lstPreOrder + mboolNOTSUPPLIER = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "D_Flag = 'Y' and M_Type = 'P'" + oRS.Filter = strSELECT + If oRS.EOF Then + End If + + Do Until oRS.EOF + With lstPreOrder + mboolNOPREORDER = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "M_Type = 'Z'" + oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + mboolNOPRECAST = False + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSELECT + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSELECT + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSELECT + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSELECT + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSELECT + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPlans_DblClick() + txtModel = lstPlans.List(lstPlans.ListIndex) + lstPlans.Visible = False + lblPlan.Visible = False + Call cmdFindPlan_Click +End Sub + +Private Sub lstPOMaterial_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + End If +End Sub + +Private Sub lstPOptions_Click() + On Error GoTo Error_EH + + If lstPOptions.ListIndex <> -1 Then + If FormFindPOpt2() Then + Call FormShowPOpt + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + txtLMBalance = "0" + chkChange = vbUnchecked + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +End Sub + +Private Sub POClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPONotes = "" + txtIssueTo = "" + txtPONum = "0" + txtPODesc = "" + txtPODate = "" + txtPay = 0 + txtPayType = "" + lstLOOKUP.Clear + lstPOMaterial.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cboPOType.ListIndex = -1 + +End Sub + +Private Sub POMatClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPOPrice = "0.00" + lstLOOKUP.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cmdFindPOMat.Visible = True + +End Sub + +Private Sub lstPOptions_DblClick() + If mboolDNU Then + MsgBox "A DNU Option Cannot Be Used - Select Another Option", vbOKOnly, "Select Again" + Exit Sub + Else + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + lstPOptions.Enabled = False + cmdOptAdd.Enabled = True + cmdOptDel.Enabled = False + End If + End If + +End Sub + +Private Sub SSTLotInfo_GotFocus() + If SSTLotInfo.Tab = 1 Then + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + End If + If SSTLotInfo.Tab = 6 Then + If chkHoldPO Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdAddPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + txtPONum.Enabled = False + txtPODate.Enabled = False + txtIssueTo.Enabled = False + txtPODesc.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + txtPOPrice.Enabled = False + cmdPrintPOPay.Enabled = False + cmdFindPOMat.Enabled = False + lstLOOKUP.Visible = False + Else +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = True + End If + End If + End If +End Sub + +Private Sub txt28Foam_GotFocus() + Call FieldSelect(txt28Foam) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtIssueTo_GotFocus() + Call FieldSelect(txtIssueTo) +End Sub + +Private Sub txtIssueTo_LostFocus() + txtIssueTo = UCase(txtIssueTo) +End Sub + +Private Sub txtJC_GotFocus() + Call FieldSelect(txtJC) +End Sub + +Private Sub txtJC_LostFocus() + txtJC = UCase(txtJC) +End Sub + +Private Sub txtLMDesc_LostFocus() + txtLMDesc = UCase(txtLMDesc) +End Sub + +Private Sub txtLMInvNo_GotFocus() + Call FieldSelect(txtLMInvNo) +End Sub + +Private Sub txtLMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If + mstrENDQTY = txtLMQty +End Sub + +Private Sub txtLOMQty_GotFocus() + mdblQTY = Field2Str2(txtLOMQty) +End Sub + +Private Sub txtLOMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLOMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLotNotes_GotFocus() + txtLotNotes.SelStart = 1000 +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtModel_LostFocus() + txtModel = UCase(txtModel) +End Sub + +Private Sub txtPay_GotFocus() + Call FieldSelect(txtPay) +End Sub + +Private Sub txtPayType_GotFocus() + Call FieldSelect(txtPayType) +End Sub + +Private Sub txtPayType_LostFocus() + txtPayType = UCase(txtPayType) + If txtPayType = "D" Or txtPayType = "R" Then + lblPayYds.Caption = "Pay Dollars:" + Else + lblPayYds.Caption = "Pay Yards:" + End If +End Sub + +Private Sub txtPODate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtPODate, "/", 1) + If Not IsDate(txtPODate) Then + If lngPOS = 0 Then + If Len(txtPODate) > 0 Then + txtPODate = Format(txtPODate, "00/00/####") + If Not IsDate(txtPODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtPODate.SetFocus + End If + End If +End Sub + +Private Sub txtPOPrice_GotFocus() + Call FieldSelect(txtPOPrice) +End Sub + +Private Sub txtPOPrice_LostFocus() + txtPOPrice = Format(txtPOPrice, "#,#.00") +End Sub + +Private Sub txtPOQty_LostFocus() + If mdblQTY <> Field2Str2(txtPOQty) Then + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If + End If + +End Sub + +Private Sub txtLMDesc_GotFocus() + Call FieldSelect(txtLMDesc) +End Sub + +Private Sub txtLMLength_GotFocus() + Call FieldSelect(txtLMLength) +End Sub + +Private Sub txtLMQty_GotFocus() + mdblQTY = Field2Str2(txtLMQty) + mstrBEGQTY = Field2Str(txtLMQty) + Call FieldSelect(txtLMQty) +End Sub + +Private Sub txtLotNo_LostFocus() + txtLotNo = UCase(txtLotNo) + Call GETJC +' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") +End Sub +Private Sub GETJC() +Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + intJC = Field2Integer(oRS!nextjc) + txtALPHA = Field2Str(oRS!jcalpha) + txtJC = txtALPHA & Format(Field2Str(intJC), "000000") + intJC = intJC + 1 + + If intJC > 999999 Then + intJC = 1 + intASCII = Asc(txtALPHA) + intASCII = intASCII + 1 + txtALPHA = Chr(intASCII) + oRS!jcalpha = Field2Str(txtALPHA) + End If + + oRS!nextjc = intJC + oRS.Update + +End Sub +Private Sub txtModel_GotFocus() + Call FieldSelect(txtModel) +End Sub + +Private Sub txtOwner_GotFocus() + Call FieldSelect(txtOwner) +End Sub + +Private Sub txtOwner_LostFocus() + txtOwner.Text = UCase(txtOwner.Text) +End Sub +Private Sub txtAddress_LostFocus() + txtAddress.Text = UCase(txtAddress.Text) +End Sub +Private Sub txtAddress_GotFocus() + Call FieldSelect(txtAddress) +End Sub +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub txtPODate_GotFocus() + Call FieldSelect(txtPODate) +End Sub + +Private Sub txtPODesc_GotFocus() + Call FieldSelect(txtPODesc) +End Sub + +Private Sub txtPODesc_LostFocus() + txtPODesc = UCase(txtPODesc) +End Sub + +Private Sub txtPOInvNo_GotFocus() + Call FieldSelect(txtPOInvNo) +End Sub + +Private Sub txtPOMatDesc_GotFocus() + Call FieldSelect(txtPOMatDesc) +End Sub + +Private Sub txtPOMatDesc_LostFocus() + txtPOMatDesc = UCase(txtPOMatDesc) +End Sub + +Private Sub txtPONotes_GotFocus() + Call FieldSelect(txtPONotes) +End Sub + +Private Sub txtPONotes_LostFocus() + txtPONotes = UCase(txtPONotes) +End Sub + +Private Sub txtPOQty_GotFocus() + mdblQTY = Field2Str2(txtPOQty) + Call FieldSelect(txtPOQty) +End Sub + +Private Sub txtSuper12_GotFocus() + Call FieldSelect(txtSuper12) +End Sub + +Private Sub txtSuper12_LostFocus() + txtSuper12 = Integer2Field(txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub txtSuper1383_LostFocus() +Dim intResponse As Integer + txtSuper1383 = Integer2Field(txtSuper1383) + If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then + intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") + If intResponse = vbYes Then + Exit Sub + Else + txtSuper1383.SetFocus + End If + End If +End Sub + +Private Sub txtSuper38_GotFocus() + Call FieldSelect(txtSuper38) +End Sub + +Private Sub txtSuper78_GotFocus() + Call FieldSelect(txtSuper78) +End Sub + +Private Sub txtSuper1383_GotFocus() + Call FieldSelect(txtSuper1383) +End Sub + +Private Sub txtSuper783_GotFocus() + Call FieldSelect(txtSuper783) +End Sub + +Private Sub txtSuper783_LostFocus() + txtSuper783 = Integer2Field(txtSuper783) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper78_LostFocus() + txtSuper78 = Integer2Field(txtSuper78) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper38_LostFocus() + txtSuper38 = Integer2Field(txtSuper38) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuperBB_GotFocus() + If mboolCOMM Then + Call FieldSelect(txtSuperBB) + End If +End Sub + +Private Sub txtSuperBB_LostFocus() + If mboolCOMM Then + txtSuperBB = Integer2Field(txtSuperBB) + End If +End Sub + +Private Sub txtSuperDW_GotFocus() + Call FieldSelect(txtSuperDW) +End Sub + +Private Sub txtSuperDW_LostFocus() + txtSuperDW = Integer2Field(txtSuperDW) +End Sub + +Private Sub txtSuperML_GotFocus() + Call FieldSelect(txtSuperML) +End Sub + +Private Sub txtSuperML_LostFocus() + txtSuperML = Integer2Field(txtSuperML) +End Sub + +Private Sub txtSuperNotes_GotFocus() + Call FieldSelect(txtSuperNotes) +End Sub + +Private Sub txtSuperNotes_LostFocus() + txtSuperNotes.Text = UCase(txtSuperNotes.Text) +End Sub + +'Private Sub txtSuperRL_GotFocus() +' Call FieldSelect(txtSuperRL) +'End Sub + +'Private Sub txtSuperRL_LostFocus() +' txtSuperRL = Integer2Field(txtSuperRL) +'End Sub + +Private Sub txtSuperSP_GotFocus() + Call FieldSelect(txtSuperSP) +End Sub + +Private Sub MatCalcOne() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double, dblDW2 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double, dblPYRO As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, intCaulkQty As Integer +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblCMNT2 As Double +Dim dblML2 As Double, dblRL2 As Double, dblMLC As Double, dblL_ADJ As Double, dblS_ADJ As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double, dblRL3 As Double +Dim oRS As Recordset +Dim intMATOpen As Integer, dblMATYDS As Double, dblMOPEN As Double + + On Error GoTo Error_EH + + dblL_ADJ = Field2Str2(moRS!l_adj) + dblS_ADJ = Field2Str2(moRS!l_adj) + + + mboolBAG100 = False +' mboolSilica = False + mboolBADD = False + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If moRSProj!BagSand Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Integer(moRSProj!bagdollars) + Else + mboolBAG100 = False + End If + + intOpenPR = Field2Integer(moRS!openpr) +' If intOpenPR > 100 Then 'Changed to 90% per Jesse 07/09/2018 + If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 +' If intOpenPR > 75 Then + + Else + intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 + intMATOpen = 40 - intOpenPR ' 02/08/2020 This is a new variable to take only 40% if openings for material yardage +' intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage +' intUSEOpen = 75 - intOpenPR +' intUSEOpen = 100 - intOpenPR + End If + + dblOPEN = (Field2Double(moRS!opening) * intUSEOpen) + dblOPEN = (dblOPEN / 100) ' + 0.99) + dblOPEN = Int(dblOPEN + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) + dblMOPEN = Int(((Field2Double(moRS!opening) * intMATOpen) / 100) + 0.99) +' dblOPEN = 0 +'' Removed per Jesse 02/11/2020 If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 -- Changed back to 500 on 7/9/2018 +' If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 -- Changed back to 500 on 7/9/2018 +' If Field2Integer(moRS!sq_yd) > 400 Then +'' boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN ' + Field2Integer(moRS!opening) + dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) +'' Else +'' boolDEDUCT = False +'' dblNEWYDS = Field2Integer(moRS!sq_yd) +'' dblMATYDS = Field2Integer(moRS!sq_yd) '- dblMOPEN '10/04/2018 changed by Jesse to give more material +'' End If + dblPYRO = 1 + +'' If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings +'' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) +' dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +'' Else +'' dblOPEN = Int((Field2Double(moRS!opening)) + 0.99) +'' End If + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 +''' REMOVE 02/11/2020 PER JESSE If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 'Stop Taking This Per Jesse 7/9/2018 +''' intDELETE = 0 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE + dblL_ADJ 'Changed 7/9/18 per Jesse +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 + dblL_ADJ +''' moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 + dblS_ADJ 'Changed 12/11/17 per Jesse +''' Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 7/9/18 +''' moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 7/9/18 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 + dblL_ADJ 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 + dblS_ADJ 'Change per Jesse 10/13/12 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 04/12/18 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 + dblS_ADJ 'Change per Jesse 04/12/18 +''' End If +''' Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' intDELETE = 0 +''' moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblL_ADJ +''' moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblS_ADJ +''' Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 10/13/12 +''' End If +''' End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + 'Setup Drywall For Black Paper Calculations + strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!Lot_ID) & " AND Inv_No = '4034'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) +' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) + End If + oRS.Close + + strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!Lot_ID) & " AND Inv_No = '4035'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) +' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) + End If + oRS.Close + +'******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + dblMLC = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblMLC = Field2Integer(moRSCMat!qty) + dblMLC = Int((dblMLC * 1.77) + 0.99) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + dblMLC = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + dblMLC = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 And dblML = 0 Then +' If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + +' If Not dblML > 0 Then +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1375'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblML = 0 +' Else +' dblML = Field2Integer(moRSCMat!qty) +' End If +' End If +' If Not dblML > 0 Then +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1371'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblML = 0 +' Else +' dblML = Field2Integer(moRSCMat!qty) +' End If +' End If +' If txtSuperML > 5 Then' +' dblML = Field2Integer(txtSuperML) +' End If + +' If txtSuperRL = -2 Then ' Takeoff RL to always be used per Jesse on 5/14/18 + ' also make sure that foam and wire is adjusted + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If + +' Else +' If txtSuperRL = -1 Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > 0 Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +' moRSCMat!qty = Field2Str(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +' moRSCMat!qty = Field2Str(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If +' Else +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' dblRL = 0 +' Else +' dblRL = Field2Integer(moRSCMat!qty) +' End If +' End If +' End If + +'**** Black Board/R-Guard Calcuations + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then +' txtSuperBB = Field2Str2(moRSCMat!Qty) + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then +' txtSuperBB = Field2Str2(moRSCMat!Qty) + moRSCMat.Delete + End If + + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbUnchecked +' moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) +' End If + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + + '*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once + dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblMATYDS < 325 Then +' If dblNEWYDS < 325 Then '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + If moRSProj!bb Then + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + End If + Else + If moRSProj!bb Then + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house +' If dblNEWYDS > 325 Then + If dblMATYDS > 325 Then '02/11/2020 correct to take advantage of Adjustments for openings per JESSE +' dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + Else +' dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation +' dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + dblBP = Int(((CDbl(dblMATYDS)) / 100) + 0.99) '02/11/2020 correct to take advantage of Adjustments for openings per JESSE + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If +'********************FINISH DEALING WITH BP TYPE BR*********** +' If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland +' dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) +' End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 16)) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) ' Changed 10/12/15 per Jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = 1817 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = 1817" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockPessimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(mstrWireAdj) +' If dblRL > 5 Then 'CHanged 1/9/2018 per Jesse - Remove all RL from Wire Calculation + dblARL = Int(((dblRL) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + + If CDbl(dblMATYDS) < 350 Then +' dblCALC = Int((((CDbl(dblMATYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) + dblCALC = Int((((CDbl(dblMATYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int((((CDbl(dblNEWYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'CHANGED on 2/11/2020 per Jesse +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'Changed per jesse 11/14/19 +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'Changed per jesse 11/14/19 +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) + Else +' dblCALC = Int((((CDbl(dblMATYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) + dblCALC = Int(((CDbl(dblMATYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'CHANGED on 2/11/2020 per Jesse +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 700) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 700) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + moRSCMat.Update + oRC.Close + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '9000' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '9000'" 'Green Floats + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) +' moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblMATYDS) / 150) + 0.99) +' oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) ' CHanged on 2/11/2020 to use dblMATYDS + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 8) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Magnawall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This calculates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + '**** takes extra yardage from dblNEWYDS for Cement/Lime/Silica Sand + dblBatch = Int((((Field2Integer(dblMATYDS))) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10)) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + dblCMNT2 = dblCMNT + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 And Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + Else + oRC!qty = dblCMNT + oRC.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + Else + oRC!qty = dblLime + oRC.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + Else + oRC!qty = dblS16 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + Else + oRC!qty = dblS16 + oRC.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRC!qty = dblS20 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRC!qty = dblS20 + oRC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + Else + oRC!qty = dblS30 + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + Else + oRC!qty = dblS30 + oRC.Update + End If + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + Else + oRC!qty = dblSYNP + oRC.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + Else + oRC!qty = dblSYN + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + oRC.Update + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + If mboolBAG100 Then + dblBAGSAND = Int(((dblCMNT2 + dblKote1) * dblCalcBAGSAND) + 0.99) + End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + +'Calculate Foam +' If txt28Foam = -2 Then + If mboolCOMM Then + txt28Foam = 0 + Else + +' If txt28Foam = 0 Then + txt28Foam = 25 + End If + + If dblRL < 5 Then + dblRL3 = 5 + Else + dblRL3 = dblRL + End If + +' If Field2Integer(dblNEWYDS) < 325 Then + If Field2Integer(dblMATYDS) < 325 Then +' dblFD1 = Int(((((Field2Integer(dblMATYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL3 * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + 'Changed 2/11/2020 to use MATYDS +' dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL3 * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else +' dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If txt28Foam = 0 Then + txt28Foam = -2 + End If + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If dblFD28 <> 0 Then + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + Else + oRC!qty = dblFD28 + oRC.Update + End If + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + Else + oRC!qty = dblFD48 + oRC.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + Else + oRC!qty = dblFD28 + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + Else + oRC!qty = dblFD48 + oRC.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + Else + oRC!qty = dblFD1 + oRC.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((dblFD1 / 2) + 0.99) + oRC.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = 1610" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed on 11/1/17 Per Rose - Jesse told after the fact +' If Field2Integer(dblNEWYDS) <= 550 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 550 And Field2Integer(dblNEWYDS) <= 1250 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1250 And Field2Integer(dblNEWYDS) <= 2200 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 2200 Then +' moRSCMat!qty = 4 +'CHanged on 7/12/2017 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) ''Changed on 9/19/2019 to automate the rounding to full boxes +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.99), 0) 'Changed on 11/13/2019 to 240 per Jesse +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.49), 0) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 240) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) 'Changed to make integer value 1/31/2020 + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed on 9/19/2019 to automate the rounding to full boxes +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.99), 0) 'Changed on 11/13/2019 to 240 per Jesse +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 240) + 0.49), 0) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 240) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) 'Changed to make integer Value 1/31/2020 + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else 'Changed use MATYDS 2/11/2020 + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 280) + 0.49)) 'Changed use MATYDS 2/11/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.49)) ' to make it the same as Pulte - when standardizing calculations 2/3/2020 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) Per ROse 7/12/2017 +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 2) + 0.99) + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 100) * 2) + 0.99) 'Changed to use MATYDS 2/11/2020 + moRSCMat.Update + End If + End If + + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + Call UpInvoice + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcThree() +Dim dblRL As Double, dblDW As Double, dblSP As Double +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String +Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer +Dim strFIN2 As String, strFIN1 As String, dblWire As Double, intUSEOpen As Integer +Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double, intOpenPR As Integer + + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE = "O" Then + MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + + intOpenPR = Field2Integer(moRS!openpr) + If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 + + Else + intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 +' intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage + End If + + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) ' changed to match one kote 10/12/2018 + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 + moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) ' - 24 'Changed per Jesse 10/12/2018 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 +' intDELETE = 19 ' changed to zero per Jesse 7/13/18 + intDELETE = 0 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) 'Change per Jesse 08/01/18 + End If + Else + moRS!s_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 5 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 +' intDELETE = 19 ' changed to zero per Jesse 7/13/18 + intDELETE = 0 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + Else + moRS!l_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 +' moRS!l_yds = Field2Integer(dblNEWYDS) - 5 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + +'Black Board + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'Stucco Wire + 'Paperback wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(mstrWireAdj) + If txtSuperSP > 0 Then + dblSP = Field2Str(txtSuperSP) + Else + dblSP = 0 + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + If dblRL > 10 Then + dblARL = Int(((dblRL - 10) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If +' dblCALC = Int(((CDbl(dblMATYDS) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.49) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) ' Changed per Jesse 12/11/17 + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + + 'Self Furing wire + If mstrWIRE = "F" Then +' If dblSP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) +' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) +' dblCALC = Int(((CDbl(dblMATYDS) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.49) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) 'CHanged per Jesse 12/11/17 + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + +'Black Paper + If txtSuperSP > 0 Then + dblSP = CDbl(txtSuperSP) + Else + dblSP = 0 + End If + +' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) +' End If +' End If + +' If dblSP > 0 Then + If moRSProj!bp_type = "B6" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) + dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) + End If + ElseIf moRSProj!bp_type = "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) + dblBP = dblBP + (((dblSP * 3.5) / 16)) +' dblBP = dblBP + (((dblSP * 3.5) / 16) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) + End If + ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) + dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strGET = "SELECT * FROM tblTCInfo" + Set oRST = New Recordset + oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + +'Scratch Coat + dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) + dblSCmnt = (dblBatch * oRST!scr_cmnt) + dblSLime = (dblBatch * oRST!scr_lime) + dblRS = (dblBatch * oRST!scr_rs) + +'Brown Coat + dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) + dblCMNT = (dblBatch * oRST!brn_cmnt) + dblLime = (dblBatch * oRST!brn_lime) + dblRS = dblRS + (dblBatch * oRST!brn_rs) + +'Texture Coat + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str(oRSC!id) = "SB" Then + dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) + +' dblSYN = Int(dblBatch + 0.5) + End If + + If Field2Integer(oRSC!cmnt) > 0 Then + dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblTCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) +' Else +' dblRS = 0 + End If + +'This calculates the additional materials needed for the second texture + If moRS!fin2 > 0 Then + + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + ' Else + ' dblTCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) +' Else +' dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) +' Else +' dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) +' Else +' dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) +' Else +' dblS30 = 0 + End If + End If + + dblRS = Int((dblRS / 2000) + 0.99) + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblSYN / 10) + 0.5) + moRSCMat.Update + End If + End If + + If moRSProj!plcmnt Then 'Calculate Plastic Cement + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2415' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2415'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + + Else + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblSLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSLime + moRSCMat.Update + End If + End If + + If dblTLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + +'Calculate 4d Nails + + strSELECT = "inv_no = 1616" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) + moRSCMat.Update + End If + End If + +'Calculate Staples + + strSELECT = "inv_no = 1705" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 400 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then + moRSCMat!qty = 4 + ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then + moRSCMat!qty = 5 + ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then + moRSCMat!qty = 6 + ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 7 + ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then + moRSCMat!qty = 8 + ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then + moRSCMat!qty = 9 + ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then + moRSCMat!qty = 10 + End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ConvertSuper() +Dim strGET As String, strSQL As String +Dim oRSC As Recordset + On Error GoTo Error_EH + + If txtSuper78 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + End If + End If + + If txtSuper38 <> 0 Then + strSQL = "inv_no = 1150" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + End If + End If + + If txtSuper783 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = 1145" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = 1565" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + Else + strSQL = "inv_no = 1140" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + End If + + If txtSuperML <> 0 Then + strSQL = "inv_no = 1370" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + End If + End If + + If txtSuperDW <> 0 Then + strSQL = "inv_no = 1320" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + End If + End If + +' If Field2Str2(txtSuper1383) <> 0 Then + If (txtSuper1383) <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = 1135" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module ConvertSuper" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcMetal() +Dim oRS As Recordset +Dim strSQL As String, dblMETAL As Double + On Error GoTo Error_EH + + moRS!METAL = 0 + + strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!summetal) + moRS!METAL = dblMETAL + moRS!calcdate = Now +' moRS!calcdate = Date + moRS.Update + txtMetal = dblMETAL + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module CalcMetal" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSuperSP_LostFocus() + txtSuperSP = Integer2Field(txtSuperSP) +End Sub + +Private Sub txtYardMemo_LostFocus() + txtYardMemo = UCase(txtYardMemo) +End Sub + +Private Sub PrintLathInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, intNMonth As Integer +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim intDUE1 As Integer, intDUE2 As Integer +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + +' If moRSProj!Wrap Then +' mboolWRAP = True +' Else +' mboolWRAP = False +' End If + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + If Not oRS.EOF Then + + + End If + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSE.EOF Then + + If oRSE!Wrap Then + mboolWRAP = True 'Check this logic in other Print Invoice areas + Else + mboolWRAP = False + End If + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !customer_no = Field2Str(moRSProj!ar) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str2(moRS!lot_no), "000") & "L" +' mstrINV = Field2Str(moRSProj!inv) & Format(CSng(Field2Str2(moRS!lot_no)), "###") & "L" + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" + mstrINV = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intNMonth = Month(Date) + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) +' If mbool2Dates Then +' intDUE1 = Integer2Field(moRSProj!duedate) +' intDUE2 = Integer2Field(moRSProj!duedate2) +' Else +' intDUE1 = Integer2Field(moRSProj!duedate) +' End If + If intCDay > moRSProj!inv_due Then + If mbool2Dates Then +' If intCDay > intDUE1 And intCDay < intDUE2 Then + + If intCDay > intDUE1 And intNMonth = intCMonth Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + + ElseIf intCDay > intDUE2 Or intCDay < intDUE1 Then +'' ElseIf intCDay > intDUE1 And intCDay > intDUE2 Then + + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + End If '***May Be An Extra End If + Else + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear +' !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update + !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Day(moRS!lorder) +' intDay = intDay + 30 +' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2017 to try to simplify dates on invoices +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + dblBillAmt = Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !invoice_no = mstrINV + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "After Main Lath Information " + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + gstrMODULE = "After Trans ID Update Information " + + '*****Project not marked to bill options with Stucco + '*****Options will be billed with Lath + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Day(moRS!lorder) +' intDay = intDay + 30 +' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2018 to try and simplify dates +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !customer_no = Field2Str(moRSProj!ar) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + + !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!lorder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INS CREDIT " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !invoice_no = mstrINV + !header = vbUnchecked +' !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "After Main Lath Information " + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module PrintLathInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintCompleteInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double, strSQLINFO As String +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSC.EOF Then + If Field2Str(oRSC!Address2) = "" Then + strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + strADD3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + strADD4 = "" + Else + strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + If oRS.EOF Then + + End If + + + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Val(Field2Str2(moRS!forder)) +' !ship_date = Val(Field2Str2(moRS!SORDER)) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + End If + + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Val(oRSE!s_bill) + + !sales_code = Field2Str(oRSE!s_code) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + End If + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!forder) +' !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSP!Amt)) + dblBillAmt = dblBillAmt + Val(Field2Str2(oRSP!Amt)) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + oRSO.MoveNext + End If + Loop + +'********************************************************************************************************* + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + End If + +'********************************************************************************************************* + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintCompleteInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strTEST As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double ', mboolWRAP As Boolean +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String, strModELEV As String + + On Error GoTo Error_EH + +' If moRSProj!Wrap Then +' mboolWRAP = True +' Else +' mboolWRAP = False +' End If + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly +' If oRSE.EOF Then +' End If +' Else + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If +' End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +'' intCMonth = Month(moRS!SORDER) +'' intCDay = Day(moRS!SORDER) +'' intCYear = Year(moRS!SORDER) +' intCMonth = Month(moRS!forder) +' intCDay = Day(moRS!forder) +' intCYear = Year(moRS!forder) +' If intCDay > moRSProj!inv_due Then +' intCMonth = intCMonth + 1 +' If intCMonth > 12 Then +' intCMonth = intCMonth - 12 +' intCYear = intCYear + 1 +' End If +' End If + intCDay = Field2Integer(moRSProj!inv_due) ' Invoice Date + If intCDay = 0 Then + intCDay = Day(moRS!forder) + End If + + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Val(oRSE!s_bill) + + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + strModELEV = Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With +' End If + + gstrMODULE = "Before Option Setup" + + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "Before Update mlngINVID second time" + +'********************************************************************************************************** + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) + !non_tax_amt = Field2Str2(oRSE!s_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = Round((dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1), 2) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + End If +' End If +'*********************************************************************************************************** + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double, boolHEADER As Boolean, txtSALECD As String + + On Error GoTo Error_EH + + gintCOPY = 1 + boolHEADER = False + txtSALECD = "" + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' or B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + +' This has been changed to always pickup the Option Billing Info + + If Not mboolSTONE3 Then ' CHANGED 01/10/2020 +' If mboolSTONE3 Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) + ' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + !sales_code = Field2Str(oRSE!st_code) + txtSALECD = Field2Str(oRSE!st_code) + If txtSALECD <> "" Then + !header = vbChecked + boolHEADER = True + Else + !header = vbUnchecked + boolHEADER = False + End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!st_bill) + !amount = Field2Str2(oRSE!st_bill) + +' !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) +' !inv_type = "S" + !inv_type = "V" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + + If boolHEADER Then + !header = vbUnchecked + boolHEADER = False + Else + !header = vbChecked + boolHEADER = True + End If + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSO!Amt) +' !non_tax_amt = Field2Str2(oRSE!st_bill) +'' dblINVTOTAL = dblINVTOTAL + Val(oRSO!Amt) +'' dblBillAmt = Val(oRSO!Amt) +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +' dblBillAmt = Val(oRSE!st_bill) + +'' !sales_code = Field2Str(oRSO!b_code) +' !sales_code = Field2Str(oRSE!st_code) + + + ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + ' !inv_due_date = Field2Str(strDate) + ' !disc_due_date = DateAdd("d", 3, moRS!Vorder) + ' !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + ' !sales_code = Field2Str(oRSE!st_code) + +'' If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +'' !taxcode = "AZ" +'' Else +'' !taxcode = Field2Str(moRSProj!taxcode) +'' End If +'' !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +'' !price = Field2Str2(oRSO!Amt) +'' !amount = Field2Str2(oRSO!Amt) +' !price = Field2Str2(oRSE!st_bill) +' !amount = Field2Str2(oRSE!st_bill) +'' !header = vbChecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +' !po_num = 57961 +'' .Update + + '**** +'' gstrMODULE = "Before mlngINVID update" +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update + +'' End With +'' End If +'************************************************************************************************ + '********** Print Options that are stone + +'' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +'' strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID +'' Set oRSO = New Recordset +'' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +'' Do Until oRSO.EOF +'' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +'' Set oRSP = New Recordset +'' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSP.EOF Then +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_id = gintLOTID +'' !Proj_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) +'' !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) +'' !customer_no = Field2Str(moRSProj!ar) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' Else +''''' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' End If +'' gstrMODULE = "During Option Setup for ARINVOICE" +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !job_number = Field2Str(moRS!jobcost) +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSP!amt) +'' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!amt) +'' dblBillAmt = dblBillAmt + Val(oRSP!amt) +'' !sales_code = Field2Str(oRSP!b_code) +'' !Description = Field2Str(oRSP!Desc) & " - " & strModELEV +'' !Quantity = 1 +'' !price = Field2Str2(oRSP!amt) +'' !amount = Field2Str2(oRSP!amt) +'' !header = vbUnchecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update + +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If +'' oRSO.MoveNext +'' Loop +'' End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv_20200111() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' or B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + +' This has been changed to always pickup the Option Billing Info + + If Not mboolSTONE3 Then ' CHANGED 01/10/2020 +' If mboolSTONE3 Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) + ' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + !invoice_no = strTEST2 + ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + Else +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 + ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + End If + ' intCMonth = Month(moRS!VOrder) + ' intCDay = Day(moRS!VOrder) + ' intCYear = Year(moRS!VOrder) + ' If intCDay > moRSProj!inv_due Then + ' intCMonth = intCMonth + 1 + ' If intCMonth > 12 Then + ' intCMonth = intCMonth - 12 + ' intCYear = intCYear + 1 + ' End If + ' End If + ' intCDay = Field2Integer(moRSProj!inv_due) + ' If intCDay = 0 Then + ' Select Case intCMonth + ' Case 2 + ' intCDay = 28 + ' Case 1, 3, 5, 7, 8, 10, 12 + ' intCDay = 31 + ' Case 4, 6, 9, 11 + ' intCDay = 30 + ' End Select + ' End If + + ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSO!Amt) +' !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSO!Amt) + dblBillAmt = Val(oRSO!Amt) +' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +' dblBillAmt = Val(oRSE!st_bill) + + !sales_code = Field2Str(oRSO!b_code) +' !sales_code = Field2Str(oRSE!st_code) + + + ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + ' !inv_due_date = Field2Str(strDate) + ' !disc_due_date = DateAdd("d", 3, moRS!Vorder) + ' !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + ' !sales_code = Field2Str(oRSE!st_code) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSO!Amt) + !amount = Field2Str2(oRSO!Amt) +' !price = Field2Str2(oRSE!st_bill) +' !amount = Field2Str2(oRSE!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM +' !po_num = 57961 + .Update + + '**** + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + + End With + End If +'************************************************************************************************ + '********** Print Options that are stone + +'' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +'' strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID +'' Set oRSO = New Recordset +'' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +'' Do Until oRSO.EOF +'' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +'' Set oRSP = New Recordset +'' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSP.EOF Then +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_id = gintLOTID +'' !Proj_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) +'' !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) +'' !customer_no = Field2Str(moRSProj!ar) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' Else +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +'' End If +'' gstrMODULE = "During Option Setup for ARINVOICE" +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !job_number = Field2Str(moRS!jobcost) +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSP!amt) +'' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!amt) +'' dblBillAmt = dblBillAmt + Val(oRSP!amt) +'' !sales_code = Field2Str(oRSP!b_code) +'' !Description = Field2Str(oRSP!Desc) & " - " & strModELEV +'' !Quantity = 1 +'' !price = Field2Str2(oRSP!amt) +'' !amount = Field2Str2(oRSP!amt) +'' !header = vbUnchecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update + +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If +'' oRSO.MoveNext +'' Loop +'' End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then +' strSELECT = "{tblARInvoice.po_num} = '57961'" ' & gstrPONUM & "'" + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintInvxx() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'xx + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + oRS.Close + oRSS.Close + oRSC.Close + 'End of Interior Paint Invoice PI + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'yy + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "P" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" 'zz + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub JCSetup() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblJCTrans" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblJCTransM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If IsNull(moRSProj!ar) Then + MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" + Exit Sub + End If + With oRS + .AddNew + !Lot_ID = gintLOTID + !job_number = Field2Str(moRS!jobcost) + !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no + !address = Field2Str(moRS!address) + !customer_no = Field2Str(moRSProj!ar) + !retention_pct = Field2Str2(moRSProj!retention) + !setup_date = Date + !status_date = Date + .Update + End With + MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module JCSetup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POInvoice() +Dim strSELECT As String + + On Error GoTo Error_EH + + If Not mboolSTPAY Then + If moRS!st_flg Then + MsgBox "This Lot Has Already Had A Stone Invoice Printed", vbOKOnly, "Invoice Not Available" + Exit Sub + End If + End If + + gintCOPY = 1 + strSELECT = "{tblPOrder.PONum} = " & lstPO.ItemData(lstPO.ListIndex) + If gstrPONUM = "" Then + gstrPONUM = lstPO.ItemData(lstPO.ListIndex) + End If +'************************************************************************************* testing Stone Invoice + If optStone Then +' If optStucco Then + Call PrintStoneInv + Exit Sub + End If + +'************************************************************************************* + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POInvoice" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ElevLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!Folder = oRS!Folder + oRSS!FileName = oRS!FileName + oRSS!Primary = oRS!Primary + oRSS.Update + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ElevLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintIInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PI" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_IDate = Date + 21 + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_bill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_bill)) + !sales_code = Field2Str(oRSE!PNT_CODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_bill) + !amount = Field2Str2(oRSE!pnt_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PI" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + +' gstrMODULE = "Before Option Setup" + +' If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID +' Set oRSO = New Recordset +' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + +' Do Until oRSO.EOF +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +'' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) +' Set oRSP = New Recordset +' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSP.EOF Then +' With oRS +' .AddNew +' !Trans_ID = mlngINVID +' !Lot_id = gintLOTID +' !proj_id = gintPROJID +' !project = Field2Str(moRSProj!proj_desc) +' !lot_no = Field2Str(moRS!lot_no) +' !address = Field2Str(moRS!address) +' !inv_type = "S" +' !ship_date = Field2Str(moRS!forder) +'' !ship_date = Field2Str(moRS!SORDER) +' !customer_no = Field2Str(moRSProj!ar) +' !projcode = Field2Str(moRSProj!proj_code) +' !CodeDesc = Trim(Field2Str(moRSProj!proj_code)) & "-" & Trim(Field2Str(moRSProj!proj_desc)) +' !ProjLot = Trim(Field2Str(moRSProj!proj_desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then +'' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' Else +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' End If +' intCMonth = Month(moRS!forder) +' intCDay = Day(moRS!forder) +' intCYear = Year(moRS!forder) +'' intCMonth = Month(moRS!SORDER) +'' intCDay = Day(moRS!SORDER) +'' intCYear = Year(moRS!SORDER) +' If intCDay > moRSProj!inv_due Then +' intCMonth = intCMonth + 1 +' If intCMonth > 12 Then +' intCMonth = intCMonth - 12 +' intCYear = intCYear + 1 +' End If +' End If +' intCDay = Field2Integer(moRSProj!inv_due) +' If intCDay = 0 Then +' Select Case intCMonth +' Case 2 +' intCDay = 28 +' Case 1, 3, 5, 7, 8, 10, 12 +' intCDay = 31 +' Case 4, 6, 9, 11 +' intCDay = 30 +' End Select +' End If +' gstrMODULE = "During Option Setup for ARINVOICE" +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear +' !invoice_date = Field2Str(strCDate) +'' moRS!PRNT_S = Field2Str(strCDate) +'' moRS.Update +'' !invoice_date = DateAdd("d", 3, moRS!sorder) +' !disc_due_date = DateAdd("d", 3, moRS!forder) +'' !disc_due_date = DateAdd("d", 3, moRS!SORDER) +' !job_number = Field2Str(moRS!jobcost) +' intYear = Year(!invoice_date) +' intMonth = Month(!invoice_date) + 1 +' If intMonth > 12 Then +' intMonth = intMonth - 12 +' intYear = intYear + 1 +' End If +' intDay = Field2Integer(moRSProj!duedate) +'' If intDay = 0 Then +'' intDay = 1 +'' End If +' Select Case intMonth +' Case 2 +' If intDay = 0 Then +' intDay = 28 +' End If +' If intDay > 28 Then +' intDay = 28 +' End If +' Case 1, 3, 5, 7, 8, 10, 12 +' If intDay = 0 Then +' intDay = 31 +' End If +' If intDay > 31 Then +' intDay = 31 +' End If + +' Case 4, 6, 9, 11 +' If intDay = 0 Then +' intDay = 30 +' End If +' If intDay > 30 Then +' intDay = 30 +' End If +' End Select + +' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) +' !non_tax_amt = Field2Str2(oRSP!Amt) +' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) +' !sales_code = Field2Str(oRSP!b_code) +' !Description = Field2Str(oRSP!Desc) +' !Quantity = 1 +' !price = Field2Str2(oRSP!Amt) +' !amount = Field2Str2(oRSP!Amt) +' !header = vbUnchecked +' If Not oRSC.EOF Then +' !c_add1 = Field2Str(oRSC!Name) +' !c_add2 = Field2Str(oRSC!address1) +' If Field2Str(oRSC!address2) = "" Then +' !c_add3 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) +' Else +' !c_add3 = Field2Str(oRSC!address2) +' End If +' If Field2Str(oRSC!address2) = "" Then +' !c_add4 = "" +' Else +' !c_add4 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) +' End If +' Else +' !c_add1 = "" +' !c_add2 = "" +' !c_add3 = "" +' !c_add4 = "" +' End If +' !po_num = gstrPONUM +' .Update +' mlngINVID = mlngINVID + 1 +' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +' Set moRSInvINFO = New Recordset +' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +' moRSInvINFO.Update +' End With +' End If +' oRSO.MoveNext +' Loop +' End If + +' gstrMODULE = "Before Update mlngINVID second time" +' If Field2Integer(moRSProj!retention) > 0 Then +' dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") +' Else +' dblRETENTION = 0 +' End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PI' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PI' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" +' strSELECT = "{tblARInvoice.Lot_ID} = '" & gintLOTID & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintInteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintPaintEInvxx() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + If oRSE.EOF Then + + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PE" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + strCDate = DateAdd("d", 3, moRS!forder) +' strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) +' moRS!PNT_EDate = Field2Str(strCDate) + moRS!PNT_EDate = Date + 21 + moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & Format(intYear, "0000") + !inv_due_date = strDate +' !inv_due_date = DateAdd("d", 3, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_ebill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) + !sales_code = Field2Str(oRSE!PNT_ECODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_ebill) + !amount = Field2Str2(oRSE!pnt_ebill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PE" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintFInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PF" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_FDate = Date + 21 +' moRS!PNT_FDate = Field2Str(strCDate) + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_fbill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_fbill)) + !sales_code = Field2Str(oRSE!PNT_FCODE) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT FINAL - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_fbill) + !amount = Field2Str2(oRSE!pnt_fbill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PF" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + gstrMODULE = "Before Update mlngINVID second time" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PF' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PF' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PF'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PF'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintFinalInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintEInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String + + '************* Needs to be added to LOTINFO5 ********************** + + '**** Logic to print the Paint Materials PO's needs to be designed +' Exit Sub + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSE.EOF Then + + End If + + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + +' gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "PE" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + + moRS!PNT_EDate = Date + 21 +' moRS!PNT_FDate = Field2Str(strCDate) + moRS.Update + + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!pnt_ebill) + dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) + !sales_code = Field2Str(oRSE!PNT_ECODE) + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If +' If chkSynthetic Then +' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +' Else + !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) +' End If + !price = Field2Str2(oRSE!pnt_ebill) + !amount = Field2Str2(oRSE!pnt_ebill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM & "PE" + + gstrMODULE = "Before UPDATE of ARINVOICE Main Line" + .Update + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + gstrMODULE = "Before Update mlngINVID second time" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frx new file mode 100644 index 0000000..c8982c2 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frm new file mode 100644 index 0000000..429bdab --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frm @@ -0,0 +1,21278 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotInfo5 + BorderStyle = 1 'Fixed Single + Caption = "Lot Information - Pre-Mix / Typar Lots" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + TabIndex = 13 + Top = 780 + Width = 600 + End + Begin VB.TextBox txtStoneBill + Alignment = 1 'Right Justify + Height = 330 + Left = 8640 + TabIndex = 227 + TabStop = 0 'False + Top = 420 + Visible = 0 'False + Width = 540 + End + Begin VB.CheckBox chkFirst + Caption = "First Time" + Height = 315 + Left = 10680 + TabIndex = 212 + Top = 1500 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtESTID + Height = 375 + Left = 3120 + TabIndex = 210 + Top = 1680 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtOPEN + Height = 285 + Left = 10740 + TabIndex = 209 + Top = 1140 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtJC + Enabled = 0 'False + Height = 315 + Left = 2700 + MaxLength = 7 + TabIndex = 8 + Top = 2220 + Width = 915 + End + Begin VB.Timer tmrPause + Enabled = 0 'False + Interval = 500 + Left = 8700 + Top = 1020 + End + Begin Crystal.CrystalReport crOrder + Left = 120 + Top = 960 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtSand + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5160 + TabIndex = 33 + TabStop = 0 'False + Top = 780 + Width = 420 + End + Begin VB.ListBox lstPlans + Height = 2205 + Left = 9240 + Sorted = -1 'True + TabIndex = 31 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdFindPlan + Height = 435 + Left = 2580 + Picture = "frmLotInfo5.frx":0000 + Style = 1 'Graphical + TabIndex = 7 + Top = 1440 + Width = 435 + End + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 29 + TabStop = 0 'False + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 27 + TabStop = 0 'False + Top = 60 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1020 + Left = 3900 + MultiLine = -1 'True + TabIndex = 15 + Top = 1515 + Width = 4635 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + MaxLength = 3 + TabIndex = 12 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 3 + TabIndex = 10 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + TabIndex = 14 + TabStop = 0 'False + Top = 1155 + Width = 615 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 7920 + MaxLength = 3 + TabIndex = 11 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 25 + TabStop = 0 'False + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 24 + TabStop = 0 'False + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 2 + TabIndex = 9 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 23 + TabStop = 0 'False + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Enabled = 0 'False + Height = 315 + Left = 1440 + MaxLength = 5 + TabIndex = 5 + Top = 1125 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + MaxLength = 8 + TabIndex = 6 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + MaxLength = 15 + TabIndex = 4 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + MaxLength = 30 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 150 + TabIndex = 35 + TabStop = 0 'False + Top = 2895 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "&General Information" + TabPicture(0) = "frmLotInfo5.frx":0442 + Tab(0).ControlEnabled= -1 'True + Tab(0).Control(0)= "lblDiana" + Tab(0).Control(0).Enabled= 0 'False + Tab(0).Control(1)= "lblYardMemo" + Tab(0).Control(1).Enabled= 0 'False + Tab(0).Control(2)= "lblMetal" + Tab(0).Control(2).Enabled= 0 'False + Tab(0).Control(3)= "lblLathBill" + Tab(0).Control(3).Enabled= 0 'False + Tab(0).Control(4)= "lblTextureO" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "lblBrownO" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "lblScratchO" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "lblSandO" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "lblLathO" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lblOrderDates" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtLotNotes" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "cmdShowChange" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "txtYardMemo" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cmdEdit" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "cmdSetupRpt" + Tab(0).Control(14).Enabled= 0 'False + Tab(0).Control(15)= "txtMetal" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "cmdDelLot" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "cmdAddLot" + Tab(0).Control(17).Enabled= 0 'False + Tab(0).Control(18)= "txtLathBill" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "txtTextureO" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "txtBrownO" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "txtScratchO" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "txtSandO" + Tab(0).Control(22).Enabled= 0 'False + Tab(0).Control(23)= "txtLathO" + Tab(0).Control(23).Enabled= 0 'False + Tab(0).Control(24)= "cmdSaveLotInfo" + Tab(0).Control(24).Enabled= 0 'False + Tab(0).Control(25)= "cmdOrders" + Tab(0).Control(25).Enabled= 0 'False + Tab(0).Control(26)= "cmdExit" + Tab(0).Control(26).Enabled= 0 'False + Tab(0).Control(27)= "cmdCalc" + Tab(0).Control(27).Enabled= 0 'False + Tab(0).Control(28)= "cmdJCSetup" + Tab(0).Control(28).Enabled= 0 'False + Tab(0).Control(29)= "chkSynthetic" + Tab(0).Control(29).Enabled= 0 'False + Tab(0).Control(30)= "cmdOrder" + Tab(0).Control(30).Enabled= 0 'False + Tab(0).Control(31)= "chkStone" + Tab(0).Control(31).Enabled= 0 'False + Tab(0).Control(32)= "cmdPrintR" + Tab(0).Control(32).Enabled= 0 'False + Tab(0).Control(33)= "chkOthers" + Tab(0).Control(33).Enabled= 0 'False + Tab(0).Control(34)= "chkNoPay" + Tab(0).Control(34).Enabled= 0 'False + Tab(0).Control(35)= "chkPaint" + Tab(0).Control(35).Enabled= 0 'False + Tab(0).ControlCount= 36 + TabCaption(1) = "&Super's Orders" + TabPicture(1) = "frmLotInfo5.frx":045E + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblSuperNotes" + Tab(1).Control(1)= "lblPreOrder" + Tab(1).Control(2)= "lblSupHelp" + Tab(1).Control(3)= "lblSuperSP" + Tab(1).Control(4)= "lblSuperDW" + Tab(1).Control(5)= "lblSuperRL" + Tab(1).Control(6)= "lblSuperML" + Tab(1).Control(7)= "lblSuper138" + Tab(1).Control(8)= "lblSuper38" + Tab(1).Control(9)= "lblSuper78" + Tab(1).Control(10)= "lblSuper783" + Tab(1).Control(11)= "lblSuper12" + Tab(1).Control(12)= "linSO" + Tab(1).Control(13)= "lblSuperBB" + Tab(1).Control(14)= "lblTake138" + Tab(1).Control(15)= "lblBB" + Tab(1).Control(16)= "lblZMetal" + Tab(1).Control(17)= "lstPreOrder" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdRePrintL" + Tab(1).Control(19)= "cmdStuccoPay" + Tab(1).Control(20)= "cmdLathPay" + Tab(1).Control(21)= "txtSuperNotes" + Tab(1).Control(22)= "cmdPreOrderPrintS" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "cmdPreOrderPrintY" + Tab(1).Control(23).Enabled= 0 'False + Tab(1).Control(24)= "txtCalc138" + Tab(1).Control(24).Enabled= 0 'False + Tab(1).Control(25)= "txtSuperSP" + Tab(1).Control(26)= "txtSuperDW" + Tab(1).Control(27)= "txtSuperML" + Tab(1).Control(28)= "txtSuperRL" + Tab(1).Control(29)= "txtSuper1383" + Tab(1).Control(30)= "txtSuper38" + Tab(1).Control(31)= "txtSuper78" + Tab(1).Control(32)= "txtSuper783" + Tab(1).Control(33)= "txtSuper12" + Tab(1).Control(34)= "txtSuperBB" + Tab(1).Control(35)= "txtTake138" + Tab(1).Control(35).Enabled= 0 'False + Tab(1).Control(36)= "cmdLFlag" + Tab(1).Control(37)= "cmdIssue" + Tab(1).Control(38)= "cmdPreOrderPrintPC" + Tab(1).ControlCount= 39 + TabCaption(2) = "&Materials" + TabPicture(2) = "frmLotInfo5.frx":047A + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblMatInst" + Tab(2).Control(1)= "lblOrderBalance" + Tab(2).Control(2)= "lblLMLength" + Tab(2).Control(3)= "lblLMetal" + Tab(2).Control(4)= "lblLMType" + Tab(2).Control(5)= "lblLMDFlag" + Tab(2).Control(6)= "lblQty" + Tab(2).Control(7)= "lblLMInvNo" + Tab(2).Control(8)= "lblLMDesc" + Tab(2).Control(9)= "lstLMaterial" + Tab(2).Control(10)= "lstInventory" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "chkChange" + Tab(2).Control(12)= "cmdFindInv" + Tab(2).Control(13)= "cmdInventory" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "txtLMBalance" + Tab(2).Control(14).Enabled= 0 'False + Tab(2).Control(15)= "cboLMMetal" + Tab(2).Control(16)= "cboLMType" + Tab(2).Control(17)= "cboLMDFlag" + Tab(2).Control(18)= "txtLMLength" + Tab(2).Control(19)= "txtLMQty" + Tab(2).Control(20)= "txtLMInvNo" + Tab(2).Control(21)= "txtLMDesc" + Tab(2).Control(22)= "cmdDelMatrl" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdSaveMatrl" + Tab(2).Control(24)= "cmdAddMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).ControlCount= 25 + TabCaption(3) = "Op&tions" + TabPicture(3) = "frmLotInfo5.frx":0496 + Tab(3).ControlEnabled= 0 'False + Tab(3).Control(0)= "lblBAmt" + Tab(3).Control(1)= "lblBillingAmt" + Tab(3).Control(2)= "lblSelectOpt" + Tab(3).Control(3)= "lblLOMLength" + Tab(3).Control(4)= "lblLOMetal" + Tab(3).Control(5)= "lblLOMType" + Tab(3).Control(6)= "lblLOMDFlag" + Tab(3).Control(7)= "lblLOMQty" + Tab(3).Control(8)= "lblLOMInvNo" + Tab(3).Control(9)= "lblLOMDesc" + Tab(3).Control(10)= "lblLOTexture" + Tab(3).Control(11)= "lblLOFAdj" + Tab(3).Control(12)= "lblLOFin2" + Tab(3).Control(13)= "lblLOYdge" + Tab(3).Control(14)= "lblLODesc" + Tab(3).Control(15)= "lblLOptions" + Tab(3).Control(16)= "lblPOptions" + Tab(3).Control(17)= "lblOStone" + Tab(3).Control(18)= "lblOptNum" + Tab(3).Control(19)= "lstOptMatrl" + Tab(3).Control(20)= "txtNote" + Tab(3).Control(21)= "txtNote2" + Tab(3).Control(22)= "cboLOMetal" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "cboLOMType" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "cboLOMDFlag" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "txtLOMLength" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "txtLOMQty" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "txtLOMInvNo" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "txtLOMDesc" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "txtLOTexture" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "txtLOFoam" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "txtLOFin2" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "txtLOYdge" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "txtLODesc" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lstLOptions" + Tab(3).Control(35)= "cmdOptDel" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "cmdOptAdd" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lstPOptions" + Tab(3).Control(38)= "chkOStone" + Tab(3).Control(39)= "txtOSt_SqFt" + Tab(3).ControlCount= 40 + TabCaption(4) = "&Lath Orders" + TabPicture(4) = "frmLotInfo5.frx":04B2 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lblLathOrd" + Tab(4).Control(1)= "lblYardOrd" + Tab(4).Control(2)= "lstLath" + Tab(4).Control(2).Enabled= 0 'False + Tab(4).Control(3)= "lstYard" + Tab(4).Control(3).Enabled= 0 'False + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco &Orders" + TabPicture(5) = "frmLotInfo5.frx":04CE + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lblTexOrd" + Tab(5).Control(1)= "lblBrnOrd" + Tab(5).Control(2)= "lblScrOrd" + Tab(5).Control(3)= "lstTexture" + Tab(5).Control(3).Enabled= 0 'False + Tab(5).Control(4)= "lstBrown" + Tab(5).Control(4).Enabled= 0 'False + Tab(5).Control(5)= "lstScratch" + Tab(5).Control(5).Enabled= 0 'False + Tab(5).ControlCount= 6 + TabCaption(6) = "&Purchase Orders" + TabPicture(6) = "frmLotInfo5.frx":04EA + Tab(6).ControlEnabled= 0 'False + Tab(6).Control(0)= "lblPayYds" + Tab(6).Control(1)= "lblOptMatPrice" + Tab(6).Control(2)= "lblPODate" + Tab(6).Control(3)= "lblPOMType" + Tab(6).Control(4)= "lblPODFlag" + Tab(6).Control(5)= "lblPOQty" + Tab(6).Control(6)= "lblDescription" + Tab(6).Control(7)= "lblInvNo" + Tab(6).Control(8)= "lblPONum" + Tab(6).Control(9)= "lblDesc" + Tab(6).Control(10)= "lblPO" + Tab(6).Control(11)= "lblPONotes" + Tab(6).Control(12)= "lblPOMaterials" + Tab(6).Control(13)= "lblIssueTo" + Tab(6).Control(14)= "lblPOType" + Tab(6).Control(15)= "lblPayType" + Tab(6).Control(16)= "lstPOMaterial" + Tab(6).Control(17)= "cmdPrintPOPay" + Tab(6).Control(18)= "txtPay" + Tab(6).Control(19)= "fraPO" + Tab(6).Control(20)= "cmdPrintForm" + Tab(6).Control(20).Enabled= 0 'False + Tab(6).Control(21)= "txtPOPrice" + Tab(6).Control(22)= "txtPODate" + Tab(6).Control(23)= "txtPODesc" + Tab(6).Control(24)= "txtPOMatDesc" + Tab(6).Control(25)= "cmdPrintPO" + Tab(6).Control(25).Enabled= 0 'False + Tab(6).Control(26)= "cmdDelPOMat" + Tab(6).Control(26).Enabled= 0 'False + Tab(6).Control(27)= "cmdSavePOMat" + Tab(6).Control(28)= "cmdAddPOMat" + Tab(6).Control(28).Enabled= 0 'False + Tab(6).Control(29)= "cmdFindPOMat" + Tab(6).Control(30)= "cboPOMType" + Tab(6).Control(31)= "cboPODFlag" + Tab(6).Control(32)= "txtPOQty" + Tab(6).Control(33)= "txtPOInvNo" + Tab(6).Control(34)= "cmdDelPO" + Tab(6).Control(34).Enabled= 0 'False + Tab(6).Control(35)= "cmdSavePO" + Tab(6).Control(36)= "cmdAddPO" + Tab(6).Control(36).Enabled= 0 'False + Tab(6).Control(37)= "txtIssueTo" + Tab(6).Control(38)= "txtPONum" + Tab(6).Control(38).Enabled= 0 'False + Tab(6).Control(39)= "txtPONotes" + Tab(6).Control(40)= "lstPO" + Tab(6).Control(41)= "cboPOType" + Tab(6).Control(42)= "txtPOType" + Tab(6).Control(42).Enabled= 0 'False + Tab(6).Control(43)= "txtPayType" + Tab(6).Control(44)= "lstLOOKUP" + Tab(6).Control(44).Enabled= 0 'False + Tab(6).ControlCount= 45 + Begin LpLib.fpList lstLOOKUP + Height = 2820 + Left = -67275 + TabIndex = 241 + Top = 2760 + Visible = 0 'False + Width = 3555 + _Version = 196608 + _ExtentX = 6271 + _ExtentY = 4974 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":0506 + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 285 + Left = 1005 + TabIndex = 239 + Top = 2940 + Width = 675 + End + Begin VB.CommandButton cmdPreOrderPrintPC + Caption = "Print PreCast PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66540 + TabIndex = 237 + Top = 1380 + Width = 1335 + End + Begin VB.CommandButton cmdIssue + Caption = "RePrint &Yard Ticket" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69420 + TabIndex = 234 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkNoPay + Alignment = 1 'Right Justify + BackColor = &H00C0C0C0& + Caption = "No Pay Sheets Issued" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 2220 + TabIndex = 233 + Top = 3420 + Width = 2295 + End + Begin VB.CheckBox chkOthers + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 255 + Left = 2940 + TabIndex = 232 + Top = 3180 + Width = 1575 + End + Begin VB.CommandButton cmdPrintR + Caption = "Process Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 231 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 300 + Left = -64755 + TabIndex = 230 + Top = 675 + Width = 975 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 240 + Left = -68475 + TabIndex = 228 + Top = 735 + Width = 1890 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 3180 + TabIndex = 225 + Top = 2940 + Width = 1335 + End + Begin VB.TextBox txtPayType + Height = 315 + Left = -70920 + MaxLength = 1 + TabIndex = 58 + Top = 2280 + Width = 375 + End + Begin VB.CommandButton cmdOrder + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 220 + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtPOType + Height = 285 + Left = -70980 + TabIndex = 219 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 615 + End + Begin VB.ComboBox cboPOType + Height = 315 + ItemData = "frmLotInfo5.frx":086F + Left = -72300 + List = "frmLotInfo5.frx":087F + Style = 2 'Dropdown List + TabIndex = 55 + Top = 1200 + Width = 1995 + End + Begin VB.CheckBox chkSynthetic + Alignment = 1 'Right Justify + Caption = "Synthetic" + Height = 195 + Left = 2100 + TabIndex = 215 + Top = 2940 + Width = 975 + End + Begin VB.CommandButton cmdLFlag + Caption = "Set Lath Flags" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -69435 + TabIndex = 214 + Top = 705 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdJCSetup + Caption = "Setup JC Record" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 211 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = -73080 + TabIndex = 137 + TabStop = 0 'False + Top = 1680 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 127 + Top = 2325 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 128 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 129 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 130 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + MaxLength = 4 + TabIndex = 131 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 132 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 133 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 134 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 135 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + MaxLength = 4 + TabIndex = 136 + Top = 4740 + Width = 795 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfo5.frx":08BA + Left = -74760 + List = "frmLotInfo5.frx":08C1 + TabIndex = 126 + Top = 1020 + Width = 3095 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + TabIndex = 125 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 124 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 123 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 122 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -67320 + TabIndex = 121 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = -74760 + Sorted = -1 'True + TabIndex = 120 + Top = 1080 + Width = 885 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = -73800 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 60 + Top = 2700 + Width = 3915 + End + Begin VB.TextBox txtPONum + BackColor = &H00E0E0E0& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -72300 + TabIndex = 119 + TabStop = 0 'False + Top = 840 + Width = 975 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 56 + Top = 1560 + Width = 3735 + End + Begin VB.CommandButton cmdAddPO + Caption = "&New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 118 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdSavePO + Caption = "S&ave PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 62 + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdDelPO + Caption = "D&elete PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 117 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66240 + TabIndex = 116 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -64920 + TabIndex = 115 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 114 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 112 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 113 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 103 + Top = 780 + Width = 4275 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 104 + Top = 1200 + Width = 2625 + End + Begin VB.TextBox txtLMQty + Alignment = 1 'Right Justify + ForeColor = &H00000000& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 105 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtLMLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 2 + TabIndex = 109 + Top = 3192 + Width = 915 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfo5.frx":08D2 + Left = -68100 + List = "frmLotInfo5.frx":08DC + Style = 2 'Dropdown List + TabIndex = 106 + Top = 1980 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfo5.frx":08F0 + Left = -68085 + List = "frmLotInfo5.frx":08F2 + Style = 2 'Dropdown List + TabIndex = 107 + Top = 2388 + Width = 1215 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfo5.frx":08F4 + Left = -68100 + List = "frmLotInfo5.frx":08FE + Style = 2 'Dropdown List + TabIndex = 108 + Top = 2790 + Width = 1215 + End + Begin VB.TextBox txtLMBalance + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 110 + TabStop = 0 'False + Top = 3600 + Width = 915 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = -71640 + TabIndex = 102 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLODesc + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 97 + TabStop = 0 'False + Top = 1020 + Width = 2835 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 101 + TabStop = 0 'False + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 100 + TabStop = 0 'False + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 99 + TabStop = 0 'False + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOTexture + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 98 + TabStop = 0 'False + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOMDesc + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 96 + TabStop = 0 'False + Top = 3135 + Width = 4155 + End + Begin VB.TextBox txtLOMInvNo + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 95 + TabStop = 0 'False + Top = 3480 + Width = 2625 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 94 + TabStop = 0 'False + Top = 3810 + Width = 915 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 93 + TabStop = 0 'False + Top = 5160 + Width = 915 + End + Begin VB.ComboBox cboLOMDFlag + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 92 + TabStop = 0 'False + Text = "cboLOMDFlag" + Top = 4155 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmLotInfo5.frx":090F + Left = -68100 + List = "frmLotInfo5.frx":0911 + TabIndex = 91 + TabStop = 0 'False + Text = "cboLOMType" + Top = 4500 + Width = 1155 + End + Begin VB.ComboBox cboLOMetal + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 90 + TabStop = 0 'False + Text = "cboLOMetal" + Top = 4830 + Width = 1155 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 89 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 88 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 480 + TabIndex = 87 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 86 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 85 + TabStop = 0 'False + Top = 4440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtLathO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 84 + TabStop = 0 'False + Top = 1080 + Width = 1335 + End + Begin VB.TextBox txtSandO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 83 + TabStop = 0 'False + Top = 1422 + Width = 1335 + End + Begin VB.TextBox txtScratchO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 82 + TabStop = 0 'False + Top = 1764 + Width = 1335 + End + Begin VB.TextBox txtBrownO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 81 + TabStop = 0 'False + Top = 2106 + Width = 1335 + End + Begin VB.TextBox txtTextureO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 80 + TabStop = 0 'False + Top = 2448 + Width = 1335 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = -65445 + Picture = "frmLotInfo5.frx":0913 + Style = 1 'Graphical + TabIndex = 79 + Top = 1140 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtLathBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + MaxLength = 10 + TabIndex = 78 + TabStop = 0 'False + Top = 2790 + Width = 1335 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add New Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 77 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdDelLot + Caption = "Delete Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 1740 + TabIndex = 76 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtCalc138 + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -69720 + TabIndex = 75 + TabStop = 0 'False + Top = 2400 + Width = 435 + End + Begin VB.CheckBox chkChange + Alignment = 1 'Right Justify + Caption = "Recalc Flag:" + Height = 255 + Left = -69180 + TabIndex = 111 + Top = 4020 + Width = 1455 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 9900 + TabIndex = 74 + Top = 3480 + Width = 1335 + End + Begin VB.TextBox txtPOInvNo + Height = 315 + Left = -68760 + MaxLength = 18 + TabIndex = 66 + Top = 2640 + Width = 2625 + End + Begin VB.TextBox txtPOQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + MaxLength = 4 + TabIndex = 69 + Top = 3360 + Width = 915 + End + Begin VB.ComboBox cboPODFlag + Height = 315 + ItemData = "frmLotInfo5.frx":0D55 + Left = -68760 + List = "frmLotInfo5.frx":0D5F + Style = 2 'Dropdown List + TabIndex = 70 + Top = 3720 + Width = 1215 + End + Begin VB.ComboBox cboPOMType + Height = 315 + ItemData = "frmLotInfo5.frx":0D73 + Left = -68760 + List = "frmLotInfo5.frx":0D75 + Style = 2 'Dropdown List + TabIndex = 71 + Top = 4080 + Width = 1215 + End + Begin VB.CommandButton cmdFindPOMat + Height = 435 + Left = -66105 + Picture = "frmLotInfo5.frx":0D77 + Style = 1 'Graphical + TabIndex = 67 + Top = 2550 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdAddPOMat + Caption = "&Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 65 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdSavePOMat + Caption = "S&ave Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 73 + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdDelPOMat + Caption = "D&elete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 64 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPO + Caption = "P&rint PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 63 + TabStop = 0 'False + Top = 960 + Width = 1095 + End + Begin VB.TextBox txtPOMatDesc + Height = 315 + Left = -68760 + MaxLength = 50 + TabIndex = 68 + Top = 3000 + Width = 4275 + End + Begin VB.TextBox txtPODesc + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 57 + Top = 1920 + Width = 3735 + End + Begin VB.TextBox txtPODate + Alignment = 1 'Right Justify + Height = 315 + Left = -69600 + MaxLength = 10 + TabIndex = 61 + Top = 1200 + Width = 1035 + End + Begin VB.TextBox txtPOPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + TabIndex = 72 + Top = 4440 + Width = 975 + End + Begin VB.CommandButton cmdPrintForm + Caption = "Print Form" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 54 + TabStop = 0 'False + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSetupRpt + Caption = "Setup Processing" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 53 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPreOrderPrintY + Caption = "Print Yard PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 52 + TabStop = 0 'False + Top = 720 + Width = 1335 + End + Begin VB.CommandButton cmdPreOrderPrintS + Caption = "Print Supplier PreOrders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -65100 + TabIndex = 51 + TabStop = 0 'False + Top = 1380 + Width = 1335 + End + Begin VB.Frame fraPO + Height = 435 + Left = -68520 + TabIndex = 46 + Top = 2040 + Width = 4875 + Begin VB.OptionButton optStone + Caption = "Stone" + Height = 255 + Left = 3240 + TabIndex = 236 + Top = 120 + Width = 795 + End + Begin VB.OptionButton optPreOrder + Caption = "PreOrder" + Height = 255 + Left = 2280 + TabIndex = 223 + Top = 120 + Width = 975 + End + Begin VB.OptionButton optLath + Caption = "Lath" + Height = 255 + Left = 60 + TabIndex = 50 + Top = 120 + Width = 675 + End + Begin VB.OptionButton optStucco + Caption = "Stucco" + Height = 255 + Left = 720 + TabIndex = 49 + Top = 120 + Width = 855 + End + Begin VB.OptionButton optSand + Caption = "Sand" + Height = 255 + Left = 1560 + TabIndex = 48 + Top = 120 + Width = 735 + End + Begin VB.OptionButton optNone + Caption = "None" + Height = 255 + Left = 4080 + TabIndex = 47 + Top = 120 + Value = -1 'True + Width = 735 + End + End + Begin VB.TextBox txtSuperNotes + Height = 1275 + Left = -69240 + MaxLength = 255 + MultiLine = -1 'True + TabIndex = 147 + Top = 4200 + Width = 5445 + End + Begin VB.CommandButton cmdEdit + Caption = "Edit Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3000 + TabIndex = 45 + TabStop = 0 'False + Top = 2160 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtYardMemo + Height = 1755 + Left = 525 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 44 + Top = 3825 + Width = 5355 + End + Begin VB.TextBox txtPay + Alignment = 1 'Right Justify + Height = 315 + Left = -69240 + TabIndex = 59 + Top = 2280 + Width = 675 + End + Begin VB.CommandButton cmdPrintPOPay + Caption = "Print Pay Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68760 + TabIndex = 43 + Top = 4920 + Width = 1035 + End + Begin VB.CommandButton cmdLathPay + Caption = "RePrint Lath Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66525 + TabIndex = 42 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdStuccoPay + Caption = "RePrint Stucco Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67980 + TabIndex = 41 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdRePrintL + Caption = "ReSet Lath Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67980 + TabIndex = 40 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdShowChange + Caption = "Show Change Log" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4245 + TabIndex = 39 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtNote2 + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 38 + Top = 3060 + Width = 5475 + End + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 795 + Left = -74775 + MultiLine = -1 'True + TabIndex = 37 + Top = 3855 + Width = 5475 + End + Begin VB.TextBox txtLotNotes + Height = 1785 + Left = 5880 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 36 + Top = 3825 + Width = 5355 + End + Begin LpLib.fpList lstPOMaterial + Height = 1260 + Left = -73800 + TabIndex = 240 + Top = 4230 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 2222 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 90 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":11B9 + End + Begin LpLib.fpList lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 243 + Top = 4725 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":15B2 + End + Begin LpLib.fpList lstInventory + Height = 2070 + Left = -66825 + TabIndex = 244 + Top = 2790 + Visible = 0 'False + Width = 3165 + _Version = 196608 + _ExtentX = 5583 + _ExtentY = 3651 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 225 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":1A31 + End + Begin LpLib.fpList lstLMaterial + Height = 4590 + Left = -74880 + TabIndex = 242 + Top = 825 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 8096 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":1D99 + End + Begin LpLib.fpList lstPreOrder + Height = 1425 + Left = -69255 + TabIndex = 245 + Top = 2190 + Width = 5445 + _Version = 196608 + _ExtentX = 9604 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfo5.frx":220A + End + Begin VB.Label lblOptNum + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -70560 + TabIndex = 238 + Top = 720 + Width = 1890 + End + Begin VB.Label lblZMetal + Alignment = 2 'Center + Caption = "This House Uses Z-Metal" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = -74940 + TabIndex = 235 + Top = 5160 + Visible = 0 'False + Width = 5655 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Opt. SqFt:" + Height = 195 + Left = -66540 + TabIndex = 229 + Top = 750 + Width = 1740 + End + Begin VB.Label lblPayType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Type:" + Height = 195 + Left = -71805 + TabIndex = 224 + Top = 2340 + Width = 720 + End + Begin VB.Label lblPOType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Type:" + Height = 195 + Left = -73005 + TabIndex = 218 + Top = 1260 + Width = 675 + End + Begin VB.Label lblBB + Alignment = 2 'Center + Caption = "This House Uses R-Guard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 675 + Left = -72180 + TabIndex = 217 + Top = 1380 + Width = 2475 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = -74895 + TabIndex = 207 + Top = 1740 + Width = 1590 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard/R-Guard:" + Height = 195 + Left = -74835 + TabIndex = 206 + Top = 2400 + Width = 1530 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = -75000 + X2 = -69660 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = -74040 + TabIndex = 205 + Top = 3000 + Width = 735 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = -74160 + TabIndex = 204 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 203 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 202 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = -71880 + TabIndex = 201 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Enabled = 0 'False + Height = 195 + Left = -71580 + TabIndex = 200 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Enabled = 0 'False + Height = 195 + Left = -71460 + TabIndex = 199 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Enabled = 0 'False + Height = 195 + Left = -71340 + TabIndex = 198 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = -71700 + TabIndex = 197 + Top = 4800 + Width = 915 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = -73740 + TabIndex = 196 + Top = 1620 + Width = 1410 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -73800 + TabIndex = 195 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -73800 + TabIndex = 194 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -74760 + TabIndex = 193 + Top = 720 + Width = 1815 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 192 + Top = 840 + Width = 1200 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 191 + Top = 840 + Width = 1065 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Texture Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67260 + TabIndex = 190 + Top = 840 + Width = 1185 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 189 + Top = 900 + Width = 930 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Supplier Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 188 + Top = 900 + Width = 1665 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfo5.frx":25FD + Height = 855 + Left = -74760 + TabIndex = 187 + Top = 735 + Width = 5115 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -68700 + TabIndex = 186 + Top = 1905 + Width = 2715 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 185 + Top = 840 + Width = 840 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 184 + Top = 1242 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 183 + Top = 1644 + Width = 630 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 182 + Top = 2046 + Width = 960 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 181 + Top = 2448 + Width = 1005 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 180 + Top = 2850 + Width = 780 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 179 + Top = 3252 + Width = 975 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipped So Far:" + Height = 195 + Left = -69285 + TabIndex = 178 + Top = 3660 + Width = 1140 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 177 + Top = 720 + Width = 1095 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71580 + TabIndex = 176 + Top = 720 + Width = 990 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68100 + TabIndex = 175 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = -68415 + TabIndex = 174 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -68265 + TabIndex = 173 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = -68475 + TabIndex = 172 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = -68415 + TabIndex = 171 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 170 + Top = 3135 + Width = 840 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 169 + Top = 3480 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = -68805 + TabIndex = 168 + Top = 3840 + Width = 660 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 167 + Top = 4185 + Width = 960 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 166 + Top = 4530 + Width = 1005 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68940 + TabIndex = 165 + Top = 4890 + Width = 780 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 164 + Top = 5220 + Width = 975 + End + Begin VB.Label lblMatInst + Caption = $"frmLotInfo5.frx":26E7 + Height = 1155 + Left = -66630 + TabIndex = 163 + Top = 1560 + Visible = 0 'False + Width = 2835 + End + Begin VB.Label lblOrderDates + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 9900 + TabIndex = 162 + Top = 780 + Width = 1275 + End + Begin VB.Label lblLathO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath:" + Height = 195 + Left = 9465 + TabIndex = 161 + Top = 1140 + Width = 360 + End + Begin VB.Label lblSandO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 9405 + TabIndex = 160 + Top = 1482 + Width = 420 + End + Begin VB.Label lblScratchO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch:" + Height = 195 + Left = 9225 + TabIndex = 159 + Top = 1824 + Width = 600 + End + Begin VB.Label lblBrownO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown:" + Height = 195 + Left = 9330 + TabIndex = 158 + Top = 2166 + Width = 495 + End + Begin VB.Label lblTextureO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 9240 + TabIndex = 157 + Top = 2508 + Width = 585 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone:" + Height = 195 + Left = 9360 + TabIndex = 156 + Top = 2850 + Width = 465 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Feet:" + Height = 195 + Left = 9000 + TabIndex = 155 + Top = 3540 + Width = 795 + End + Begin VB.Label lblSelectOpt + Caption = "Double Click the desired option to selected it for Add or Delete." + Height = 375 + Left = -66060 + TabIndex = 154 + Top = 2100 + Width = 2235 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = -73485 + TabIndex = 153 + Top = 1980 + Width = 1155 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO #:" + Height = 195 + Left = -72750 + TabIndex = 152 + Top = 900 + Width = 420 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = -69360 + TabIndex = 151 + Top = 2700 + Width = 525 + End + Begin VB.Label lblDescription + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69675 + TabIndex = 150 + Top = 3060 + Width = 840 + End + Begin VB.Label lblPOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -69465 + TabIndex = 149 + Top = 3420 + Width = 630 + End + Begin VB.Label lblPODFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69795 + TabIndex = 148 + Top = 3780 + Width = 1020 + End + Begin VB.Label lblPOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69780 + TabIndex = 146 + Top = 4140 + Width = 1005 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = -70260 + TabIndex = 145 + Top = 1260 + Width = 660 + End + Begin VB.Label lblBillingAmt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -64980 + TabIndex = 144 + Top = 2700 + Width = 915 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + Caption = "$:" + Height = 255 + Left = -65280 + TabIndex = 143 + Top = 2760 + Width = 195 + End + Begin VB.Label lblSuperNotes + AutoSize = -1 'True + Caption = "Notes to Super:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69240 + TabIndex = 142 + Top = 3960 + Width = 1350 + End + Begin VB.Label lblYardMemo + AutoSize = -1 'True + Caption = "Yard Order Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 540 + TabIndex = 141 + Top = 3600 + Width = 1830 + End + Begin VB.Label lblOptMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = -69540 + TabIndex = 140 + Top = 4500 + Width = 765 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = -70140 + TabIndex = 139 + Top = 2340 + Width = 765 + End + Begin VB.Label lblDiana + AutoSize = -1 'True + Caption = "Lot Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6000 + TabIndex = 138 + Top = 3600 + Width = 1065 + End + End + Begin VB.Label lblStone + Alignment = 2 'Center + Caption = "Stone Veneer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8640 + TabIndex = 226 + Top = 1440 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSandShip + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5580 + TabIndex = 222 + Top = 780 + Width = 420 + End + Begin VB.Label lblSZone + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6060 + TabIndex = 221 + Top = 780 + Width = 315 + End + Begin VB.Label lblSynthetic + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Synthetic Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8970 + TabIndex = 216 + Top = 1440 + Visible = 0 'False + Width = 2475 + End + Begin VB.Label lblFirst + Alignment = 2 'Center + Caption = "First Time This Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 8640 + TabIndex = 213 + Top = 1800 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 4620 + TabIndex = 208 + Top = 840 + Width = 480 + End + Begin VB.Label lblJC + Alignment = 1 'Right Justify + Caption = "Job Cost:" + Height = 375 + Left = 2280 + TabIndex = 34 + Top = 2160 + Width = 375 + End + Begin VB.Label lblPlan + AutoSize = -1 'True + Caption = "Double Click the Desired Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8700 + TabIndex = 32 + Top = 840 + Visible = 0 'False + Width = 2565 + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 9000 + TabIndex = 30 + Top = 2220 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 28 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " Plan Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3900 + TabIndex = 26 + Top = 1245 + Width = 1275 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 22 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + Caption = $"frmLotInfo5.frx":27D8 + Height = 1350 + Left = 6450 + TabIndex = 21 + Top = 90 + Width = 1425 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 20 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 19 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 18 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 17 + Top = 1560 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 16 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1200 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfo5" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSPOpt2 As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset +Dim moRSPO As Recordset +Dim moRSPOMAT As Recordset +Dim moRSMemo As Recordset +Dim moRSPay As Recordset +Dim moRSInvINFO As Recordset + +Dim mboolNOTSUPPLIER As Boolean, mstrMTYPE As String, mstrORDERNUM As String, mintOPENPR2 As Integer +Dim mboolLATHC As Boolean, mboolSTUCCOC As Boolean, mboolWRAPC As Boolean, mboolPULTE As Boolean, mboolSTPAY As Boolean +Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String, mstrBEGQTY As String, mstrENDQTY As String +Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean, mboolST_ADJ As Boolean +Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean, mboolWRAP As Boolean +Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngARINVID As Long, mintPAYCREW As Integer +Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mboolPSpecialCALC As Boolean +Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngINVID As Long, mboolDNU As Boolean +Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mboolPSW As Boolean ', mintOpenPR As Integer +Dim mlngFind As Long, mintBOOKMARK As Integer, boolPrtLATH As Boolean ', mlngARINVID As Long +Dim mintTake138 As Integer, mintPONUM As Long, mintOpenPR As Integer, mbool2Dates As Boolean, mboolSTONE3 As Boolean 'For Printing Invoices +Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String, mboolSTONE2 As Boolean +Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolCERTIFIED As Boolean, mstrTAXCODE As String +Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolNoPrint As Boolean, mboolPAINT As Boolean, mboolRPSTUCCO As Byte +Dim mboolSupP, mboolWrapP, mboolLathP, mboolNescoP, mboolPopOutP As Boolean, mboolADD As Boolean +Dim mboolBrownP, mboolTexP, mboolCMUP, mboolEX1P, mboolEX2P, mboolEX3P As Boolean, mboolHLNotes As Boolean +Dim mboolStoneP As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String +Dim msglPAYRT1, msglPAYRT2 As Single, mstrTexture As String, mstrCREWTYPE As String, mstrWORK As String +'Dim mboolADD As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If Not oRS.EOF Then + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + End If + Loop + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub SetStone() +Dim strSQL As String + + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbTrue + moRS!c_flg = vbTrue + moRS!t_flg = vbTrue + moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub GetPayRates() +Dim oRSCR As Recordset, strSQL As String + + msglPAYRT1 = 0 + msglPAYRT2 = 0 + + strSQL = "SELECT * FROM tblCREWRATE WHERE not inactive and CREW_ID = " & mintPAYCREW & " AND PROJ_ID = " & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRSCR.EOF Then + strSQL = "SELECT * FROM tblCREWRATE WHERE not inactive and CREW_ID = " & mintPAYCREW & " AND PROJ_ID = 99999" ' & gintPROJID + Set oRSCR = New Recordset + oRSCR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If +' Else + If Not oRSCR.EOF Then + If mstrCREWTYPE = "L" Then ' Or mstrCREWTYPE = "W" Then + If mboolPULTE Then +' msglPAYRT1 = Field2Str2(oRSCR!Sand) ' Wrap Rate + msglPAYRT1 = Field2Str2(oRSCR!Smooth) ' Wrap/Lath Rate Commented this out on 05/19/2019 -- may need to be changed back + msglPAYRT2 = Field2Str2(oRSCR!METAL) +' msglPAYRT1 = Field2Str2(oRSCR!lath_skip) ' Change it back of it is not correct + Else + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + End If + + If (mstrCREWTYPE = "L" Or mstrCREWTYPE = "W") And mboolWRAPC Then ' Or mstrCREWTYPE = "W" Then +' If mstrCREWTYPE = "L" And mboolWRAPC Then ' Or mstrCREWTYPE = "W" Then + If mboolPULTE Then + msglPAYRT1 = Field2Str2(oRSCR!sand) ' Wrap Rate +' msglPAYRT1 = Field2Str2(oRSCR!Smooth) ' Wrap/Lath Rate + Else + msglPAYRT1 = 0 + msglPAYRT2 = 0 +' msglPAYRT1 = Field2Str2(oRSCR!lath_skip) +' msglPAYRT2 = Field2Str2(oRSCR!METAL) + End If + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SK" Or mstrTexture = "RL" Or mstrTexture = "CS" Or mstrTexture = "RS") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "SA" Or mstrTexture = "S2" Or mstrTexture = "S3" Or mstrTexture = "RD" Or mstrTexture = "S4") Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "DA" Then + msglPAYRT1 = Field2Str2(oRSCR!dash) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "MN" Or mstrTexture = "RM") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QU" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "QS" Then + msglPAYRT1 = Field2Str2(oRSCR!qu) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SM" Then + msglPAYRT1 = Field2Str2(oRSCR!Smooth) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "DF" Or mstrTexture = "SS" Or mstrTexture = "RF") Then + msglPAYRT1 = Field2Str2(oRSCR!lath_skip) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And mstrTexture = "SC" Then + msglPAYRT1 = Field2Str2(oRSCR!sand) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + + If mstrCREWTYPE = "S" And (mstrTexture = "M2" Or mstrTexture = "M3" Or mstrTexture = "MF") Then + msglPAYRT1 = Field2Str2(oRSCR!mn) + msglPAYRT2 = Field2Str2(oRSCR!sand) + End If + +' If mstrCREWTYPE = "V" Then +' msglPAYRT1 = Field2Str2(oRSCR!Lath_Skip) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + +' If mstrCREWTYPE = "S" And mstrTEXTURE = "DA" Then +' msglPAYRT1 = Field2Str2(oRSCR!Dash) +' msglPAYRT2 = Field2Str2(oRSCR!metal) +' End If + + End If +' Else +' End If + +End Sub + +Private Sub RePrintLath() 'Allows a lath order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint Lath") + + moRS!l_FLG = Null + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null + moRS!lorder = "12/31/2030" + moRS!Border = Null + moRS!TORDER = Null + moRS!forder = Null + moRS!corder = Null + moRS!SORDER = Null + moRS!VOrder = Null + moRS!WrapP = vbFalse + moRS!WrapD = vbFalse + moRS!LathP = vbFalse + moRS!LathD = vbFalse +'May need to add more items to be reset so that other things can be printed. + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!o_qty = 0 +' oRS!d_flag = "X" +' oRS!ar_trans = vbChecked +' oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID + goConn.Execute strSQL + + Call LotRePrinted +End Sub + +Private Sub cboPOType_LostFocus() + If cboPOType.ListIndex = -1 Then + cboPOType.ListIndex = 0 + End If + txtPOType = Left(cboPOType.Text, 1) + gstrPO = txtPOType + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + End Select + +End Sub + +''Private Sub chkHoldOrders_Click() +'' cmdSaveLotInfo.Enabled = True +'' If gbytSECURITY > 3 Then +'' chkHoldOrders.Enabled = False +'' chkHoldOrders.BackColor = &H80FFFF +'' End If +''End Sub + +''Private Sub chkHoldPO_Click() +'' cmdSaveLotInfo.Enabled = True +'' If gbytSECURITY > 3 Then +'' chkHoldPO.Enabled = False +'' chkHoldPO.BackColor = &H80FFFF +'' End If +''End Sub + +Private Sub chkOthers_Click() + cmdSaveLotInfo.Enabled = True + +End Sub + +Private Sub chkSplit_Click() + cmdSaveLotInfo.Enabled = True +' lblSynthetic.Visible = True + If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkStone_Click() + If chkStone Then + cmdSaveLotInfo.Enabled = True + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + lblStone.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblStone.Visible = False + txtStone = 0 + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + End If + +End Sub + +Private Sub chkSynthetic_Click() + If chkSynthetic Then + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = False + End If + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + End If + +End Sub + +Private Sub cmdAddPOMat_Click() + Call POMatClear + gconACTION = 0 + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPODate.Enabled = False + txtPODesc.Enabled = False + txtIssueTo.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + mboolAdding = True + txtPOInvNo.SetFocus + +End Sub + +Private Sub cmdBrownPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer, strPAY As String, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + strCrewType = "" + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intSTUCCOCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOCREW) + moRS!BCREW = Field2Str2(intSTUCCOCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!BCREW = 0 + moRS.Update + End If + + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "B" + gstrTYPE = "S" + Call ShowPrint '***************** REsume here + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue +' moRS!BrownD = vbTrue + End If + moRS.Update 'Mark Complete? + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewBrown.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + '***************Start of Print Stucco Pay Sheets copied from Lath Order + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + ' gintCOPY = 4 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 + Else + If moRS!texture = "SB" Or moRS!texture = "S2" Then '*** This is to print Brown paysheets + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoPay3 + crOrder.Reset + gintCOPY = 1 + End If + If (moRS!texture <> "SB" And moRS!texture <> "S2") Then + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 +' ElseIf moRS!texture = "SF" Then +' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 +' Call PrintStuccoStone +' crOrder.Reset +' gintCOPY = 1 +' Else +' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 +' Call PrintStuccoSyn + crOrder.Reset + gintCOPY = 1 + End If + End If + Else ' *************** Logic below this is strictly 3 coat + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + intTCPAY = gintCOPY * 3 + MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + + + If boolCOMPLETE Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then + Call PrintStuccoInv + Else + Call PrintCompleteInv + End If + End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'B')" + goConn.Execute strSQLUP + + moRS!PRNT_S = Now() + moRS.Update + +' If mboolPAINT Then +' MsgBox "Insert 1 White and 13 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 +' intCOPY = 0 +' crOrder.Reset +' gstrMODULE = "Before Print Paint Pay " + +' Call PrintPaintPay +' End If + +' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " +' moRSMemo!notes = UCase(Field2Str(txtYardMemo)) +' moRSMemo.Update + + gboolPRINT = False + If Not moRSProj!bill Then + moRS!BrownD = vbTrue +' moRS!TexP = vbTrue +' moRS!TexD = vbTrue + Else + moRS!BrownD = vbTrue +' moRS!TexP = vbTrue +' moRS!TexD = vbTrue + End If + moRS.Update +' cmdBrownPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdBrownPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintStuccoPay2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + +'***FIX On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB2_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" + Exit Sub +' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +'' If gintCOPY > 3 Then +'' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +'' intTOTAL = Int((gintCOPY / 2) + 0.99) +'' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +'' i = 1 +'' Do Until i = ((gintCOPY / 2) + 1) +'' crOrder.Formulas(1) = "PaySheetCount = " & i +'' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +'' crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 +'' crOrder.Action = 1 + +'' moRSPay.AddNew +'' moRSPay!lotid = gintLOTID +'' moRSPay!Type = "S" +'' moRSPay!worktype = "P" +'' moRSPay!pay_ydge = intYDS +'' moRSPay!sheet = i +'' moRSPay!Create = gstrLOGIN +'' moRSPay!printed = vbChecked +'' moRSPay!totalsheet = intTOTAL +'' If moRSProj!cocode = 0 Then +'' moRSPay!cocode = 0 +'' ElseIf moRSProj!cocode = 1 Then +'' moRSPay!cocode = 1 +'' End If +'' moRSPay.Update +'' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +'' moRS!multipay = vbChecked +'' moRS.Update +'' i = i + 1 +'' Loop +'' crOrder.Reset +'' Exit Sub +'' Else +'**** This will Print the Pay Sheet for Brown + + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 +' crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +'This will print the Pay Sheet for Texture + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = (intYDS - mintST_ADJ) + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay3() ' This is to print Brown and Texture Paysheets for Sand Finish and EIFS over OneKote +Dim strSQL As String, i As Integer, strPAY As String +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + +'***FIX On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then +' crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopayB3_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" + Exit Sub +' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +'' If gintCOPY > 3 Then +'' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +'' intTOTAL = Int((gintCOPY / 2) + 0.99) +'' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +'' i = 1 +'' Do Until i = ((gintCOPY / 2) + 1) +'' crOrder.Formulas(1) = "PaySheetCount = " & i +'' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +'' crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 +'' crOrder.Action = 1 + +'' moRSPay.AddNew +'' moRSPay!lotid = gintLOTID +'' moRSPay!Type = "S" +'' moRSPay!worktype = "P" +'' moRSPay!pay_ydge = intYDS +'' moRSPay!sheet = i +'' moRSPay!Create = gstrLOGIN +'' moRSPay!printed = vbChecked +'' moRSPay!totalsheet = intTOTAL +'' If moRSProj!cocode = 0 Then +'' moRSPay!cocode = 0 +'' ElseIf moRSProj!cocode = 1 Then +'' moRSPay!cocode = 1 +'' End If +'' moRSPay.Update +'' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +'' moRS!multipay = vbChecked +'' moRS.Update +'' i = i + 1 +'' Loop +'' crOrder.Reset +'' Exit Sub +'' Else +'**** This will Print the Pay Sheet for Brown + + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 '******************WOrk here and in PRINTSTUCCOPAY3 to fix + End If '***** BROWN PAY SHEETS AND TEXTURE PAY SHEETS +' crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 +' crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" '*****STUCCO CREW + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW '******PayCrew Info + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +'This will print the Pay Sheet for Texture +' crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToPrinter +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Action = 1 +' crOrder.Reset + +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "S" +' moRSPay!worktype = "T" +' moRSPay!pay_ydge = (intYDS - mintST_ADJ) +' moRSPay!sheet = i +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay!totalsheet = intTOTAL +' If moRSProj!cocode = 0 Then +' moRSPay!cocode = 0 +' ElseIf moRSProj!cocode = 1 Then +' moRSPay!cocode = 1 +' End If +' moRSPay.Update + +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay4() +Dim strSQL As String, i As Integer, intMETAL As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset '******* tblPAYSHEET + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + +' Call GetPayRates + + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then +' crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" + crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_T17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew '******* tblPAYSHEET Add Information + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY +' dblGROSSPAY = Round(dblGROSSPAY, 2) +' crOrder.Formulas(4) = "Z_Gross = " & Format(CStr(dblGROSSPAY), "Currency") +' crOrder.CopiesToPrinter = 1 +' crOrder.CopiesToPrinter = gintCOPY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew '******* tblPAYSHEET Add New Paysheet + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!crewID = mintPAYCREW + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdCalc_Click() + If moRS!texture = "DF" Or moRS!texture = "MF" Or moRS!texture = "QS" Or moRS!texture = "RF" Then + gbool2FIN = True + Else + gbool2FIN = False + End If + + If moRS!texture = "DW" Then + moRS!calcdate = Date + moRS.Update + Else + If moRSProj!stype <> "T" Then + Call MatCalcOne + Call ConvertSuper + Call MatLoad + Call CalcMetal + Else + Call MatCalcThree + Call ConvertSuper + Call MatLoad + Call CalcMetal + End If + End If + MsgBox "Materials Calculation is Complete" + txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +End Sub + +Private Sub cmdDelLot_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Lot") +' Call LotChange(mstrPROJLOT, "Delete Lot", ) + Unload Me + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdDelLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelPO_Click() +Dim strSQL As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPO.ListIndex + cmdDelPO.Enabled = False + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdPrintPO.Enabled = False + cmdAddPOMat.Enabled = True + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM + goConn.Execute strSQL + Call LotChange(mstrPROJLOT, "Delete PO") + Call POLoad + If lstPO.ListCount Then + If lstPO.ListCount > mintBOOKMARK Then + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPO.ListIndex = mintBOOKMARK - 1 + End If + Else + mintBOOKMARK = -1 + Call POMatClear + Call POClear + End If + gconACTION = 0 +End Sub + +Private Sub cmdDelPOMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPOMaterial.ListIndex + moRSPOMAT.Delete + Call LotChange(mstrPROJLOT, "Delete PO Material") + Call POMatLoad + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdAddPOMat.Enabled = True + If lstPOMaterial.ListCount Then + If lstPOMaterial.ListCount > mintBOOKMARK Then + lstPOMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 +End Sub + +Private Sub cmdEdit_Click() + gconACTION = 5 + cmdSaveMatrl.Enabled = True + cmdCalc.Enabled = True + cmdFindPlan.Visible = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + cmdSaveLotInfo.Enabled = True +' cmdPrintCMU.Enabled = True +' cmdUpCMU.Enabled = True + txtAddress.Enabled = True + txtOwner.Enabled = True + lstLOptions.Enabled = True + lstPOptions.Enabled = True +End Sub + +Private Sub cmdFindPOMat_Click() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + Else + lstLOOKUP.Visible = True + Call LoadILookUp + lngFind = Field2Long(txtPOInvNo) + Call ListFindItem2(lstLOOKUP, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub LoadILookUp() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOOKUP.Clear + + Do Until oRS.EOF + With lstLOOKUP + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOOKUP.ListCount Then + lstLOOKUP.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module LoadLookUp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdIssue_Click() + If cmdIssue.Caption = "RePrint &Yard Ticket" Then + gintCOPY = 1 + Call PrintIssueA + End If + + If cmdIssue.Caption = "RePrint Actual Rpt" Then + gintCOPY = 1 + Call PrintActual + End If + + cmdIssue.Visible = False +End Sub + +Private Sub PrintIssueA() +Dim lngTIE As Long +Dim strSQL As String + + lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) + + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Formulas(4) = 1 + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Formulas(4) = 1 + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If +' cmdIssue.Visible = False +End Sub + +Private Sub cmdJCSetup_Click() + Call JCSetup +End Sub + +Private Sub cmdLathPay_Click() +Dim strPAY As String +Dim bytINFO As Byte + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) + If bytINFO = 1 Then + gintCOPY = 1 + ElseIf bytINFO = 2 Then + gintCOPY = 3 + ElseIf bytINFO = 3 Then + gintCOPY = 5 + ElseIf bytINFO = 4 Then + gintCOPY = 7 + ElseIf bytINFO = 5 Then + gintCOPY = 9 + End If + + Call LotChange(mstrPROJLOT, "RePrint Lath Pay") + Call PrintLathPay + cmdLathPay.Visible = False +End Sub + +Private Sub cmdLathPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNL As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intYNS As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean, intLATHCREW As Integer +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String, intSTUCCOCREW As Integer +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim strSQLC As String, oRSCPO As Recordset +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String +Dim oRSL As Recordset, strSQLX As String + + On Error GoTo Error_EH + + strCrewType = "" + boolPrtLATH = False + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mboolLATHC = False + mboolSTUCCOC = False + mboolWRAPC = False + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If mboolPLANUP Then + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" + cmdExit.Enabled = True + Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic +' If moRSPay.EOF Then +' End If + gintCOPY = 1 +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + +' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then + MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + If Field2Str2(oRS!s_bill) = 0 Then + MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + + intYNL = MsgBox("Do You Want To Use A Crew Number With The Lath PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNL = vbYes Then + intLATHCREW = InputBox("Enter The Lath Crew Number", "Lath Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intLATHCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intLATHCREW = 0 Or IsNull(intLATHCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Lath Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Lath Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intLATHCREW) + moRS!LCREW = Field2Str2(intLATHCREW) + moRS.Update + mboolLATHC = True + End If + Else + moRS!LCREW = 0 + moRS.Update + End If + +'' intYNS = MsgBox("Do You Want To Use A Crew Number With The Stucco PaySheet? Y or N)", vbYesNo, "Use Crew") +'' If intYNS = vbYes Then +'' intSTUCCOCREW = InputBox("Enter The Stucco Crew Number", "Stucco Crew", 0) +'' If intSTUCCOCREW = 0 Or IsNull(intSTUCCOCREW) Then +'' MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" +'' Exit Sub +'' Else +'' moRS!BCREW = Field2Str2(intSTUCCOCREW) +'' moRS.Update +'' mboolSTUCCOC = True +'' End If +'' Else +'' moRS!BCREW = 0 +'' moRS.Update +'' End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "L" + gstrTYPE = "Y" + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) + moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then + '***************** need to move this to Issue and Make a unique identifier + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If +' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Lath PO" + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" +' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLathM.rpt" + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + + moRS!PRNT_L = Now() + moRS.Update + + If boolFPRINT Then + gstrMODULE = "Before Print Actual " + Call PrintActual + gintCOPY = 1 + crOrder.Reset + End If +' If boolFPRINT Then + gstrMODULE = "Before Print Issue Ticket " + Call PrintIssue + gintCOPY = 1 + crOrder.Reset + + strSQLC = "SELECT Lot_ID, M_Type FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " AND M_Type = 'D'" + Set oRSCPO = New Recordset + oRSCPO.Open strSQLC, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSCPO.EOF Then + gstrMODULE = "Before Print Coated Popout Issue Ticket " + Call PrintCoated + gintCOPY = 1 + crOrder.Reset + End If + +' End If + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " + Call PrintLathMat + crOrder.Reset + ' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then +' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If + If Field2Str2(txtTtlYdge) - 19 > 1200 Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Else + MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + End If + gstrMODULE = "Before Print Lath Pay " + Call PrintLathPay + + '***********Beginning of print stucco pay - moved to Print Brown Order --- REMOVE TWO TICK MARKS TO START USING AGAIN +'' gintCOPY = 1 +'' intCOPY = 0 +'' crOrder.Reset +'' gstrMODULE = "Before Print Stucco Pay " + +'' If moRSProj!stype <> "T" Then +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 2 +'' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' ' gintCOPY = 4 +'' Call PrintStuccoPay +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' If moRS!texture <> "SB" Then +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' Call PrintStuccoPay +'' crOrder.Reset +'' gintCOPY = 1 +'' ElseIf moRS!texture = "SF" Then +'' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 2 +'' Call PrintStuccoStone +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +'' gintCOPY = 2 +'' Call PrintStuccoSyn +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If +'' Else +'' If Field2Str2(txtTtlYdge) - 24 > 1200 Then +'' intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) +'' gintCOPY = intCOPY * 2 +'' intTCPAY = gintCOPY * 3 +'' MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +''' gintCOPY = 4 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' Else +'' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' Call PrintStuccoThree +'' crOrder.Reset +'' gintCOPY = 1 +'' End If +'' End If + '****************** End of Print Stucco Pay moved to Print Brown Order + + gintCOPY = 1 +' If Field2Integer(moRS!CMU) > 0 Then +' intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") +' If intYN = vbYes Then +' Call cmdPrintCMU_Click +' crOrder.Reset +' End If +' End If + End If + End If + '****** Print Stone Pay Sheet and Invoice + '****** Removed 06/27/05 per Rose +' If Not chkNoPay Then +' If moRS!ostone And Not moRS!otstone Then +' crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" +' gintCOPY = 2 +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' crOrder.ReportFileName = App.Path & "\StonePay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' crOrder.Action = 1 + +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If +' End If + + If moRS!Firsttime Then + MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" + End If + + If boolCOMPLETE Then +' gintCOPY = 1 +' crOrder.Reset +' If Not moRS!Split Then +' If Not moRSProj!bill Then +' Call PrintLathInv +' crOrder.Reset +' End If +' End If + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!LathD = vbTrue +' cmdLathPrint.Enabled = False + End If + + strSQLX = "SELECT Lot_id, Invoice_NO, Inv_Type, Header, PO_NUM FROM tblARINVOICE WHERE INV_TYPE = 'L' AND LOT_ID = " & Field2Str2(moRS!Lot_ID) + Set oRSL = New Recordset + oRSL.Open strSQLX, goConn, adOpenKeyset, adLockOptimistic + +' If Not oRSL.EOF Then + If oRSL.EOF Then + boolPrtLATH = True +' lblLathInv = Field2Str(oRS!invoice_no) +' lblLathPO = Field2Str(oRS!po_num) + End If + oRSL.Close + + If boolPrtLATH Then + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If + ' moRS!l_flg = "P" + ' moRS!y_flg = "P" + ' moRS!S_flg = "P" + ' cmdLathPrint.Enabled = False + End If + End If + End If + moRS.Update + gintCOPY = 1 + gboolPRINT = False +' cmdLathPrint.Enabled = False + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module cmdLathPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdWrapPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer, intYNW As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer, intWRAPCREW As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + strCrewType = "" + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + mboolWRAPC = False + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If IsNull(Date2Field(moRS!calcdate)) Or (Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate)) Then +' If Date2Field(moRSPlan!Update) > Field2Str2(moRS!calcdate) Then +' If Field2Str(moRSPlan!Update) > Field2Str(moRS!calcdate) Then +' MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" +' cmdExit.Enabled = True +' Exit Sub +' End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + gintCOPY = 1 + If mboolSPLIT Then + 'look at the next line and decide if it needs to be deleted + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Wrap Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + + intYNW = MsgBox("Do You Want To Use A Crew Number With The Wrap PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNW = vbYes Then + intWRAPCREW = InputBox("Enter The Wrap Crew Number", "Wrap Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE NOT INACTIVE AND Crew_ID = " & intWRAPCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intWRAPCREW = 0 Or IsNull(intWRAPCREW) Or strCrewType <> "L" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Wrap Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Wrap Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intWRAPCREW) + moRS!WCREW = Field2Str2(intWRAPCREW) + moRS.Update + mboolWRAPC = True + End If + Else + moRS!WCREW = 0 + moRS.Update + End If + + gboolPRINT = True + gstrPO = "W" 'Wrap + gstrFLAG = "W" 'Wrap + gstrTYPE = "S" +' gstrTYPE = "Y" + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'W'" +' strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) +' moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'W')" +' strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then + + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Wrap PO" + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewWrap2.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + 'This is to remove 2 pages not needed with wrap orders take out the 'x to turn back on + +'x gintCOPY = 2 +'x If moRSProj!cocode = 0 Then +'x crOrder.ReportFileName = App.Path & "\NewWrap.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewLathM.rpt" +'x End If + +'x crOrder.ReplaceSelectionFormula (strSQL) +'x crOrder.Destination = crptToPrinter +'x crOrder.CopiesToPrinter = gintCOPY +'x crOrder.Action = 1 +'x crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER WRAP ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and M_Type = 'W'" + goConn.Execute strSQLUP + + gintCOPY = 1 + crOrder.Reset + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " +' Call PrintWrapMat +' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Wrap Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gstrMODULE = "Before Print Lath Pay " + + Call PrintWrapPay + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + End If + End If + End If ''''**** may need to remove this + + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update + 'Moved From Print Lath to Help with preliens + + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If + End If + + gintCOPY = 1 + gboolPRINT = False + + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module cmdWrapPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintLathPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + If mboolLATHC Then + crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpay.rpt" + Else + crOrder.ReportFileName = App.Path & "\lathpay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + mstrCREWTYPE = "L" + Call GetPayRates + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + mstrCREWTYPE = "L" + moRSPay!Type = "L" + moRSPay!worktype = "P" + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + mstrCREWTYPE = "L" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintLathPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +Dim dblGROSSPAY As Double, strGROSSPAY As String + + On Error GoTo Error_EH + +' gintCOPY = 2 + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + + If moRSProj!cocode = 0 Then + If mboolWRAPC Then + crOrder.ReportFileName = App.Path & "\wrappay_17.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + Else + crOrder.ReportFileName = App.Path & "\wrappay_171.rpt" + End If + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) +' intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + mstrCREWTYPE = "L" + Call GetPayRates + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) +' intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) +' dblGROSSPAY = Round(dblGROSSPAY, 2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "W" + mstrCREWTYPE = "W" + moRSPay!worktype = "P" + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!WrapAmt = Field2Integer(moRS!pylath) + intYDS +' moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + mstrCREWTYPE = "L" + Call GetPayRates + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) ', "#,0.00") + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY ')) ', "$ #,0.00") + + crOrder.CopiesToPrinter = 1 +' crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "W" + mstrCREWTYPE = "W" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!WrapAmt = Field2Integer(moRS!pylath) + intYDS +' moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintWrapPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, strPAY As String +Dim dblGROSSPAY As Double, intMETAL As Integer, strGROSSPAY As String + + On Error GoTo Error_EH + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + If mboolSTUCCOC Then + crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + Else + crOrder.ReportFileName = App.Path & "\stuccopay_171.rpt" + End If + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + mstrCREWTYPE = "S" + Call GetPayRates + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + mstrCREWTYPE = "S" + Call GetPayRates + If intYDS < 300 Then + crOrder.CopiesToPrinter = 1 + Else + crOrder.CopiesToPrinter = 2 + End If +' crOrder.CopiesToPrinter = gintCOPY + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Format(Round(dblGROSSPAY, 2), "#,0.00") + strGROSSPAY = CStr(dblGROSSPAY) + crOrder.Formulas(4) = "Z_Gross = " & strGROSSPAY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + mstrCREWTYPE = "S" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL +' Call GetPayRates + moRSPay!M_Rate = msglPAYRT2 + moRSPay!Y_Rate = msglPAYRT1 + dblGROSSPAY = (intYDS * msglPAYRT1) + (intMETAL * msglPAYRT2) + dblGROSSPAY = Round(dblGROSSPAY, 2) + moRSPay!GROSSPAY = dblGROSSPAY + moRSPay!Amt = dblGROSSPAY + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!crewID = mintPAYCREW + moRSPay!texture = mstrTexture + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoThree() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +' crOrder.Action = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + + crOrder.ReportFileName = App.Path & "\stuccopayB_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayt.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintStuccoSyn() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoStone() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoStone" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssueHold() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!po_num = "ORIGINAL ORDER" + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintIssueHold" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssue() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean, strMType As String + On Error GoTo Error_EH +' gintCOPY = 2 + mstrMTYPE = "" + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + +' strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + + If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Round(dblOrder, 2) + oRS!qtyIssue = Round(dblOrder, 2) +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + + mstrMTYPE = Field2Str(oRSS!m_type) +' If mstrMTYPE <> "" Or Not IsNull(mstrMTYPE) Then + If mstrMTYPE = "P" Or mstrMTYPE = "Z" Then + Call GetPONUM + oRS!po_num = mstrORDERNUM + mstrORDERNUM = "" + mstrType = "" + End If + + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) +' lngSHIPPED = Round(Field2Str2(oRSS!o_qty), 2) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + + End If + oRSS.MoveNext + Loop + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" +' strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + goConn.Execute strSQLUP + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issue2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P' or {tblLOTMATRL.M_Type} = 'Z') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issueM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If +' gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintIssue" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPONUM() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT Lot_ID, M_Type, D_Flag, PO_NUM FROM tblORDERS WHERE Lot_ID = " & gintLOTID & " AND D_Flag = 'Y' AND M_Type = '" & mstrMTYPE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrORDERNUM = Field2Str(oRS!po_num) + End If + + Exit Sub +End Sub + +Private Sub PrintCoated() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean + On Error GoTo Error_EH + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'D' )" 'or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " And Split >= " & lngTIE +' strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D') And Split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + +' If oRS.RecordCount > 0 Then +' strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D') And Split >= " & lngTIE +' goConn.Execute strYARD +' End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'D')" 'or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + +' If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = dblOrder + oRS!qtyIssue = dblOrder +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS!d_flag = Field2Str(oRSS!d_flag) + oRS!m_type = Field2Str(oRSS!m_type) + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + +' End If + oRSS.MoveNext + Loop + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL COATED POPOUT ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " COATED POPOUT ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'D')" 'or M_Type = 'P')" + goConn.Execute strSQLUP + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\Coated2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\Coated2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE +' strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " and {tblYARDORDER.D_Flag} = 'Y' and {tblYARDORDER.M_Type} = 'D' AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\Coated.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\CoatedM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintCoated" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintLathMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathmat.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintLathMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'W' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\wrapmat.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) 'May need to removed the or {tblLOTMATRL.M_Type} = 'P' from the strSQL + crOrder.CopiesToPrinter = gintCOPY 'Find out from Ryan how to make this report process faster. +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintWrapMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" + crOrder.ReportFileName = App.Path & "\stuccomat.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintStuccoMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ShowPrint() +Dim oRS As Recordset +Dim strSQL As String, lngPO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngPO = Field2Long(oRS!nextpo) + gstrMODULE = "Line 8" + lngPO = lngPO + 1 + If lngPO > 99999 Then + lngPO = 1 + End If + oRS!nextpo = lngPO + oRS.Update + gstrMODULE = gstrMODULE & " Line 15" + + Load frmPrint + gstrMODULE = gstrMODULE & " Line 18" + frmPrint.txtJobCost = Field2Str(moRS!jobcost) + frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) +' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) + gstrMODULE = gstrMODULE & " Line 20" + frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) +' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) + gstrMODULE = gstrMODULE & " Line 22" + frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "0000") +' gstrPONUM = gstrPONUM & Format(intPO, "0000") + gstrMODULE = gstrMODULE & " Line 24" + frmPrint.txtMFlag = gstrFLAG + gstrMODULE = gstrMODULE & " Line 26" + frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) +' gstrCREW = Left$(Field2Str(txtPODesc), 20) + gstrMODULE = gstrMODULE & gstrFLAG & " " + frmPrint.txtDFlag = gstrTYPE + gstrMODULE = gstrMODULE & " Line 30" + If mintSUPPLIER = 99 Then + frmPrint.txtPO = Field2Str2(moRSPO!ponum) +' gintPONUM = moRSPO!ponum + Else + frmPrint.txtPO = 0 +' gintPONUM = 0 + End If + gstrMODULE = gstrMODULE & " Line 35" + frmPrint.Show 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo5 - Module ShowPrint" +' gstrMODULE = " Form LotInfo5 - Module ShowPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdAddPO_Click() + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" + End If + + Call POClear + gconACTION = 0 + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + mboolAdding = True + cboPOType.SetFocus +End Sub + +Private Sub cmdLFlag_Click() + moRS!y_FLG = "P" + moRS!l_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + Call cmdSaveLotInfo_Click + cmdLFlag.Visible = False + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If +End Sub + +Private Sub cmdOrder_Click() + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdPreOrderPrintY_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "Y" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & " ' and {tblORDERS.m_type} = '" & oRS!m_type & "'" + + strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + gboolPRINT = False + Call Form_Load + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPreOrderPrintY" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +'''Private Sub cmdPrint_Click() +''' If cmdPrint.Caption = "Print Lath Order" Then +''' Call cmdLathPrint_Click +''' ElseIf cmdPrint.Caption = "Print Sand Order" Then +''' Call cmdSandPrint_Click +''' ElseIf cmdPrint.Caption = "Print Brown Order" Then +''' Call cmdBrownPrint_Click +''' ElseIf cmdPrint.Caption = "Print Scratch Order" Then +''' Call cmdScratchPrint_Click +''' ElseIf cmdPrint.Caption = "Print Texture Order" Then +''' Call cmdTexturePrint_Click +''' ElseIf cmdPrint.Caption = "Print Stone Order" Then +''' Call cmdStonePrint_Click +''' Else + +''' End If +'''End Sub + +Private Sub cmdPrintCMU_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\cmupay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN + Call FormSave +' cmdPrintCMU.Enabled = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintCMU_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() + Call ProcessRpt +End Sub + +Private Sub cmdPrintPOPay_Click() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + gintPRINT = 1 + frmReport.Show 1 + If gintPRINT Then + Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") + + strSQL = "{tblPOrder.ponum} = " & mintPONUM + crOrder.ReportFileName = App.Path & "\POpay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + ' crOrder.Destination = crptToWindow + ' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS!pay_flag = vbTrue + oRS.Update + cmdPrintPOPay.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintPOPay_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPO_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, intResponse As Integer +Dim strSELECT As String + + mintBOOKMARK = lstPO.ListIndex + + On Error GoTo Error_EH + + gboolPRINT = True + If optPreOrder Then + gstrFLAG = "P" + Else + gstrFLAG = "R" + End If + gintCOPY = 1 + If optLath Then + gstrTYPE = "Y" + ElseIf optStucco Then + gstrTYPE = "S" + ElseIf optSand Then + gstrTYPE = "A" + ElseIf optPreOrder Then + gstrTYPE = "Y" + ElseIf optStone Then + mboolSTONE2 = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + ElseIf optNone Then + gstrTYPE = "" + End If + mintSUPPLIER = 99 + Call ShowPrint + mintSUPPLIER = 0 + + If gboolPRINT And mboolSTONE2 Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) +' moRS!st_flg = vbTrue + moRS.Update + End If + End If + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS!p_flg = "P" Then + MsgBox "This PO has already been printed" + Exit Sub + End If + If Not oRS.EOF Then + crOrder.Reset + strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + If gstrPO <> "L" Then + crOrder.ReportFileName = App.Path & "\POMisc.rpt" + Else + Call POSetup + crOrder.ReportFileName = App.Path & "\purchase.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + oRS!p_flg = "P" + oRS.Update + End If + gboolPRINT = False + If gstrPO = "L" Then + intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") + If intResponse = vbOK Then + Call POInvoice + End If + End If + Call Form_Load + SSTLotInfo.Tab = 6 + Else + Call Form_Load + SSTLotInfo.Tab = 6 + End If + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdPrintPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub POSetup() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblOrder As Double + + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + dblOrder = Field2Str2(oRS!qty) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + +End Sub + +Private Sub cmdPreOrderPrintS_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gintCOPY = 2 + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + + End If + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" ' + +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblLOTMATRL.d_flag} = 'S' and {tblLOTMATRL.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + gintCOPY = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PreOrderPrintS_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPreOrderPrintPC_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "Z" + gstrTYPE = "Y" +' gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'Z'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" + crOrder.ReportFileName = App.Path & "\preorderPC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PreOrderPrintPC_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintForm_Click() + Me.PrintForm +End Sub + +Private Sub cmdPrintR_Click() + Call ProcessRpt +' Call LotLoad + If mboolNoPrint Then + MsgBox "No Processing Selected Yet - Exiting", vbOKOnly + Exit Sub + End If + If mboolSupP Then + Call cmdSuperRpt_Click + End If + If mboolStoneP Then + MsgBox "Stone Not Setup", vbOKOnly, "Not Enabled" + moRS!StoneP = vbFalse + moRS.Update + Call cmdStonePrint_Click + End If + If mboolWrapP Then + Call cmdWrapPrint_Click + End If + If mboolLathP Then + Call cmdLathPrint_Click + End If + If mboolNescoP Then + MsgBox "Nesco Not Setup", vbOKOnly, "Not Enabled" + moRS!NescoP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolPopOutP Then + MsgBox "PopOut Not Setup", vbOKOnly, "Not Enabled" + moRS!PopoutP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolBrownP Then + Call cmdBrownPrint_Click + End If + If mboolTexP Then + Call cmdTexturePrint_Click + End If + If mboolCMUP Then + MsgBox "CMU Not Setup", vbOKOnly, "Not Enabled" + moRS!CMUP = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX1P Then + MsgBox "Extra 1 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX1P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX2P Then + MsgBox "Extra 2 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX2P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + If mboolEX3P Then + MsgBox "Extra 3 Not Setup", vbOKOnly, "Not Enabled" + moRS!EX3P = vbFalse + moRS.Update +' Call cmdSuperRpt_Click + End If + + mboolSupP = False + mboolLathP = False + mboolWrapP = False + mboolStoneP = False + mboolNescoP = False + mboolPopOutP = False + mboolCMUP = False + mboolBrownP = False + mboolTexP = False + mboolEX1P = False + mboolEX2P = False + mboolEX3P = False +End Sub + +'''Private Sub cmdPrint_Click() +''' If cmdPrint.Caption = "Print Lath Order" Then +''' Call cmdLathPrint_Click +''' ElseIf cmdPrint.Caption = "Print Sand Order" Then +''' Call cmdSandPrint_Click +''' ElseIf cmdPrint.Caption = "Print Brown Order" Then +''' Call cmdBrownPrint_Click +''' ElseIf cmdPrint.Caption = "Print Scratch Order" Then +''' Call cmdScratchPrint_Click +''' ElseIf cmdPrint.Caption = "Print Texture Order" Then +''' Call cmdTexturePrint_Click +''' ElseIf cmdPrint.Caption = "Print Stone Order" Then +''' Call cmdStonePrint_Click +''' Else + +''' End If +'''End Sub + + +Private Sub cmdRePrintL_Click() + Call RePrintLath + cmdRePrintL.Visible = False + Call FormShow +End Sub + +Private Sub cmdSandPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single +Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Field2Str2(moRS!zone) = 0 Then + MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" + Exit Sub + End If + +'' If chkHoldOrders Then +'' MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + cmdExit.Enabled = False +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If +' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "A" + gstrTYPE = "A" + gintCOPY = 1 + Call ShowPrint + gstrMODULE = "After SHOWPRINT " + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- Plaster Sand " & vbCrLf + strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf + If boolCOMPLETE Then + dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) + End If + strMSG = strMSG & "Tons For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = moRS!ORD_NO + dblOrder + If dblCheck > moRS!sand_ton Then + dblOrder = moRS!sand_ton - moRS!ORD_NO +' Else + End If + moRS!ORD_NO = moRS!ORD_NO + dblOrder + moRS.Update + Else + dblOrder = moRS!sand_ton + End If + + moRS!Border = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!a_flg = vbTrue + End If + moRS.Update + gstrMODULE = "After Update Delivery Date " +' glngORDERID = Field2Long(oRS!order_id) + + strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & Field2Integer(moRS!zone) + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + If oRSSS.EOF Then + Else + oRSSS.MoveFirst + strFIND = "zone = " & Field2Str2(moRS!zone) + oRSSS.Find strFIND + sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") + End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Before Setup Materials " + With oRSS + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9999" + !Desc = "ICBO RIVER PLASTER SAND" + !x_flag = vbChecked + !o_qty = dblOrder + !a_qty = dblOrder + !price = sglSAND + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9994" + !Desc = "SPLIT CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 15 + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9993" + !Desc = "MINIMUM ORDER CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 40 + .Update + End With + crOrder.Reset + strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\sand.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\sandM.rpt" + End If + crOrder.Formulas(1) = "Sand = " & dblOrder + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + gboolPRINT = False +' cmdSandPrint.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5 - Module cmdSandPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdSaveLotInfo_ClickOLD() + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSavePO_Click() +Dim lngID As Long + If Not IsDate(txtPODate) Then + MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" + txtPODate.SetFocus + Exit Sub + End If + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - Talk to Angel", vbOKOnly, "Plan Verified" + Call LotChange(mstrPROJLOT, "Chnge After Verified") + End If + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Chnge PO Information") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPO.ListIndex + If mboolAdding Then + If mintBOOKMARK = -1 Then + mintBOOKMARK = 0 + End If + End If + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + lstLOOKUP.Visible = False + Call POSave + Call POLoad + + If mboolAdding Then + mboolAdding = False + lngID = FindMax("tblPOrder", "PONum") + Call CBFindString(lstPO, CStr(lngID)) + cmdAddPOMat.SetFocus + mintBOOKMARK = lstPO.ListIndex + End If + + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePOMat_Click() +Dim intINVNO As Integer, lngID As Long + + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Change PO Material") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPOMaterial.ListIndex + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + lstLOOKUP.Visible = False + intINVNO = txtPOInvNo + Call POMatSave + Call POMatLoad + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + If mboolAdding Then + mboolAdding = False + Call CBFindString4(lstPOMaterial, CStr(intINVNO)) + cmdAddPOMat.SetFocus + mintBOOKMARK = 0 + Exit Sub + End If + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = CLng(mintBOOKMARK) +' lstPOMaterial.ListIndex = 5 + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = -1 + End If + mintBOOKMARK = 0 +End Sub + +Private Sub cmdScratchPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String, strSQLUP As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gboolPRINT = True + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gstrPO = "L" + gstrFLAG = "S" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!TORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!c_flg = vbTrue + End If + moRS.Update + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" + crOrder.ReportFileName = App.Path & "\NewScratch.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'S')" + goConn.Execute strSQLUP + +' cmdScratchPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdScratchPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub +Private Sub PrintActual() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actual.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintActual" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSetupRpt_Click() + frmLotPrtJobs.Show 1 + Call LotLoad +End Sub + +Private Sub cmdShowChange_Click() + frmLotChLog.Show 1 +End Sub + +Private Sub cmdStonePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean + + On Error GoTo Error_EH + boolNOSTONE = False + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If + + gintCOPY = 1 + + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) + If boolCOMPLETE Then +' moRS!st_flg = vbTrue + End If + moRS.Update + End If + + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + boolNOSTONE = True + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' If oRSS.State = adStateOpen Then +' oRSS.Close +' End If + If Not boolNOSTONE Then + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + + crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" + gintCOPY = 1 + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + crOrder.ReportFileName = App.Path & "\StonePay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + If boolCOMPLETE Then + Call PrintStoneInv + crOrder.Reset + End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + Call Form_Load + End If +' cmdStonePrint.Enabled = False + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdStonePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub + +End Sub + + +Private Sub cmdStuccoPay_Click() +Dim strPAY As String + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") + If moRSProj!stype <> "T" Then + gintCOPY = 1 + Call PrintStuccoPay + Else + gintCOPY = 1 + Call PrintStuccoThree + End If + cmdStuccoPay.Visible = False +End Sub + +Private Sub cmdSuperRpt_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer + + On Error GoTo Error_EH + + cmdExit.Enabled = False + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + Exit Sub + End If + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + gintCOPY = 1 + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update + gintPRINT = 9 + frmReport.Show 1 + If gintPRINT = 0 Then + cmdExit.Enabled = True + Exit Sub + End If + strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + + crOrder.ReportFileName = App.Path & "\super.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + cmdExit.Enabled = True + + strSELECT = moRS!model +' moRS!superd = vbTrue + moRS!superp = vbFalse + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdSuperRpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intSTUCCOTCREW As Integer +Dim oRS As Recordset, oRSS As Recordset, intYNS As Integer, intSTUCCOCREW As Integer +Dim strSELECT As String, strSql2 As String, strSQLUP As String, intTCPAY As Integer +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String, intCOPY As Integer +Dim oRSC As Recordset, strCrewType As String, strSQLCREW As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + mintPAYCREW = 0 + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + +'' If chkHoldOrders Then +'' MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" +'' cmdExit.Enabled = True +'' Exit Sub +'' End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + +'***** LOGIC TO SETUP CREW NUMBERS FOR TEXTURE PAYSHEETS + + If moRS!texture = "S2" Or moRS!texture = "SB" Then + intYNS = MsgBox("Do You Want To Use A Crew Number With The Texture PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNS = vbYes Then + intSTUCCOTCREW = InputBox("Enter The Texture Crew Number", "Stucco Crew", 0) + + strSQLCREW = "SELECT * FROM tblcrew WHERE Not InActive AND Crew_ID = " & intSTUCCOTCREW + Set oRSC = New Recordset + oRSC.Open strSQLCREW, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + strCrewType = oRSC!Type + End If + + If intSTUCCOTCREW = 0 Or IsNull(intSTUCCOTCREW) Or strCrewType <> "S" Then + If strCrewType = "" Then + MsgBox "Crew Is InActive - Must Enter An Active Stucco Crew Number - Will Exit Now", vbOKOnly, "InActive Crew" + Exit Sub + End If + MsgBox "Must Enter A Valid Stucco Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intSTUCCOTCREW) + moRS!TCREW = Field2Str2(intSTUCCOTCREW) + moRS.Update + mboolSTUCCOC = True + End If + Else + moRS!TCREW = 0 + moRS.Update + mboolSTUCCOC = False + End If + End If + +'***** INSERTED TO PRINT TEXTURE PAYSHEETS FOR S2 and SB textures + + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then '**** Three Coat + If Field2Str2(txtTtlYdge) - 24 > 1200 Then 'If error for S2 and SB paysheets on large yardage, this logic needs to be tweeked + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + If mboolST_ADJ Then + Call PrintStuccoPay4 + Else + Call PrintStuccoPay4 '****** + End If + crOrder.Reset + gintCOPY = 1 + Else + + If moRS!texture = "SB" Or moRS!texture = "S2" Then '*** This is to print Brown paysheets + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoPay4 + crOrder.Reset + gintCOPY = 1 + End If + '*************** commenting this out to stop non SB or S2 printing texture pay sheets + +'' If (moRS!texture <> "SB" And moRS!texture <> "S2") Then +'' MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +'' gintCOPY = 2 +'' If mboolST_ADJ Then +'' Call PrintStuccoPay2 +'' Else +'' Call PrintStuccoPay +'' End If +'' crOrder.Reset +'' gintCOPY = 1 +'' crOrder.Reset +'' gintCOPY = 1 +'' End If + End If + End If + '********** End of information copied to print stucco pay sheets - copied from Print Lath Orders + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + moRS!TexD = vbTrue + End If + moRS.Update + + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and M_Type = 'T'" + goConn.Execute strSQLUP + + gboolPRINT = False + '**** Stone Print moved back to it own button on 06/27/05 + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdUpCMU_Click() +Dim intCMU As Integer + + intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") + If intCMU > 0 Then + moRS!CMU = intCMU + moRS.Update + Call FormShow + End If +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + mboolBAD = False +' mboolENTER = False + + If gintLOTID = 0 Then + intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") + If intResponse = vbYes Then + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAddLot_Click + If mboolBAD Then + Unload Me + End If + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String, intYN As Integer +Dim strPAY As String, strMSG As String, lngOPTID As Long +Dim strSQLST As String, oRSST As Recordset, strSQLPST As String, oRSPST As Recordset +Dim intYNW As Integer, intWRAPCREW As Integer + + mboolSTPAY = False + +' E Print Stone Order +' Ctrl-5 Reset to allow Brown To Be Reprinted (B_Flg, BrownP, BrownD) +' L Allow Reprint of Lath Pay Sheets +' This is turned off *** A Allow update of Address and Owner information on after Lot has been completed +' X Update Paint Square Footage +' T Print Paint Pay Sheets if not already done. +' J RePrint Wrap Pay Sheets +' S Reprint Stucco Pay Sheets +' M Resets the PO Flag to true +' W Update cost on the highlighted item in the Materials List +' Y Allow the reprint of the Lath Yard Order +' I Allow Lath Material Order to be reprinted +' F Turn On The Lath material +' R Turn on the RePrint Lath Button +' H ReSet The PreOrder info & Turn On The Print PreOrder Button +' D Turn on the Reprint PreorderY button +' G Print the Actual Report for Jesse +' N Turn on the Save Lot Info BUtton +' U Set flag for Stucco Cert +' Q Mark a lot option for Stone +' A Print a Stone Invoice +' O Update Stone Options to No Invoice + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKey5 And gbytSECURITY < 3 Then ' Lath Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + moRS!b_flg = False + moRS!BrownP = False + moRS!BrownD = False + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyO And gbytSECURITY < 3 Then ' Update No Invoice for Stone Option +' If CtrlDown And SSTLotInfo.Tab = 1 Then + If CtrlDown Then + Call UpInvoice + End If + Exit Sub + End If + + If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Lath Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyA And gbytSECURITY < 3 Then ' Allow RePrint of Stone? Pay Sheets + If CtrlDown And SSTLotInfo.Tab = 6 Then + mboolSTPAY = True + Call POInvoice + ' cmdLathPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyJ And gbytSECURITY < 3 Then ' Wrap Pay Reprint. + If CtrlDown And SSTLotInfo.Tab = 1 Then + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + intYNW = MsgBox("Do You Want To Use A Crew Number With The Wrap PaySheet? Y or N)", vbYesNo, "Use Crew") + If intYNW = vbYes Then + intWRAPCREW = InputBox("Enter The Wrap Crew Number", "Wrap Crew", 0) + If intWRAPCREW = 0 Or IsNull(intWRAPCREW) Then + MsgBox "Must Enter A Valid Crew Number Greater Than Zero (0) - Will Exit Now", vbOKOnly, "Invalid Crew" + Exit Sub + Else + mintPAYCREW = Field2Str2(intWRAPCREW) + moRS!WCREW = Field2Str2(intWRAPCREW) + moRS.Update + mboolWRAPC = True + End If + Else + moRS!WCREW = 0 + moRS.Update + End If + gintCOPY = 1 + Call PrintWrapPay + End If + Exit Sub + End If + +' If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Turn the address & owner field on & the SAVE Button +' If CtrlDown And SSTLotInfo.Tab = 0 Then +' txtAddress.Enabled = True +' txtOwner.Enabled = True +' cmdSaveLotInfo.Enabled = True +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "VHJ") Then ' Print Special Report for Jesse +' Dim intYN As Integer + If CtrlDown And SSTLotInfo.Tab = 1 Then + intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") + If intYN = vbNo Then + Exit Sub + End If + Call PrintActualJG + End If + Exit Sub + End If + + If KeyCode = vbKeyU Then ' Make the Flag that Shows Stucco Cert Done - True + If CtrlDown Then + moRS!SCert = vbTrue + moRS.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' REPrint Stucco Pay. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdStuccoPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm + If CtrlDown And SSTLotInfo.Tab = 2 Then + strINVNO = lstLMaterial.ItemData(lstLMaterial.ListIndex) + strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & strINVNO + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) + oRS!price = Field2Str2(strCOST) + oRS.Update + + End If + Exit Sub + End If + If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' RePrint Yard Ticket. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Caption = "RePrint &Yard Ticket" + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyZ And gbytSECURITY < 3 Then ' RePrint Actual REport. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Caption = "RePrint Actual Rpt" + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Reprint Lath Material. + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call PrintLathMat + gintCOPY = 1 + End If + Exit Sub + End If + + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLFlag.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdRePrintL.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' Reprint Preorder PreCut + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintPC.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyD And gbytSECURITY < 3 Then 'RePrint Yard Pre Order + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintY.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyE And gbytSECURITY < 3 Then ' Reprint Wrap + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call cmdWrapPrint_Click + End If + Exit Sub + End If + + If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If CtrlDown Then + cmdSaveLotInfo.Enabled = True + cmdSaveLotInfo.SetFocus + End If + Exit Sub + End If + + If Field2Str(moRS!l_FLG) <> "P" Then + If Not cmdSaveLotInfo.Enabled Then + Call DataHasChanged + End If + End If +End Sub + +Private Sub DataHasChanged() + + cmdSaveLotInfo.Enabled = True + cmdAddLot.Enabled = False + +End Sub + +Private Sub PrintActualJG() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, intYN As Integer +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actualJG.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + intYN = MsgBox("Do You Want To Print To The Printer", vbYesNo + vbDefaultButton2, "Printer or Screen") + If intYN = vbYes Then + crOrder.Destination = crptToPrinter + Else + crOrder.Destination = crptToWindow + End If +' crOrder.Destination = crptToWindow + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PrintActualJG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtLMInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + txtLMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtLMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdFindInv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFindPlan_Click() +Dim oRS As Recordset, oRSSS As Recordset +Dim strSQL As String, lngFind As Long, strTEST As String +Dim strSql2 As String + On Error GoTo Error_EH + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not mboolAdding Then + txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + + If oRS.RecordCount > 0 Then + + With oRS + +' txtTtlYdge = Field2Integer(!TO_TTLYDS) + txtTtlYdge = Field2Integer(!mat_yds) 'Changed back per Jesse on 07/09/2018 + txtModel = Field2Str(!Mod_Elv) + txtCMUYdge = Field2Integer(!CMUYDS) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + If !HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If +' chkHLNote = Field2CheckBox(!HLNotes) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Integer(!opening) + chkStone = Field2CheckBox(!stone) + '*** Do We Need To Add Paint Here??? + txtStone = Field2Str2(!ST_SQFT) + txtStoneBill = Field2Str2(!st_bill) + moRS!Scaf6 = Field2Str2(!Scaf6) + moRS!scaf10 = Field2Str2(!scaf10) + moRS!TWOSTORY = !TWOSTORY + moRS!openpr = Field2Str2(!openpr) + moRS!P_RL = Field2CheckBox(!P_RL) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Pre Mix Stucco" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + If Not !Firsttime Then + !Firsttime = vbChecked + chkFirst = vbChecked + .Update + End If + + gintESTID = !est_id + If Not mboolAdding Then + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + End If + Call FieldsSave + End With + ' oRS.Update + 'clear materials and get correct for model + 'update materials and yardage for options + Else + Call PlanLoad + cmdFindPlan.Visible = False + If lstPlans.ListCount = 0 Then + MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" + cmdSaveLotInfo.Enabled = False + gstrFLAG = "P" + Unload Me + Exit Sub + Else + lstPlans.ListIndex = 0 + lstPlans.SetFocus + oRS.Close + Exit Sub + End If + End If + oRS.Close + If mboolAdding Then + Call ElevLoad + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad + mboolAdding = False + Else + Call ElevLoad + Call DelLotMat + Call PlanMatLoad + Call ReloadOptMat + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call cmdSaveLotInfo_Click + Call UpInvoice + Call cmdExit_Click + End If + + + Exit Sub + +Error_EH: + Call ErrorHandler(oRSSS.ActiveConnection) +' gstrMODULE = "Form LotInfo5 - Module cmdFindPlan_Click" +' Call ErrorHandler2 +' gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DelLotMat() +Dim strSQL As String + + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked + goConn.Execute strSQL + +End Sub + +Private Sub ReloadOptMat() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + mintOPTID = Field2Long(oRS!Opt_ID) + Call UpLotInfo + Call UpLMat + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: +' Call ErrorHandler(oRSS.ActiveConnection) + gstrMODULE = "Form LotInfo5 - Module ReloadOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdAddLot_Click() +Dim strSTARTDATE As String, lngPOS As Long + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub + ' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" + ' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + Else + mstrSTARTDATE = strSTARTDATE + End If + mboolAdding = True + gconACTION = 0 + gintLOTID = 0 + txtJC.Enabled = True + cmdCalc.Enabled = False + cmdDelLot.Enabled = False + cmdAddLot.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptAdd.Enabled = False + cmdOptDel.Enabled = False + txtLotNo.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + Call LotNew + Call FormClear + Call MatClear + + txtAddress.SetFocus +End Sub + +Private Sub cmdAddMatrl_Click() +' lstLMaterial.ListIndex = -1 + lstLMaterial.Enabled = False +' moRSMat.Update +' moRSMat.Close + Call MatClear + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdInventory.Visible = True + lblMatInst.Visible = True + txtLMDesc.SetFocus + mboolAdding = True + +End Sub + +Private Sub cmdDelMatrl_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstLMaterial.ListIndex + moRSMat.Delete + Call LotChange(mstrPROJLOT, "Delete Material") + Call MatLoad + If lstLMaterial.ListCount Then + If lstLMaterial.ListCount > mintBOOKMARK Then + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstLMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False +End Sub + +Private Sub cmdInventory_Click() + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub UpInvoice() +Dim strSQL As String, strSQLP As String +Dim oRS As Recordset, oRSP As Recordset +Dim lngOPTID As Long, OPTCNT As Integer, CNT As Integer + + CNT = 0 + OPTCNT = lstLOptions.ListCount + If lstLOptions.ListCount <> 0 Then + Do Until CNT = OPTCNT + strSQL = "SELECT * FROM tblLOption WHERE Opt_ID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " AND LOT_ID = " & gintLOTID +' strSQL = "SELECT * FROM tblLOption WHERE Opt_ID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + strSQLP = "SELECT * FROM tblPOption WHERE OptID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSP.EOF And oRSP!invoice Then +' If oRSP!invoice Then + oRS!invoice = vbTrue + oRS.Update +' End If + End If + + End If + If lstLOptions.ListIndex + 1 <> OPTCNT Then + lstLOptions.ListIndex = lstLOptions.ListIndex + 1 + End If + CNT = CNT + 1 + Loop + + End If + +End Sub + +Private Sub cmdOptAdd_Click() +Dim strSQL As String +Dim strSql2 As String, oRS As Recordset + + On Error GoTo Error_EH + + If moRSLOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblLOption where opt_id = 1" + Set moRSLOpt = New Recordset + moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + End If + + strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!Lot_ID = gintLOTID + moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) + mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt!C_USER = gstrLOGIN + If oRS!ostone Then + moRSLOpt!ostone = vbChecked + moRSLOpt!invoice = vbChecked +' moRSLOpt.Update + End If + moRSLOpt.Update + If oRS!ostone Then + moRSLOpt!ostone = vbChecked + End If + lstPOptions.Enabled = True + Call UpLotInfo + Call UpLMat + Call LOptLoad + Call FieldsSave + Call MatSave + Call MatLoad + lstPOptions.ListIndex = -1 + cmdOptAdd.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module cmdOptAdd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOptDel_Click() +Dim strSQL As String + gconACTION = 3 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Call LotChange(mstrPROJLOT, "Delete Lot Option") + Call UpdateLotInfo + Call UpdateLMat + Call MatSave + Call MatLoad + Call FieldsSave + strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call LOptLoad + cmdOptDel.Enabled = False + gconACTION = 0 + If lstOptMatrl.ListCount > 0 Then + lstOptMatrl.Clear + If lstLOptions.ListCount > 0 Then + lstLOptions.ListIndex = 0 + Call lstLOptions_Click + End If + End If +End Sub + +Private Sub UpLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + oRSSS.AddNew + oRSSS!Lot_ID = gintLOTID + oRSSS!inv_no = Field2Str(oRSS!inv_no) + oRSSS!Desc = Field2Str(oRSS!Desc) + oRSSS!d_flag = Field2Str(oRSS!d_flag) + oRSSS!m_type = Field2Str(oRSS!m_type) + oRSSS!calc_flag = Field2Str(oRSS!calc_flag) + oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) + oRSSS!qty = Field2Str(oRSS!qty) + oRSSS.Update +' oRSSS.Close + Else + oRSSS!qty = (oRSSS!qty + oRSS!qty) + oRSSS.Update + ' oRSSS.Close + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + + oRS.Close + oRSS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset, intTEST As Integer +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + intTEST = oRSS.RecordCount + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + Else + oRSSS!qty = (oRSSS!qty - oRSS!qty) + If oRSSS!qty <= 0 Then + oRSSS.Delete + Else + oRSSS.Update + End If + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + If Err = -2147217885 Then + Resume Next + Else + gstrMODULE = "Form LotInfo5 - Module UpdateLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub +Private Sub UpdateLotInfo() +Dim oRS As Recordset, oRSE As Recordset, oRSL As Recordset, strSQLLO As String +Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String +Dim strSQL As String, strSql2 As String, strSQLE As String + On Error GoTo Error_EH + '******************** Need To Make Sure That STONE LotOptions have NoInvoice checked + strSQL = "SELECT * FROM tblPOption WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS!invoice Then + strSQLLO = "SELECT * FROM tblLOption WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + End If + + moRS!sq_yd = moRS!sq_yd - oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 - oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj - oRS!f_adj + txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + strSQL = "SELECT Texture " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + moRS!texture = Field2Str(oRSS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + + If moRS!texture <> "SB" Then + chkSynthetic = vbUnchecked + lblSynthetic.Visible = False + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + + strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID + Set oRSSE = New Recordset + oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSE.EOF Then + oRSE!FileName = oRSSE!FileName + oRSE.Update + oRSE.Close + End If + oRSSE.Close + End If + If oRS!ostone Then +' moRS!stone = vbUnchecked + chkStone = vbUnchecked + moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt + txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) + txtStone = moRS!ST_SQFT + moRS!ostone = vbUnchecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpdateLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub UpLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim strSQL As String, strMSG As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOption WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.RecordCount = 0 Then + strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" + Exit Sub + End If + + moRS!sq_yd = moRS!sq_yd + oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 + oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj + oRS!f_adj + txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + moRS!texture = Field2Str(oRS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + If moRS!texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSE.EOF Then + oRSE!FileName = oRS!FileName + oRSE.Update + oRSE.Close + End If + End If + If oRS!ostone Then +' moRS!stone = vbChecked + chkStone = vbChecked + moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt +' = Val(txtStoneBill) + Field2Double(oRS!amt) + txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) + txtStone = moRS!ST_SQFT + moRS!ostone = vbChecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module UpLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If mboolCRITICAL Then + Exit Sub + End If + If gstrFLAG <> "D" Then + If gstrFLAG <> "P" Then + If cmdSaveLotInfo.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + End If + End If + + If moRS.State = adStateOpen Then + moRS.Update + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + gintLOTID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cmdSaveLotInfo_Click() + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If +' cmdAddLot.Enabled = True + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSaveMatrl_Click() + + + If gconACTION = 6 Then + Call LotChange2(mstrPROJLOT, "Change Lot Material", txtLMDesc, mstrBEGQTY, mstrENDQTY) +' Call LotChange(mstrPROJLOT, "Change Lot Material") + gconACTION = 0 +' End If + ElseIf gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + On Error GoTo Error_EH + mintBOOKMARK = lstLMaterial.ListIndex + + + ' Store the controls to the recordset + Call MatSave + + Call MatLoad + +' mintINVNO = Field2Str2(moRSMat!inv_no) + If mboolAdding Then + mboolAdding = False + Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) +' Call ListFindItem(lstLMaterial, CLng(mintINVNO)) + mintBOOKMARK = lstLMaterial.ListIndex + End If + + cmdInventory.Visible = False + lblMatInst.Visible = False + If gconACTION <> 5 Then + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + End If + + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + lstLMaterial.SetFocus + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() +Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + Set moRSPO = New Recordset + Set moRSPOMAT = New Recordset + Set moRSMemo = New Recordset + + On Error GoTo Error_EH + + mboolHLNotes = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + + gboolPSpecialCALC = False + gboolPULTE = False + +' If moRS!P_RL Then +' gboolPSpecialCALC = True +' End If + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 30 +' gdteUPDATE = oRS!LastUP - 45 + + strSQLL = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + + lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) + mlngINVID = lngINVID + lngINVID = lngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID + moRSInvINFO.Update + + mboolSPLIT = False + mboolStone = False + gstrFLAG = "" + gstrPO = "L" +' gbytSECURITY = 1 + SSTLotInfo.Tab = 0 + mboolCRITICAL = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + ' if + Call MTypeLoad(cboPOMType) + Call MTypeLoad(cboLMType) + Call MTypeLoad(cboLOMType) + Call ProjLoad + + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + + If FormFind() Then + Call PlanFind + If mboolCRITICAL Then + Unload Me + Exit Sub + End If + If mboolStone Then + Call SetStone + End If + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad +' Call POMatLoad + End If + If gintLOTID <> 0 Then + If IsNull(moRS!y_FLG) Then + cmdPreOrderPrintY.Enabled = True + End If + If mboolNOTSUPPLIER Then + moRS!s_FLG = "P" + moRS.Update + End If + If IsNull(moRS!s_FLG) Then + cmdPreOrderPrintS.Enabled = True + End If + If IsNull(moRS!z_FLG) Then + cmdPreOrderPrintPC.Enabled = True + End If + +' If IsNull(moRS!l_flg) Then +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then +' cmdSandPrint.Enabled = True +' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!b_flg Then +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdStonePrint.Enabled = True +' End If + +''' If IsNull(moRS!l_FLG) Then +''' cmdPrint.Caption = "Print Lath Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then +''' cmdPrint.Caption = "Print Sand Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!b_flg Then +''' cmdPrint.Caption = "Print Brown Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +''' cmdPrint.Caption = "Print Scratch Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!b_flg And Not moRS!t_flg Then +''' cmdPrint.Caption = "Print Texture Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +''' cmdPrint.Caption = "Print Stone Order" +''' cmdPrint.Enabled = True +''' Else +''' cmdPrint.Caption = "All Orders Printed" +''' cmdPrint.Enabled = False +''' End If + + If IsNull(moRS!l_FLG) Then +''' cmdPrint.Caption = "Print Lath Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then +''' cmdPrint.Caption = "Print Sand Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!b_flg Then + ElseIf moRS!l_FLG = "P" And Not moRS!b_flg Then + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' cmdPrint.Caption = "Print Brown Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +''' cmdPrint.Caption = "Print Scratch Order" +''' cmdPrint.Enabled = True + ElseIf moRS!b_flg And Not moRS!t_flg Then + moRS!BrownP = vbTrue + moRS!BrownD = vbTrue + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' ElseIf moRS!t_flg Then +''' cmdPrint.Caption = "Print Texture Order" +''' cmdPrint.Enabled = True +''' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +''' cmdPrint.Caption = "Print Stone Order" +''' cmdPrint.Enabled = True + Else + moRS!TexP = vbTrue + moRS!TexD = vbTrue + moRS!BrownP = vbTrue + moRS!BrownD = vbTrue + moRS!LathD = vbTrue + moRS!LathP = vbTrue + moRS!WrapD = vbTrue + moRS!WrapP = vbTrue + moRS.Update +''' cmdPrint.Caption = "All Orders Printed" +''' cmdPrint.Enabled = False + End If + + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If + End If + If gbytSECURITY <= 6 Then + cmdEdit.Visible = True + cmdEdit.Enabled = True + End If +'' If chkHoldOrders Then +'' cmdSaveLotInfo.Enabled = False +'' If gbytSECURITY > 3 Then +'' chkHoldOrders.Enabled = False +'' chkHoldOrders.BackColor = &H80FFFF +'' Else +'' chkHoldOrders.Enabled = True +'' chkHoldOrders.BackColor = &H80FFFF +'' End If +'' Else +'' chkHoldOrders.Enabled = True +'' End If +' If chkSplit Then +' cmdSaveLotInfo.Enabled = False +' If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF +' Else +' chkSplit.Enabled = True +' chkSplit.BackColor = &H80FFFF +' End If +' Else +' chkSplit.Enabled = True +' End If +'' If chkHoldPO Then +'' cmdSaveLotInfo.Enabled = False +'' If gbytSECURITY > 3 Then +'' chkHoldPO.Enabled = False +'' chkHoldPO.BackColor = &H80FFFF +'' Else +'' chkHoldPO.Enabled = True +'' chkHoldPO.BackColor = &H80FFFF +'' End If +'' Else +'' chkHoldPO.Enabled = True +'' End If + If chkSynthetic Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + Else + chkSynthetic.Enabled = True + chkSynthetic.BackColor = &H80FFFF + End If + + End If + If chkStone Then + cmdSaveLotInfo.Enabled = False + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + Else + chkStone.Enabled = True + chkStone.BackColor = &H80FFFF + End If + + End If + If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdAddPOMat.Enabled = False + End If + +' Call ListChanges + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + If moRSProj!cont_id = 864 Or moRSProj!cont_id = 146 Then + mboolPULTE = True + Else + mboolPULTE = False + End If + + If moRSProj!stone Then + mboolStone = True + End If + + If moRSProj!Pulte Then + gboolPULTE = True + End If + + If moRSProj!Apt Then + mboolCOMM = True + Else + mboolCOMM = False + End If + + If moRSProj!P_SW Then + mboolPSW = True + Else + mboolPSW = False + End If + + mstrWIRE = Field2Str(moRSProj!wire) + mstrTAXCODE = Field2Str(moRSProj!taxcode) + + gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PlanLoad() +Dim oRS As Recordset +Dim strSQL As String, strTEST As String + On Error GoTo Error_EH + + strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPlans.Clear + + Do Until oRS.EOF + With lstPlans + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS!est_id + End With + lstPlans.Visible = True + lblPlan.Visible = True + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module PlanLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + If moRSProj!bb Then + lblBB.Caption = "This House Uses Blackboard" + Else + lblBB.Caption = "This House Uses R-Guard" + End If + If moRSProj!zmetal Then + lblZMetal.Visible = True + Else + lblZMetal.Visible = False + End If + + With moRS + lblSZone = Field2Str2(!zone) + lblSandShip = Field2Str2(!ORD_NO) + txtTake138 = Field2Integer(!jmb138) + txtCalc138 = Field2Integer(!jmb138) + txtTtlYdge = Field2Integer(!sq_yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!Owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Integer(!CMU) + txtNotes = Field2Str(!notes) + If !HLNotes And Len(txtNotes) > 0 Then + txtNotes.ForeColor = &HFF& + txtNotes.BackColor = &H80FFFF + Else + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + End If + txtSuperNotes = Field2Str(!supernotes) + txtLotNotes = Field2Str(!lotnotes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Integer(!foam) + txtStone = Field2Str2(!ST_SQFT) + txtOPEN = Field2Str2(!opening) + chkFirst = Field2CheckBox(!Firsttime) + txtMetal = Field2Double(!METAL) + txtSand = Field2Integer(!sand_ton) + txtSuperBB = Field2Integer(!SUP_BB) + txtSuper12 = Field2Integer(!SUP_FD12) + txtSuper1383 = Field2Integer(!SUP_138) + If CInt(txtSuper1383) < 0 Then + txtSuper1383 = 0 + End If + txtSuper783 = Field2Integer(!SUP_783) + txtSuper78 = Field2Integer(!SUP_78) + txtSuper38 = Field2Integer(!SUP_38) +' txtSuperRL = Field2Integer(!SUP_RL) + txtSuperML = Field2Integer(!SUP_ML) + txtSuperDW = Field2Integer(!SUP_DW) + txtSuperSP = Field2Integer(!SUP_SP) + txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + If txtLathO = "" Then + txtLathO = "12/31/2030" + End If + txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) + txtStoneBill = Field2Str2(!st_bill) + txtJC = Field2Str(!jobcost) +' chkHoldOrders = Field2CheckBox(!hold_stucco) +' chkHoldPO = Field2CheckBox(!hold_po) + chkPaint = Field2CheckBox(!PNT_FLG) + chkSynthetic = Field2CheckBox(!syn_flag) + chkStone = Field2CheckBox(!stone) + chkOthers = Field2CheckBox(!otstone) + chkNoPay = Field2CheckBox(!nopayissue) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + End With + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Pre Mix Stucco" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "C" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "San Man" + End If + + If moRS!l_FLG = "P" Then + txtTtlYdge.Enabled = False + txtCMUYdge.Enabled = False + txtStone.Enabled = False + txtLotNo.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptDel.Enabled = False + cmdDelLot.Enabled = False + cmdSaveLotInfo.Enabled = False + cmdFindPlan.Enabled = False + cmdOrders.Enabled = False + cmdCalc.Enabled = False + txtYardMemo.Enabled = True + txtYardMemo.Locked = True +' txtYardMemo.Enabled = False +' cmdUpCMU.Enabled = False +' cmdPrintCMU.Enabled = False + Call LotPrinted + End If + If moRS!Firsttime Then + lblFirst.Visible = True + End If + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotPrinted() + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtNotes.Enabled = False + txtFoamAdj.Enabled = False + txtLaborAdj.Enabled = False + txtWireAdj.Enabled = False + txtFin2.Enabled = False + txt28Foam.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False + lblLathPrint.Visible = True + cmdPreOrderPrintY.Enabled = False + cmdPreOrderPrintS.Enabled = False + +End Sub + +Private Sub LotRePrinted() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True + txtFoamAdj.Enabled = True + txtLaborAdj.Enabled = True + txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + lblLathPrint.Visible = False + cmdPreOrderPrintY.Enabled = True + cmdPreOrderPrintS.Enabled = True +''' cmdPrint.Enabled = True +End Sub + +Private Sub LotNew() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True + txtFoamAdj.Enabled = True + txtLaborAdj.Enabled = True + txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If +' txtSuperBB.Enabled = True + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True +' txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) +' txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + lblLathPrint.Visible = False + lblFirst.Visible = False + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!qty) + + If CInt(txtLMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLMQty.ForeColor = &HFF& + txtLMQty.FontBold = True + Else + txtLMQty.ForeColor = &H0& + txtLMQty.FontBold = False + End If + txtLMLength = Field2Integer(!calc_amt) + txtLMBalance = Field2Str(!o_qty) + chkChange = Field2CheckBox(!ch_flag) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + Call FindType(cboLMType, strTYPE) + + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt + txtLOYdge = Field2Integer(!Yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Integer(!fin2) + txtLOFoam = Field2Integer(!f_adj) + lblBillingAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + Call FindTexture2(Field2Str(!texture), strTYPE) + txtLOTexture = strTYPE +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) +' lblOptNum = "# " & Trim(Field2Str(!Opt_ID)) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOpt() +Dim strDNU As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt2 + txtNote2 = Field2Str(!notes) + If Left(Field2Str(!Desc), 3) = "DNU" Then + mboolDNU = True + Else + mboolDNU = False + End If + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPO() +Dim bytPOType As Byte + + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPO + gintPONUM = Field2Long(!ponum) + txtPONum = Field2Long(!ponum) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + txtPODate = Field2Str(!Date) + txtPay = Field2Str2(!yards) + txtPayType = Field2Str(!payflag) + txtPOType = Field2Str(!potype) + gstrPO = txtPOType + bytPOType = Field2Str2(!Opt_Type) + End With + + If bytPOType = 1 Then + optLath = True + ElseIf bytPOType = 2 Then + optStucco = True + ElseIf bytPOType = 3 Then + optSand = True + ElseIf bytPOType = 4 Then + optPreOrder = True + ElseIf bytPOType = 5 Then + optStone = True + ElseIf bytPOType = 6 Or bytPOType = 0 Then + optNone = True + End If + + If moRSPO!p_flg = "P" Then + cmdPrintPO.Enabled = False + Else + cmdPrintPO.Enabled = True + End If + mboolSHOW = False + If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then + cmdPrintPOPay.Enabled = True + Else + cmdPrintPOPay.Enabled = False + End If + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + End Select + + Call CBFindString1(cboPOType, txtPOType) + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!qty) + If CInt(txtLOMQty) < 0 Then +' txtLMQty = Format(txtLMQty, "(####)") + txtLOMQty.ForeColor = &HFF& + txtLOMQty.FontBold = True + Else + txtLOMQty.ForeColor = &H0& + txtLOMQty.FontBold = False + End If + txtLOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboLOMType, strTYPE) + + If !calc_flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOQty = Field2Str(!qty) + txtPOPrice = Format(Field2Str2(!price), "#,#.00") + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If IsNull(txtModel) Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + ElseIf Trim$(txtModel) = "" Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + End If + +' If mboolAdding Then +' moRS.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled +' cmdAddLot.Enabled = Not cmdAddLot.Enabled + cmdDelLot.Enabled = Not cmdDelLot.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSaveLotInfo.Enabled Then + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String +Dim strSQLB As String, oRSB As Recordset + + On Error GoTo Error_EH + + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount > 0 Then + txtYardMemo = Field2Str(moRSMemo!notes) + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = "" + moRSMemo.Update + txtYardMemo = "" + End If + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + mstrTexture = moRS!texture + + If moRS!HLNotes = True Then + mboolHLNotes = True + Else + mboolHLNotes = False + End If + mboolSTONE3 = False + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + mstrPLNELEV = Field2Str(moRS!model) + + If moRS!P_RL Then + gboolPSpecialCALC = True + End If + + If moRS!Split Then + mboolSPLIT = False '*** Changed from true to false on 7/21/2017 because discontinued split orders + Else + mboolSPLIT = False + End If + strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!PROJ_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSB = New Recordset + oRSB.Open strSQLB, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSB.EOF Then + If IsNull(oRSB!st_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False + End If + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LotLoad() +Dim strSQL As String + + strSQL = "SELECT * " & "FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + +End Sub + +Private Sub PlanFind() +Dim oRS As Recordset +Dim strSQL As String, strPlan As String, strTEST As String + On Error GoTo Open_EH + mintOpenPR = 0 + +' strSQL = "SELECT * " + strSQL = "SELECT est_id, verified, update, OpenPR FROM tblPlans WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + If Not moRSPlan.EOF Then + mboolVERIFIED = moRSPlan!verified + mintOpenPR = Field2Integer(moRSPlan!openpr) + gintESTID = moRSPlan!est_id + If moRSProj!FHA Then + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" + Else + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" + End If + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + If oRS.EOF Then + mintTake138 = 0 + Else + moRS!jmb138 = oRS!qty +' mintTake138 = oRS!qty + End If + oRS.Close + Else + MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" + mboolCRITICAL = True + End If + Exit Sub + +Open_EH: + gstrMODULE = "Form LotInfo5 - Module PlanFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindPOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOpt2() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT notes, optid, desc " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) + + Set moRSPOpt2 = New Recordset + + moRSPOpt2.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt2.EOF Then + FormFindPOpt2 = False + Else + FormFindPOpt2 = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOpt2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) + + If moRSPO.State = adStateOpen Then + + moRSPO.Close + End If + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindLOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + Set moRSLOpt = New Recordset + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!Opt_ID +' lblOptNum = "# " & lstLOptions.ItemData(Index) +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindLOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstOptMatrl.col = 4 + strINVNO = lstOptMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + + On Error GoTo Error_EH + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + If moRSPOMAT.State = adStateOpen Then + moRSPOMAT.Close + End If + + moRSPOMAT.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstLMaterial.col = 4 + strINVNO = lstLMaterial.ColText + + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' intTest = moRSMat.RecordCount + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub cmdExit_Click() + + Unload Me +End Sub +Private Sub FieldsSave() +Dim strLOT As String, strTYPE As String, intOpenPR As Integer, intUSEOpen As Integer +Dim dblOPEN As Double, intDELETE As Integer, int1383 As Integer + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS!startdate = Str2Field(mstrSTARTDATE) + moRS!openpr = mintOpenPR + End If + + If Field2Integer(moRS!sq_yd) > 1 Then + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 90 - intOpenPR ' This is primarly for labor +' intMATOpen = Int(40 - intOpenPR) ' 02/08/2020 Changed to 40% to give more materials yardage + + +' dblWRAP = Int(Field2Double(moRS!opening)) + ' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + If moRSProj!use_open Then +''' If Field2Integer(moRS!sq_yd) > 500 Then Changed to match MATCALCONE +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 ' Changed by Jesse 07/13/18 +''' intDELETE = 0 +''' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE +''' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE +''' Else +' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 + moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 5 - dblOPEN 'Change per Jesse 08/22/05 + moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 5 - dblOPEN 'Change per Jesse 08/22/05 +'' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +''' End If + Else +''' If Field2Integer(moRS!sq_yd) > 500 Then +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +' intDELETE = 19 ' Changed by Jesse 07/13/18 +''' intDELETE = 0 +''' moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE +''' moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE +''' Else +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 + moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 + moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 +' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 +''' End If + End If + End If + + With moRS + If mboolHLNotes Then + !HLNotes = vbChecked + Else + !HLNotes = vbUnchecked + End If + !zone = Integer2Field(moRSProj!zone) + !sq_yd = Integer2Field(txtTtlYdge) + !address = Str2Field(txtAddress) + !Owner = Str2Field(txtOwner) + !model = Str2Field(txtModel) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtNotes) + !supernotes = Str2Field(txtSuperNotes) + !lotnotes = Str2Field(txtLotNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !lot_no = Str2Field(txtLotNo) + !foam = Integer2Field(txt28Foam) + !lorder = Date2Field(txtLathO) + !SUP_BB = Integer2Field(txtSuperBB) + !SUP_FD12 = Integer2Field(txtSuper12) + !SUP_783 = Integer2Field(txtSuper783) + !SUP_78 = Integer2Field(txtSuper78) + !SUP_38 = Integer2Field(txtSuper38) +' !SUP_138 = Integer2Field(txtSuper1383) + int1383 = Integer2Field(txtSuper1383) + If int1383 < 0 Then + !SUP_138 = 0 + Else + !SUP_138 = Integer2Field(txtSuper1383) + End If +' !SUP_RL = Integer2Field(txtSuperRL) + !SUP_ML = Integer2Field(txtSuperML) + !SUP_DW = Integer2Field(txtSuperDW) + !SUP_SP = Integer2Field(txtSuperSP) + !opening = Integer2Field(txtOPEN) + !sand_ton = Integer2Field(txtSand) + !SORDER = Str2Field(txtTextureO) + !Border = Str2Field(txtSandO) + !TORDER = Str2Field(txtScratchO) + !forder = Str2Field(txtBrownO) + !VOrder = Str2Field(txtLathBill) + !st_bill = Double2Field(txtStoneBill) + !jobcost = Str2Field(txtJC) +'' !hold_stucco = chkHoldOrders +'' !hold_po = chkHoldPO + !PNT_FLG = chkPaint + !LUUser = gstrLOGIN + !Update = Date + !Firsttime = chkFirst + !syn_flag = chkSynthetic + !stone = chkStone + !otstone = chkOthers + !ST_SQFT = Integer2Field(txtStone) + + Call FindTexture(txtFinish, strTYPE) + !texture = strTYPE + + End With + moRS.Update + + If mboolAdding Then + Call GetLotID + Call PlanMatLoad + Call POptLoad + Call JCSetup + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If + mboolAdding = False + End If + moRSMemo!notes = Field2Str(txtYardMemo) + moRSMemo.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") + If Len(strLOT) > 0 Then + moRS!lot_no = Field2Str(strLOT) + txtLotNo = Field2Str(strLOT) + txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") + moRS!jobcost = Field2Str(txtJC) + moRS.Update + End If + Resume Next + End If + gstrMODULE = "Form LotInfo5 - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetLotID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintLOTID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPlanInfo() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + mboolPLANUP = False + strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrPLANUP = Field2Str(oRS!Update) +' mboolVERIFIED = oRS!verified + If mstrPLANUP > Field2Str(moRS!import) Then + mboolPLANUP = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module GetPlanInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POSave() +Dim strSQL As String, strMAX As String +Dim oRS As Recordset, oRSS As Recordset +Dim bytPOType As Byte + + On Error GoTo Error_EH + + If optLath Then + bytPOType = 1 + ElseIf optStucco Then + bytPOType = 2 + ElseIf optSand Then + bytPOType = 3 + ElseIf optPreOrder Then + bytPOType = 4 + ElseIf optStone Then + bytPOType = 5 + Else + bytPOType = 6 + End If + + If moRSPO.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Opt_Type = bytPOType + !Date = Str2Field(txtPODate) + !User = gstrLOGIN + !Up_User = gstrLOGIN + !Update = Date + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + oRS.Update + + oRS.Close + Call POLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPO.AddNew + moRSPO!User = gstrLOGIN + End If + + With moRSPO + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Update = Date + !Up_User = gstrLOGIN + !Date = Str2Field(txtPODate) + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + moRSPO.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPO.ActiveConnection) + Exit Sub +End Sub + +Private Sub POMatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSPOMAT.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + oRS.Update + + oRS.Close + Call OptMatLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPOMAT.AddNew + End If + + With moRSPOMAT + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + moRSPOMAT.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPOMAT.ActiveConnection) + Exit Sub + + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH +' If moRSMat.State = adStateOpen Then + If moRSMat.State = adStateClosed Then + Exit Sub + End If + + strSQL = moRSMat.RecordCount + With moRSMat + If moRSMat.EOF Then + End If + If mboolAdding Then + .AddNew + !Lot_ID = gintLOTID + End If + !inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !qty = Str2Field(txtLMQty.Text) + !calc_amt = Integer2Field(txtLMLength.Text) + !o_qty = Integer2Field(txtLMBalance.Text) + !ch_flag = chkChange + !m_type = Left$(cboLMType.Text, 1) + + If cboLMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + End With + mintINVNO = Field2Str2(txtLMInvNo) + moRSMat.Update + Exit Sub + +Error_EH: +' If Err = -2147217885 Then + If Err = -2147217864 Then + Resume Next + Else + gstrMODULE = "Form LotInfo5 - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub + +Private Sub FormClear() + moRSMemo.Close + txtLotNotes = "" + txtYardMemo = "" + txtSuperNotes = "" + txtTtlYdge = 0 + txtAddress = "" + txtOwner = "" + txtModel = "" + txtCMUYdge = 0 + chkFirst = vbUnchecked + txtNotes = "" + txtNotes.ForeColor = &H80000008 + txtNotes.BackColor = &H80000005 + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = 0 + txtLotNo = "" + txt28Foam = 0 + txtLathO = "12/31/2030" + txtMetal = 0 + txtOPEN = 0 + txtSuperBB = 0 + txtSuper12 = 0 + txtSuper783 = 0 + txtSuper78 = 0 + txtSuper38 = 0 + txtSuper1383 = 0 + txtSuperRL = 0 + txtSuperML = 0 + txtSuperDW = 0 + txtSuperSP = 0 +' txtLathO = "" + txtSandO = "" + txtScratchO = "" + txtBrownO = "" + txtTextureO = "" + txtLathBill = "" + txtStoneBill = 0 + txtFinish.Text = "" + txtTake138 = 0 + txtOneKote.Text = "" + lstLath.Clear + lstYard.Clear + lstPreOrder.Clear + lstLMaterial.Clear + lstInventory.Clear + lstPOptions.Clear + lstLOptions.Clear + lstOptMatrl.Clear + lstPO.Clear + lstPOMaterial.Clear + lstBrown.Clear + lstScratch.Clear + lstTexture.Clear + txtLOYdge = 0 + txtLODesc = "" + txtLOFin2 = 0 + txtLOFoam = 0 + txtLOMInvNo = 0 + txtLOMDesc = "" + txtLOMQty = "" + txtSand = 0 + txtLOMLength = 0 + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + gintOPTID = 0 +' txtLODate.Enabled = False +' chkHoldOrders = vbUnchecked +' chkHoldOrders.Enabled = True +' chkHoldPO = vbUnchecked +' chkHoldPO.Enabled = True + chkPaint = vbUnchecked + chkSynthetic = vbUnchecked + chkSynthetic.Enabled = True + chkStone = vbUnchecked + chkOthers = vbUnchecked + chkNoPay = vbUnchecked + chkStone.Enabled = True + txtStone = 0 + lblFirst.Visible = False + lblSZone = "" + lblSandShip = "" + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FIXTypar() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, strINVNO As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + +' lstLMaterial.Clear + + Do Until oRS.EOF + strINVNO = Field2Str(oRS!inv_no) + If strINVNO = "3331" Or strINVNO = "1809" Or strINVNO = "1570" Or strINVNO = "1565" Or strINVNO = "1730" Or strINVNO = "1904" Or strINVNO = "1906" Or strINVNO = "7104" Or strINVNO = "7106" Or strINVNO = "1831" Then + oRS!d_flag = "S" + oRS!m_type = "W" + oRS.Update + End If + oRS.MoveNext + Loop + oRS.Close + +' If lstLMaterial.ListCount Then +' lstLMaterial.ListIndex = 0 +' Else +' txtLMInvNo = "0" +' txtLMDesc = "" +' txtLMQty = "0" +' txtLMLength = "0" +' cboLMDFlag.ListIndex = -1 +' cboLMType.ListIndex = -1 +' cboLMMetal.ListIndex = -1 +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FIXTypar" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProcessRpt() +Dim strSELECT As String + + With moRS + +' strSELECT = !model + If !superp And Not !superd Then + mboolSupP = True + mboolNoPrint = False +' Else +' mboolSupP = False +' mboolNoPrint = True +' End If + ElseIf !WrapP And Not !WrapD Then + mboolWrapP = True + mboolNoPrint = False +' Else +' mboolWrapP = False +' mboolNoPrint = True +' End If + ElseIf !LathP And Not !LathD Then + mboolLathP = True + mboolNoPrint = False +' Else +' mboolLathP = False +' mboolNoPrint = True +' End If + ElseIf !StoneP And Not !StoneD Then + mboolStoneP = True + mboolNoPrint = False + ElseIf !NescoP And Not !NescoD Then + mboolNescoP = True + mboolNoPrint = False +' Else +' mboolNescoP = False +' mboolNoPrint = True +' End If + ElseIf !PopoutP And Not !PopOutD Then + mboolPopOutP = True + mboolNoPrint = False +' Else +' mboolPopOutP = False +' mboolNoPrint = True +' End If + ElseIf !BrownP And Not !BrownD Then + mboolBrownP = True + mboolNoPrint = False +' Else +' mboolBrownP = False +' mboolNoPrint = True +' End If + ElseIf !TexP And Not !TexD Then + mboolTexP = True + mboolNoPrint = False +' Else +' mboolTexP = False +' mboolNoPrint = True +' End If + ElseIf !CMUP And Not !CMUD Then + mboolCMUP = True + mboolNoPrint = False +' Else +' mboolCMUP = False +' mboolNoPrint = True +' End If + ElseIf !EX1P And Not !EX1D Then + mboolEX1P = True + mboolNoPrint = False +' Else +' mboolEX1P = False +' mboolNoPrint = True +' End If + ElseIf !EX2P And Not !EX2D Then + mboolEX2P = True + mboolNoPrint = False +' Else +' mboolEX2P = False +' mboolNoPrint = True +' End If + ElseIf !EX3P And Not !EX3D Then + mboolEX3P = True + mboolNoPrint = False + Else +' mboolEX3P = False + mboolNoPrint = True + End If + + End With + +End Sub +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") +' strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = Field2Str(oRS("inv_no")) + + If mboolAdding Then +' intINVNO = Field2Integer(txtPOInvNo) + If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then + mintBOOKMARK = .ListIndex + End If + End If + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, intCOUNT As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + intCOUNT = oRSS.RecordCount + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str2(oRS!qty) +' oRSS!price = 0 + oRSS!price = Field2Str2(oRS!price) + oRSS.Update + If moRSProj!FHA Then + If Field2Str(oRS!inv_no) = "1570" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + Else + If Field2Str(oRS!inv_no) = "1130" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If +' Resume Next + +End Sub +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String, strINVNO As String +Dim strLine As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String, strSELECT As String +Dim strLine As String + + On Error GoTo Error_EH + If lstLOptions.ListIndex = -1 Then + lstOptMatrl.ListIndex = -1 + Exit Sub + End If + strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + lstOptMatrl.ListIndex = -1 + End If + Exit Sub + +Error_EH: + If Err = 381 Then + strSELECT = 0 + cmdOptDel.Enabled = False + Resume Next + End If + +End Sub +Private Sub POptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + + .AddItem oRS!ponum + .ItemData(.NewIndex) = oRS!ponum + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPO.ListCount Then + lstPO.ListIndex = 0 + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LOptLoad() +Dim oRS As Recordset +Dim strSQL As String, intLoop As Integer, intPos As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!Opt_ID + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Else + lstLOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module LOptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboLMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_DblClick() + cmdAddMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdDelMatrl.Enabled = True +End Sub + +Private Sub lstLookup_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstLOOKUP.col = 0 + strINVNO = lstLOOKUP.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = " & lstLOOKUP.ItemData(lstLOOKUP.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstLookup_dblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_Click() + On Error GoTo Error_EH + + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "0" + txtLODesc = "" + txtLOFin2 = "0" + txtLOFoam = "0" + txtLOTexture = "" + End If + If FormFindLOpt() Then +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End If + Else + cmdOptDel.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstLOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptDel.Enabled = True + cmdOptAdd.Enabled = False + End If + +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_Click() + On Error GoTo Error_EH + + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +' cboLMDFlag.Text = "" +' cboLMType.Text = "" +' cboLMMetal.Text = "" + txtLMBalance = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstLMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_DblClick() +'' If chkHoldPO Then +'' MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" +'' Exit Sub +'' End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + End If +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_Click() + On Error GoTo Error_EH + + If lstPO.ListIndex <> -1 Then + If FormFindPO() Then + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + Else + lstPO.Clear + txtPONum = "0" + txtPODesc = "" + txtIssueTo = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OrderLoad() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strLine As String, strSELECT As String + On Error Resume Next + + mboolNOTSUPPLIER = True + +' lstLMaterial.col = 0 +' strINVNO = lstLMaterial.ColText + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'S' and M_Type = 'P'" + oRS.Filter = strSELECT + lstPreOrder.Clear + If oRS.EOF Then + End If +' strSELECT = "M_Type = 'Z'" +' oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + mboolNOTSUPPLIER = False + + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst +' strSELECT = "M_Type = 'P'" + strSELECT = "D_Flag = 'Y' and M_Type = 'P'" + oRS.Filter = strSELECT +' lstPreOrder.Clear + If oRS.EOF Then + End If +' strSELECT = "M_Type = 'Z'" +' oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "M_Type = 'Z'" + oRS.Filter = strSELECT + lstPreOrder.Redraw = True + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & vbTab & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSELECT + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSELECT + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'D'" + oRS.Filter = strSELECT +' lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSELECT + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSELECT + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSELECT + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPlans_DblClick() + txtModel = lstPlans.List(lstPlans.ListIndex) + lstPlans.Visible = False + lblPlan.Visible = False + Call cmdFindPlan_Click +End Sub + +Private Sub lstPOMaterial_DblClick() +'' If chkHoldPO Then +'' MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" +'' Exit Sub +'' End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + End If +End Sub + +Private Sub lstPOptions_Click() + On Error GoTo Error_EH + + If lstPOptions.ListIndex <> -1 Then + If FormFindPOpt2() Then + Call FormShowPOpt + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module lstPOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + txtLMBalance = "0" + chkChange = vbUnchecked + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +End Sub + +Private Sub POClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPONotes = "" + txtIssueTo = "" + txtPONum = "0" + txtPODesc = "" + txtPODate = "" + txtPay = 0 + txtPayType = "" + lstLOOKUP.Clear + lstPOMaterial.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cboPOType.ListIndex = -1 + +End Sub + +Private Sub POMatClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPOPrice = "0" + lstLOOKUP.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cmdFindPOMat.Visible = True + +End Sub + +Private Sub lstPOptions_DblClick() + If mboolDNU Then + MsgBox "A DNU Option Cannot Be Used - Select Another Option", vbOKOnly, "Select Again" + Exit Sub + Else + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + lstPOptions.Enabled = False + cmdOptAdd.Enabled = True + cmdOptDel.Enabled = False + End If + End If +End Sub + +Private Sub SSTLotInfo_GotFocus() + If SSTLotInfo.Tab = 1 Then + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) +' txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + End If + If SSTLotInfo.Tab = 6 Then +'' If chkHoldPO Then +'' cmdAddPO.Enabled = False +'' cmdSavePO.Enabled = False +'' cmdDelPO.Enabled = False +'' cmdPrintPO.Enabled = False +'' cmdPrintForm.Enabled = False +'' cmdAddPOMat.Enabled = False +'' cmdSavePOMat.Enabled = False +'' cmdDelPOMat.Enabled = False +'' txtPONum.Enabled = False +'' txtPODate.Enabled = False +'' txtIssueTo.Enabled = False +'' txtPODesc.Enabled = False +'' txtPay.Enabled = False +'' txtPayType.Enabled = False +'' txtPONotes.Enabled = False +'' txtPOInvNo.Enabled = False +'' txtPOMatDesc.Enabled = False +'' txtPOQty.Enabled = False +'' cboPODFlag.Enabled = False +'' cboPOMType.Enabled = False +'' txtPOPrice.Enabled = False +'' cmdPrintPOPay.Enabled = False +'' cmdFindPOMat.Enabled = False +'' lstLookup.Visible = False +'' Else +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then +'' If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then +'' cmdAddPO.Enabled = True +'' End If +'' End If + End If +End Sub + +Private Sub txt28Foam_GotFocus() + Call FieldSelect(txt28Foam) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtIssueTo_GotFocus() + Call FieldSelect(txtIssueTo) +End Sub + +Private Sub txtIssueTo_LostFocus() + txtIssueTo = UCase(txtIssueTo) +End Sub + +Private Sub txtJC_GotFocus() + Call FieldSelect(txtJC) +End Sub + +Private Sub txtJC_LostFocus() + txtJC = UCase(txtJC) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtLMDesc_LostFocus() + txtLMDesc = UCase(txtLMDesc) +End Sub + +Private Sub txtLMInvNo_GotFocus() + Call FieldSelect(txtLMInvNo) +End Sub + +Private Sub txtLMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If + mstrENDQTY = txtLMQty +End Sub + +Private Sub txtLOMQty_GotFocus() + mdblQTY = Field2Str2(txtLOMQty) +End Sub + +Private Sub txtLOMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLOMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLotNotes_GotFocus() + txtLotNotes.SelStart = 1000 +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtModel_LostFocus() + txtModel = UCase(txtModel) +End Sub + +Private Sub txtPay_GotFocus() + Call FieldSelect(txtPay) +End Sub + +Private Sub txtPayType_GotFocus() + Call FieldSelect(txtPayType) +End Sub + +Private Sub txtPayType_LostFocus() + txtPayType = UCase(txtPayType) + If txtPayType = "D" Or txtPayType = "R" Then + lblPayYds.Caption = "Pay Dollars:" + Else + lblPayYds.Caption = "Pay Yards:" + End If +End Sub + +Private Sub txtPODate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtPODate, "/", 1) + If Not IsDate(txtPODate) Then + If lngPOS = 0 Then + If Len(txtPODate) > 0 Then + txtPODate = Format(txtPODate, "00/00/####") + If Not IsDate(txtPODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtPODate.SetFocus + End If + End If +End Sub + +Private Sub txtPOPrice_GotFocus() + Call FieldSelect(txtPOPrice) +End Sub + +Private Sub txtPOPrice_LostFocus() + txtPOPrice = Format(txtPOPrice, "#,#.00") +End Sub + +Private Sub txtPOQty_LostFocus() + If mdblQTY <> Field2Str2(txtPOQty) Then + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If + End If + +End Sub + +Private Sub txtLMDesc_GotFocus() + Call FieldSelect(txtLMDesc) +End Sub + +Private Sub txtLMLength_GotFocus() + Call FieldSelect(txtLMLength) +End Sub + +Private Sub txtLMQty_GotFocus() + mdblQTY = Field2Str2(txtLMQty) + mstrBEGQTY = Field2Str(txtLMQty) + Call FieldSelect(txtLMQty) +End Sub + +Private Sub txtLotNo_LostFocus() + txtLotNo = UCase(txtLotNo) + + Call GETJC +' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") +End Sub +Private Sub GETJC() +Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + intJC = Field2Integer(oRS!nextjc) + txtALPHA = Field2Str(oRS!jcalpha) + txtJC = txtALPHA & Format(Field2Str(intJC), "000000") + intJC = intJC + 1 + + If intJC > 999999 Then + intJC = 1 + intASCII = Asc(txtALPHA) + intASCII = intASCII + 1 + txtALPHA = Chr(intASCII) + oRS!jcalpha = Field2Str(txtALPHA) + End If + + oRS!nextjc = intJC + oRS.Update + +End Sub +Private Sub txtModel_GotFocus() + Call FieldSelect(txtModel) +End Sub + +Private Sub txtOwner_GotFocus() + Call FieldSelect(txtOwner) +End Sub + +Private Sub txtOwner_LostFocus() + txtOwner.Text = UCase(txtOwner.Text) +End Sub +Private Sub txtAddress_LostFocus() + txtAddress.Text = UCase(txtAddress.Text) +End Sub +Private Sub txtAddress_GotFocus() + Call FieldSelect(txtAddress) +End Sub +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub txtPODate_GotFocus() + Call FieldSelect(txtPODate) +End Sub + +Private Sub txtPODesc_GotFocus() + Call FieldSelect(txtPODesc) +End Sub + +Private Sub txtPODesc_LostFocus() + txtPODesc = UCase(txtPODesc) +End Sub + +Private Sub txtPOInvNo_GotFocus() + Call FieldSelect(txtPOInvNo) +End Sub + +Private Sub txtPOMatDesc_GotFocus() + Call FieldSelect(txtPOMatDesc) +End Sub + +Private Sub txtPOMatDesc_LostFocus() + txtPOMatDesc = UCase(txtPOMatDesc) +End Sub + +Private Sub txtPONotes_GotFocus() + Call FieldSelect(txtPONotes) +End Sub + +Private Sub txtPONotes_LostFocus() + txtPONotes = UCase(txtPONotes) +End Sub + +Private Sub txtPOQty_GotFocus() + mdblQTY = Field2Str2(txtPOQty) + Call FieldSelect(txtPOQty) +End Sub + +Private Sub txtSuper12_GotFocus() + Call FieldSelect(txtSuper12) +End Sub + +Private Sub txtSuper12_LostFocus() + txtSuper12 = Integer2Field(txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub txtSuper1383_LostFocus() +Dim intResponse As Integer + txtSuper1383 = Integer2Field(txtSuper1383) + If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then + intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") + If intResponse = vbYes Then + Exit Sub + Else + txtSuper1383.SetFocus + End If + End If +End Sub + +Private Sub txtSuper38_GotFocus() + Call FieldSelect(txtSuper38) +End Sub + +Private Sub txtSuper78_GotFocus() + Call FieldSelect(txtSuper78) +End Sub + +Private Sub txtSuper1383_GotFocus() + Call FieldSelect(txtSuper1383) +End Sub + +Private Sub txtSuper783_GotFocus() + Call FieldSelect(txtSuper783) +End Sub + +Private Sub txtSuper783_LostFocus() + txtSuper783 = Integer2Field(txtSuper783) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper78_LostFocus() + txtSuper78 = Integer2Field(txtSuper78) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuper38_LostFocus() + txtSuper38 = Integer2Field(txtSuper38) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) + If CInt(txtCalc138) < 0 Then + txtCalc138 = 0 + End If + txtSuper1383 = Integer2Field(txtCalc138) +End Sub + +Private Sub txtSuperBB_GotFocus() + If mboolCOMM Then + Call FieldSelect(txtSuperBB) + End If +End Sub + +Private Sub txtSuperBB_LostFocus() + If mboolCOMM Then + txtSuperBB = Integer2Field(txtSuperBB) + End If +End Sub + +Private Sub txtSuperDW_GotFocus() + Call FieldSelect(txtSuperDW) +End Sub + +Private Sub txtSuperDW_LostFocus() + txtSuperDW = Integer2Field(txtSuperDW) +End Sub + +Private Sub txtSuperML_GotFocus() + Call FieldSelect(txtSuperML) +End Sub + +Private Sub txtSuperML_LostFocus() + txtSuperML = Integer2Field(txtSuperML) +End Sub + +Private Sub txtSuperNotes_GotFocus() + Call FieldSelect(txtSuperNotes) +End Sub + +Private Sub txtSuperNotes_LostFocus() + txtSuperNotes.Text = UCase(txtSuperNotes.Text) +End Sub + +'Private Sub txtSuperRL_GotFocus() +' Call FieldSelect(txtSuperRL) +'End Sub + +'Private Sub txtSuperRL_LostFocus() +' txtSuperRL = Integer2Field(txtSuperRL) +'End Sub + +Private Sub txtSuperSP_GotFocus() + Call FieldSelect(txtSuperSP) +End Sub + +Private Sub MatCalcOne() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, dblPYRO As Double +Dim dblTP4, dblTP6, dblTP9, dblTPNail, dblTPCTape As Double, dblML2 As Double, dblRL2 As Double +Dim intTP9 As Integer, dblTYPAR As Double, strCHECK As String, mboolSilica As Boolean +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblSUB As Double +Dim dblBB3, dblDW3, dblRL3, dblF12_3, dblRL8 As Double, dblWRAP As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double +Dim intMATOpen As Integer, dblMATYDS As Double, dblMOPEN As Double + + On Error GoTo Error_EH + +' ****** If errors are reported where quantities are being changed in material +' ****** when not wanted look at this -- oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' Else +' oRC!QTY = dblBB +' oRC.Update + + mboolBADD = False + mboolBAG100 = False + mboolSilica = False + dblRL8 = 0 + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + dblPYRO = 1 + + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 90 - intOpenPR ' This is primarly for labor +' intMATOpen = Abs(50 - intOpenPR) ' 10/4/2018 This is a new variable to take only 50% of openings for material yardage +' intMATOpen = Abs(40 - intOpenPR) ' 02/08/2020 Changed to 40% to give more materials yardage + intMATOpen = Int(40 - intOpenPR) ' 02/08/2020 Changed to 40% to give more materials yardage + + dblWRAP = Int(Field2Double(moRS!opening)) 'This is to make wrap calculate on 100% of yardage - 10/04/2018 +' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) + dblMOPEN = Int(((Field2Double(moRS!opening) * intMATOpen) / 100) + 0.99) + 'REMOVED TO MAKE ALL CALCULATIONS THE SAME PER JESSE 2/11/2020 To fix remove triple ''' +''' If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 Changed back to 500 on 7/9/18 +' If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 Changed back to 500 on 7/9/18 +' If Field2Integer(moRS!sq_yd) > 400 Then +''' boolDEDUCT = True +''' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +''' dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) ' 01/04/2018 per Jesse removed all openings from calculations. +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) +''' Else +''' boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN + dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material +' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) '' 01/04/2018 per Jesse removed all openings from calculations. +''' End If + +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + + 'REMOVED TO MAKE ALL CALCULATIONS THE SAME PER JESSE 2/11/2020 To fix remove triple ''' +''' If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' intDELETE = 0 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse +''' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 'Changed 12/11/17 per Jesse +''' moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 'Changed 12/11/17 per Jesse +''' Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 +''' End If +''' Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 +''' If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +''' intDELETE = 0 +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 +''' moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 +''' moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 +''' Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 +'------------------------------------------------------------------------------------------------------- +''' End If +''' End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + '******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + + '********** Need to determine correct RL +' If txtSuperRL = "-2" Then ' Use Takeoff RL always per Jesse 05/15/18 + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If +' Else +' If txtSuperRL = "-1" Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > "0" Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If + +' End If +' End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1331'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL2 = 0 + Else + dblRL2 = Field2Integer(moRSCMat!qty) + dblRL = dblRL + dblRL2 + dblRL2 = 0 + End If + If gboolPSpecialCALC Then + dblRL8 = dblRL + End If +'** Black Board and R Guard + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once +' dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + dblBP = Int((CDbl(dblMATYDS) / 33) + 0.99) '10/04/2018 changed by Jesse to give more material + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblNEWYDS < 325 Then + If moRSProj!bb Then + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + ' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int((((CDbl(dblMATYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS + End If + Else + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblMATYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house + If dblNEWYDS > 325 Then + dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) +' dblBP = Int(((CDbl(dblMATYDS) * 2) / 33) + 0.99) '10/04/2018 did not use this because openings added over 325 + Else + dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) +' dblBP = Int((((CDbl(dblMATYDS) + dblOPEN) * 2) / 33) + 0.99) '10/04/2018 did not use this because openings added over 325 + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation + dblBP = Int(((CDbl(dblMATYDS)) / 100) + 0.99) 'CHANGED 2/11/2020 for use of MATYDS +' dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + End If + + If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate + End If + End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + 'For 60 minute, use 1/2 foam divided by 16 +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) +' End If + dblBP = Int(((((dblFD12 + dblRL8) * 1.77)) / 16) + 0.99) '60 Min uses 1/2 foam for yardage + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 16)) + 0.99) '10/04/2018 Changed per Jesse to use full yardage +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) 'Changed 10/12/15 per jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "BP" Then 'Pulte Calculation + +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) +' End If +' dblBP = Int(((((dblFD12 + dblRL8) * 1.77)) / 16) + 0.99) '60 Min uses 1/2 foam for yardage + dblBP = Int((CDbl(dblMATYDS) / 70) + 0.99) 'Foam Calc - Total Yardage/70 YDs -- FOR PULTE ONLy + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID 'Material is TYVEK STRAIT FLASH + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "BP" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "BR" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(txtWireAdj) 'RL reducing Wire calculation +' If dblRL > 5 Then + dblARL = Int(((dblRL) * 1.77) + 0.99) +' dblARL = Int(((dblRL - 5) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 +'CHANGED THIS ON 2/11/2020 to get more yardage to houses per JESSE To remove take out the ''' +''' If CDbl(txtTtlYdge) < 350 Then +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) +''' dblCALC = Int((((CDbl(dblNEWYDS)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.79) 'Changed Per Jesse 11/14/2019 +' dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'Changed Per Jesse 11/14/2019 +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) +''' Else '10/04/2018 Did not change this to dblMATYDS because openings are already added back in + dblCALC = Int(((CDbl(dblMATYDS) - (dblAML + dblARL + dblWire)))) ' / 45) + 0.49) +' dblCALC = Int(((dblCALC) / 45) + 0.49) + dblCALC = Int(((dblCALC) / 45) + 0.79) +' dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)))) ' / 45) + 0.49) +' dblCALC = Int(((dblCALC) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) +''' End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate Typar Stucco Wrap '10/04/2018 Not changed for dblMATYDS because using txtTTLYDGE + If moRSProj!TYPAR Then +' dblTYPAR = Int((Field2Integer(txtTTLYds) / 90) + 0.99) +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.79) ' CHanged on 10/4/2018 per Jesse -- Tangerine Ridge discussion + dblTYPAR = Int((Field2Integer(dblMATYDS) / 80) + 0.79) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +''' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 80) + 0.79) ' CHanged on 11/16/2018 per Jesse -- Fermin Discussion' 18104 dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 70) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to take into consideration overlap +' dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 90) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.99) 'Changed 7/22/2015 after discussion with BBart/JR +' intTP45 = 1 'combined all typar into 1 calcuation + intTP9 = dblTYPAR '- intTP45 + + dblTP4 = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 100) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +' dblTP4 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 100) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP6 = Int((Field2Integer(txtTtlYdge) / 100) + 0.99) 'Changed 10/17/17 No Longer using 6 in tape + dblTP9 = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 500) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS + dblTPNail = Int(((Field2Integer(dblMATYDS) + dblWRAP) / 250) + 0.99) ' CHanged on 2/11/2020 per Jesse for dblMATYDS +' dblTP9 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 500) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTPNail = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 250) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP9 = Int((Field2Integer(txtTtlYdge) / 500) + 0.99) +' dblTPNail = Int((Field2Integer(txtTtlYdge) / 250) + 0.99) + dblTPCTape = intTP9 + +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3310 and lot_id = " & gintLOTID + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3300' and lot_id = " & gintLOTID ' To Delete + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + + Else + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3310' and lot_id = " & gintLOTID +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3300 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3310' and Inv_Type = " & gbytINV_TYPE +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3300 and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = intTP9 + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = intTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3324' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3324' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + moRSCMat!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + oRC!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3326' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRC.EOF Then + oRC.Delete + End If + + '******* This section is being removed per JR because this is not needed 05/21/2020 + '******* If this needs to be included again, remove the '' from the beginning of the line. + +'' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID +'' Set oRC = New Recordset +'' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +'' If oRC.EOF Then +'' strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3329' and Inv_Type = " & gbytINV_TYPE +'' Set oRSC = New Recordset +'' oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSC.EOF Then '********** This is for 12in Flex Butyl Tape +'' moRSCMat.AddNew +'' moRSCMat!Lot_ID = gintLOTID +'' moRSCMat!inv_no = Field2Str(oRSC!inv_no) +'' moRSCMat!Desc = Field2Str(oRSC!Desc) +'' moRSCMat!qty = 1 +' moRSCMat!qty = dblTP9 ' May need to use this if coming up short. Super should hang on to extra butyl +'' moRSCMat!price = Field2Str(oRSC!tprice) +'' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +'' moRSCMat!m_type = Field2Str(oRSC!m_type) +'' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +'' moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) +'' moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked +'' moRSCMat.Update +'' End If +'' Else +'' oRC!qty = 1 +' oRC!qty = dblTP9 +'' oRC.Update +'' End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '1831' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1831' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPNail + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPNail + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3320' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPCTape + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPCTape + oRC.Update + End If + + End If + + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material + ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material + ' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'Now PREMIX Western One KOTE Not MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int(CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int(CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 8) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Western PREMIX + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material +' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This caluclates the materials needed for the primary texture + 'mboolbag100 + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + If Not ((Field2Str2(oRSC!s16) > 0) Or (Field2Str2(oRSC!s20) > 0) Or (Field2Str2(oRSC!s30) > 0)) Then + If moRSProj!bag100 Or mboolPSW Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Str2(moRSProj!bagdollars) + Else + mboolSilica = True + End If + Else + mboolSilica = True + End If + End If + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblMATYDS))) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS))) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 Then + If Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + End If + + If mboolBAG100 And Not mboolPSW Then + dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) + ElseIf mboolPSW Then + dblBAGSAND = Int(((dblKote1 + dblCMNT) * dblCalcBAGSAND) + 0.99) + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) +' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + '********** + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRSC!qty = dblS20 + oRSC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + +' If mboolBAG100 Then +' dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) +' End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + End If + End If + + 'Calculate the Bag Sand + If dblRS > 0 And Not mboolSilica Then + txtSand = dblRS + Else + txtSand = 0 + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If +'CHanged all dblNEWYDS in foam calculations to dblmatyds 02/18/2020 + + If Field2Integer(dblMATYDS) < 325 Then +' If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblMATYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) +' dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else + dblBB3 = (dblBB * 3.5) + dblDW3 = (dblDW * 3.5) + dblRL3 = (dblRL * 1.77) + dblF12_3 = (dblFD12 * 1.77) + dblSUB = (((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77)) / 1.77) +' dblFD1 = Int((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - dblSUB + 0.99) +' dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = '1610'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed 11/1/17 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed to help with the rounding to full boxes + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 240 Then + moRSCMat!qty = 1 + Else +' moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) 'Changed to help with the rounding to full boxes + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 240) + 0.49)) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.49)) +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If gboolPULTE Then + moRSCMat.Delete +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 25) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + End If + + strSELECT = "inv_no = '1822'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1822'" 'XTRA 9500 Caulk + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 75)) + 0.99) + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblMATYDS) / 75)) + 0.99) + moRSCMat.Update + End If + +' If Not moRSCMat.EOF Then +' If Not moRSCMat!ch_flag Then +' If gboolPULTE Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update +' Else +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) +' moRSCMat.Update +' End If +' End If +' End If + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblMATYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + If moRSProj!cont_id = 146 Or moRSProj!cont_id = 864 Then +' If moRSProj!Cont_ID = "146" Or moRSProj!Cont_ID = 864 Then + Call FIXTypar + End If + Call WrapMatPrices + Call UpInvoice + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo5 - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub WrapMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module WrapMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module OrderMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcOne_20180629() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, dblPYRO As Double +Dim dblTP4, dblTP6, dblTP9, dblTPNail, dblTPCTape As Double, dblML2 As Double, dblRL2 As Double +Dim intTP9 As Integer, dblTYPAR As Double, strCHECK As String, mboolSilica As Boolean +Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblSUB As Double +Dim dblBB3, dblDW3, dblRL3, dblF12_3 As Double, dblWRAP As Double +Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double + + On Error GoTo Error_EH + +' ****** If errors are reported where quantities are being changed in material +' ****** when not wanted look at this -- oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' Else +' oRC!QTY = dblBB +' oRC.Update + + mboolBADD = False + mboolBAG100 = False + mboolSilica = False + + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + dblPYRO = 1 + + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 100 - intOpenPR + + dblWRAP = Int(Field2Double(moRS!opening)) +' dblWRAP = Int(((Field2Double(moRS!opening) * intOpenPR) / 100) + 0.99) + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 + If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 +' If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) ' 01/04/2018 per Jesse removed all openings from calculations. +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) '- dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN +' dblNEWYDS = Field2Integer(moRS!sq_yd) - Field2Integer(moRS!opening) '01/08/2018 corrected to use the opening balance +' dblNEWYDS = Field2Integer(moRS!sq_yd) '' 01/04/2018 per Jesse removed all openings from calculations. + End If + +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse + moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE 'Changed 12/11/17 per Jesse + moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 'Changed 12/11/17 per Jesse + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 10/13/12 + End If + Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) + intDELETE = 19 +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 10/13/12 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + '******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If +' If Not dblML > 0 Then + If dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML2 = 0 + Else + dblML2 = Field2Integer(moRSCMat!qty) + dblML = dblML + dblML2 + dblML2 = 0 + End If + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 Then + dblML2 = Field2Integer(txtSuperML) + dblML = dblML + dblML2 - 5 + dblML2 = 0 + End If + + '********** Need to determine correct RL +' If txtSuperRL = "-2" Then ' Use Takeoff RL always per Jesse 05/15/18 + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If +' Else +' If txtSuperRL = "-1" Then +' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" +' goConn.Execute strSQL +' End If +' If txtSuperRL > "0" Then +' dblRL = CInt(txtSuperRL) +' moRSCMat.MoveFirst +' strSELECT = "inv_no = '1330'" +' moRSCMat.Find strSELECT +' If moRSCMat.EOF Then +' moRSCMat.MovePrevious +' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" +' Set oRSC = New Recordset +' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic +' moRSCMat.AddNew +' moRSCMat!Lot_id = gintLOTID +' moRSCMat!inv_no = "1330" +' moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!d_flag = Field2Str(oRSC!d_flag) +' moRSCMat!m_type = Field2Str(oRSC!m_type) +' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) +' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) +' ' moRSCMat!rc_flag = vbChecked +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' Else +'' moRSCMat!qty = Field2Str2(txtSuperRL) +' moRSCMat!ch_flag = vbChecked +' moRSCMat.Update +' End If + +' End If +' End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1331'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL2 = 0 + Else + dblRL2 = Field2Integer(moRSCMat!qty) + dblRL = dblRL + dblRL2 + dblRL2 = 0 + End If +'** Black Board and R Guard + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else +' ElseIf moRSProj!bb Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB5 = Field2Str(moRSCMat!qty) +' Else +' dblBB = 0 + End If +' ElseIf moRSProj!rg12 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG125 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblRG15 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If +' ElseIf moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblPYRO5 = Field2Str2(moRSCMat!qty) +' txtSuperBB = Field2Str2(moRSCMat!Qty) + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!pyro Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + + If dblBB5 > 0 And moRSProj!bb Then + dblBB = dblBB5 + End If + If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then + dblBB = dblRG125 + End If + If dblRG15 > 0 And moRSProj!rg1 Then + dblBB = dblRG15 + End If + If moRSProj!pyro Then + dblBB = dblPYRO5 + End If + + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1310'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1315'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!Qty = Field2Str(txtSuperBB) + moRSCMat!qty = dblBB + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update +' strSELECT = "inv_no = '1317'" +' moRSCMat.Find strSELECT +' dblBB = Field2Str(moRSCMat!Qty) + ElseIf moRSProj!pyro Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblPYRO +' moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1805'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If +'*** Calc Black Paper + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once + dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblNEWYDS < 325 Then + If moRSProj!bb Then + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + Else + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) +' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house + If dblNEWYDS > 325 Then + dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation + dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + End If + + If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + 'For 60 minute, use 1/2 foam divided by 16 +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) +' End If + dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) 'Changed 10/12/15 per jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID 'Material is TYVEK STRAIT FLASH + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + Else + oRC!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) + oRC.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + ElseIf moRSProj!bp_type = "BR" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + Else + oRC!qty = dblBP + oRC.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(txtWireAdj) 'RL reducing Wire calculation +' If dblRL > 5 Then + dblARL = Int(((dblRL) * 1.77) + 0.99) +' dblARL = Int(((dblRL - 5) * 1.77) + 0.99) +' Else +' dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) +' End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + If CDbl(txtTtlYdge) < 350 Then +' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) + dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) + Else + dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate Typar Stucco Wrap + If moRSProj!TYPAR Then +' dblTYPAR = Int((Field2Integer(txtTTLYds) / 90) + 0.99) + dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 70) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to take into consideration overlap +' dblTYPAR = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 90) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTYPAR = Int((Field2Integer(txtTtlYdge) / 90) + 0.99) 'Changed 7/22/2015 after discussion with BBart/JR +' intTP45 = 1 'combined all typar into 1 calcuation + intTP9 = dblTYPAR '- intTP45 + + dblTP4 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 100) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP6 = Int((Field2Integer(txtTtlYdge) / 100) + 0.99) 'Changed 10/17/17 No Longer using 6 in tape + dblTP9 = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 500) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house + dblTPNail = Int(((Field2Integer(txtTtlYdge) + dblWRAP) / 250) + 0.99) 'Changed 5/7/2018 after discussion with Jesse to include total yardage of house +' dblTP9 = Int((Field2Integer(txtTtlYdge) / 500) + 0.99) +' dblTPNail = Int((Field2Integer(txtTtlYdge) / 250) + 0.99) + dblTPCTape = intTP9 + +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3310 and lot_id = " & gintLOTID + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3300' and lot_id = " & gintLOTID ' To Delete + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + + Else + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3310' and lot_id = " & gintLOTID +' strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = 3300 and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3310' and Inv_Type = " & gbytINV_TYPE +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3300 and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = intTP9 + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = intTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3324' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3324' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) +' moRSCMat!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + moRSCMat!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = (dblTP4 * 2) ' Changed 10/17/17 per JR & Jesse + oRC!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3326' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRC.EOF Then + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3329' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3329' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then '********** + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = 1 +' moRSCMat!qty = dblTP9 ' May need to use this if coming up short. Super should hang on to extra butyl + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +'' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '1831' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1831' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPNail + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPNail + oRC.Update + End If + + strCHECK = "SELECT * FROM tblLotMatrl WHERE inv_no = '3320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3320' and Inv_Type = " & gbytINV_TYPE + Set oRSC = New Recordset + oRSC.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = dblTPCTape + moRSCMat!price = Field2Str(oRSC!tprice) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPCTape + oRC.Update + End If + + End If + + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + oRC.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + Else + oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + oRC.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "M" Then 'Now PREMIX Western One KOTE Not MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int(CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) ' + 0.99) +' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Western PREMIX + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + Else + oRC!qty = dblKote1 + oRC.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This caluclates the materials needed for the primary texture + 'mboolbag100 + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSC.EOF Then + If Not ((Field2Str2(oRSC!s16) > 0) Or (Field2Str2(oRSC!s20) > 0) Or (Field2Str2(oRSC!s30) > 0)) Then + If moRSProj!bag100 Or mboolPSW Then + mboolBAG100 = True + dblCalcBAGSAND = Field2Str2(moRSProj!bagdollars) + Else + mboolSilica = True + End If + Else + mboolSilica = True + End If + End If + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS))) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Not mboolBAG100 Then + If Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + End If + + If mboolBAG100 And Not mboolPSW Then + dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) + ElseIf mboolPSW Then + dblBAGSAND = Int(((dblKote1 + dblCMNT) * dblCalcBAGSAND) + 0.99) + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + Else + oRSC!qty = dblS20 + oRSC.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + +' If mboolBAG100 Then +' dblBAGSAND = Int((dblCMNT * dblCalcBAGSAND) + 0.99) +' End If + + If dblBAGSAND > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBAGSAND + moRSCMat.Update + Else + oRC!qty = dblBAGSAND + oRC.Update + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + End If + End If + + 'Calculate the Bag Sand + If dblRS > 0 And Not mboolSilica Then + txtSand = dblRS + Else + txtSand = 0 + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If + + If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else + dblBB3 = (dblBB * 3.5) + dblDW3 = (dblDW * 3.5) + dblRL3 = (dblRL * 1.77) + dblF12_3 = (dblFD12 * 1.77) + dblSUB = (((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77)) / 1.77) +' dblFD1 = Int((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - dblSUB + 0.99) + dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1211' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1211'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1241' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1241'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + Else + oRC!qty = Field2Str(txtSuper12) + oRC.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = '1610'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then 'Changed 11/1/17 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then + If Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 230 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If gboolPULTE Then + moRSCMat.Delete +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + End If + + strSELECT = "inv_no = '1822'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = 1822" 'XTRA 9500 Caulk + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 75)) + 0.99) + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 75)) + 0.99) + moRSCMat.Update + End If + +' If Not moRSCMat.EOF Then +' If Not moRSCMat!ch_flag Then +' If gboolPULTE Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.25) + 0.49) +' moRSCMat.Update +' Else +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) +' moRSCMat.Update +' End If +' End If +' End If + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + If moRSProj!cont_id = 146 Or moRSProj!cont_id = 864 Then +' If moRSProj!Cont_ID = "146" Or moRSProj!Cont_ID = 864 Then + Call FIXTypar + End If + + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo5- Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcThree() +Dim dblRL As Double, dblDW As Double, dblSP As Double +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String +Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer +Dim strFIN2 As String, strFIN1 As String, dblWire As Double +Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double + + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE = "O" Then + MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + + dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then + moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 ' changed from 19 to 0 per Jesse 01/13/18 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) 'Change per Jesse 08/01/18 + End If + Else + moRS!s_yds = Field2Integer(dblNEWYDS) - 5 'Change per Jesse 08/01/18 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 5 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 ' changed from 19 to 0 per Jesse 01/13/18 +' intDELETE = 19 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE + Else + moRS!l_yds = Field2Integer(dblNEWYDS) ' Change for Jesse 08/01/2018 +' moRS!l_yds = Field2Integer(dblNEWYDS) - 5 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str2(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str2(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + +'Black Board + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'Stucco Wire + 'Paperback wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(txtWireAdj) + If txtSuperSP > 0 Then + dblSP = Field2Str(txtSuperSP) + Else + dblSP = 0 + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + If dblRL > 10 Then + dblARL = Int(((dblRL - 10) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + + 'Self Furing wire + If mstrWIRE = "F" Then +' If dblSP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) +' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + +'Black Paper + If txtSuperSP > 0 Then + dblSP = CDbl(txtSuperSP) + Else + dblSP = 0 + End If + +' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) +' End If +' End If + +' If dblSP > 0 Then + If moRSProj!bp_type = "B6" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) + dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) + End If + ElseIf moRSProj!bp_type = "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) + dblBP = dblBP + (((dblSP * 3.5) / 16)) ' Changed 10/12/15 per Jesse +' dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) + End If + ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) + dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strGET = "SELECT * FROM tblTCInfo" + Set oRST = New Recordset + oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + +'Scratch Coat + dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) + dblSCmnt = (dblBatch * oRST!scr_cmnt) + dblSLime = (dblBatch * oRST!scr_lime) + dblRS = (dblBatch * oRST!scr_rs) + +'Brown Coat + dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) + dblCMNT = (dblBatch * oRST!brn_cmnt) + dblLime = (dblBatch * oRST!brn_lime) + dblRS = dblRS + (dblBatch * oRST!brn_rs) + +'Texture Coat + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str(oRSC!id) = "SB" Then + dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) + +' dblSYN = Int(dblBatch + 0.5) + End If + + If Field2Integer(oRSC!cmnt) > 0 Then + dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblTCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) +' Else +' dblRS = 0 + End If + +'This calculates the additional materials needed for the second texture + If moRS!fin2 > 0 Then + + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + ' Else + ' dblTCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) +' Else +' dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) +' Else +' dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) +' Else +' dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) +' Else +' dblS30 = 0 + End If + End If + + dblRS = Int((dblRS / 2000) + 0.99) + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblSYN / 10) + 0.5) + moRSCMat.Update + End If + End If + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblSLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSLime + moRSCMat.Update + End If + End If + + If dblTLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + +'Calculate 4d Nails + + strSELECT = "inv_no = '1616'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) + moRSCMat.Update + End If + End If + +'Calculate Staples + + strSELECT = "inv_no = '1705'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 400 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then + moRSCMat!qty = 4 + ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then + moRSCMat!qty = 5 + ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then + moRSCMat!qty = 6 + ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 7 + ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then + moRSCMat!qty = 8 + ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then + moRSCMat!qty = 9 + ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then + moRSCMat!qty = 10 + End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module MatCalcThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ConvertSuper() +Dim strGET As String, strSQL As String +Dim oRSC As Recordset + On Error GoTo Error_EH + + If txtSuper78 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + End If + End If + + If txtSuper38 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + End If + End If + + If txtSuper783 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = '1145'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1565'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1140'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + End If + + If txtSuperML <> 0 Then + strSQL = "inv_no = '1370'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + End If + End If + + If txtSuperDW <> 0 Then + strSQL = "inv_no = '1320'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + End If + End If + + If txtSuper1383 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = '1135'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + Else + strSQL = "inv_no = '1570'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = '1130'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module ConvertSuper" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcMetal() +Dim oRS As Recordset +Dim strSQL As String, dblMETAL As Double + On Error GoTo Error_EH + + moRS!METAL = 0 + + strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!summetal) + moRS!METAL = dblMETAL +' moRS!calcdate = Now + moRS!calcdate = Date + moRS.Update + txtMetal = dblMETAL + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module CalcMetal" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSuperSP_LostFocus() + txtSuperSP = Integer2Field(txtSuperSP) +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub txtWireAdj_LostFocus() + txtWireAdj = Integer2Field(txtWireAdj) +End Sub + +Private Sub txtYardMemo_LostFocus() + txtYardMemo = UCase(txtYardMemo) +End Sub + +Private Sub PrintLathInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If oRSE.EOF Then + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "L" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = DateAdd("d", 3, moRS!lorder) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) +' !disc_due_date = DateAdd("d", 3, moRS!lorder) + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "Before mlngINVID update" + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "After Main Lath Information " + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) +' !inv_due_date = Field2Str(strDate) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintLathInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintWrapInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" +' ElseIf moRSProj!cocode = 1 Then +' strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If oRSE.EOF Then + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" +' ElseIf moRSProj!cocode = 1 Then +' strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "W" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "W" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "0000") & "W" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!lorder) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "After Main Lath Information " + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "W" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "W" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "W" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!lorder) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!lorder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Winvoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintWrapInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintCompleteInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSC.EOF Then + If Field2Str(oRSC!Address2) = "" Then + strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + strADD3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + strADD4 = "" + Else + strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + End If + + dblINVTOTAL = 0 + dblRETENTION = 0 + If oRS.EOF Then + End If + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSS!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!s_bill) + !sales_code = Field2Str(oRSS!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(oRSS!s_bill) + !amount = Field2Str2(oRSS!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!SORDER) + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!SORDER) +' !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSO.MoveNext + End If + Loop + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintCompleteInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String, strSQLINFO As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Before Add Inv To ARINVOICE" + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" '*** This may be causing the extra zeros on the front of the invoice numbers + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" '*** This may be causing the extra zeros on the front of the invoice numbers +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + +' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!forder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !inv_due_date = Field2Str(strDate) +' !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + !taxcode = "AZ" +' !TAXCODE = mstrTAXCODE + Else +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + !taxcode = mstrTAXCODE + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + gstrMODULE = "Before mlngINVID update" + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "Before Option Setup" + + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = DateAdd("d", 3, moRS!forder) + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +' !inv_due_date = Field2Str(strDate) + !inv_due_date = DateAdd("d", 33, moRS!forder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + gstrMODULE = "Before Update mlngINVID second time" + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + gstrMODULE = "Before Print Invoice" + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID +' ElseIf moRSProj!cocode = 1 Then +' strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo5- Module PrintStuccoInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset ', oRSE As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer ' , strSQLE As String +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double, boolHEADER As Boolean, txtSALECD As String + + On Error GoTo Error_EH + + gintCOPY = 1 + boolHEADER = False + txtSALECD = "" + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' OR B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + +' 02/11/2020 commenting this out to prevent printing a blank stone items remove double marks to start using this again +'' If Not mboolSTONE3 Then + +'' With oRS +'' .AddNew +'' !Trans_ID = mlngINVID +'' !Lot_ID = gintLOTID +'' !PROJ_ID = gintPROJID +'' !project = Field2Str(moRSProj!Proj_Desc) +'' !lot_no = Field2Str(moRS!lot_no) +'' !address = Field2Str(moRS!address) +'' !inv_type = "V" +'' !customer_no = Field2Str(moRSProj!ar) +' !ship_date = Field2Str(moRS!VOrder) +'' !ship_date = (moRS!VOrder) +'' !projcode = Field2Str(moRSProj!Proj_Code) +'' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) +'' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +'' If IsNumeric(moRS!lot_no) Then +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' Else +'' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +'' End If +'' intCMonth = Month(moRS!VOrder) +'' intCDay = Day(moRS!VOrder) +'' intCYear = Year(moRS!VOrder) +'' If intCDay > moRSProj!inv_due Then +'' intCMonth = intCMonth + 1 +'' If intCMonth > 12 Then +'' intCMonth = intCMonth - 12 +'' intCYear = intCYear + 1 +'' End If +'' End If +'' intCDay = Field2Integer(moRSProj!inv_due) +'' If intCDay = 0 Then +'' Select Case intCMonth +'' Case 2 +'' intCDay = 28 +'' Case 1, 3, 5, 7, 8, 10, 12 +'' intCDay = 31 +'' Case 4, 6, 9, 11 +'' intCDay = 30 +'' End Select +'' End If + +'' strCDate = DateAdd("d", 3, moRS!VOrder) +'' !invoice_date = Field2Str(strCDate) +'' !job_number = Field2Str(moRS!jobcost) + +'' intYear = Year(!invoice_date) +'' intMonth = Month(!invoice_date) + 1 +'' intDay = Field2Integer(moRSProj!DueDate) +'' If intMonth > 12 Then +'' intMonth = intMonth - 12 +'' intYear = intYear + 1 +'' End If +'' Select Case intMonth +'' Case 2 +'' If intDay = 0 Then +'' intDay = 28 +'' End If +'' If intDay > 28 Then +'' intDay = 28 +'' End If +'' Case 1, 3, 5, 7, 8, 10, 12 +'' If intDay = 0 Then +'' intDay = 31 +'' End If +'' If intDay > 31 Then +'' intDay = 31 +'' End If + +'' Case 4, 6, 9, 11 +'' If intDay = 0 Then +'' intDay = 30 +'' End If +'' If intDay > 30 Then +'' intDay = 30 +'' End If +'' End Select + +'' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear +'' !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) +'' !disc_due_date = DateAdd("d", 3, moRS!VOrder) +'' !non_tax_amt = Field2Str2(oRSE!st_bill) +'' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) +'' !sales_code = Field2Str(oRSE!st_code) +'' If txtSALECD <> "" Then +'' !header = vbChecked +'' boolHEADER = True +'' Else +'' !header = vbUnchecked +'' boolHEADER = False +'' End If +'' If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then +'' !taxcode = "AZ" +'' Else +'' !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) +'' End If +'' !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) +'' !price = Field2Str2(oRSE!st_bill) +'' !amount = Field2Str2(oRSE!st_bill) +' !header = vbChecked +'' If Not oRSC.EOF Then +'' !c_add1 = Field2Str(oRSC!Name) +'' !c_add2 = Field2Str(oRSC!Address1) +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' Else +'' !c_add3 = Field2Str(oRSC!Address2) +'' End If +'' If Field2Str(oRSC!Address2) = "" Then +'' !c_add4 = "" +'' Else +'' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) +'' End If +'' Else +'' !c_add1 = "" +'' !c_add2 = "" +'' !c_add3 = "" +'' !c_add4 = "" +'' End If +'' !po_num = gstrPONUM +'' .Update +'' mlngINVID = mlngINVID + 1 +'' strSQLINFO = "SELECT * FROM tblTABLE_INFO" +'' Set moRSInvINFO = New Recordset +'' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic +'' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID +'' moRSInvINFO.Update +'' End With +'' End If + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) +' !inv_type = "S" + !inv_type = "V" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !taxcode = mstrTAXCODE + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + + If boolHEADER Then + !header = vbUnchecked + boolHEADER = False + Else + !header = vbChecked + boolHEADER = True + End If + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub JCSetup() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblJCTrans" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblJCTransM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If IsNull(moRSProj!ar) Then + MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" + Exit Sub + End If + With oRS + .AddNew + !Lot_ID = gintLOTID + !job_number = Field2Str(moRS!jobcost) + !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no + !address = Field2Str(moRS!address) + !customer_no = Field2Str(moRSProj!ar) + !retention_pct = Field2Str2(moRSProj!retention) + !setup_date = Date + !status_date = Date + .Update + End With + MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5- Module JCSetup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv_20200111() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset ', oRSE As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer ' , strSQLE As String +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String +Dim dblBillAmt As Double, dblWAmt As Double + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strModELEV = Field2Str(oRSE!Mod_Elv) + If oRSE!Wrap Then + mboolWRAP = True + Else + mboolWRAP = False + End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +'***************** To Put A "V" in the tblARInvoice +' strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" + strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND (B_code = 'STONE' OR B_code = 'WSTONE') and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" + Set oRSO = New Recordset + oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSO.EOF Then +' If IsNull(oRSO!B_code) Then + mboolSTONE3 = True + Else + mboolSTONE3 = False +' End If + End If + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + + + If Not mboolSTONE3 Then + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) +' !ship_date = Field2Str(moRS!VOrder) + !ship_date = (moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + ' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + ' !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) + !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!st_bill) + !amount = Field2Str2(oRSE!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + +'************************************************************************************************ + '********** Print Options that are stone + + If moRSProj!opt Then +' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" +' !ship_date = Field2Str(moRS!vorder) + !ship_date = (moRS!VOrder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "ST" + End If + gstrMODULE = "During Option Setup for ARINVOICE" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !job_number = Field2Str(moRS!jobcost) + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + dblBillAmt = dblBillAmt + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) & " - " & strModELEV + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbChecked +' !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + End If + oRSO.MoveNext + Loop + End If + +'************************************************************************************************ + +'************************************************************************************************ + + '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance + '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen + + If mboolWRAP Then + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + !invoice_no = strTEST2 + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + strCDate = DateAdd("d", 3, moRS!VOrder) + !invoice_date = Field2Str(strCDate) + + !job_number = Field2Str(moRS!jobcost) + + !inv_due_date = DateAdd("d", 33, moRS!VOrder) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSE!st_bill) + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) + dblINVTOTAL = dblINVTOTAL + dblBillAmt + ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* + !sales_code = "WINS" + ' dblBillAmt = Val(oRSE!s_bill) +' !sales_code = Field2Str(oRSE!st_code) + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = mstrTAXCODE +' !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) + !price = dblBillAmt + !amount = dblBillAmt + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + + gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + + End If + +'************************************************************************************************ + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + moRS!st_flg = vbTrue + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POInvoice() +Dim strSELECT As String + + On Error GoTo Error_EH + + If Not mboolSTPAY Then + If moRS!st_flg Then + MsgBox "This Lot Has Already Had A Stone Invoice Printed", vbOKOnly, "Invoice Not Available" + Exit Sub + End If + End If + + gintCOPY = 1 + strSELECT = "{tblOrders.PONum} = " & lstPO.ItemData(lstPO.ListIndex) + If gstrPONUM = "" Then + gstrPONUM = lstPO.ItemData(lstPO.ListIndex) + End If +'************************************************************************************* testing Stone Invoice + If optStone Then +' If optStucco Then + Call PrintStoneInv + Exit Sub + End If + +'************************************************************************************* + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5- Module POInvoice" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ElevLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!Folder = oRS!Folder + oRSS!FileName = oRS!FileName + oRSS!Primary = oRS!Primary + oRSS.Update + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Form LotInfo5 - Module ElevLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frx new file mode 100644 index 0000000..bdf1141 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfo5.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frm new file mode 100644 index 0000000..32eb960 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frm @@ -0,0 +1,16784 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotInfoE + BorderStyle = 1 'Fixed Single + Caption = "Lot Information -- Synthetic Job" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtStoneBill + Alignment = 1 'Right Justify + Height = 330 + Left = 8640 + TabIndex = 228 + TabStop = 0 'False + Top = 420 + Visible = 0 'False + Width = 540 + End + Begin VB.CheckBox chkFirst + Caption = "First Time" + Height = 315 + Left = 10680 + TabIndex = 213 + Top = 1500 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtESTID + Height = 375 + Left = 3120 + TabIndex = 209 + Top = 1680 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtOPEN + Height = 285 + Left = 10740 + TabIndex = 208 + Top = 1140 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtJC + Enabled = 0 'False + Height = 315 + Left = 2700 + MaxLength = 7 + TabIndex = 8 + Top = 2220 + Width = 915 + End + Begin VB.Timer tmrPause + Enabled = 0 'False + Interval = 500 + Left = 8700 + Top = 1020 + End + Begin Crystal.CrystalReport crOrder + Left = 120 + Top = 960 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtSand + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5160 + TabIndex = 28 + TabStop = 0 'False + Top = 780 + Width = 420 + End + Begin VB.ListBox lstPlans + Height = 2205 + Left = 9240 + Sorted = -1 'True + TabIndex = 26 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdFindPlan + Height = 435 + Left = 2565 + Picture = "frmLotInfoE.frx":0000 + Style = 1 'Graphical + TabIndex = 7 + Top = 1410 + Width = 435 + End + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 24 + TabStop = 0 'False + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 22 + TabStop = 0 'False + Top = 45 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1020 + Left = 3900 + MultiLine = -1 'True + TabIndex = 11 + Top = 1515 + Width = 4635 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 3 + TabIndex = 10 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 20 + TabStop = 0 'False + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 19 + TabStop = 0 'False + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 5760 + MaxLength = 2 + TabIndex = 9 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 18 + TabStop = 0 'False + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Enabled = 0 'False + Height = 315 + Left = 1440 + MaxLength = 5 + TabIndex = 5 + Top = 1140 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + MaxLength = 8 + TabIndex = 6 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + MaxLength = 15 + TabIndex = 4 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + MaxLength = 30 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 150 + TabIndex = 30 + TabStop = 0 'False + Top = 2850 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + Tab = 1 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "&General Information" + TabPicture(0) = "frmLotInfoE.frx":0442 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "lblDiana" + Tab(0).Control(1)= "lblYardMemo" + Tab(0).Control(2)= "lblMetal" + Tab(0).Control(3)= "lblLathBill" + Tab(0).Control(4)= "lblTextureO" + Tab(0).Control(5)= "lblBrownO" + Tab(0).Control(6)= "lblScratchO" + Tab(0).Control(7)= "lblSandO" + Tab(0).Control(8)= "lblLathO" + Tab(0).Control(9)= "lblOrderDates" + Tab(0).Control(10)= "txtLotNotes" + Tab(0).Control(11)= "cmdShowChange" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "cmdPrintCMU" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cmdUpCMU" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "txtYardMemo" + Tab(0).Control(15)= "cmdEdit" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "cmdSuperRpt" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "txtMetal" + Tab(0).Control(18)= "cmdDelLot" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "cmdAddLot" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "txtLathBill" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "txtTextureO" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "txtBrownO" + Tab(0).Control(22).Enabled= 0 'False + Tab(0).Control(23)= "txtScratchO" + Tab(0).Control(23).Enabled= 0 'False + Tab(0).Control(24)= "txtSandO" + Tab(0).Control(24).Enabled= 0 'False + Tab(0).Control(25)= "txtLathO" + Tab(0).Control(25).Enabled= 0 'False + Tab(0).Control(26)= "cmdSaveLotInfo" + Tab(0).Control(26).Enabled= 0 'False + Tab(0).Control(27)= "cmdOrders" + Tab(0).Control(27).Enabled= 0 'False + Tab(0).Control(28)= "cmdExit" + Tab(0).Control(28).Enabled= 0 'False + Tab(0).Control(29)= "cmdCalc" + Tab(0).Control(29).Enabled= 0 'False + Tab(0).Control(30)= "cmdJCSetup" + Tab(0).Control(31)= "chkHoldOrders" + Tab(0).Control(32)= "chkHoldPO" + Tab(0).Control(33)= "chkSynthetic" + Tab(0).Control(34)= "cmdOrder" + Tab(0).Control(35)= "chkStone" + Tab(0).Control(36)= "cmdPrint" + Tab(0).Control(37)= "chkOthers" + Tab(0).Control(38)= "chkNoPay" + Tab(0).Control(39)= "chkPaint" + Tab(0).ControlCount= 40 + TabCaption(1) = "&Super's Orders" + TabPicture(1) = "frmLotInfoE.frx":045E + Tab(1).ControlEnabled= -1 'True + Tab(1).Control(0)= "lblSuperNotes" + Tab(1).Control(0).Enabled= 0 'False + Tab(1).Control(1)= "lblPreOrder" + Tab(1).Control(1).Enabled= 0 'False + Tab(1).Control(2)= "lblSupHelp" + Tab(1).Control(2).Enabled= 0 'False + Tab(1).Control(3)= "lblSuperSP" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "lblSuperDW" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lblSuperRL" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "lblSuperML" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "lblSuper138" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "lblSuper38" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "lblSuper78" + Tab(1).Control(9).Enabled= 0 'False + Tab(1).Control(10)= "lblSuper783" + Tab(1).Control(10).Enabled= 0 'False + Tab(1).Control(11)= "lblSuper12" + Tab(1).Control(11).Enabled= 0 'False + Tab(1).Control(12)= "linSO" + Tab(1).Control(12).Enabled= 0 'False + Tab(1).Control(13)= "lblSuperBB" + Tab(1).Control(13).Enabled= 0 'False + Tab(1).Control(14)= "lblTake138" + Tab(1).Control(14).Enabled= 0 'False + Tab(1).Control(15)= "lblBB" + Tab(1).Control(15).Enabled= 0 'False + Tab(1).Control(16)= "lblZMetal" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cmdRePrintL" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdStuccoPay" + Tab(1).Control(18).Enabled= 0 'False + Tab(1).Control(19)= "cmdLathPay" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "txtSuperNotes" + Tab(1).Control(20).Enabled= 0 'False + Tab(1).Control(21)= "cmdPreOrderPrintS" + Tab(1).Control(21).Enabled= 0 'False + Tab(1).Control(22)= "cmdPreOrderPrintY" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "txtCalc138" + Tab(1).Control(23).Enabled= 0 'False + Tab(1).Control(24)= "lstPreOrder" + Tab(1).Control(24).Enabled= 0 'False + Tab(1).Control(25)= "txtSuperSP" + Tab(1).Control(25).Enabled= 0 'False + Tab(1).Control(26)= "txtSuperDW" + Tab(1).Control(26).Enabled= 0 'False + Tab(1).Control(27)= "txtSuperML" + Tab(1).Control(27).Enabled= 0 'False + Tab(1).Control(28)= "txtSuperRL" + Tab(1).Control(28).Enabled= 0 'False + Tab(1).Control(29)= "txtSuper1383" + Tab(1).Control(29).Enabled= 0 'False + Tab(1).Control(30)= "txtSuper38" + Tab(1).Control(30).Enabled= 0 'False + Tab(1).Control(31)= "txtSuper78" + Tab(1).Control(31).Enabled= 0 'False + Tab(1).Control(32)= "txtSuper783" + Tab(1).Control(32).Enabled= 0 'False + Tab(1).Control(33)= "txtSuper12" + Tab(1).Control(33).Enabled= 0 'False + Tab(1).Control(34)= "txtSuperBB" + Tab(1).Control(34).Enabled= 0 'False + Tab(1).Control(35)= "txtTake138" + Tab(1).Control(35).Enabled= 0 'False + Tab(1).Control(36)= "cmdLFlag" + Tab(1).Control(36).Enabled= 0 'False + Tab(1).Control(37)= "cmdIssue" + Tab(1).Control(37).Enabled= 0 'False + Tab(1).Control(38)= "cmdPreOrderPrintPC" + Tab(1).Control(38).Enabled= 0 'False + Tab(1).ControlCount= 39 + TabCaption(2) = "&Materials" + TabPicture(2) = "frmLotInfoE.frx":047A + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblMatInst" + Tab(2).Control(1)= "lblOrderBalance" + Tab(2).Control(2)= "lblLMLength" + Tab(2).Control(3)= "lblLMetal" + Tab(2).Control(4)= "lblLMType" + Tab(2).Control(5)= "lblLMDFlag" + Tab(2).Control(6)= "lblQty" + Tab(2).Control(7)= "lblLMInvNo" + Tab(2).Control(8)= "lblLMDesc" + Tab(2).Control(9)= "lstInventory" + Tab(2).Control(9).Enabled= 0 'False + Tab(2).Control(10)= "lstLMaterial" + Tab(2).Control(11)= "chkChange" + Tab(2).Control(12)= "cmdFindInv" + Tab(2).Control(13)= "cmdInventory" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "txtLMBalance" + Tab(2).Control(14).Enabled= 0 'False + Tab(2).Control(15)= "cboLMMetal" + Tab(2).Control(16)= "cboLMType" + Tab(2).Control(17)= "cboLMDFlag" + Tab(2).Control(18)= "txtLMLength" + Tab(2).Control(19)= "txtLMQty" + Tab(2).Control(20)= "txtLMInvNo" + Tab(2).Control(21)= "txtLMDesc" + Tab(2).Control(22)= "cmdDelMatrl" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdSaveMatrl" + Tab(2).Control(24)= "cmdAddMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).ControlCount= 25 + TabCaption(3) = "Op&tions" + TabPicture(3) = "frmLotInfoE.frx":0496 + Tab(3).ControlEnabled= 0 'False + Tab(3).Control(0)= "txtOSt_SqFt" + Tab(3).Control(1)= "chkOStone" + Tab(3).Control(2)= "lstPOptions" + Tab(3).Control(3)= "lstOptMatrl" + Tab(3).Control(4)= "cmdOptAdd" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "cmdOptDel" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lstLOptions" + Tab(3).Control(7)= "txtLODesc" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "txtLOYdge" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "txtLOFin2" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "txtLOFoam" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "txtLOTexture" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "txtLOMDesc" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "txtLOMInvNo" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "txtLOMQty" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "txtLOMLength" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "cboLOMDFlag" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "cboLOMType" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "cboLOMetal" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "txtNote2" + Tab(3).Control(20)= "txtNote" + Tab(3).Control(21)= "lblOptNum" + Tab(3).Control(22)= "lblOStone" + Tab(3).Control(23)= "lblPOptions" + Tab(3).Control(24)= "lblLOptions" + Tab(3).Control(25)= "lblLODesc" + Tab(3).Control(26)= "lblLOYdge" + Tab(3).Control(27)= "lblLOFin2" + Tab(3).Control(28)= "lblLOFAdj" + Tab(3).Control(29)= "lblLOTexture" + Tab(3).Control(30)= "lblLOMDesc" + Tab(3).Control(31)= "lblLOMInvNo" + Tab(3).Control(32)= "lblLOMQty" + Tab(3).Control(33)= "lblLOMDFlag" + Tab(3).Control(34)= "lblLOMType" + Tab(3).Control(35)= "lblLOMetal" + Tab(3).Control(36)= "lblLOMLength" + Tab(3).Control(37)= "lblSelectOpt" + Tab(3).Control(38)= "lblBillingAmt" + Tab(3).Control(39)= "lblBAmt" + Tab(3).ControlCount= 40 + TabCaption(4) = "&Lath Orders" + TabPicture(4) = "frmLotInfoE.frx":04B2 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lblLathOrd" + Tab(4).Control(1)= "lblYardOrd" + Tab(4).Control(2)= "lstLath" + Tab(4).Control(2).Enabled= 0 'False + Tab(4).Control(3)= "lstYard" + Tab(4).Control(3).Enabled= 0 'False + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco &Orders" + TabPicture(5) = "frmLotInfoE.frx":04CE + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lblTexOrd" + Tab(5).Control(1)= "lblBrnOrd" + Tab(5).Control(2)= "lblScrOrd" + Tab(5).Control(3)= "lstTexture" + Tab(5).Control(3).Enabled= 0 'False + Tab(5).Control(4)= "lstBrown" + Tab(5).Control(4).Enabled= 0 'False + Tab(5).Control(5)= "lstScratch" + Tab(5).Control(5).Enabled= 0 'False + Tab(5).ControlCount= 6 + TabCaption(6) = "&Purchase Orders" + TabPicture(6) = "frmLotInfoE.frx":04EA + Tab(6).ControlEnabled= 0 'False + Tab(6).Control(0)= "lblPayYds" + Tab(6).Control(1)= "lblOptMatPrice" + Tab(6).Control(2)= "lblPODate" + Tab(6).Control(3)= "lblPOMType" + Tab(6).Control(4)= "lblPODFlag" + Tab(6).Control(5)= "lblPOQty" + Tab(6).Control(6)= "lblDescription" + Tab(6).Control(7)= "lblInvNo" + Tab(6).Control(8)= "lblPONum" + Tab(6).Control(9)= "lblDesc" + Tab(6).Control(10)= "lblPO" + Tab(6).Control(11)= "lblPONotes" + Tab(6).Control(12)= "lblPOMaterials" + Tab(6).Control(13)= "lblIssueTo" + Tab(6).Control(14)= "lblPOType" + Tab(6).Control(15)= "lblPayType" + Tab(6).Control(16)= "lstPOMaterial" + Tab(6).Control(17)= "cmdPrintPOPay" + Tab(6).Control(18)= "txtPay" + Tab(6).Control(19)= "fraPO" + Tab(6).Control(20)= "cmdPrintForm" + Tab(6).Control(20).Enabled= 0 'False + Tab(6).Control(21)= "txtPOPrice" + Tab(6).Control(22)= "txtPODate" + Tab(6).Control(23)= "txtPODesc" + Tab(6).Control(24)= "txtPOMatDesc" + Tab(6).Control(25)= "cmdPrintPO" + Tab(6).Control(25).Enabled= 0 'False + Tab(6).Control(26)= "cmdDelPOMat" + Tab(6).Control(26).Enabled= 0 'False + Tab(6).Control(27)= "cmdSavePOMat" + Tab(6).Control(28)= "cmdAddPOMat" + Tab(6).Control(28).Enabled= 0 'False + Tab(6).Control(29)= "cmdFindPOMat" + Tab(6).Control(30)= "cboPOMType" + Tab(6).Control(31)= "cboPODFlag" + Tab(6).Control(32)= "txtPOQty" + Tab(6).Control(33)= "txtPOInvNo" + Tab(6).Control(34)= "cmdDelPO" + Tab(6).Control(34).Enabled= 0 'False + Tab(6).Control(35)= "cmdSavePO" + Tab(6).Control(36)= "cmdAddPO" + Tab(6).Control(36).Enabled= 0 'False + Tab(6).Control(37)= "txtIssueTo" + Tab(6).Control(38)= "txtPONum" + Tab(6).Control(38).Enabled= 0 'False + Tab(6).Control(39)= "txtPONotes" + Tab(6).Control(40)= "lstPO" + Tab(6).Control(41)= "cboPOType" + Tab(6).Control(42)= "txtPOType" + Tab(6).Control(42).Enabled= 0 'False + Tab(6).Control(43)= "txtPayType" + Tab(6).Control(44)= "lstLOOKUP" + Tab(6).Control(44).Enabled= 0 'False + Tab(6).ControlCount= 45 + Begin LpLib.fpList lstLOOKUP + Height = 2820 + Left = -67170 + TabIndex = 248 + Top = 2640 + Visible = 0 'False + Width = 3555 + _Version = 196608 + _ExtentX = 6271 + _ExtentY = 4974 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfoE.frx":0506 + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 255 + Left = -74460 + TabIndex = 240 + Top = 3345 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdPreOrderPrintPC + Caption = "Print PreCast PreOrders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 8460 + TabIndex = 238 + Top = 1380 + Width = 1335 + End + Begin VB.CommandButton cmdIssue + Caption = "RePrint &Yard Ticket" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5580 + TabIndex = 235 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkNoPay + Alignment = 1 'Right Justify + BackColor = &H00C0C0C0& + Caption = "No Pay Sheets Issued" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -72780 + TabIndex = 234 + Top = 3420 + Width = 2295 + End + Begin VB.CheckBox chkOthers + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 255 + Left = -72060 + TabIndex = 233 + Top = 3180 + Visible = 0 'False + Width = 1575 + End + Begin VB.CommandButton cmdPrint + Caption = "All Orders Printed" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -72000 + TabIndex = 232 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 300 + Left = -64755 + TabIndex = 231 + Top = 675 + Width = 975 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 240 + Left = -68475 + TabIndex = 229 + Top = 735 + Width = 1890 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = -71820 + TabIndex = 226 + Top = 2925 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtPayType + Height = 315 + Left = -70920 + MaxLength = 1 + TabIndex = 55 + Top = 2280 + Width = 375 + End + Begin VB.CommandButton cmdOrder + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 221 + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtPOType + Height = 285 + Left = -70980 + TabIndex = 220 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 615 + End + Begin VB.ComboBox cboPOType + Height = 315 + ItemData = "frmLotInfoE.frx":0816 + Left = -72300 + List = "frmLotInfoE.frx":0826 + Style = 2 'Dropdown List + TabIndex = 52 + Top = 1200 + Width = 1995 + End + Begin VB.CheckBox chkSynthetic + Alignment = 1 'Right Justify + Caption = "Synthetic" + Height = 195 + Left = -72900 + TabIndex = 216 + Top = 2940 + Width = 975 + End + Begin VB.CommandButton cmdLFlag + Caption = "Set Lath Flags" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5580 + TabIndex = 215 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkHoldPO + Alignment = 1 'Right Justify + Caption = "Hold PO's" + Height = 255 + Left = -74460 + TabIndex = 212 + Top = 3120 + Visible = 0 'False + Width = 1155 + End + Begin VB.CheckBox chkHoldOrders + Alignment = 1 'Right Justify + Caption = "Hold Orders" + ForeColor = &H00404040& + Height = 255 + Left = -74460 + MaskColor = &H000000FF& + TabIndex = 211 + Top = 2880 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdJCSetup + Caption = "Setup JC Record" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 210 + Top = 1500 + Width = 1215 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 1920 + TabIndex = 136 + TabStop = 0 'False + Top = 1680 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Height = 315 + Left = 1920 + MaxLength = 4 + TabIndex = 126 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = 1935 + MaxLength = 4 + TabIndex = 127 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = 1920 + MaxLength = 4 + TabIndex = 128 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = 1920 + MaxLength = 4 + TabIndex = 129 + Top = 4155 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = 1920 + MaxLength = 4 + TabIndex = 130 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + MaxLength = 4 + TabIndex = 131 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 4395 + MaxLength = 4 + TabIndex = 132 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 4380 + MaxLength = 4 + TabIndex = 133 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 4380 + MaxLength = 4 + TabIndex = 134 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = 4380 + MaxLength = 4 + TabIndex = 135 + Top = 4740 + Width = 795 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfoE.frx":0861 + Left = -74760 + List = "frmLotInfoE.frx":0868 + TabIndex = 125 + Top = 1020 + Width = 3095 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + ItemData = "frmLotInfoE.frx":0879 + Left = -74760 + List = "frmLotInfoE.frx":0880 + Sorted = -1 'True + TabIndex = 124 + Top = 4680 + Width = 5475 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + TabIndex = 123 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 122 + TabStop = 0 'False + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 121 + TabStop = 0 'False + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 120 + TabStop = 0 'False + Top = 1140 + Width = 1650 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -68535 + TabIndex = 119 + TabStop = 0 'False + Top = 1140 + Width = 4875 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = -74760 + Sorted = -1 'True + TabIndex = 118 + Top = 1080 + Width = 885 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = -73800 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 57 + Top = 2700 + Width = 3915 + End + Begin VB.TextBox txtPONum + BackColor = &H00E0E0E0& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -72300 + TabIndex = 117 + TabStop = 0 'False + Top = 840 + Width = 975 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 53 + Top = 1560 + Width = 3735 + End + Begin VB.CommandButton cmdAddPO + Caption = "&New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 116 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdSavePO + Caption = "S&ave PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 59 + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdDelPO + Caption = "D&elete PO" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 115 + TabStop = 0 'False + Top = 960 + Width = 1035 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -66240 + TabIndex = 114 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -64920 + TabIndex = 113 + TabStop = 0 'False + Top = 1380 + Width = 1275 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 112 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 110 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 111 + TabStop = 0 'False + Top = 5040 + Width = 1335 + End + Begin VB.ListBox lstPreOrder + Height = 1620 + Left = 5760 + TabIndex = 109 + TabStop = 0 'False + Top = 2160 + Width = 5445 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 100 + Top = 780 + Width = 4275 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 101 + Top = 1155 + Width = 2625 + End + Begin VB.TextBox txtLMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 102 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtLMLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 2 + TabIndex = 106 + Top = 3192 + Width = 915 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfoE.frx":0891 + Left = -68100 + List = "frmLotInfoE.frx":089B + Style = 2 'Dropdown List + TabIndex = 103 + Top = 1980 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfoE.frx":08AF + Left = -68100 + List = "frmLotInfoE.frx":08B1 + Style = 2 'Dropdown List + TabIndex = 104 + Top = 2388 + Width = 1215 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfoE.frx":08B3 + Left = -68100 + List = "frmLotInfoE.frx":08BD + Style = 2 'Dropdown List + TabIndex = 105 + Top = 2790 + Width = 1215 + End + Begin VB.TextBox txtLMBalance + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 107 + TabStop = 0 'False + Top = 3600 + Width = 915 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = -71640 + TabIndex = 99 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLODesc + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 94 + TabStop = 0 'False + Top = 1020 + Width = 2835 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 98 + TabStop = 0 'False + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 97 + TabStop = 0 'False + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 96 + TabStop = 0 'False + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOTexture + Enabled = 0 'False + Height = 315 + Left = -67200 + TabIndex = 95 + TabStop = 0 'False + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOMDesc + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 93 + TabStop = 0 'False + Top = 3135 + Width = 4155 + End + Begin VB.TextBox txtLOMInvNo + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 92 + TabStop = 0 'False + Top = 3480 + Width = 2625 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 91 + TabStop = 0 'False + Top = 3810 + Width = 915 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 90 + TabStop = 0 'False + Top = 5160 + Width = 915 + End + Begin VB.ComboBox cboLOMDFlag + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 89 + TabStop = 0 'False + Text = "cboLOMDFlag" + Top = 4155 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmLotInfoE.frx":08CE + Left = -68100 + List = "frmLotInfoE.frx":08D0 + TabIndex = 88 + TabStop = 0 'False + Text = "cboLOMType" + Top = 4500 + Width = 1155 + End + Begin VB.ComboBox cboLOMetal + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 87 + TabStop = 0 'False + Text = "cboLOMetal" + Top = 4830 + Width = 1155 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 86 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 85 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 84 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 83 + TabStop = 0 'False + Top = 1500 + Width = 1215 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 82 + TabStop = 0 'False + Top = 4440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtLathO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 81 + TabStop = 0 'False + Top = 2445 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtSandO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 80 + TabStop = 0 'False + Top = 1422 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtScratchO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 79 + TabStop = 0 'False + Top = 1764 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtBrownO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 78 + TabStop = 0 'False + Top = 2106 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtTextureO + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65085 + TabIndex = 77 + TabStop = 0 'False + Top = 1065 + Width = 1335 + End + Begin VB.CommandButton cmdFindInv + Height = 435 + Left = -65445 + Picture = "frmLotInfoE.frx":08D2 + Style = 1 'Graphical + TabIndex = 76 + Top = 1095 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtLathBill + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + MaxLength = 10 + TabIndex = 75 + TabStop = 0 'False + Top = 2790 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add New Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 74 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdDelLot + Caption = "Delete Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73260 + TabIndex = 73 + TabStop = 0 'False + Top = 2160 + Width = 1215 + End + Begin VB.TextBox txtCalc138 + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5280 + TabIndex = 72 + TabStop = 0 'False + Top = 2400 + Width = 435 + End + Begin VB.CheckBox chkChange + Alignment = 1 'Right Justify + Caption = "Recalc Flag:" + Height = 255 + Left = -69180 + TabIndex = 108 + Top = 4020 + Width = 1455 + End + Begin VB.TextBox txtMetal + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65100 + TabIndex = 71 + Top = 3480 + Width = 1335 + End + Begin VB.TextBox txtPOInvNo + Height = 315 + Left = -68760 + MaxLength = 18 + TabIndex = 63 + Top = 2625 + Width = 2625 + End + Begin VB.TextBox txtPOQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + MaxLength = 4 + TabIndex = 66 + Top = 3360 + Width = 915 + End + Begin VB.ComboBox cboPODFlag + Height = 315 + ItemData = "frmLotInfoE.frx":0D14 + Left = -68760 + List = "frmLotInfoE.frx":0D1E + Style = 2 'Dropdown List + TabIndex = 67 + Top = 3720 + Width = 1215 + End + Begin VB.ComboBox cboPOMType + Height = 315 + ItemData = "frmLotInfoE.frx":0D32 + Left = -68760 + List = "frmLotInfoE.frx":0D34 + Style = 2 'Dropdown List + TabIndex = 68 + Top = 4080 + Width = 1215 + End + Begin VB.CommandButton cmdFindPOMat + Height = 435 + Left = -66135 + Picture = "frmLotInfoE.frx":0D36 + Style = 1 'Graphical + TabIndex = 64 + Top = 2550 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdAddPOMat + Caption = "&Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68400 + TabIndex = 62 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdSavePOMat + Caption = "S&ave Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 70 + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdDelPOMat + Caption = "D&elete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -66120 + TabIndex = 61 + TabStop = 0 'False + Top = 1560 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPO + Caption = "P&rint PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 60 + TabStop = 0 'False + Top = 960 + Width = 1095 + End + Begin VB.TextBox txtPOMatDesc + Height = 315 + Left = -68760 + MaxLength = 50 + TabIndex = 65 + Top = 3000 + Width = 4275 + End + Begin VB.TextBox txtPODesc + Height = 315 + Left = -72300 + MaxLength = 50 + TabIndex = 54 + Top = 1920 + Width = 3735 + End + Begin VB.TextBox txtPODate + Alignment = 1 'Right Justify + Height = 315 + Left = -69600 + MaxLength = 10 + TabIndex = 58 + Top = 1200 + Width = 1035 + End + Begin VB.TextBox txtPOPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68760 + TabIndex = 69 + Top = 4440 + Width = 975 + End + Begin VB.CommandButton cmdPrintForm + Caption = "Print Form" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -64980 + TabIndex = 51 + TabStop = 0 'False + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSuperRpt + Caption = "Print Super's Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -72000 + TabIndex = 50 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdPreOrderPrintY + Caption = "Print Yard PreOrders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 9900 + TabIndex = 49 + TabStop = 0 'False + Top = 720 + Width = 1335 + End + Begin VB.CommandButton cmdPreOrderPrintS + Caption = "Print Supplier PreOrders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 9900 + TabIndex = 48 + TabStop = 0 'False + Top = 1380 + Width = 1335 + End + Begin VB.Frame fraPO + Height = 435 + Left = -68520 + TabIndex = 43 + Top = 2040 + Width = 4875 + Begin VB.OptionButton optStone + Caption = "Stone" + Height = 255 + Left = 3240 + TabIndex = 237 + Top = 120 + Width = 795 + End + Begin VB.OptionButton optPreOrder + Caption = "PreOrder" + Height = 255 + Left = 2280 + TabIndex = 224 + Top = 120 + Width = 975 + End + Begin VB.OptionButton optLath + Caption = "Lath" + Height = 255 + Left = 60 + TabIndex = 47 + Top = 120 + Width = 675 + End + Begin VB.OptionButton optStucco + Caption = "Stucco" + Height = 255 + Left = 720 + TabIndex = 46 + Top = 120 + Width = 855 + End + Begin VB.OptionButton optSand + Caption = "Sand" + Height = 255 + Left = 1560 + TabIndex = 45 + Top = 120 + Width = 735 + End + Begin VB.OptionButton optNone + Caption = "None" + Height = 255 + Left = 4080 + TabIndex = 44 + Top = 120 + Value = -1 'True + Width = 735 + End + End + Begin VB.TextBox txtSuperNotes + Height = 1275 + Left = 5760 + MaxLength = 255 + MultiLine = -1 'True + TabIndex = 146 + Top = 4200 + Width = 5445 + End + Begin VB.CommandButton cmdEdit + Caption = "Edit Lot Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -72000 + TabIndex = 42 + TabStop = 0 'False + Top = 2160 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtYardMemo + Height = 1575 + Left = -74520 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 41 + Top = 3900 + Width = 5355 + End + Begin VB.CommandButton cmdUpCMU + Caption = "Update CMU Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67335 + TabIndex = 40 + TabStop = 0 'False + Top = 840 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdPrintCMU + Caption = "Print CMU Pay Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -67335 + TabIndex = 39 + TabStop = 0 'False + Top = 1500 + Visible = 0 'False + Width = 1215 + End + Begin VB.TextBox txtPay + Alignment = 1 'Right Justify + Height = 315 + Left = -69240 + TabIndex = 56 + Top = 2280 + Width = 675 + End + Begin VB.CommandButton cmdPrintPOPay + Caption = "Print Pay Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68760 + TabIndex = 38 + Top = 4785 + Width = 1035 + End + Begin VB.CommandButton cmdLathPay + Caption = "RePrint Lath Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 8460 + TabIndex = 37 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdStuccoPay + Caption = "RePrint Stucco Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7020 + TabIndex = 36 + Top = 1380 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdRePrintL + Caption = "ReSet Lath Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 7020 + TabIndex = 35 + Top = 720 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdShowChange + Caption = "Show Change Log" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -70740 + TabIndex = 34 + TabStop = 0 'False + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtNote2 + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 33 + Top = 3060 + Width = 5475 + End + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 795 + Left = -74760 + MultiLine = -1 'True + TabIndex = 32 + Top = 3840 + Width = 5475 + End + Begin VB.TextBox txtLotNotes + Height = 1575 + Left = -69120 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 31 + Top = 3900 + Width = 5355 + End + Begin LpLib.fpList lstLMaterial + Height = 4710 + Left = -74880 + TabIndex = 246 + Top = 855 + Width = 5595 + _Version = 196608 + _ExtentX = 9869 + _ExtentY = 8308 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfoE.frx":1178 + End + Begin LpLib.fpList lstInventory + Height = 2190 + Left = -66795 + TabIndex = 247 + Top = 2790 + Width = 3165 + _Version = 196608 + _ExtentX = 5583 + _ExtentY = 3863 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 225 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfoE.frx":1590 + End + Begin LpLib.fpList lstPOMaterial + Height = 1065 + Left = -73800 + TabIndex = 249 + Top = 4335 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 1879 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 90 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotInfoE.frx":189F + End + Begin VB.Label lblOptNum + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -70500 + TabIndex = 239 + Top = 720 + Width = 1680 + End + Begin VB.Label lblZMetal + Alignment = 2 'Center + Caption = "This House Uses Z-Metal" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = 60 + TabIndex = 236 + Top = 5160 + Visible = 0 'False + Width = 5655 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Opt. SqFt:" + Height = 195 + Left = -66540 + TabIndex = 230 + Top = 750 + Width = 1740 + End + Begin VB.Label lblPayType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Type:" + Height = 195 + Left = -71805 + TabIndex = 225 + Top = 2340 + Width = 720 + End + Begin VB.Label lblPOType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Type:" + Height = 195 + Left = -73005 + TabIndex = 219 + Top = 1260 + Width = 675 + End + Begin VB.Label lblBB + Alignment = 2 'Center + Caption = "This House Uses R-Guard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 675 + Left = 2820 + TabIndex = 218 + Top = 1380 + Width = 2475 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = 105 + TabIndex = 206 + Top = 1740 + Width = 1590 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard/R-Guard:" + Height = 195 + Left = 165 + TabIndex = 205 + Top = 2400 + Width = 1530 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = 0 + X2 = 5340 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = 960 + TabIndex = 204 + Top = 3000 + Width = 735 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = 840 + TabIndex = 203 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = 1035 + TabIndex = 202 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = 1035 + TabIndex = 201 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = 3120 + TabIndex = 200 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Enabled = 0 'False + Height = 195 + Left = 3420 + TabIndex = 199 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Enabled = 0 'False + Height = 195 + Left = 3540 + TabIndex = 198 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Enabled = 0 'False + Height = 195 + Left = 3660 + TabIndex = 197 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = 3300 + TabIndex = 196 + Top = 4800 + Width = 915 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = -73740 + TabIndex = 195 + Top = 1620 + Width = 1410 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -73800 + TabIndex = 194 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -73800 + TabIndex = 193 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -74760 + TabIndex = 192 + Top = 720 + Width = 1815 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 191 + Top = 840 + Width = 1200 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 190 + Top = 840 + Width = 1065 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Synthetic Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -68535 + TabIndex = 189 + Top = 840 + Width = 1335 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 188 + Top = 900 + Width = 930 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Supplier Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 187 + Top = 900 + Width = 1665 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfoE.frx":1C3F + Height = 555 + Left = 240 + TabIndex = 186 + Top = 900 + Width = 5115 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 6300 + TabIndex = 185 + Top = 1905 + Width = 2715 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 184 + Top = 840 + Width = 840 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 183 + Top = 1242 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 182 + Top = 1644 + Width = 630 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 181 + Top = 2046 + Width = 960 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 180 + Top = 2448 + Width = 1005 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 179 + Top = 2850 + Width = 780 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 178 + Top = 3252 + Width = 975 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Shipped So Far:" + Height = 195 + Left = -69285 + TabIndex = 177 + Top = 3660 + Width = 1140 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 176 + Top = 720 + Width = 1095 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71580 + TabIndex = 175 + Top = 720 + Width = 990 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68100 + TabIndex = 174 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = -68415 + TabIndex = 173 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -68265 + TabIndex = 172 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = -68475 + TabIndex = 171 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = -68415 + TabIndex = 170 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 169 + Top = 3135 + Width = 840 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 168 + Top = 3480 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = -68805 + TabIndex = 167 + Top = 3840 + Width = 660 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 166 + Top = 4185 + Width = 960 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 165 + Top = 4530 + Width = 1005 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68940 + TabIndex = 164 + Top = 4890 + Width = 780 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 163 + Top = 5220 + Width = 975 + End + Begin VB.Label lblMatInst + Caption = $"frmLotInfoE.frx":1CFA + Height = 1155 + Left = -66660 + TabIndex = 162 + Top = 1560 + Visible = 0 'False + Width = 2835 + End + Begin VB.Label lblOrderDates + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -65100 + TabIndex = 161 + Top = 780 + Width = 1275 + End + Begin VB.Label lblLathO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath:" + Height = 195 + Left = -65535 + TabIndex = 160 + Top = 2505 + Visible = 0 'False + Width = 360 + End + Begin VB.Label lblSandO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = -65595 + TabIndex = 159 + Top = 1482 + Visible = 0 'False + Width = 420 + End + Begin VB.Label lblScratchO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch:" + Height = 195 + Left = -65775 + TabIndex = 158 + Top = 1824 + Visible = 0 'False + Width = 600 + End + Begin VB.Label lblBrownO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown:" + Height = 195 + Left = -65670 + TabIndex = 157 + Top = 2166 + Visible = 0 'False + Width = 495 + End + Begin VB.Label lblTextureO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic:" + Height = 195 + Left = -65865 + TabIndex = 156 + Top = 1125 + Width = 705 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone:" + Height = 195 + Left = -65640 + TabIndex = 155 + Top = 2850 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Feet:" + Height = 195 + Left = -66000 + TabIndex = 154 + Top = 3540 + Width = 795 + End + Begin VB.Label lblSelectOpt + Caption = "Double Click the desired option to selected it for Add or Delete." + Height = 375 + Left = -66060 + TabIndex = 153 + Top = 2100 + Width = 2235 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = -73485 + TabIndex = 152 + Top = 1980 + Width = 1155 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO #:" + Height = 195 + Left = -72750 + TabIndex = 151 + Top = 900 + Width = 420 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = -69360 + TabIndex = 150 + Top = 2700 + Width = 525 + End + Begin VB.Label lblDescription + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69675 + TabIndex = 149 + Top = 3060 + Width = 840 + End + Begin VB.Label lblPOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -69465 + TabIndex = 148 + Top = 3420 + Width = 630 + End + Begin VB.Label lblPODFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69795 + TabIndex = 147 + Top = 3780 + Width = 1020 + End + Begin VB.Label lblPOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69780 + TabIndex = 145 + Top = 4140 + Width = 1005 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = -70260 + TabIndex = 144 + Top = 1260 + Width = 660 + End + Begin VB.Label lblBillingAmt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = -64980 + TabIndex = 143 + Top = 2700 + Width = 915 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + Caption = "$:" + Height = 255 + Left = -65280 + TabIndex = 142 + Top = 2760 + Width = 195 + End + Begin VB.Label lblSuperNotes + AutoSize = -1 'True + Caption = "Notes to Super:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5760 + TabIndex = 141 + Top = 3960 + Width = 1350 + End + Begin VB.Label lblYardMemo + AutoSize = -1 'True + Caption = "Yard Order Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -74460 + TabIndex = 140 + Top = 3600 + Width = 1830 + End + Begin VB.Label lblOptMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = -69540 + TabIndex = 139 + Top = 4500 + Width = 765 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = -70140 + TabIndex = 138 + Top = 2340 + Width = 765 + End + Begin VB.Label lblDiana + AutoSize = -1 'True + Caption = "Lot Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = -69000 + TabIndex = 137 + Top = 3600 + Width = 1065 + End + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Foam Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 245 + Top = 0 + Width = 1980 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Labor Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 244 + Top = 315 + Width = 1980 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Wire Adj. Yardage:" + Height = 285 + Left = 6525 + TabIndex = 243 + Top = 615 + Width = 1980 + End + Begin VB.Label lblStoneSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Stone Sq. Ft.:" + Height = 285 + Left = 6525 + TabIndex = 242 + Top = 915 + Width = 1980 + End + Begin VB.Label lblPaintSqFt + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Caption = "Paint Sq Ft: " + Height = 285 + Left = 6525 + TabIndex = 241 + Top = 1230 + Width = 1980 + End + Begin VB.Label lblStone + Alignment = 2 'Center + Caption = "Stone Veneer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8640 + TabIndex = 227 + Top = 1440 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSandShip + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5580 + TabIndex = 223 + Top = 780 + Width = 420 + End + Begin VB.Label lblSZone + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6060 + TabIndex = 222 + Top = 780 + Width = 315 + End + Begin VB.Label lblSynthetic + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Synthetic Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF00FF& + Height = 360 + Left = 8970 + TabIndex = 217 + Top = 1440 + Visible = 0 'False + Width = 2475 + End + Begin VB.Label lblFirst + Alignment = 2 'Center + Caption = "First Time This Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 8640 + TabIndex = 214 + Top = 1800 + Visible = 0 'False + Width = 3195 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 4620 + TabIndex = 207 + Top = 840 + Width = 480 + End + Begin VB.Label lblJC + Alignment = 1 'Right Justify + Caption = "Job Cost:" + Height = 375 + Left = 2280 + TabIndex = 29 + Top = 2160 + Width = 375 + End + Begin VB.Label lblPlan + AutoSize = -1 'True + Caption = "Double Click the Desired Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8700 + TabIndex = 27 + Top = 840 + Visible = 0 'False + Width = 2565 + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 9000 + TabIndex = 25 + Top = 2220 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 23 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " Plan Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3900 + TabIndex = 21 + Top = 1245 + Width = 1275 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 17 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 16 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 15 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 14 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 13 + Top = 1560 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 12 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1200 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfoE" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSPOpt2 As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset +Dim moRSPO As Recordset +Dim moRSPOMAT As Recordset +Dim moRSMemo As Recordset +Dim moRSPay As Recordset +Dim moRSInvINFO As Recordset + +Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String +Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean +Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean +Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngINVID As Long +Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mstrTAXCODE As String +Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngARINVID As Long +Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mintOpenPR As Integer +Dim mlngFind As Long, mintBOOKMARK As Integer, mstrWireAdj As String +Dim mintTake138 As Integer, mintPONUM As Long, mbool2Dates As Boolean +Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String +Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolSYNTHETIC As Boolean +Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolPAINT As Boolean +Dim mboolCOMM As Boolean + +Private Sub SetStone() +Dim strSQL As String + + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbTrue + moRS!c_flg = vbTrue + moRS!t_flg = vbTrue + moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub SetSyn() +Dim strSQL As String + + moRS!l_FLG = "P" +' moRS!y_FLG = "P" +' moRS!s_FLG = "P" +' moRS!z_FLG = "P" + moRS!a_flg = vbTrue + moRS!b_flg = vbFalse + moRS!c_flg = vbTrue + moRS!lorder = Date + moRS!Border = Date + moRS!forder = Date + moRS!corder = Date + moRS!SORDER = Null +' moRS!SORDER = Date +' moRS!t_flg = vbTrue +' moRS!stone = vbTrue + moRS.Update + +End Sub + +Private Sub PaintFix() +Dim strResponse As String + strResponse = Field2Str2(moRS!PNT_SQFT) + strResponse = Field2Str2(InputBox("Enter The Correct Square Footage For The Paint", "Correct Paint", strResponse)) + If strResponse = "" Or strResponse = 0 Then + Exit Sub + End If + moRS!PNT_SQFT = Field2Str2(strResponse) + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + moRS.Update + Call FormShow + +End Sub + +Private Sub RePrintLath() 'Allows a lath order to be reprinted +Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin +Dim oRS As Recordset 'but will keep a copy of the original orders printed + + Call LotChange(mstrPROJLOT, "Allow RePrint Lath") + + moRS!l_FLG = Null + moRS!y_FLG = Null + moRS!s_FLG = Null + moRS!z_FLG = Null + moRS!lorder = "12/31/2030" + moRS!Border = Null + moRS!TORDER = Null + moRS!forder = Null + moRS!corder = Null + moRS!SORDER = Null + moRS!VOrder = Null + moRS!pmetal = 0 + moRS!pylath = 0 + moRS!pystucco = 0 + moRS.Update + moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN + moRSMemo.Update + + strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!o_qty = 0 +' oRS!d_flag = "X" +' oRS!ar_trans = vbChecked +' oRS!ap_trans = vbChecked + oRS.Update + oRS.MoveNext + Loop + + strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID + goConn.Execute strSQL + + Call LotRePrinted +End Sub + +Private Sub cboPOType_LostFocus() + If cboPOType.ListIndex = -1 Then + cboPOType.ListIndex = 0 + End If + txtPOType = Left(cboPOType.Text, 1) + gstrPO = txtPOType + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = True + optStucco.Enabled = True + optSand.Enabled = True + optPreOrder.Enabled = True + optNone.Enabled = True + optStone.Enabled = True + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + optLath.Enabled = False + optStucco.Enabled = False + optSand.Enabled = False + optPreOrder.Enabled = False + optNone.Enabled = True + optStone.Enabled = True + End Select + +End Sub + +Private Sub chkHoldOrders_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkHoldPO_Click() + cmdSaveLotInfo.Enabled = True + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkOthers_Click() + cmdSaveLotInfo.Enabled = True + +End Sub + +Private Sub chkSplit_Click() + cmdSaveLotInfo.Enabled = True +' lblSynthetic.Visible = True + If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF + End If +End Sub + +Private Sub chkPaint_Click() + If mboolFRMLOAD Then + cmdSaveLotInfo.Enabled = True + moRS!PNT_FLG = chkPaint + Call PaintFix + End If + mboolFRMLOAD = True +End Sub + +Private Sub chkStone_Click() + If chkStone Then + cmdSaveLotInfo.Enabled = True + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + lblStone.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblStone.Visible = False + lblStoneSqFt.Caption = "Stone Square Ft.: 0" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + End If + +End Sub + +Private Sub chkSynthetic_Click() + cmdSaveLotInfo.Enabled = True + If chkSynthetic Then + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = True + Else + cmdSaveLotInfo.Enabled = True + lblSynthetic.Visible = False + End If + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + End If + +End Sub + +Private Sub cmdAddPOMat_Click() + Call POMatClear + gconACTION = 0 + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPODate.Enabled = False + txtPODesc.Enabled = False + txtIssueTo.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + mboolAdding = True + txtPOInvNo.SetFocus + +End Sub + +Private Sub cmdSynPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset, strPAY As String +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + +''' If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then +''' strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" +''' strMSG = strMSG & Chr(10) & Chr(13) +''' strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" +''' intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" +''' If intResponse = vbYes Then +''' Call cmdFindPlan_Click +''' Call cmdCalc_Click +''' cmdExit.Enabled = True +''' End If +' Exit Sub +''' End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + +' If moRS!Split Then +''' If mboolSPLIT Then +''' strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID +''' Set oRS = New Recordset +''' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +''' intPERCENT = Field2Str2(oRS!SUMPercent) +''' If intPERCENT = 0 Then +''' boolFPRINT = True +''' Else +''' boolFPRINT = False +''' End If +''' gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) +''' If gintPERCENT = 0 Then +''' MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" +''' Exit Sub +''' End If +''' If (intPERCENT + gintPERCENT) > 100 Then +''' MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" +''' cmdExit.Enabled = True +''' Exit Sub +''' End If +''' Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True +''' End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "E" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'E'" + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID & " and m_type = 'E'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'E'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!forder = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!b_flg = vbTrue + End If + moRS.Update + End If + + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'E')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewSyn.rpt" + ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' If chkSynthetic Then + If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' moRS.Update +' If Not moRS!Split Then + If Not mboolSPLIT Then + If Not moRSProj!bill Then + Call PrintSynInv +' Else +' Call PrintCompleteInv + End If + boolFPRINT = False + End If + End If + If boolFPRINT Then +' moRS!t_flg = vbTrue +' moRS.Update + If Not moRSProj!bill Then + Call PrintSynInv +' Else +' Call PrintCompleteInv + End If + End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SYNTHETIC ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gintCOPY = 1 +' intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + MsgBox "**SYNTHETIC** Insert 9 Sheets of Purple Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + Call PrintSynPay + crOrder.Reset + gintCOPY = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdSynPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdCalc_Click() +Dim strMSG As String + + strMSG = "No Material Calculation Is Necessary" + strMSG = strMSG & vbCrLf & "On Synthetic Orders At This Time" + MsgBox strMSG, vbOKOnly, "Not Needed" + Exit Sub + + If moRS!texture = "DW" Then + moRS!calcdate = Date + moRS.Update + Else + If moRSProj!stype <> "T" Then + Call MatCalcOne + Call ConvertSuper + Call MatLoad + Call CalcMetal + Else + Call MatCalcThree + Call ConvertSuper + Call MatLoad + Call CalcMetal + End If + End If + MsgBox "Materials Calculation is Complete" + txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Date & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +End Sub + +Private Sub cmdDelLot_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID + goConn.Execute strSQL + moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Lot") + Unload Me + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdDelLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelPO_Click() +Dim strSQL As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPO.ListIndex + cmdDelPO.Enabled = False + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdPrintPO.Enabled = False + cmdAddPOMat.Enabled = True + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM + goConn.Execute strSQL + Call LotChange(mstrPROJLOT, "Delete PO") + Call POLoad + If lstPO.ListCount Then + If lstPO.ListCount > mintBOOKMARK Then + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPO.ListIndex = mintBOOKMARK - 1 + End If + Else + mintBOOKMARK = -1 + Call POMatClear + Call POClear + End If + gconACTION = 0 +End Sub + +Private Sub cmdDelPOMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstPOMaterial.ListIndex + moRSPOMAT.Delete + Call LotChange(mstrPROJLOT, "Delete PO Material") + Call POMatLoad + cmdAddPO.Enabled = True + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdAddPOMat.Enabled = True + If lstPOMaterial.ListCount Then + If lstPOMaterial.ListCount > mintBOOKMARK Then + lstPOMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 +End Sub + +Private Sub cmdEdit_Click() + gconACTION = 5 + cmdSaveMatrl.Enabled = True + cmdCalc.Enabled = True + cmdFindPlan.Visible = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdPrintCMU.Enabled = True + cmdUpCMU.Enabled = True + txtAddress.Enabled = True + txtOwner.Enabled = True + lstLOptions.Enabled = True + lstPOptions.Enabled = True +End Sub + +Private Sub cmdFindPOMat_Click() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + Else + lstLOOKUP.Visible = True + Call LoadILookUp + lngFind = Field2Long(txtPOInvNo) + Call ListFindItem2(lstLOOKUP, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub LoadILookUp() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOOKUP.Clear + + Do Until oRS.EOF + With lstLOOKUP + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOOKUP.ListCount Then + lstLOOKUP.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LoadLookUp" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdIssue_Click() +Dim lngTIE As Long +Dim strSQL As String + + lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) + + + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Formulas(4) = 1 + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Formulas(4) = 1 + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + cmdIssue.Visible = False +End Sub + +Private Sub cmdJCSetup_Click() + Call JCSetup +End Sub + + +Private Sub cmdLathPay_Click() +Dim strPAY As String +Dim bytINFO As Byte + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) + If bytINFO = 1 Then + gintCOPY = 1 + ElseIf bytINFO = 2 Then + gintCOPY = 3 + ElseIf bytINFO = 3 Then + gintCOPY = 5 + ElseIf bytINFO = 4 Then + gintCOPY = 7 + ElseIf bytINFO = 5 Then + gintCOPY = 9 + End If + + Call LotChange(mstrPROJLOT, "RePrint Lath Pay") + Call PrintLathPay + cmdLathPay.Visible = False +End Sub + +Private Sub cmdLathPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer +Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer +Dim strSELECT As String, strSql2 As String, strMSG As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer +Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer + + On Error GoTo Error_EH + +' If mstrPLANUP > Field2Str(moRS!CalcDate) Then +' strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" +' strMSG = strMSG & Chr(10) & Chr(13) +' strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" +' MsgBox strMSG, vbYesNo, "Recalculate Recommended" +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" +' If intResponse = vbYes Then +' Call cmdFindPlan_Click +' Call cmdCalc_Click +' End If +' Exit Sub +' End If + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Not moRSProj!setup Then + MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + cmdExit.Enabled = False + + Call GetPlanInfo +' If mboolPLANUP Then + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" + cmdExit.Enabled = True + Exit Sub + End If + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic +' If moRSPay.EOF Then +' End If + gintCOPY = 1 +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + If txtSuperBB = 0 And txtSuper12 = 0 Then + MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" + cmdExit.Enabled = True + Exit Sub + End If + +' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" + cmdExit.Enabled = True + Exit Sub + End If + If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then + MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + If Field2Str2(oRS!s_bill) = 0 Then + MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" + cmdExit.Enabled = True + Exit Sub + End If + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "L" + gstrTYPE = "Y" + Call ShowPrint + gstrMODULE = "After Show Print" + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "Step 1 " + If oRS.EOF Then + + Else +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) + moRS!lorder = Field2Str(oRS!order_date) + moRS.Update + End If + gstrMODULE = "Step 2 " + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Step 3 " + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then + '***************** need to move this to Issue and Make a unique identifier + If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If +' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS!a_qty = dblOrder + oRSS.Update + End If + oRS.MoveNext + Loop + End If + gstrMODULE = "Step 4 " + If oRS.State = adStateOpen Then + oRS.Close + End If + gstrMODULE = "Step 5 " + If oRSS.State = adStateOpen Then + oRSS.Close + End If + gstrMODULE = "Before Print Lath PO" + MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" +' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + gintCOPY = 1 'Added 8/1/17 to make the report only print 1 copy + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 2 + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewLath.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewLathM.rpt" + End If + + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + gintCOPY = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + moRS!PRNT_L = Now() + moRS.Update + + If boolFPRINT Then + gstrMODULE = "Before Print Actual " + Call PrintActual + gintCOPY = 1 + crOrder.Reset + End If +' If boolFPRINT Then + gstrMODULE = "Before Print Issue Ticket " + Call PrintIssue + gintCOPY = 1 + crOrder.Reset +' End If + If boolFPRINT Then + gstrMODULE = "Before Print Lath Material Report " + Call PrintLathMat + crOrder.Reset + ' crOrder.Reset + +' Load frmEPElev +' Unload frmEPElev + + If Not chkNoPay Then +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then +' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If +' If Field2Str2(txtTtlYdge) - 19 > 1200 Then + intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " 1 Sheet of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = intCOPY * 2 +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 +' Else +' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 2 +' End If + gstrMODULE = "Before Print Lath Pay " + Call PrintLathPay + + If mboolPAINT Then + MsgBox "Insert 1 White and 10 Orange Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Paint Pay " + + Call PrintPaintPay + End If + + gintCOPY = 1 + intCOPY = 0 + crOrder.Reset + gstrMODULE = "Before Print Stucco Pay " + + If moRSProj!stype <> "T" Then + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = 1 +' gintCOPY = intCOPY * 2 + MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + ' gintCOPY = 4 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 + Else + If moRS!texture <> "SB" Then +' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 1 + MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoPay + crOrder.Reset + gintCOPY = 1 + ElseIf moRS!texture = "SF" Then + MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" + gintCOPY = 1 +' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 + Call PrintStuccoStone + crOrder.Reset + gintCOPY = 1 +' Else +' MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 1 +' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" +' gintCOPY = 2 +' Call PrintStuccoSyn +' crOrder.Reset +' gintCOPY = 1 + End If + End If + Else + If Field2Str2(txtTtlYdge) - 24 > 1200 Then + intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) + gintCOPY = intCOPY * 2 + intTCPAY = gintCOPY * 3 + MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" +' gintCOPY = 4 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + Else + MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" + gintCOPY = 2 + Call PrintStuccoThree + crOrder.Reset + gintCOPY = 1 + End If + End If + gintCOPY = 1 + If Field2Integer(moRS!CMU) > 0 Then + intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") + If intYN = vbYes Then + Call cmdPrintCMU_Click + crOrder.Reset + End If + End If + End If + End If + '****** Print Stone Pay Sheet and Invoice + '****** Removed 06/27/05 per Rose +' If Not chkNoPay Then +' If moRS!ostone And Not moRS!otstone Then +' crOrder.Reset +' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" +' gintCOPY = 2 +' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' crOrder.ReportFileName = App.Path & "\StonePay.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter +' crOrder.Action = 1 + +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If +' End If + + If moRS!Firsttime Then + MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" + End If + + If boolCOMPLETE Then +' gintCOPY = 1 +' crOrder.Reset +' If Not moRS!Split Then +' If Not moRSProj!bill Then +' Call PrintLathInv +' crOrder.Reset +' End If +' End If + moRS!l_FLG = "P" + moRS!y_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" +' cmdLathPrint.Enabled = False + End If + If boolFPRINT Then + gintCOPY = 1 + crOrder.Reset + If Not moRSProj!bill Then + Call PrintLathInv + crOrder.Reset + End If +' moRS!l_flg = "P" +' moRS!y_flg = "P" +' moRS!S_flg = "P" +' cmdLathPrint.Enabled = False + End If + End If + moRS.Update + gintCOPY = 1 + gboolPRINT = False +' cmdLathPrint.Enabled = False + Call Form_Load + cmdExit.Enabled = True + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module cmdLathPrint" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub PrintLathPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpay.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to set to 1 if still printing multiple copies 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) + intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) + i = 1 + Do Until i = (Int((gintCOPY / 2)) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "L" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!METAL = intMETAL + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pylath = Field2Integer(moRS!pylath) + intYDS + moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPaintPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCover.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End Prep Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End IS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End ES Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End 2T Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End OH Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG1 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End F2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CC Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End FG2 Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End PO Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End CS Pay Sheet + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintPaintPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoPay() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" + End If +' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = 2 +' crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "P" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop + crOrder.Reset + Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoThree() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 +' crOrder.Action = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS!multipay = vbChecked + moRS.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "S" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + End If + + crOrder.ReportFileName = App.Path & "\stuccopayB_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "B" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" +' crOrder.ReportFileName = App.Path & "\stuccopayt.rpt" +' crOrder.CopiesToPrinter = gintCOPY + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + i = 1 + If gintCOPY > 3 Then + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + i = 1 + Do Until i = ((gintCOPY / 2) + 1) + crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY / 2 + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay.Update + i = i + 1 + Loop +' Exit Sub + Else + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "S" + moRSPay!worktype = "T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!printed = vbChecked + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = intTOTAL + moRSPay.Update + End If +' crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PrintStuccoSyn() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + +' crOrder.Reset +' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) +' intTOTAL = Int((gintCOPY / 2) + 0.99) +' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) +' crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToPrinter +' crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" +' crOrder.CopiesToPrinter = gintCOPY +' crOrder.Action = 1 +' crOrder.Reset + +' moRSPay.AddNew +' moRSPay!lotid = gintLOTID +' moRSPay!Type = "Y" +' moRSPay!worktype = "C" +' moRSPay!pay_ydge = intYDS +' moRSPay!sheet = 1 +' moRSPay!Create = gstrLOGIN +' moRSPay!printed = vbChecked +' moRSPay!totalsheet = intTOTAL +' If moRSProj!cocode = 0 Then +' moRSPay!cocode = 0 +' ElseIf moRSProj!cocode = 1 Then +' moRSPay!cocode = 1 +' End If +' moRSPay.Update + moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintSynPay() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayEFIN.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update +' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS +' moRS.Update + + crOrder.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayEFOA.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayEFSH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayEHIM.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayEMPL.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayENET.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayERAS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayESEN.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = 1" '& (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + crOrder.ReportFileName = App.Path & "\synpayESFL.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "Y" + moRSPay!worktype = "E" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintSyn" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoStone() +Dim strSQL As String +Dim intTOTAL As Integer, intYDS As Integer + + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + crOrder.Reset + crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.Destination = crptToPrinter + crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "V" + moRSPay!worktype = "C" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = 1 + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + If moRSProj!cocode = 0 Then + moRSPay!cocode = 0 + ElseIf moRSProj!cocode = 1 Then + moRSPay!cocode = 1 + End If + moRSPay.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoStone" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssueHold() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!po_num = "ORIGINAL ORDER" + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + crOrder.ReportFileName = App.Path & "\issue.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssueHold" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintIssue() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double +Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long +Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String +Dim boolSPLIT As Boolean + ' On Error GoTo Error_EH + boolSPLIT = False + strSYS = "SELECT * FROM tblSYSINFO" + Set oRSYS = New Recordset + oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic + lngTIE = oRSYS!Split + oRSYS!Split = oRSYS!Split + 1 + oRSYS.Update + + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!price) +' oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID + goConn.Execute strYARD + End If + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + + + If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then +' If moRS!Split Then + If mboolSPLIT Then +' mboolSPLIT = True + dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) + + dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) + dblBal = Round(dblBal, 2) + If dblOrder > dblBal Then + dblOrder = dblBal + End If + strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRSS!o_qty + dblOrder + If dblCheck > oRSS!qty Then + dblOrder = oRSS!qty - oRSS!o_qty + End If +' oRSS!o_qty = oRSS!o_qty + dblOrder + oRSS.Update + Else + dblOrder = oRSS!qty + End If + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = dblOrder + oRS!qtyIssue = dblOrder +' oRS!qty = Field2Str2(oRSS!qty) +' oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + If mboolSPLIT Then + oRS!po_num = "PARTIAL ORDER" + Else + oRS!po_num = "ORIGINAL ORDER" + End If + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS!Split = lngTIE + oRS.Update + lngSHIPPED = Field2Str2(oRSS!o_qty) + oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) + oRSS.Update + + End If + oRSS.MoveNext + Loop + + If mboolSPLIT Then + txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + Else + txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + End If + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + +' crOrder.Formulas(1) = "PaySheetCount = " & i + crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE + If mboolSPLIT Then +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issue2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Else +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE + strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\issue.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\issueM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintIssue" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintLathMat() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\lathmat.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\lathmatM.rpt" + End If +' crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.ReplaceSelectionFormula (strSQL) + crOrder.ReplaceSelectionFormula (strSQL) + gintCOPY = 1 'Changed to 1 on 8/1/17 to stop multiple copies + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintLathMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" + crOrder.ReportFileName = App.Path & "\stuccomat.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY 'May need to change this to 1 if printing more than 1 8/1/2017 +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ShowPrint() +Dim oRS As Recordset +Dim strSQL As String, lngPO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngPO = Field2Long(oRS!nextpo) + gstrMODULE = "Line 8" + lngPO = lngPO + 1 + If lngPO > 99999 Then + lngPO = 1 + End If + oRS!nextpo = lngPO + oRS.Update + gstrMODULE = gstrMODULE & " Line 15" + + Load frmPrint + gstrMODULE = gstrMODULE & " Line 18" + frmPrint.txtJobCost = Field2Str(moRS!jobcost) + frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) +' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) + gstrMODULE = gstrMODULE & " Line 20" + frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) +' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) + gstrMODULE = gstrMODULE & " Line 22" + frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "0000") +' gstrPONUM = gstrPONUM & Format(intPO, "0000") + gstrMODULE = gstrMODULE & " Line 24" + frmPrint.txtMFlag = gstrFLAG + gstrMODULE = gstrMODULE & " Line 26" + frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) +' gstrCREW = Left$(Field2Str(txtPODesc), 20) + gstrMODULE = gstrMODULE & gstrFLAG & " " + frmPrint.txtDFlag = gstrTYPE + gstrMODULE = gstrMODULE & " Line 30" + If mintSUPPLIER = 99 Then + frmPrint.txtPO = Field2Str2(moRSPO!ponum) +' gintPONUM = moRSPO!ponum + Else + frmPrint.txtPO = 0 +' gintPONUM = 0 + End If + gstrMODULE = gstrMODULE & " Line 35" + frmPrint.Show 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form LotInfo - Module ShowPrint" +' gstrMODULE = " Form LotInfo - Module ShowPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdAddPO_Click() + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" + End If + + Call POClear + gconACTION = 0 + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + mboolAdding = True + cboPOType.SetFocus +End Sub + +Private Sub cmdLFlag_Click() + moRS!y_FLG = "P" + moRS!l_FLG = "P" + moRS!s_FLG = "P" + moRS!z_FLG = "P" + Call cmdSaveLotInfo_Click + cmdLFlag.Visible = False + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If +End Sub + +Private Sub cmdOrder_Click() + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdPreOrderPrintY_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "Y" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + gboolPRINT = False + Call Form_Load + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!y_FLG = "P" + moRS.Update + cmdPreOrderPrintY.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPreOrderPrintY" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint_Click() + If cmdPrint.Caption = "Print Lath Order" Then + Call cmdLathPrint_Click + ElseIf cmdPrint.Caption = "Print Sand Order" Then + Call cmdSandPrint_Click + ElseIf cmdPrint.Caption = "Print Brown Order" Then +' Call cmdBrownPrint_Click + ElseIf cmdPrint.Caption = "Print Scratch Order" Then + Call cmdScratchPrint_Click + ElseIf cmdPrint.Caption = "Print Texture Order" Then + Call cmdTexturePrint_Click + ElseIf cmdPrint.Caption = "Print Stone Order" Then + Call cmdStonePrint_Click + ElseIf cmdPrint.Caption = "Print Synthetic Order" Then + Call cmdSynPrint_Click + Else + '***CHeck to see why an invoice had an extra zero 002 instead of 02 + End If +End Sub + +Private Sub cmdPrintCMU_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\cmupay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN + Call FormSave + cmdPrintCMU.Enabled = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintCMU_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPOPay_Click() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + gintCOPY = 1 + gintPRINT = 1 + frmReport.Show 1 + If gintPRINT Then + Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") + + strSQL = "{tblPOrder.ponum} = " & mintPONUM + crOrder.ReportFileName = App.Path & "\POpay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + ' crOrder.Destination = crptToWindow + ' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS!pay_flag = vbTrue + oRS.Update + cmdPrintPOPay.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPOPay_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPO_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, intResponse As Integer +Dim strSELECT As String + + mintBOOKMARK = lstPO.ListIndex + + On Error GoTo Error_EH + gboolPRINT = True + If optPreOrder Then + gstrFLAG = "P" + Else + gstrFLAG = "R" + End If + gintCOPY = 1 + If optLath Then + gstrTYPE = "Y" + ElseIf optStucco Then + gstrTYPE = "S" + ElseIf optSand Then + gstrTYPE = "A" + ElseIf optPreOrder Then + gstrTYPE = "Y" + ElseIf optStone Then + gstrTYPE = "S" + ElseIf optNone Then + gstrTYPE = "" + End If + mintSUPPLIER = 99 + Call ShowPrint + mintSUPPLIER = 0 + If gboolPRINT Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS!p_flg = "P" Then + MsgBox "This PO has already been printed" + Exit Sub + End If + If Not oRS.EOF Then + crOrder.Reset + strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" +' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" + If gstrPO <> "L" Then + crOrder.ReportFileName = App.Path & "\POMisc.rpt" + Else + Call POSetup + crOrder.ReportFileName = App.Path & "\purchase.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + oRS!p_flg = "P" + oRS.Update + End If + gboolPRINT = False + If gstrPO = "L" Then + intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") + If intResponse = vbOK Then + Call POInvoice + End If + End If + Call Form_Load + SSTLotInfo.Tab = 6 + Else + Call Form_Load + SSTLotInfo.Tab = 6 + End If + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdPrintPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub POSetup() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblOrder As Double + + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + gstrPONUM = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" +' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + dblOrder = Field2Str2(oRS!qty) + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + +End Sub + +Private Sub cmdPreOrderPrintS_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "P" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" + crOrder.ReportFileName = App.Path & "\preorder.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!s_FLG = "P" + moRS.Update + cmdPreOrderPrintS.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintS_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPreOrderPrintPC_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + gstrFLAG = "Z" + gstrTYPE = "S" + gstrPO = "L" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" + crOrder.ReportFileName = App.Path & "\preorderPC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + gboolPRINT = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + ElseIf Len(gstrPONUM) > 0 Then + moRS!z_FLG = "P" + moRS.Update + cmdPreOrderPrintPC.Enabled = False + Call Form_Load + txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + SSTLotInfo.Tab = 1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PreOrderPrintPC_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintForm_Click() + Me.PrintForm +End Sub + + +Private Sub cmdRePrintL_Click() + Call RePrintLath + cmdRePrintL.Visible = False + Call FormShow +End Sub + +Private Sub cmdSandPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single +Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + + If Field2Str2(moRS!zone) = 0 Then + MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" + Exit Sub + End If + + If chkHoldOrders Then + MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + cmdExit.Enabled = False +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If +' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "A" + gstrTYPE = "A" + gintCOPY = 1 + Call ShowPrint + gstrMODULE = "After SHOWPRINT " + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- Plaster Sand " & vbCrLf + strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf + strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf + If boolCOMPLETE Then + dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) + End If + strMSG = strMSG & "Tons For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = moRS!ORD_NO + dblOrder + If dblCheck > moRS!sand_ton Then + dblOrder = moRS!sand_ton - moRS!ORD_NO +' Else + End If + moRS!ORD_NO = moRS!ORD_NO + dblOrder + moRS.Update + Else + dblOrder = moRS!sand_ton + End If + + moRS!Border = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!a_flg = vbTrue + End If + moRS.Update + gstrMODULE = "After Update Delivery Date " +' glngORDERID = Field2Long(oRS!order_id) + + strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & Field2Integer(moRS!zone) + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + If oRSSS.EOF Then + Else + oRSSS.MoveFirst + strFIND = "zone = " & Field2Str2(moRS!zone) + oRSSS.Find strFIND + sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") + End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Before Setup Materials " + With oRSS + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9999" + !Desc = "ICBO RIVER PLASTER SAND" + !x_flag = vbChecked + !o_qty = dblOrder + !a_qty = dblOrder + !price = sglSAND + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9994" + !Desc = "SPLIT CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 15 + .Update + .AddNew + !order_id = glngORDERID + !Lot_ID = gintLOTID + !po_num = Field2Str(oRS!po_num) + !d_flag = "S" + !m_type = "A" + !inv_no = "9993" + !Desc = "MINIMUM ORDER CHARGE" + !x_flag = vbChecked + !o_qty = 0 + !a_qty = 0 + !price = 40 + .Update + End With + crOrder.Reset + strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\sand.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\sandM.rpt" + End If + crOrder.Formulas(1) = "Sand = " & dblOrder + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + + gboolPRINT = False +' cmdSandPrint.Enabled = False + txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module cmdSandPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdSavePO_Click() +Dim lngID As Long + If Not IsDate(txtPODate) Then + MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" + txtPODate.SetFocus + Exit Sub + End If + If mboolVERIFIED Then + MsgBox "This Plan Has Been Checked and Verified - Talk to Angel", vbOKOnly, "Plan Verified" + Call LotChange(mstrPROJLOT, "Chnge After Verified") + End If + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Chnge PO Information") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPO.ListIndex + If mboolAdding Then + If mintBOOKMARK = -1 Then + mintBOOKMARK = 0 + End If + End If + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + txtPODate.Enabled = True + txtPODesc.Enabled = True + txtIssueTo.Enabled = True + txtPay.Enabled = True + txtPayType.Enabled = True + txtPONotes.Enabled = True + lstLOOKUP.Visible = False + Call POSave + Call POLoad + + If mboolAdding Then + mboolAdding = False + lngID = FindMax("tblPOrder", "PONum") + Call CBFindString(lstPO, CStr(lngID)) + cmdAddPOMat.SetFocus + mintBOOKMARK = lstPO.ListIndex + End If + + lstPO.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePOMat_Click() +Dim intINVNO As Integer, lngID As Long + + If gconACTION = 2 Then + Call LotChange(mstrPROJLOT, "Change PO Material") + gconACTION = 0 + End If +' If gconACTION = 5 Then +' Call LotChange(mstrPROJLOT, "Update After Lath") +' End If + mintBOOKMARK = lstPOMaterial.ListIndex + cmdAddPO.Enabled = True + cmdAddPOMat.Enabled = True + cmdSavePO.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPO.Enabled = True + cmdDelPOMat.Enabled = True + cmdPrintPO.Enabled = True + cmdFindPOMat.Visible = False + lstLOOKUP.Visible = False + intINVNO = txtPOInvNo + Call POMatSave + Call POMatLoad + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + txtPOPrice.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + cmdFindPOMat.Enabled = False + If mboolAdding Then + mboolAdding = False + Call CBFindString4(lstPOMaterial, CStr(intINVNO)) + cmdAddPOMat.SetFocus + mintBOOKMARK = 0 + Exit Sub + End If + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = CLng(mintBOOKMARK) +' lstPOMaterial.ListIndex = 5 + mintBOOKMARK = 0 + Else + lstPOMaterial.ListIndex = -1 + End If + mintBOOKMARK = 0 +End Sub + +Private Sub cmdScratchPrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gboolPRINT = True + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gstrPO = "L" + gstrFLAG = "S" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!TORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!c_flg = vbTrue + End If + moRS.Update + End If +'**** need to mark these for deletion +' If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'S'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +' +' If oRS.EOF Then +' +' Else +' glngORDERID = Field2Integer(oRS!order_id) +' gstrPONUM = Field2Str(oRS!po_num) +' strORDERDATE = Field2Str2(oRS!order_date) +'' moRS!TORDER = Field2Str(oRS!order_date) +' If boolCOMPLETE Then +' moRS!c_flg = vbTrue +' End If +' moRS.Update +' End If +' +' strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" +''' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If oRS.EOF Then +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +'' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub +' Else +' strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" +' Set oRSS = New Recordset +' oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then +' intORDER = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) +' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf +' ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) +' strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf +' strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf +' strMSG = strMSG & "Qty For This Order -- " & intORDER +' intORDER = CInt(InputBox(strMSG, "Order Quantity", intORDER)) +' intCHECK = oRS!o_qty + intORDER +' If intCHECK > oRS!qty Then +' intORDER = oRS!qty - oRS!o_qty +'' Else +' End If +' oRS!o_qty = oRS!o_qty + intORDER +' oRS.Update +' Else +' intORDER = oRS!qty +' End If +' oRSS.AddNew +' oRSS!order_id = glngORDERID +' oRSS!Desc = oRS!Desc +' oRSS!Lot_id = oRS!Lot_id +' oRSS!po_num = gstrPONUM +' oRSS!d_flag = oRS!d_flag +' oRSS!m_type = oRS!m_type +' oRSS!o_qty = intORDER +' oRSS!x_flag = vbChecked +' oRSS!a_qty = intORDER +' oRSS!price = oRS!price +' oRSS!inv_no = oRS!inv_no +' oRSS.Update +' End If +' oRS.MoveNext +' Loop +' End If + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" +' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" + crOrder.ReportFileName = App.Path & "\NewScratch.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + moRS!PRNT_S = Now() + moRS.Update + + gboolPRINT = False +' cmdScratchPrint.Enabled = False + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdScratchPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub +Private Sub PrintActual() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actual.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintActual" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdShowChange_Click() + frmLotChLog.Show 1 +End Sub + +Private Sub cmdStonePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean + + On Error GoTo Error_EH + boolNOSTONE = False + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "V" + gstrTYPE = "S" + Call ShowPrint + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + moRS!VOrder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!st_flg = vbTrue + End If + moRS.Update + End If + + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + boolNOSTONE = True + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty +' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!x_flag = vbChecked + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' If oRSS.State = adStateOpen Then +' oRSS.Close +' End If + If Not boolNOSTONE Then + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\Stone.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + + crOrder.Reset + MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" + gintCOPY = 2 + strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + crOrder.ReportFileName = App.Path & "\StonePay.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + If boolCOMPLETE Then + Call PrintStoneInv + crOrder.Reset + End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + Call Form_Load + End If +' cmdStonePrint.Enabled = False + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdStonePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub + +End Sub + + +Private Sub cmdStuccoPay_Click() +Dim strPAY As String + + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") + If moRSProj!stype <> "T" Then + gintCOPY = 1 + Call PrintStuccoPay + Else + gintCOPY = 1 + Call PrintStuccoThree + End If + cmdStuccoPay.Visible = False +End Sub + +Private Sub cmdSuperRpt_Click() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer + On Error GoTo Error_EH + + cmdExit.Enabled = False + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If +' If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" +' Exit Sub +' End If + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + gintCOPY = 1 + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update + gintPRINT = 9 + frmReport.Show 1 + If gintPRINT = 0 Then + cmdExit.Enabled = True + Exit Sub + End If + strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID + + crOrder.ReportFileName = App.Path & "\superSyn.rpt" + crOrder.ReplaceSelectionFormula (strSQL) +' crOrder.Destination = crptToWindow +' crOrder.Destination = crptToPrinter + crOrder.Destination = gintDEST + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdSuperRpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdTexturePrint_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSELECT As String, strSql2 As String +Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean +Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer +Dim strORDERDATE As String + + On Error GoTo Error_EH + + If Not IsDate(moRSPlan!Update) Then + moRSPlan!Update = 0 + End If + If Not IsDate(moRS!calcdate) Then + moRS!calcdate = 1 + End If + + If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then + strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" + strMSG = strMSG & Chr(10) & Chr(13) + strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" + intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") +' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" + If intResponse = vbYes Then + Call cmdFindPlan_Click + Call cmdCalc_Click + cmdExit.Enabled = True + End If +' Exit Sub + End If + + If moRSProj!plien_req And Not moRSProj!plien_done Then + MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" + Exit Sub + End If + cmdExit.Enabled = False + + If chkHoldOrders Then + MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" + cmdExit.Enabled = True + Exit Sub + End If +' If chkSynthetic Then +' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" +' cmdExit.Enabled = True +' Exit Sub +' End If + + gintCOPY = 1 + +' If moRS!Split Then + If mboolSPLIT Then + strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + intPERCENT = Field2Str2(oRS!SUMPercent) + If intPERCENT = 0 Then + boolFPRINT = True + Else + boolFPRINT = False + End If + gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) + If gintPERCENT = 0 Then + MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" + Exit Sub + End If + If (intPERCENT + gintPERCENT) > 100 Then + MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" + cmdExit.Enabled = True + Exit Sub + End If + Else + gintPERCENT = 100 + boolCOMPLETE = True + boolFPRINT = True + End If + If (intPERCENT + gintPERCENT) = 100 Then + boolCOMPLETE = True + End If + + gboolPRINT = True + gstrPO = "L" + gstrFLAG = "T" + gstrTYPE = "S" + Call ShowPrint + + If gboolPRINT Then + strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + + Else + strORDERDATE = Field2Str(oRS!order_date) + +' glngORDERID = Field2Integer(oRS!order_id) + gstrPONUM = Field2Str(oRS!po_num) +' If moRS!Split Then + strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" + ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" + Call Form_Load + cmdExit.Enabled = True + Exit Sub + Else + strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + strMSG = oRS!Desc + If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then +' If moRS!Split Then + If mboolSPLIT Then + dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) + strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) + strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf + strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf + strMSG = strMSG & "Qty For This Order -- " & dblOrder + dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) + dblCheck = oRS!o_qty + dblOrder + If dblCheck > oRS!qty Then + dblOrder = oRS!qty - oRS!o_qty + ' Else + End If + oRS!o_qty = oRS!o_qty + dblOrder + oRS.Update + Else + dblOrder = oRS!qty + End If + oRSS.AddNew + oRSS!order_id = glngORDERID + oRSS!Desc = oRS!Desc + oRSS!Lot_ID = oRS!Lot_ID + oRSS!po_num = gstrPONUM + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!x_flag = vbChecked + oRSS!o_qty = dblOrder + oRSS!a_qty = dblOrder + oRSS!price = oRS!price + oRSS!inv_no = oRS!inv_no + oRSS.Update + End If + oRS.MoveNext + Loop + End If +' End If + moRS!SORDER = strORDERDATE +' moRS!forder = Field2Str(oRS!order_date) + If boolCOMPLETE Then + moRS!t_flg = vbTrue + End If + moRS.Update + End If + +'**** these need to be marked for deletion +' If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +' +' If oRS.EOF Then +' +' Else +' moRS!SORDER = Field2Str(oRS!order_date) +' If boolCOMPLETE Then +' moRS!t_flg = vbTrue +' End If +' moRS.Update +' End If +' +' strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If oRS.EOF Then +' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" +' Call Form_Load +' cmdExit.Enabled = True +' Exit Sub +' Else +' strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" +' Set oRSS = New Recordset +' oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' Do Until oRS.EOF +' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then +' If moRS!Split Then +' intORDER = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) +' +' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf + +' strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf +' strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf +' strMSG = strMSG & "Qty For This Order -- " & intORDER +' intORDER = CInt(InputBox(strMSG, "Order Quantity", intORDER)) +' intCHECK = oRS!o_qty + intORDER +' If intCHECK > oRS!qty Then +' intORDER = oRS!qty - oRS!o_qty +' End If +' oRS!o_qty = oRS!o_qty + intORDER +' oRS.Update +' Else +' intORDER = oRS!qty +' End If +' oRSS.AddNew +' oRSS!order_id = glngORDERID +' oRSS!Desc = Field2Str(oRS!Desc) +' oRSS!Lot_id = Field2Integer(oRS!Lot_id) +' oRSS!po_num = gstrPONUM +' oRSS!d_flag = Field2Str(oRS!d_flag) +' oRSS!m_type = Field2Str(oRS!m_type) +' oRSS!o_qty = intORDER +' oRSS!a_qty = intORDER +' oRSS!x_flag = vbChecked +' oRSS!price = Field2Str2(oRS!price) +' oRSS!inv_no = Field2Str2(oRS!inv_no) +' oRSS.Update +' End If +' oRS.MoveNext +' Loop +' End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + crOrder.Reset + strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\NewTexture.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + +' This was moved to the cmdBrownPrint procedure at request of Rose on 09/03/2003 and again 04/18/2005 +' To reinstate, comment out the information in cmdBrownPrint and uncomment the next 7 lines +' If boolCOMPLETE Then +' If Not moRSProj!bill Then +' Call PrintStuccoInv +' Else +' Call PrintCompleteInv +' End If +' End If + + txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + + gboolPRINT = False + '**** Stone Print moved back to it own button on 06/27/05 +' cmdTexturePrint.Enabled = False +' If chkStone Then +' Call cmdStonePrint_Click +' If boolCOMPLETE Then +' Call PrintStoneInv +' crOrder.Reset +' End If +' End If + Call Form_Load + End If + cmdExit.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdTexturePrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub cmdUpCMU_Click() +Dim intCMU As Integer + + intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") + If intCMU > 0 Then + moRS!CMU = intCMU + moRS.Update + Call FormShow + End If +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + mboolBAD = False +' mboolENTER = False + + If gintLOTID = 0 Then + intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") + If intResponse = vbYes Then + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAddLot_Click + If mboolBAD Then + Unload Me + End If + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String +Dim strPAY As String, intYN As Integer + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLathPay.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 0 Then + txtAddress.Enabled = True + txtOwner.Enabled = True + cmdSaveLotInfo.Enabled = True + End If + Exit Sub + End If + If KeyCode = vbKeyX Then ' Update the Paint Square Footage + If CtrlDown Then + Call PaintFix + End If + Exit Sub + End If + + If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintPC.Enabled = True 'eVisible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyD And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdPreOrderPrintY.Enabled = True + End If + Exit Sub + End If + + If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "VHJ") Then ' Print Special Report for Jesse +' Dim intYN As Integer + If CtrlDown And SSTLotInfo.Tab = 1 Then + intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") + If intYN = vbNo Then + Exit Sub + End If + Call PrintActualJG + End If + Exit Sub + End If + + If KeyCode = vbKeyT And gbytSECURITY < 3 Then ' Print Paint Pay Sheets + If CtrlDown Then + If Not mboolPAINT Then + MsgBox "This Lot Does Not Have Paint - PaySheets Will Not Be Printed", vbOKOnly, "Not A Paint Lot" + Exit Sub + Else + intYN = MsgBox("Are You Sure You Want To Print Paint PaySheets?", vbYesNo, "Print Paint PaySheets") + + If intYN = vbYes Then + strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic + + Call LotChange(mstrPROJLOT, "Print Paint Pay") + Call PrintPaintPay + End If + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdStuccoPay.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyM And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 6 Then + moRSPO!POFlag = vbTrue + moRSPO.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm + If CtrlDown And SSTLotInfo.Tab = 2 Then + strINVNO = lstLMaterial.ItemData(lstLMaterial.ListIndex) + strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & strINVNO + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) + oRS!price = Field2Str2(strCOST) + oRS.Update + + End If + Exit Sub + End If + If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdIssue.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + Call PrintLathMat + gintCOPY = 1 + End If + Exit Sub + End If + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdLFlag.Visible = True + End If + Exit Sub + End If + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And SSTLotInfo.Tab = 1 Then + cmdRePrintL.Visible = True + End If + Exit Sub + End If + + If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If CtrlDown Then + cmdSaveLotInfo.Enabled = True + cmdSaveLotInfo.SetFocus + End If + Exit Sub + End If + + If KeyCode = vbKeyK Then ' And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If CtrlDown Then + Call SetSyn + + End If + Exit Sub + End If + + If Field2Str(moRS!l_FLG) <> "P" Then + If Not cmdSaveLotInfo.Enabled Then + Call DataHasChanged + End If + End If +End Sub + +Private Sub DataHasChanged() + + cmdSaveLotInfo.Enabled = True + cmdAddLot.Enabled = False + +End Sub + +Private Sub PrintActualJG() +Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSELECT As String, strOPTION As String, intCOUNT As Integer +Dim start + On Error GoTo Error_EH + + strSELECT = "DELETE * FROM tblReport" + goConn.Execute strSELECT + + strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + strOPTION = "SELECT * FROM tblReport" + Set oRSSS = New Recordset + oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic + oRSSS.AddNew + intCOUNT = 0 + Do Until oRS.EOF + strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + intYARDS = intYARDS + Field2Integer(oRSS!Yardage) + intCOUNT = intCOUNT + 1 + If intCOUNT = 1 Then + oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 2 Then + oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 3 Then + oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 4 Then + oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 5 Then + oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 6 Then + oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 7 Then + oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 8 Then + oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 9 Then + oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + If intCOUNT = 10 Then + oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) + End If + End If + oRS.MoveNext + Loop + oRSSS!Lot_ID = gintLOTID + oRSSS!optyds = intYARDS + oRSSS.Update +' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID + start = Timer ' Set start time. + Do While Timer < start + 5 + ' DoEvents ' Yield to other processes. + Loop + + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\actualJG.rpt" +' ElseIf moRSProj!cocode = 1 Then +' crOrder.ReportFileName = App.Path & "\actualM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + crOrder.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfoE - Module PrintActualJG" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtLMInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + txtLMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtLMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdFindInv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFindPlan_Click() +Dim oRS As Recordset, oRSSS As Recordset +Dim strSQL As String, lngFind As Long, strTEST As String +Dim strSql2 As String + On Error GoTo Error_EH + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + + strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not mboolAdding Then + txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " + moRSMemo!notes = UCase(Field2Str(txtYardMemo)) + moRSMemo.Update + End If + + If oRS.RecordCount > 0 Then + + With oRS + +' txtTtlYdge = Field2Integer(!mat_yds) + txtTtlYdge = Field2Integer(!TO_TTLYDS) + txtModel = Field2Str(!Mod_Elv) + txtCMUYdge = Field2Integer(!CMUYDS) + txtNotes = Field2Str(!notes) +' txtFoamAdj = Field2Integer(!f_adj) + mstrFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Integer(!opening) + chkStone = Field2CheckBox(!stone) +' txtStone = Field2Str2(!ST_SQFT) + mstrStone = Field2Str2(!ST_SQFT) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) ' & "'" + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) ' & "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) ' & "'" + txtStoneBill = Field2Str2(!st_bill) + moRS!Scaf6 = Field2Str2(!Scaf6) + moRS!scaf10 = Field2Str2(!scaf10) + moRS!TWOSTORY = !TWOSTORY + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + If Not !Firsttime Then + !Firsttime = vbChecked + chkFirst = vbChecked + .Update + End If + + gintESTID = !est_id + If Not mboolAdding Then + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + End If + Call FieldsSave + End With + ' oRS.Update + 'clear materials and get correct for model + 'update materials and yardage for options + Else + Call PlanLoad + cmdFindPlan.Visible = False + If lstPlans.ListCount = 0 Then + MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" + cmdSaveLotInfo.Enabled = False + gstrFLAG = "P" + Unload Me + Exit Sub + Else + lstPlans.ListIndex = 0 + lstPlans.SetFocus + oRS.Close + Exit Sub + End If + End If + oRS.Close + If mboolAdding Then + Call ElevLoad + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad + mboolAdding = False + Else + Call ElevLoad + Call DelLotMat + Call PlanMatLoad + Call ReloadOptMat + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call cmdSaveLotInfo_Click + End If + Exit Sub + +Error_EH: + Call ErrorHandler(oRSSS.ActiveConnection) +' gstrMODULE = "Form LotInfo - Module cmdFindPlan_Click" +' Call ErrorHandler2 +' gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DelLotMat() +Dim strSQL As String + + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked + goConn.Execute strSQL + +End Sub + +Private Sub ReloadOptMat() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + mintOPTID = Field2Long(oRS!Opt_ID) + Call UpLotInfo + Call UpLMat + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: +' Call ErrorHandler(oRSS.ActiveConnection) + gstrMODULE = "Form LotInfo - Module ReloadOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdAddLot_Click() +Dim strSTARTDATE As String, lngPOS As Long + strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") + + lngPOS = InStr(1, strSTARTDATE, "/", 1) + If Not IsDate(strSTARTDATE) Then + If lngPOS = 0 Then + If Len(strSTARTDATE) > 0 Then + strSTARTDATE = Format(strSTARTDATE, "00/00/####") + If Not IsDate(strSTARTDATE) Then + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + mstrSTARTDATE = strSTARTDATE + Else + MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" + mboolBAD = True + Exit Sub +' Call cmdExit_Click + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" +' Call cmdExit_Click + mboolBAD = True + Exit Sub + End If + End If + mboolAdding = True + gconACTION = 0 + gintLOTID = 0 + txtJC.Enabled = True + cmdCalc.Enabled = False + cmdDelLot.Enabled = False + cmdAddLot.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptAdd.Enabled = False + cmdOptDel.Enabled = False + txtLotNo.Enabled = True + cmdSaveLotInfo.Enabled = True + cmdFindPlan.Enabled = True + cmdOrders.Enabled = True + Call LotNew + Call FormClear + Call MatClear + + txtAddress.SetFocus +End Sub + +Private Sub cmdAddMatrl_Click() +' lstLMaterial.ListIndex = -1 + lstLMaterial.Enabled = False +' moRSMat.Update +' moRSMat.Close + Call MatClear + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdInventory.Visible = True + lblMatInst.Visible = True + txtLMDesc.SetFocus + mboolAdding = True + +End Sub + +Private Sub cmdDelMatrl_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + mintBOOKMARK = lstLMaterial.ListIndex + moRSMat.Delete + Call LotChange(mstrPROJLOT, "Delete Material") + Call MatLoad + If lstLMaterial.ListCount Then + If lstLMaterial.ListCount > mintBOOKMARK Then + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstLMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If + gconACTION = 0 + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False +End Sub + +Private Sub cmdInventory_Click() + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub cmdOptAdd_Click() +Dim strSQL As String +Dim strSql2 As String, oRS As Recordset + + On Error GoTo Error_EH + + If moRSLOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblLOption where opt_id = 1" + Set moRSLOpt = New Recordset + moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + End If + + strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!Lot_ID = gintLOTID + moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) + mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt!C_USER = gstrLOGIN + moRSLOpt.Update + If oRS!ostone Then + moRSLOpt!ostone = vbChecked + End If + Call UpLotInfo + Call UpLMat + Call LOptLoad + Call FieldsSave + Call MatSave + Call MatLoad + lstPOptions.ListIndex = -1 + cmdOptAdd.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module cmdOptAdd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOptDel_Click() +Dim strSQL As String + gconACTION = 3 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Call LotChange(mstrPROJLOT, "Delete Lot Option") + Call UpdateLotInfo + Call UpdateLMat + Call MatSave + Call MatLoad + Call FieldsSave + strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call LOptLoad + cmdOptDel.Enabled = False + gconACTION = 0 +End Sub + +Private Sub UpLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + oRSSS.AddNew + oRSSS!Lot_ID = gintLOTID + oRSSS!inv_no = Field2Str(oRSS!inv_no) + oRSSS!Desc = Field2Str(oRSS!Desc) + oRSSS!d_flag = Field2Str(oRSS!d_flag) + oRSSS!m_type = Field2Str(oRSS!m_type) + oRSSS!calc_flag = Field2Str(oRSS!calc_flag) + oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) + oRSSS!qty = Field2Str(oRSS!qty) + oRSSS.Update +' oRSSS.Close + Else + oRSSS!qty = (oRSSS!qty + oRSS!qty) + oRSSS.Update + ' oRSSS.Close + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + + oRS.Close + oRSS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateLMat() +Dim oRS As Recordset +Dim oRSS As Recordset +Dim oRSSS As Recordset +Dim strSQL As String, strSql2 As String, intOpt As Integer +Dim intLoop As Integer, strSQL3 As String + On Error GoTo Error_EH + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + oRS.MoveLast + oRS.MoveFirst + intOpt = oRS.RecordCount + + For intLoop = 1 To intOpt + strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRSS.EOF + strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID + Set oRSSS = New Recordset + oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic + If oRSSS.RecordCount = 0 Then + Else + oRSSS!qty = (oRSSS!qty - oRSS!qty) + If oRSSS!qty <= 0 Then + oRSSS.Delete + Else + oRSSS.Update + End If + End If + If moRSProj!FHA Then + If Field2Str(oRSSS!inv_no) = "1570" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + Else + If Field2Str(oRSSS!inv_no) = "1130" Then + ' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRSSS!qty) + txtTake138 = moRS!jmb138 + ' txtTake138 = mintTake138 + moRS.Update + End If + End If + oRSSS.Close + oRSS.MoveNext + Loop + + Next intLoop + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + If Err = -2147217885 Then + Resume Next + Else + gstrMODULE = "Form LotInfo - Module UpdateLMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + End If +End Sub +Private Sub UpdateLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String +Dim strSQL As String, strSql2 As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + moRS!sq_yd = moRS!sq_yd - oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 - oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj - oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + strSQL = "SELECT Texture " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + moRS!texture = Field2Str(oRSS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + + If moRS!texture <> "SB" Then + chkSynthetic = vbUnchecked + lblSynthetic.Visible = False + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + + strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID + Set oRSSE = New Recordset + oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSE.EOF Then + oRSE!FileName = oRSSE!FileName + oRSE.Update + oRSE.Close + End If + oRSSE.Close + End If + If oRS!ostone Then +' moRS!stone = vbUnchecked + chkStone = vbUnchecked + moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt + txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(moRS!ST_SQFT) + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(moRS!PNT_SQFT) +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbUnchecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpdateLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub UpLotInfo() +Dim oRS As Recordset, oRSE As Recordset +Dim strSQL As String, strMSG As String, strSQLE As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If oRS.RecordCount = 0 Then + strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" + Exit Sub + End If + moRS!sq_yd = moRS!sq_yd + oRS!Yardage + txtTtlYdge = moRS!sq_yd + moRS!fin2 = moRS!fin2 + oRS!fin2 + txtFin2 = moRS!fin2 + moRS!f_adj = moRS!f_adj + oRS!f_adj + lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" + mstrFoamAdj = Field2Str2(moRS!f_adj) +' txtFoamAdj = moRS!f_adj + If oRS!texture <> "" Then + moRS!texture = Field2Str(oRS!texture) + Call FindTexture2(moRS!texture, strTYPE) + txtFinish = strTYPE + If moRS!texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + End If + If oRS!FileName <> "" Then + strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSE.EOF Then + oRSE!FileName = oRS!FileName + oRSE.Update + oRSE.Close + End If + End If + If oRS!ostone Then +' moRS!stone = vbChecked + chkStone = vbChecked + moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt +' = Val(txtStoneBill) + Field2Double(oRS!amt) + txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) + lblStoneSqFt.Caption = "Stone Square Ft.: " & "'" & Field2Str2(moRS!ST_SQFT) & "'" +' txtStone = moRS!ST_SQFT + mstrStone = Field2Str2(moRS!ST_SQFT) + moRS!ostone = vbChecked + End If + + If oRS.State = adStateOpen Then + oRS.Close + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module UpLotInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If mboolCRITICAL Then + Exit Sub + End If + If gstrFLAG <> "D" Then + If gstrFLAG <> "P" Then + If cmdSaveLotInfo.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + End If + End If + + If moRS.State = adStateOpen Then + moRS.Update + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + gintLOTID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cmdSaveLotInfo_Click() + If gconACTION = 4 Then + Call LotChange(mstrPROJLOT, "Change Lot Information") + gconACTION = 0 + End If + If gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + Call FieldsSave + Call MatSave + txtLotNo.Enabled = False + cmdSaveLotInfo.Enabled = False + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If +' cmdAddLot.Enabled = True + cmdAddMatrl.Enabled = True + cmdSaveMatrl.Enabled = False + cmdDelMatrl.Enabled = False + txtJC.Enabled = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuperBB = 0 And txtSuper12 = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub cmdSaveMatrl_Click() + + If gconACTION = 6 Then + Call LotChange(mstrPROJLOT, "Change Lot Material") + gconACTION = 0 +' End If + ElseIf gconACTION = 5 Then + Call LotChange(mstrPROJLOT, "Update After Lath") + gconACTION = 0 + End If + On Error GoTo Error_EH + mintBOOKMARK = lstLMaterial.ListIndex + + + ' Store the controls to the recordset + Call MatSave + + Call MatLoad + +' mintINVNO = Field2Str2(moRSMat!inv_no) + If mboolAdding Then + mboolAdding = False +' Call ListFindItem(lstLMaterial, CLng(mintINVNO)) + Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) + mintBOOKMARK = lstLMaterial.ListIndex + End If + + cmdInventory.Visible = False + lblMatInst.Visible = False + If gconACTION <> 5 Then + cmdAddMatrl.Enabled = True + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + lstLMaterial.Enabled = True + End If + + lstLMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + lstLMaterial.SetFocus + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() +Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long + + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + Set moRSPO = New Recordset + Set moRSPOMAT = New Recordset + Set moRSMemo = New Recordset + On Error GoTo Error_EH + + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 45 + + strSQLL = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + + lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) + mlngINVID = lngINVID + lngINVID = lngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID + moRSInvINFO.Update + + mboolFRMLOAD = False + mboolSPLIT = False + mboolStone = False + mboolSYNTHETIC = False + gstrFLAG = "" + gstrPO = "L" +' gbytSECURITY = 1 + SSTLotInfo.Tab = 0 + mboolCRITICAL = False + If gbytSECURITY = 1 Then + cmdDelLot.Enabled = True + End If + ' if + Call MTypeLoad(cboPOMType) + Call MTypeLoad(cboLMType) + Call MTypeLoad(cboLOMType) + Call ProjLoad + + If FormFind() Then + Call PlanFind + If mboolCRITICAL Then + Unload Me + Exit Sub + End If + If mboolStone Then + Call SetStone + End If + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + Call POLoad +' Call POMatLoad + End If + If moRS!l_FLG <> "P" Or IsNull(moRS!l_FLG) Then + Call SetSyn + End If + If gintLOTID <> 0 Then + If IsNull(moRS!y_FLG) Then + cmdPreOrderPrintY.Enabled = True + End If + If IsNull(moRS!s_FLG) Then + cmdPreOrderPrintS.Enabled = True + End If + If IsNull(moRS!z_FLG) Then + cmdPreOrderPrintPC.Enabled = True + End If + +' If IsNull(moRS!l_flg) Then +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then +' cmdSandPrint.Enabled = True +' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!b_flg Then +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdStonePrint.Enabled = True +' End If + +' If IsNull(moRS!l_FLG) Then +' cmdPrint.Caption = "Print Lath Order" +' cmdPrint.Enabled = True +' cmdLathPrint.Enabled = True +' ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then +' cmdPrint.Caption = "Print Sand Order" +' cmdPrint.Enabled = True +' cmdSandPrint.Enabled = True + If moRS!a_flg And Not moRS!b_flg Then + cmdPrint.Caption = "Print Synthetic Order" + cmdPrint.Enabled = True +' cmdScratchPrint.Enabled = True +' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then +' cmdPrint.Caption = "Print Scratch Order" +' cmdPrint.Enabled = True +' cmdBrownPrint.Enabled = True +' ElseIf moRS!b_flg And Not moRS!t_flg Then +' cmdPrint.Caption = "Print Texture Order" +' cmdPrint.Enabled = True +' cmdTexturePrint.Enabled = True +' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then +' cmdPrint.Caption = "Print Stone Order" +' cmdPrint.Enabled = True +' cmdStonePrint.Enabled = True + Else + cmdPrint.Caption = "All Orders Printed" + cmdPrint.Enabled = False + End If + + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If + End If + If gbytSECURITY <= 6 Then + cmdEdit.Visible = True + cmdEdit.Enabled = True + End If + If chkHoldOrders Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldOrders.Enabled = False + chkHoldOrders.BackColor = &H80FFFF + Else + chkHoldOrders.Enabled = True + chkHoldOrders.BackColor = &H80FFFF + End If + Else + chkHoldOrders.Enabled = True + End If +' If chkSplit Then +' cmdSaveLotInfo.Enabled = False +' If gbytSECURITY > 3 Then +' chkSplit.Enabled = False +' chkSplit.BackColor = &H80FFFF +' Else +' chkSplit.Enabled = True +' chkSplit.BackColor = &H80FFFF +' End If +' Else +' chkSplit.Enabled = True +' End If + If chkHoldPO Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkHoldPO.Enabled = False + chkHoldPO.BackColor = &H80FFFF + Else + chkHoldPO.Enabled = True + chkHoldPO.BackColor = &H80FFFF + End If + Else + chkHoldPO.Enabled = True + End If + If chkSynthetic Then + cmdSaveLotInfo.Enabled = False + If gbytSECURITY > 3 Then + chkSynthetic.Enabled = False + chkSynthetic.BackColor = &H80FFFF + Else + chkSynthetic.Enabled = True + chkSynthetic.BackColor = &H80FFFF + End If + + End If + If chkStone Then + cmdSaveLotInfo.Enabled = False + If chkOthers Then + lblStone.Caption = "Stone By Others" + chkOthers.BackColor = &HFF + Else + lblStone.Caption = "Stone Veneer" + End If + If gbytSECURITY > 3 Then + chkStone.Enabled = False + chkStone.BackColor = &H80FFFF + Else + chkStone.Enabled = True + chkStone.BackColor = &H80FFFF + End If + + End If +' If gbytSECURITY = 6 And lstPO.ListCount > 4 Then + If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdAddPOMat.Enabled = False + End If + mboolFRMLOAD = True +' Call ListChanges + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then + Do Until oRS.EOF + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + Loop +' End If + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + If moRSProj!SYNTHETIC Then + mboolSYNTHETIC = True + End If + mstrWIRE = Field2Str(moRSProj!wire) + If moRSProj!twodates Then + mbool2Dates = True + + End If + + If moRSProj!Apt Then + mboolCOMM = True + Else + mboolCOMM = False + End If + + gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub PlanLoad() +Dim oRS As Recordset +Dim strSQL As String, strTEST As String + On Error GoTo Error_EH + + strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPlans.Clear + + Do Until oRS.EOF + With lstPlans + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS!est_id + End With + lstPlans.Visible = True + lblPlan.Visible = True + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PlanLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + If moRSProj!bb Then + lblBB.Caption = "This House Uses Blackboard" + Else + lblBB.Caption = "This House Uses R-Guard" + End If + If moRSProj!zmetal Then + lblZMetal.Visible = True + Else + lblZMetal.Visible = False + End If + + With moRS + lblSZone = Field2Str2(!zone) + lblSandShip = Field2Str2(!ORD_NO) + txtTake138 = Field2Integer(!jmb138) + txtCalc138 = Field2Integer(!jmb138) + txtTtlYdge = Field2Integer(!sq_yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!Owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Integer(!CMU) + txtNotes = Field2Str(!notes) + txtSuperNotes = Field2Str(!supernotes) + txtLotNotes = Field2Str(!lotnotes) + lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) + lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" + lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) '& "'" + lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" + lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) '& "'" + mstrFoamAdj = Field2Integer(!f_adj) + mstrLaborAdj = Field2Integer(!l_adj) + mstrStone = Field2Str2(!ST_SQFT) +' txtFoamAdj = Field2Integer(!f_adj) +' txtLaborAdj = Field2Integer(!l_adj) + mstrWireAdj = Field2Integer(!w_adj) +' txtStone = Field2Str2(!ST_SQFT) + txtFin2 = Field2Integer(!fin2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Integer(!foam) + txtOPEN = Field2Str2(!opening) + chkFirst = Field2CheckBox(!Firsttime) + txtMetal = Field2Double(!METAL) + txtSand = Field2Integer(!sand_ton) + txtSuperBB = Field2Integer(!SUP_BB) + txtSuper12 = Field2Integer(!SUP_FD12) + txtSuper1383 = Field2Integer(!SUP_138) + txtSuper783 = Field2Integer(!SUP_783) + txtSuper78 = Field2Integer(!SUP_78) + txtSuper38 = Field2Integer(!SUP_38) + txtSuperRL = Field2Integer(!SUP_RL) + txtSuperML = Field2Integer(!SUP_ML) + txtSuperDW = Field2Integer(!SUP_DW) + txtSuperSP = Field2Integer(!SUP_SP) + txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + If txtLathO = "" Then + txtLathO = "12/31/2030" + End If + txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) + txtStoneBill = Field2Str2(!st_bill) + txtJC = Field2Str(!jobcost) + chkHoldOrders = Field2CheckBox(!hold_stucco) + chkHoldPO = Field2CheckBox(!hold_po) + chkPaint = Field2CheckBox(!PNT_FLG) + chkSynthetic = Field2CheckBox(!syn_flag) + If Not chkSynthetic And mboolSYNTHETIC Then + chkSynthetic = vbChecked + End If + chkStone = Field2CheckBox(!stone) + chkOthers = Field2CheckBox(!otstone) + chkNoPay = Field2CheckBox(!nopayissue) + + Call FindTexture2(Field2Str(!texture), strTYPE) + txtFinish = strTYPE + If !texture = "SB" Then + chkSynthetic = vbChecked + lblSynthetic.Visible = True + End If + + End With + + If moRSProj!stype = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!stype = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!stype = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!stype = "C" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!stype = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!stype = "W" Then + txtOneKote.Text = "Western 1 Kote" + ElseIf moRSProj!stype = "N" Then + txtOneKote.Text = "San Man" + End If + + If moRS!l_FLG = "P" Then + txtTtlYdge.Enabled = False + txtCMUYdge.Enabled = False +' txtStone.Enabled = False + txtLotNo.Enabled = False + cmdAddMatrl.Enabled = False + cmdDelMatrl.Enabled = False + cmdSaveMatrl.Enabled = False + cmdOptDel.Enabled = False + cmdDelLot.Enabled = False + cmdSaveLotInfo.Enabled = False + cmdFindPlan.Enabled = False + cmdOrders.Enabled = False + cmdCalc.Enabled = False +' txtYardMemo.Enabled = False + txtYardMemo.Enabled = True + txtYardMemo.Locked = True + cmdUpCMU.Enabled = False + cmdPrintCMU.Enabled = False + Call LotPrinted + End If + If moRS!Firsttime Then + lblFirst.Visible = True + End If + If chkPaint = vbChecked Then + mboolPAINT = True + Else + mboolPAINT = False + End If + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotPrinted() + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtNotes.Enabled = False +' txtFoamAdj.Enabled = False +' txtLaborAdj.Enabled = False +' txtWireAdj.Enabled = False +' txtFin2.Enabled = False + txt28Foam.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False +' lblLathPrint.Visible = True + cmdPreOrderPrintY.Enabled = False + cmdPreOrderPrintS.Enabled = False + +End Sub + +Private Sub LotRePrinted() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True +' txtFin2.Enabled = True + txt28Foam.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If +' txtSuperBB.Enabled = True + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True + txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + lblLathPrint.Visible = False + cmdPreOrderPrintY.Enabled = True + cmdPreOrderPrintS.Enabled = True + cmdPrint.Enabled = True +End Sub + +Private Sub LotNew() + txtAddress.Enabled = True + txtOwner.Enabled = True + txtModel.Enabled = True + txtNotes.Enabled = True +' txtFoamAdj.Enabled = True +' txtLaborAdj.Enabled = True +' txtWireAdj.Enabled = True + txtFin2.Enabled = True + txt28Foam.Enabled = True +' txtSuperBB.Enabled = True + If mboolCOMM Then + txtSuperBB.Enabled = True + Else + txtSuperBB.Enabled = False + End If + txtSuper12.Enabled = True + txtSuper783.Enabled = True + txtSuper78.Enabled = True + txtSuper38.Enabled = True + txtSuper1383.Enabled = True +' txtSuperRL.Enabled = True +' txtSuperML.Enabled = True +' txtSuperDW.Enabled = True + txtSuperSP.Enabled = True + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + lblLathPrint.Visible = False + lblFirst.Visible = False + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!qty) + txtLMLength = Field2Integer(!calc_amt) + txtLMBalance = Field2Str(!o_qty) + chkChange = Field2CheckBox(!ch_flag) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + strTYPE = Field2Str(!m_type) + Call FindType(cboLMType, strTYPE) + + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt + txtLOYdge = Field2Integer(!Yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Integer(!fin2) + txtLOFoam = Field2Integer(!f_adj) + lblBillingAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOSt_SqFt = Field2Str2(!OSt_SqFt) + Call FindTexture2(Field2Str(!texture), strTYPE) + txtLOTexture = strTYPE +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOpt() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOpt2 + txtNote2 = Field2Str(!notes) + End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPO() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPO + gintPONUM = Field2Long(!ponum) + txtPONum = Field2Long(!ponum) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + txtPODate = Field2Str(!Date) + txtPay = Field2Str2(!yards) + txtPayType = Field2Str(!payflag) + txtPOType = Field2Str(!potype) + gstrPO = txtPOType + End With + If moRSPO!p_flg = "P" Then + cmdPrintPO.Enabled = False + Else + cmdPrintPO.Enabled = True + End If + mboolSHOW = False + If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then + cmdPrintPOPay.Enabled = True + Else + cmdPrintPOPay.Enabled = False + End If + + Select Case txtPOType + Case "L" + lblIssueTo = "Invoice Description:" + txtIssueTo.Visible = True + lblIssueTo.Visible = True + lblDesc = "Pay Description:" + txtPODesc.Visible = True + lblDesc.Visible = True + lblPayYds = "Pay Yards:" + txtPay.Visible = True + lblPayYds.Visible = True + txtPayType.Visible = True + Case "Y" + lblIssueTo.Visible = False + txtIssueTo.Visible = False + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "V" + lblIssueTo = "Mileage:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + Case "M" + lblIssueTo = "Person Requesting:" + txtIssueTo.Visible = True + lblDesc = "Supplier:" + txtPODesc.Visible = True + lblPayYds.Visible = False + txtPay.Visible = False + txtPayType.Visible = False + End Select + + Call CBFindString1(cboPOType, txtPOType) + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!qty) + txtLOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboLOMType, strTYPE) + + If !calc_flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOQty = Field2Str(!qty) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + ElseIf !d_flag = "Y" Then + cboPODFlag.Text = "Yard" + Else + cboPODFlag.ListIndex = -1 + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboPOMType, strTYPE) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If IsNull(txtModel) Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + ElseIf Trim$(txtModel) = "" Then + MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" + Exit Sub + End If + +' If mboolAdding Then +' moRS.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled +' cmdAddLot.Enabled = Not cmdAddLot.Enabled + cmdDelLot.Enabled = Not cmdDelLot.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSaveLotInfo.Enabled Then + If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then + cmdAddLot.Enabled = False + Else + cmdAddLot.Enabled = True + End If + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + On Error GoTo Error_EH + + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount > 0 Then + txtYardMemo = Field2Str(moRSMemo!notes) + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = "" + moRSMemo.Update + txtYardMemo = "" + End If + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + If moRS!Split Then + mboolSPLIT = False '*** Changed from True to False 7/21/2017 because no longer processing Split Qty + Else + mboolSPLIT = False + End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub PlanFind() +Dim oRS As Recordset +Dim strSQL As String, strPlan As String, strTEST As String + On Error GoTo Open_EH + mintOpenPR = 0 + +' strSQL = "SELECT * " + strSQL = "SELECT est_id, verified, update, OpenPR " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + If Not moRSPlan.EOF Then + mboolVERIFIED = moRSPlan!verified + mintOpenPR = Field2Integer(moRSPlan!openpr) + gintESTID = moRSPlan!est_id + If moRSProj!FHA Then + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" + Else + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" + End If + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + If oRS.EOF Then + mintTake138 = 0 + Else + moRS!jmb138 = oRS!qty +' mintTake138 = oRS!qty + End If + oRS.Close + Else + MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" + mboolCRITICAL = True + End If + Exit Sub + +Open_EH: + gstrMODULE = "Form LotInfo - Module PlanFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Function FormFindPOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOpt2() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT notes, optid " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) + + Set moRSPOpt2 = New Recordset + + moRSPOpt2.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt2.EOF Then + FormFindPOpt2 = False + Else + FormFindPOpt2 = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOpt2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) + + If moRSPO.State = adStateOpen Then + + moRSPO.Close + End If + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindLOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + Set moRSLOpt = New Recordset + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!Opt_ID + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindLOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String, strOPTID As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrdMat " + strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = " & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) + + If moRSPOMAT.State = adStateOpen Then + moRSPOMAT.Close + End If + + moRSPOMAT.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstLMaterial.col = 0 + strINVNO = lstLMaterial.ColText + + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' intTest = moRSMat.RecordCount + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Sub cmdExit_Click() + + Unload Me +End Sub +Private Sub FieldsSave() +Dim strLOT As String, strTYPE As String +Dim dblOPEN As Double, intDELETE As Integer + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + moRS!est_id = gintESTID + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS!startdate = Str2Field(mstrSTARTDATE) + End If + + If Field2Integer(moRS!sq_yd) > 1 Then + dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + If moRSProj!use_open Then + If Field2Integer(moRS!sq_yd) > 500 Then +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 0 ' changed from 19 to 0 per Jesse 01/13/18 + moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE + moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE + Else +' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 + moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 5 'Change per Jesse 08/22/05 + moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 5 'Change per Jesse 08/22/05 +'' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 + End If + Else + If Field2Integer(moRS!sq_yd) > 500 Then +' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 0 + moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE + moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE + Else +' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 + moRS!l_yds = Field2Integer(moRS!sq_yd) - 5 + moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 +' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 +' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 + End If + End If + End If + + With moRS + !zone = Integer2Field(moRSProj!zone) + !sq_yd = Integer2Field(txtTtlYdge) + !address = Str2Field(txtAddress) + !Owner = Str2Field(txtOwner) + !model = Str2Field(txtModel) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtNotes) + !supernotes = Str2Field(txtSuperNotes) + !lotnotes = Str2Field(txtLotNotes) +' !f_adj = Integer2Field(txtFoamAdj) +' !l_adj = Integer2Field(txtLaborAdj) + !f_adj = Field2Str2(mstrFoamAdj) + !l_adj = Field2Str2(mstrLaborAdj) + !w_adj = Field2Str2(mstrWireAdj) + !fin2 = Integer2Field(txtFin2) + !lot_no = Str2Field(txtLotNo) + !foam = Integer2Field(txt28Foam) + !lorder = Date2Field(txtLathO) + !SUP_BB = Integer2Field(txtSuperBB) + !SUP_FD12 = Integer2Field(txtSuper12) + !SUP_783 = Integer2Field(txtSuper783) + !SUP_78 = Integer2Field(txtSuper78) + !SUP_38 = Integer2Field(txtSuper38) + !SUP_138 = Integer2Field(txtSuper1383) + !SUP_RL = Integer2Field(txtSuperRL) + !SUP_ML = Integer2Field(txtSuperML) + !SUP_DW = Integer2Field(txtSuperDW) + !SUP_SP = Integer2Field(txtSuperSP) + !opening = Integer2Field(txtOPEN) + !sand_ton = Integer2Field(txtSand) + !SORDER = Str2Field(txtBrownO) +' !SORDER = Str2Field(txtTextureO) + !Border = Str2Field(txtSandO) + !TORDER = Str2Field(txtScratchO) + !forder = Str2Field(txtBrownO) + !VOrder = Str2Field(txtLathBill) + !st_bill = Integer2Field(txtStoneBill) + !jobcost = Str2Field(txtJC) + !hold_stucco = chkHoldOrders + !hold_po = chkHoldPO + !PNT_FLG = chkPaint + !LUUser = gstrLOGIN + !Update = Date + !Firsttime = chkFirst + !syn_flag = chkSynthetic + !stone = chkStone + !otstone = chkOthers +' !ST_SQFT = Integer2Field(txtStone) + + Call FindTexture(txtFinish, strTYPE) + !texture = strTYPE + + End With + moRS.Update + + If mboolAdding Then + Call GetLotID + Call PlanMatLoad + Call POptLoad + Call JCSetup + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + End If + mboolAdding = False + End If + moRSMemo!notes = Field2Str(txtYardMemo) + moRSMemo.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") + If Len(strLOT) > 0 Then + moRS!lot_no = Field2Str(strLOT) + txtLotNo = Field2Str(strLOT) + txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") + moRS!jobcost = Field2Str(txtJC) + moRS.Update + End If + Resume Next + End If + gstrMODULE = "Form LotInfo - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetLotID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintLOTID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPlanInfo() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + mboolPLANUP = False + strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrPLANUP = Field2Str(oRS!Update) +' mboolVERIFIED = oRS!verified + If mstrPLANUP > Field2Str(moRS!import) Then + mboolPLANUP = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetPlanInfo" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POSave() +Dim strSQL As String, strMAX As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + If moRSPO.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + + !Date = Str2Field(txtPODate) + !User = gstrLOGIN + !Up_User = gstrLOGIN + !Update = Date + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + oRS.Update + + oRS.Close + Call POLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPO.AddNew + moRSPO!User = gstrLOGIN + End If + + With moRSPO + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !towhom = Str2Field(txtIssueTo) + !Desc = Str2Field(txtPODesc) + !Update = Date + !Up_User = gstrLOGIN + !Date = Str2Field(txtPODate) + !notes = Str2Field(txtPONotes) + !yards = Str2Field(txtPay) + !payflag = Str2Field(txtPayType) + !potype = Left(cboPOType.Text, 1) + End With + moRSPO.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPO.ActiveConnection) + Exit Sub +End Sub + +Private Sub POMatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSPOMAT.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) +' !price = Str2Field(txtPOPrice) + + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + oRS.Update + + oRS.Close + Call OptMatLoad + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSPOMAT.AddNew + End If + + With moRSPOMAT + !Lot_ID = gintLOTID + !ponum = mintPONUM + !inv_no = Str2Field(txtPOInvNo) + !Desc = Str2Field(txtPOMatDesc) + !qty = Str2Field(txtPOQty) + !price = Str2Field(txtPOPrice) + !m_type = Left$(cboPOMType.Text, 1) + + If cboPODFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPODFlag.Text = "Yard" Then + !d_flag = "Y" + End If + End With + moRSPOMAT.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPOMAT.ActiveConnection) + Exit Sub + + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + Exit Sub + End If + + + With moRSMat + + If mboolAdding Then + .AddNew + !Lot_ID = gintLOTID + End If + !inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !qty = Str2Field(txtLMQty.Text) + !calc_amt = Integer2Field(txtLMLength.Text) + !o_qty = Integer2Field(txtLMBalance.Text) + !ch_flag = chkChange + !m_type = Left$(cboLMType.Text, 1) + + If cboLMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !calc_flag = "M" + Else + !calc_flag = "" + !calc_amt = 0 + End If + End With + mintINVNO = Field2Str2(txtLMInvNo) + moRSMat.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + moRSMemo.Close + txtLotNotes = "" + txtYardMemo = "" + txtSuperNotes = "" + txtTtlYdge = 0 + txtAddress = "" + txtOwner = "" + txtModel = "" + txtCMUYdge = 0 + chkFirst = vbUnchecked + txtNotes = "" + lblFoamAdj.Caption = "Form Adj. Yardage: " + lblLaborAdj.Caption = "Labor Adj. Yardage: " + lblWireAdj.Caption = "Wire Adj. Yardage: " + lblPaintSqFt.Caption = "Paint Square Ft.: " + lblStoneSqFt.Caption = "Stone Square Ft.: " + txtFin2 = 0 + txtLotNo = "" + txt28Foam = 0 + txtLathO = "12/31/2030" + txtMetal = 0 + txtOPEN = 0 + txtSuperBB = 0 + txtSuper12 = 0 + txtSuper783 = 0 + txtSuper78 = 0 + txtSuper38 = 0 + txtSuper1383 = 0 + txtSuperRL = 0 + txtSuperML = 0 + txtSuperDW = 0 + txtSuperSP = 0 +' txtLathO = "" + txtSandO = "" + txtScratchO = "" + txtBrownO = "" + txtTextureO = "" + txtLathBill = "" + txtStoneBill = 0 + txtFinish.Text = "" + txtTake138 = 0 + txtOneKote.Text = "" + lstLath.Clear + lstYard.Clear + lstPreOrder.Clear + lstLMaterial.Clear + lstInventory.Clear + lstPOptions.Clear + lstLOptions.Clear + lstOptMatrl.Clear + lstPO.Clear + lstPOMaterial.Clear + lstBrown.Clear + lstScratch.Clear + lstTexture.Clear + txtLOYdge = 0 + txtLODesc = "" + txtLOFin2 = 0 + txtLOFoam = 0 + txtLOMInvNo = 0 + txtLOMDesc = "" + txtLOMQty = "" + txtSand = 0 + txtLOMLength = 0 + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + gintOPTID = 0 +' txtLODate.Enabled = False + chkHoldOrders = vbUnchecked + chkHoldOrders.Enabled = True + chkHoldPO = vbUnchecked + chkHoldPO.Enabled = True + chkPaint = vbUnchecked + chkSynthetic = vbUnchecked + chkSynthetic.Enabled = True + chkStone = vbUnchecked + chkOthers = vbUnchecked + chkNoPay = vbUnchecked + chkStone.Enabled = True + lblFirst.Visible = False + lblSZone = "" + lblSandShip = "" + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = Field2Integer(oRS("inv_no")) + + If mboolAdding Then +' intINVNO = Field2Integer(txtPOInvNo) + If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then + mintBOOKMARK = .ListIndex + End If + End If + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, intCOUNT As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + intCOUNT = oRSS.RecordCount + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str2(oRS!qty) +' oRSS!price = 0 + oRSS!price = Field2Str2(oRS!price) + oRSS.Update + If moRSProj!FHA Then + If Field2Str(oRS!inv_no) = "1570" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + Else + If Field2Str(oRS!inv_no) = "1130" Then +' mintTake138 = Field2Str(oRS!qty) + moRS!jmb138 = Field2Str(oRS!qty) + txtTake138 = Field2Str(moRS!jmb138) +' txtTake138 = mintTake138 + End If + End If + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If +' Resume Next + +End Sub +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String, strSELECT As String +Dim strLine As String + + On Error GoTo Error_EH + If lstLOptions.ListIndex = -1 Then + lstOptMatrl.ListIndex = -1 + Exit Sub + End If + strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.ListIndex = -1 + cboLOMDFlag.Text = "" + cboLOMType.ListIndex = -1 + cboLOMType.Text = "" + cboLOMetal.ListIndex = -1 + cboLOMetal.Text = "" + lstOptMatrl.ListIndex = -1 + End If + Exit Sub + +Error_EH: + If Err = 381 Then + strSELECT = 0 + cmdOptDel.Enabled = False + Resume Next + End If + +End Sub +Private Sub POptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + + .AddItem oRS!ponum + .ItemData(.NewIndex) = oRS!ponum + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPO.ListCount Then + lstPO.ListIndex = 0 + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LOptLoad() +Dim oRS As Recordset +Dim strSQL As String, intLoop As Integer, intPos As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!Opt_ID + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) + Else + lstLOptions.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module LOptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + txtLMInvNo = Field2Str(!inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboLMType, strTYPE) + + If !calc_flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_DblClick() + cmdAddMatrl.Enabled = False + cmdSaveMatrl.Enabled = True + cmdDelMatrl.Enabled = True +End Sub + +Private Sub lstLookup_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstLOOKUP.col = 0 + strINVNO = lstLOOKUP.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = " & lstLOOKUP.ItemData(lstLOOKUP.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPOInvNo = Field2Str(!inv_no) + txtPOMatDesc = Field2Str(!Desc) + txtPOPrice = Field2Str2(!price) + + If !d_flag = "S" Then + cboPODFlag.Text = "Supplier" + Else + cboPODFlag.Text = "Yard" + End If + + strTYPE = !m_type + Call FindType(cboPOMType, strTYPE) + + End With + txtPOQty.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLookup_dblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_Click() + On Error GoTo Error_EH + + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "0" + txtLODesc = "" + txtLOFin2 = "0" + txtLOFoam = "0" + txtLOTexture = "" + End If + If FormFindLOpt() Then +' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) + + End If + Else + cmdOptDel.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptDel.Enabled = True + cmdOptAdd.Enabled = False + End If + +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "0" + txtLOMDesc = "" + txtLOMQty = "0" + txtLOMLength = "0" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstLMaterial_Click() + On Error GoTo Error_EH + + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +' cboLMDFlag.Text = "" +' cboLMType.Text = "" +' cboLMMetal.Text = "" + txtLMBalance = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstLMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = True + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdPrintPO.Enabled = False + End If +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPO_Click() + On Error GoTo Error_EH + + If lstPO.ListIndex <> -1 Then + If FormFindPO() Then + mintPONUM = lstPO.ItemData(lstPO.ListIndex) + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + End If + End If + Else + lstPO.Clear + txtPONum = "0" + txtPODesc = "" + txtIssueTo = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPO_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub OrderLoad() +Dim oRS As Recordset, strLOOK As String +Dim strSQL As String, strLine As String, strSELECT As String + On Error Resume Next + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSELECT = "M_Type = 'P'" +' strSELECT = "D_Flag = 'S' and M_Type = 'P'" + + oRS.Filter = strSELECT + lstPreOrder.Clear + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + strSELECT = "M_Type = 'Z'" + oRS.Filter = strSELECT + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!d_flag & " " & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSELECT + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSELECT + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSELECT + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSELECT + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSELECT = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSELECT + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + strSELECT = "D_Flag = 'S' and M_Type = 'E'" + oRS.Filter = strSELECT + lstTexture.Clear + strLOOK = oRS!m_type + + Do Until oRS.EOF + With lstTexture + strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPlans_DblClick() + txtModel = lstPlans.List(lstPlans.ListIndex) + lstPlans.Visible = False + lblPlan.Visible = False + Call cmdFindPlan_Click +End Sub + +Private Sub lstPOMaterial_DblClick() + If chkHoldPO Then + MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" + Exit Sub + End If + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdAddPO.Enabled = False + cmdAddPOMat.Enabled = False + cmdDelPOMat.Enabled = False + cmdSavePOMat.Enabled = True + cmdPrintPO.Enabled = False + txtPOInvNo.Enabled = True + txtPOMatDesc.Enabled = True + txtPOQty.Enabled = True + txtPOPrice.Enabled = True + cboPODFlag.Enabled = True + cboPOMType.Enabled = True + cmdFindPOMat.Enabled = True + End If +End Sub + +Private Sub lstPOptions_Click() + On Error GoTo Error_EH + + If lstPOptions.ListIndex <> -1 Then + If FormFindPOpt2() Then + Call FormShowPOpt + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module lstPOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + txtLMInvNo = "0" + txtLMDesc = "" + txtLMQty = "0" + txtLMLength = "0" + txtLMBalance = "0" + chkChange = vbUnchecked + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 +End Sub + +Private Sub POClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + txtPONotes = "" + txtIssueTo = "" + txtPONum = "0" + txtPODesc = "" + txtPODate = "" + txtPay = 0 + txtPayType = "" + lstLOOKUP.Clear + lstPOMaterial.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cboPOType.ListIndex = -1 + +End Sub + +Private Sub POMatClear() + + txtPOInvNo = "0" + txtPOMatDesc = "" + txtPOQty = "0" + lstLOOKUP.Clear + cboPODFlag.ListIndex = -1 + cboPOMType.ListIndex = -1 + cmdFindPOMat.Visible = True + +End Sub + +Private Sub lstPOptions_DblClick() + If IsNull(moRS!l_FLG) Or gconACTION = 5 Then + cmdOptAdd.Enabled = True + cmdOptDel.Enabled = False + End If + +End Sub + +Private Sub SSTLotInfo_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String +'Private Sub SSTLotInfo_GotFocus() + + If SSTLotInfo.Tab = 3 Then + MsgBox "Options Are Not Available For Synthetic Jobs", vbOKOnly, "Invalid Selection" + SSTLotInfo.Tab = PreviousTab +' txtNotes.SetFocus + Exit Sub + End If + +' If SSTLotInfo.Tab = 1 Then +' MsgBox "Super's Orders Are Not Available For Synthetic Jobs", vbOKOnly, "Invalid Selection" +' SSTLotInfo.Tab = PreviousTab +'' txtNotes.SetFocus +' Exit Sub +' End If + + If SSTLotInfo.Tab = 1 Then + txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) + txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) + txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) + txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) + txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) + txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) + txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) + txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) + txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) + txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) + End If + + If SSTLotInfo.Tab = 6 Then + If chkHoldPO Then + cmdAddPO.Enabled = False + cmdSavePO.Enabled = False + cmdDelPO.Enabled = False + cmdPrintPO.Enabled = False + cmdPrintForm.Enabled = False + cmdAddPOMat.Enabled = False + cmdSavePOMat.Enabled = False + cmdDelPOMat.Enabled = False + txtPONum.Enabled = False + txtPODate.Enabled = False + txtIssueTo.Enabled = False + txtPODesc.Enabled = False + txtPay.Enabled = False + txtPayType.Enabled = False + txtPONotes.Enabled = False + txtPOInvNo.Enabled = False + txtPOMatDesc.Enabled = False + txtPOQty.Enabled = False + cboPODFlag.Enabled = False + cboPOMType.Enabled = False + txtPOPrice.Enabled = False + cmdPrintPOPay.Enabled = False + cmdFindPOMat.Enabled = False + lstLOOKUP.Visible = False + Else +' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then + If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then + cmdAddPO.Enabled = True + End If + End If + End If +End Sub + +Private Sub txt28Foam_GotFocus() + Call FieldSelect(txt28Foam) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtIssueTo_GotFocus() + Call FieldSelect(txtIssueTo) +End Sub + +Private Sub txtIssueTo_LostFocus() + txtIssueTo = UCase(txtIssueTo) +End Sub + +Private Sub txtJC_GotFocus() + Call FieldSelect(txtJC) +End Sub + +Private Sub txtJC_LostFocus() + txtJC = UCase(txtJC) +End Sub + +Private Sub txtLMDesc_LostFocus() + txtLMDesc = UCase(txtLMDesc) +End Sub + +Private Sub txtLMInvNo_GotFocus() + Call FieldSelect(txtLMInvNo) +End Sub + +Private Sub txtLMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLOMQty_GotFocus() + mdblQTY = Field2Str2(txtLOMQty) +End Sub + +Private Sub txtLOMQty_LostFocus() + If mdblQTY <> Field2Str2(txtLOMQty) Then + If gconACTION <> 5 Then + gconACTION = 6 + End If + End If +End Sub + +Private Sub txtLotNotes_GotFocus() + txtLotNotes.SelStart = 1000 +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtModel_LostFocus() + txtModel = UCase(txtModel) +End Sub + +Private Sub txtPay_GotFocus() + Call FieldSelect(txtPay) +End Sub + +Private Sub txtPayType_GotFocus() + Call FieldSelect(txtPayType) +End Sub + +Private Sub txtPayType_LostFocus() + txtPayType = UCase(txtPayType) + If txtPayType = "D" Or txtPayType = "R" Then + lblPayYds.Caption = "Pay Dollars:" + Else + lblPayYds.Caption = "Pay Yards:" + End If +End Sub + +Private Sub txtPODate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtPODate, "/", 1) + If Not IsDate(txtPODate) Then + If lngPOS = 0 Then + If Len(txtPODate) > 0 Then + txtPODate = Format(txtPODate, "00/00/####") + If Not IsDate(txtPODate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPODate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtPODate.SetFocus + End If + End If +End Sub + +Private Sub txtPOQty_LostFocus() + If mdblQTY <> Field2Str2(txtPOQty) Then + If moRSPO!p_flg = "P" Then + gconACTION = 2 + End If + End If + +End Sub + +Private Sub txtLMDesc_GotFocus() + Call FieldSelect(txtLMDesc) +End Sub + +Private Sub txtLMLength_GotFocus() + Call FieldSelect(txtLMLength) +End Sub + +Private Sub txtLMQty_GotFocus() + mdblQTY = Field2Str2(txtLMQty) + Call FieldSelect(txtLMQty) +End Sub + +Private Sub txtLotNo_LostFocus() + txtLotNo = UCase(txtLotNo) + Call GETJC +' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") +End Sub +Private Sub GETJC() +Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + intJC = Field2Integer(oRS!nextjc) + txtALPHA = Field2Str(oRS!jcalpha) + txtJC = txtALPHA & Format(Field2Str(intJC), "000000") + intJC = intJC + 1 + + If intJC > 999999 Then + intJC = 1 + intASCII = Asc(txtALPHA) + intASCII = intASCII + 1 + txtALPHA = Chr(intASCII) + oRS!jcalpha = Field2Str(txtALPHA) + End If + + oRS!nextjc = intJC + oRS.Update + +End Sub +Private Sub txtModel_GotFocus() + Call FieldSelect(txtModel) +End Sub + +Private Sub txtOwner_GotFocus() + Call FieldSelect(txtOwner) +End Sub + +Private Sub txtOwner_LostFocus() + txtOwner.Text = UCase(txtOwner.Text) +End Sub +Private Sub txtAddress_LostFocus() + txtAddress.Text = UCase(txtAddress.Text) +End Sub +Private Sub txtAddress_GotFocus() + Call FieldSelect(txtAddress) +End Sub +Private Sub txtNotes_LostFocus() + txtNotes.Text = UCase(txtNotes.Text) +End Sub + +Private Sub txtPODate_GotFocus() + Call FieldSelect(txtPODate) +End Sub + +Private Sub txtPODesc_GotFocus() + Call FieldSelect(txtPODesc) +End Sub + +Private Sub txtPODesc_LostFocus() + txtPODesc = UCase(txtPODesc) +End Sub + +Private Sub txtPOInvNo_GotFocus() + Call FieldSelect(txtPOInvNo) +End Sub + +Private Sub txtPOMatDesc_GotFocus() + Call FieldSelect(txtPOMatDesc) +End Sub + +Private Sub txtPOMatDesc_LostFocus() + txtPOMatDesc = UCase(txtPOMatDesc) +End Sub + +Private Sub txtPONotes_GotFocus() + Call FieldSelect(txtPONotes) +End Sub + +Private Sub txtPONotes_LostFocus() + txtPONotes = UCase(txtPONotes) +End Sub + +Private Sub txtPOQty_GotFocus() + mdblQTY = Field2Str2(txtPOQty) + Call FieldSelect(txtPOQty) +End Sub + +Private Sub txtSuper12_GotFocus() + Call FieldSelect(txtSuper12) +End Sub + +Private Sub txtSuper12_LostFocus() + txtSuper12 = Integer2Field(txtSuper12) + If Field2Str(moRS!l_FLG) <> "P" Then + If txtSuper12 = 0 And txtSuperBB = 0 Then + cmdCalc.Enabled = False + Else + cmdCalc.Enabled = True + End If + End If +End Sub + +Private Sub txtSuper1383_LostFocus() +Dim intResponse As Integer + txtSuper1383 = Integer2Field(txtSuper1383) + If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then + intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") + If intResponse = vbYes Then + Exit Sub + Else + txtSuper1383.SetFocus + End If + End If +End Sub + +Private Sub txtSuper38_GotFocus() + Call FieldSelect(txtSuper38) +End Sub + +Private Sub txtSuper78_GotFocus() + Call FieldSelect(txtSuper78) +End Sub + +Private Sub txtSuper1383_GotFocus() + Call FieldSelect(txtSuper1383) +End Sub + +Private Sub txtSuper783_GotFocus() + Call FieldSelect(txtSuper783) +End Sub + +Private Sub txtSuper783_LostFocus() + txtSuper783 = Integer2Field(txtSuper783) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) +End Sub + +Private Sub txtSuper78_LostFocus() + txtSuper78 = Integer2Field(txtSuper78) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) +End Sub + +Private Sub txtSuper38_LostFocus() + txtSuper38 = Integer2Field(txtSuper38) + txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) +End Sub + +Private Sub txtSuperBB_GotFocus() + If mboolCOMM Then + Call FieldSelect(txtSuperBB) + End If +End Sub + +Private Sub txtSuperBB_LostFocus() + If mboolCOMM Then + txtSuperBB = Integer2Field(txtSuperBB) + End If +End Sub + +Private Sub txtSuperDW_GotFocus() + Call FieldSelect(txtSuperDW) +End Sub + +Private Sub txtSuperDW_LostFocus() + txtSuperDW = Integer2Field(txtSuperDW) +End Sub + +Private Sub txtSuperML_GotFocus() + Call FieldSelect(txtSuperML) +End Sub + +Private Sub txtSuperML_LostFocus() + txtSuperML = Integer2Field(txtSuperML) +End Sub + +Private Sub txtSuperNotes_GotFocus() + Call FieldSelect(txtSuperNotes) +End Sub + +Private Sub txtSuperNotes_LostFocus() + txtSuperNotes.Text = UCase(txtSuperNotes.Text) +End Sub + +'Private Sub txtSuperRL_GotFocus() +' Call FieldSelect(txtSuperRL) +'End Sub + +'Private Sub txtSuperRL_LostFocus() +' txtSuperRL = Integer2Field(txtSuperRL) +'End Sub + +Private Sub txtSuperSP_GotFocus() + Call FieldSelect(txtSuperSP) +End Sub + +Private Sub MatCalcOne() +Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double +Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double +Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean +Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, intCaulkQty As Integer + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE <> "O" Then + MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + intOpenPR = Field2Integer(moRS!openpr) + intUSEOpen = 100 - intOpenPR + dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) +' If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 + If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 +' If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + +' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 0 +' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse +' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse + moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 'Changed 12/11/17 per Jesse + moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 'Changed 12/11/17 per Jesse + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 +' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 +' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 +' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 + moRS!l_yds = (Field2Integer(dblNEWYDS)) ' - 10 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) ' - 15 'Change per Jesse 10/13/12 + End If + Else +' moRS!s_yds = Field2Integer(dblnewyds) - 24 + If Field2Integer(dblNEWYDS) > 500 Then +' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 + intDELETE = 0 + moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + Else +' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 +' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 10/13/12 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj!stype <> "T" Then + +'Black Paper + If IsNull(txtSuper12) Then + txtSuper12 = 0 + End If + dblFD12 = CInt(txtSuper12) + If txtSuperSP > "" Then + dblSP = CDbl(txtSuperSP) + ElseIf dblSP = 0 Then + dblSP = (dblFD12 / 2) + Else + dblSP = 0 + End If + + '******* Need to determine ML quantity + moRSCMat.MoveFirst + strSELECT = "inv_no = '1370'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + If Not dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1375'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If Not dblML > 0 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1371'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblML = 0 + Else + dblML = Field2Integer(moRSCMat!qty) + End If + End If + If txtSuperML > 5 Then + dblML = Field2Integer(txtSuperML) + End If + + If txtSuperRL = -2 Then + '******* Need to make takeoff RL to be dblRL + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + dblRL = 0 + Else + dblRL = Field2Integer(moRSCMat!qty) + End If + Else + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + End If + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + + If moRSProj!bp_type = "" Then +' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") +' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK + MsgBox "No BlackPaper is Defined for this Subdivision" + Exit Sub + End If + + If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer + dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) + End If + + If moRSProj!bp_type = "B2" Then 'double cover sheer and BB + If moRSProj!bb Then + dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) + Else + dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "BA" Then 'cover entire house once + dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB + If dblNEWYDS < 325 Then + If moRSProj!bb Then + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + Else + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + End If + + If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam + dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BS" Then 'double cover sheer panel only + dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) + End If + + If moRSProj!bp_type = "BD" Then 'double cover entire house + If dblNEWYDS > 325 Then + dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) + End If + End If + +' If moRSProj!bp_type = "TV" Then 'cover entire house once +' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) +' End If + + If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation + dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) + End If + + If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) + Else + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB + If moRSProj!bb Then + dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) + Else + dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) ' Changed 10/12/15 per Jesse +' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) + End If + End If + + If moRSProj!bp_type = "TV" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "TC" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) +' moRSCMat!qty = ((dblBP * 3) * 0.9) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Stucco Wire + 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) + 'to calc wire better for Jesse 12/14/17 + + dblWire = Field2Integer(mstrWireAdj) + If dblRL > 5 Then + dblARL = Int(((dblRL - 5) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If + If dblML > 5 Then + dblAML = Int(((dblML - 5) * 1.77) + 0.99) + Else + dblAML = 0 + End If + '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 + '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 + If CDbl(txtTtlYdge) < 325 Then + dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) + Else + dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) +' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1410" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + Else + oRC!qty = dblCALC + oRC.Update + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + oRC.Close + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '9000' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '9000'" 'Green Floats + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + + If moRSProj!stype = "S" Then ' SUPERWALL One Kote + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + End If + End If + + If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture + If Field2Str2(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + End If + End If + + If moRSProj!stype = "W" Then ' WESTERN One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + End If + End If + + If moRSProj!stype = "M" Then 'MAGNA WALL One Kote +' If Field2Str2(moRSProj!sw_order) > 0 Then + If Field2Double(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Magnawall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + End If + End If + + If moRSProj!stype = "N" Then ' SanMan Silo One Kote + If Field2Str(moRSProj!sw_order) > 0 Then + dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) + Else + dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblKote1 + moRSCMat.Update + End If + End If + + If moRS!texture = "" Then + MsgBox "No Texture is Selected for This House - Check the Plan" + Exit Sub + End If + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10)) / Field2Integer(oRSC!yds)) + 0.99) +' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!brs) > 0 Then + dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) + Else + dblRS = 0 + End If + + If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat + If Field2Double(moRSProj!syn_o) > 0 Then + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) + Else + dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) + End If + End If + +'This calculates the additional materials needed for the second texture + On Error GoTo Error_EH2 + If moRS!fin2 > 0 Then + If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture +' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture + If Field2Integer(moRSProj!syn_o2) > 0 Then + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) +' Exit Sub + Else + dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) +' Exit Sub + End If +' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then + ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + If Field2Integer(oRSC!yds) > 0 Then + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Double(oRSC!cmnt) > 0 Then + dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblLime = 0 + End If + + If Field2Str2(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) + 'Else + ' dblS16 = 0 + End If + + If Field2Str2(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) + 'Else + ' dblS20 = 0 + End If + + If Field2Str2(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) + 'Else + ' dblS30 = 0 + End If + End If + End If + End If + On Error GoTo Error_EH + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblSYNP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYNP + moRSCMat.Update + End If + End If + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) + moRSCMat.Update + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + +'Calculate Foam + If txt28Foam = 0 Then + txt28Foam = 25 + End If + + If Field2Integer(dblNEWYDS) < 325 Then + dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + Else + dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) + End If + + dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) + dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) + + If moRSProj!ftype = "O" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD28 + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD48 + moRSCMat.Update + End If + + End If + + If moRSProj!ftype = "D" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblFD1 + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblFD1 / 2) + 0.99) + moRSCMat.Update + End If + End If + + If txtSuper12 > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuper12) + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + End If + +'Calculate Nails + + strSELECT = "inv_no = '1610'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 550 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 550 And Field2Integer(dblNEWYDS) <= 1250 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 1250 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 2200 Then + moRSCMat!qty = 4 +'CHanged on 7/12/2017 per Rose +' If Field2Integer(dblNEWYDS) <= 450 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then +' moRSCMat!qty = 1.5 +' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then +' moRSCMat!qty = 2.5 +' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then +' moRSCMat!qty = 3.5 + End If + End If + moRSCMat.Update + End If + +'Calculate Staples + + strSELECT = "inv_no = '1710'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + + strSELECT = "inv_no = '1720'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 230 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 280 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) + End If +' If Field2Integer(dblnewyds) <= 400 Then +' moRSCMat!qty = 1 +' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then +' moRSCMat!qty = 2 +' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then +' moRSCMat!qty = 3 +' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then +' moRSCMat!qty = 4 +' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then +' moRSCMat!qty = 5 +' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then +' moRSCMat!qty = 6 +' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then +' moRSCMat!qty = 7 +' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then +' moRSCMat!qty = 8 +' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then +' moRSCMat!qty = 9 +' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then +' moRSCMat!qty = 10 +' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then +' moRSCMat!qty = 11 +' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then +' moRSCMat!qty = 12 +' End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then +' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) Per ROse 7/12/2017 + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 2) + 0.99) + moRSCMat.Update + End If + End If + + +'Mesh Tape + + strSELECT = "inv_no = '3200'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) + moRSCMat.Update + End If + End If + +' End If + End If + Call MatLoad + + Exit Sub +Error_EH2: + If Err = 11 Then + Resume Next + End If + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcOne" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatCalcThree() +Dim dblRL As Double, dblDW As Double, dblSP As Double +Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double +Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double +Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double +Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant +Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String +Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer +Dim strFIN2 As String, strFIN1 As String, dblWire As Double +Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double + + On Error GoTo Error_EH + + mboolBADD = False + If mstrWIRE = "O" Then + MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" + mboolBADD = True + Exit Sub + End If + + If Field2Integer(moRS!sq_yd) > 400 Then + boolDEDUCT = True + dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) +' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) + Else + boolDEDUCT = False + dblNEWYDS = Field2Integer(moRS!sq_yd) + End If + + dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) + '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath + '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 + '**** Also had me start taking openings off material yds on lots over 400 + If moRSProj!use_open Then + moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 + moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 5 - intDELETE + Else +' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 + moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 + End If + Else + moRS!s_yds = Field2Integer(dblNEWYDS) - 5 + If Field2Integer(dblNEWYDS) > 400 Then +' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) +' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 + intDELETE = 0 + moRS!l_yds = Field2Integer(dblNEWYDS) - 5 - intDELETE + Else + moRS!l_yds = Field2Integer(dblNEWYDS) - 5 + End If + End If + + strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID + goConn.Execute strSQL + + strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID + Set moRSCMat = New Recordset + moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If txtSuperRL = -1 Then + strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" + goConn.Execute strSQL + End If + If txtSuperRL > 0 Then + dblRL = CInt(txtSuperRL) + moRSCMat.MoveFirst + strSELECT = "inv_no = '1330'" + moRSCMat.Find strSELECT + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = "1330" + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + ' moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Field2Str(txtSuperRL) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + End If + + End If + +'Black Board + If txtSuperBB > 0 Then + dblBB = CInt(txtSuperBB) + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + dblBB = Field2Str(moRSCMat!qty) + Else + dblBB = 0 + End If + End If + moRSCMat.MoveFirst + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + Else + moRSCMat.MoveFirst + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If moRSProj!rg1 Then + moRSCMat.MoveFirst + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + End If + If txtSuperBB = -1 Then + Else + If moRSProj!bb Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1310'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + Else + If moRSProj!rg12 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1315'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + ElseIf moRSProj!rg1 Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!qty = Field2Str(txtSuperBB) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!ch_flag = vbChecked + moRSCMat.Update + strSELECT = "inv_no = '1317'" + moRSCMat.Find strSELECT + dblBB = Field2Str(moRSCMat!qty) + End If + End If + End If + +'Stucco Wire + 'Paperback wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(mstrWireAdj) + If txtSuperSP > 0 Then + dblSP = Field2Str(txtSuperSP) + Else + dblSP = 0 + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + If dblRL > 10 Then + dblARL = Int(((dblRL - 10) * 1.77) + 0.99) + Else + dblARL = 0 + ' dblARL = Int(((dblRL) * 1.77) + 0.99) + End If + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + + 'Self Furing wire + If mstrWIRE = "F" Then +' If dblSP > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked +' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) +' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) + dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) + moRSCMat!qty = dblCALC + moRSCMat.Update + dblCALC = 0 + End If + End If + +'Black Paper + If txtSuperSP > 0 Then + dblSP = CDbl(txtSuperSP) + Else + dblSP = 0 + End If + +' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB +' If moRSProj!bb Then +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) +' Else +' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) +' End If +' End If + +' If dblSP > 0 Then + If moRSProj!bp_type = "B6" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) + dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) + End If + ElseIf moRSProj!bp_type = "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) + dblBP = dblBP + (((dblSP * 3.5) / 16)) +' dblBP = dblBP + (((dblSP * 3.5) / 16) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) + End If + ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + If dblSP > 0 Then + dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) + dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) + dblBP = Int(dblBP + 0.99) + Else + dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) + End If + End If + + If moRSProj!bp_type = "B6" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type = "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + + If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblBP + moRSCMat.Update + End If + End If + +'Calculate 1 Kote, Cement, Lime, and Sand for the Current House + strGET = "SELECT * FROM tblTCInfo" + Set oRST = New Recordset + oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) + moRSCMat.Update + End If + + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = "S" + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) + moRSCMat.Update + End If + +'Scratch Coat + dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) + dblSCmnt = (dblBatch * oRST!scr_cmnt) + dblSLime = (dblBatch * oRST!scr_lime) + dblRS = (dblBatch * oRST!scr_rs) + +'Brown Coat + dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) + dblCMNT = (dblBatch * oRST!brn_cmnt) + dblLime = (dblBatch * oRST!brn_lime) + dblRS = dblRS + (dblBatch * oRST!brn_rs) + +'Texture Coat + +'This caluclates the materials needed for the primary texture + strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + strFIN2 = Field2Str(oRSC!Secondary) + strFIN1 = Field2Str(oRSC!Primary) + + If moRS!fin2 > 0 Then + If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then +' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then + moRS!fin2 = 0 + moRS.Update + End If + End If + + dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str(oRSC!id) = "SB" Then + dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) + +' dblSYN = Int(dblBatch + 0.5) + End If + + If Field2Integer(oRSC!cmnt) > 0 Then + dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + Else + dblTCMNT = 0 + End If + + If Field2Integer(oRSC!lime) > 0 Then + dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) + Else + dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) + Else + dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) + Else + dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) + Else + dblS30 = 0 + End If + + If Field2Integer(oRSC!trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) +' Else +' dblRS = 0 + End If + +'This calculates the additional materials needed for the second texture + If moRS!fin2 > 0 Then + + strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) + If Field2Str2(oRSC!cmnt) > 0 Then + dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) + ' Else + ' dblTCMNT = 0 + End If + + If Field2Str2(oRSC!lime) > 0 Then + dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) +' Else +' dblTLime = 0 + End If + + If Field2Integer(oRSC!s16) > 0 Then + dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) +' Else +' dblS16 = 0 + End If + + If Field2Integer(oRSC!s20) > 0 Then + dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) +' Else +' dblS20 = 0 + End If + + If Field2Integer(oRSC!s30) > 0 Then + dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) +' Else +' dblS30 = 0 + End If + End If + + dblRS = Int((dblRS / 2000) + 0.99) + + If dblSYN > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSYN + moRSCMat.Update + End If + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Int((dblSYN / 10) + 0.5) + moRSCMat.Update + End If + End If + + If dblCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblCMNT + moRSCMat.Update + End If + End If + + If dblSCmnt > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSCmnt + moRSCMat.Update + End If + End If + + If dblTCMNT > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTCMNT + moRSCMat.Update + End If + End If + + If dblLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblLime + moRSCMat.Update + End If + End If + + If dblSLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Str(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblSLime + moRSCMat.Update + End If + End If + + If dblTLime > 0 Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblTLime + moRSCMat.Update + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS16 + moRSCMat.Update + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS20 + moRSCMat.Update + End If + End If + End If + + If dblS30 > 0 Then + If moRSProj!silica Then + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + Else + strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID + Set oRC = New Recordset + oRC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = dblS30 + moRSCMat.Update + End If + End If + End If + + If dblRS > 0 Then + txtSand = dblRS + End If + + +'Calculate 4d Nails + + strSELECT = "inv_no = '1616'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) + moRSCMat.Update + End If + End If + +'Calculate Staples + + strSELECT = "inv_no = '1705'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 250 Then + moRSCMat!qty = 1 + Else + moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) + End If + End If + moRSCMat.Update + End If + +'Rapid Staples + strSELECT = "inv_no = '1730'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + If Field2Integer(dblNEWYDS) <= 400 Then + moRSCMat!qty = 1 + ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then + moRSCMat!qty = 2 + ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then + moRSCMat!qty = 3 + ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then + moRSCMat!qty = 4 + ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then + moRSCMat!qty = 5 + ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then + moRSCMat!qty = 6 + ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then + moRSCMat!qty = 7 + ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then + moRSCMat!qty = 8 + ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then + moRSCMat!qty = 9 + ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then + moRSCMat!qty = 10 + End If + End If + moRSCMat.Update + End If + +'Latex Caulking + + strSELECT = "inv_no = '1820'" + moRSCMat.MoveFirst + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + If Not moRSCMat!ch_flag Then + moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module MatCalcThree" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ConvertSuper() +Dim strGET As String, strSQL As String +Dim oRSC As Recordset + On Error GoTo Error_EH + + If txtSuper78 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper78) + moRSCMat.Update + End If + End If + + If txtSuper38 <> 0 Then + strSQL = "inv_no = '1150'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper38) + moRSCMat.Update + End If + End If + + If txtSuper783 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = '1145'" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = 1565" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + Else + strSQL = "inv_no = 1140" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper783) + moRSCMat.Update + End If + End If + End If + + If txtSuperML <> 0 Then + strSQL = "inv_no = 1370" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperML) + moRSCMat.Update + End If + End If + + If txtSuperDW <> 0 Then + strSQL = "inv_no = 1320" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuperDW) + moRSCMat.Update + End If + End If + + If txtSuper1383 <> 0 Then + If moRSProj!zmetal Then + strSQL = "inv_no = 1135" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + If moRSProj!FHA Then + strSQL = "inv_no = 1130" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = 1570" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + Else + strSQL = "inv_no = 1570" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If Not moRSCMat.EOF Then + moRSCMat.Delete + End If + strSQL = "inv_no = 1130" + moRSCMat.MoveFirst + moRSCMat.Find strSQL + If moRSCMat.EOF Then + moRSCMat.MovePrevious + strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB + Set oRSC = New Recordset + oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + moRSCMat.AddNew + moRSCMat!Lot_ID = gintLOTID + moRSCMat!inv_no = Field2Integer(oRSC!inv_no) + moRSCMat!Desc = Field2Str(oRSC!Desc) + moRSCMat!d_flag = Field2Str(oRSC!d_flag) + moRSCMat!m_type = Field2Str(oRSC!m_type) + moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) + moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) + moRSCMat!rc_flag = vbChecked + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + Else + moRSCMat!qty = Str2Field(txtSuper1383) + moRSCMat.Update + End If + End If + + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module ConvertSuper" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcMetal() +Dim oRS As Recordset +Dim strSQL As String, dblMETAL As Double + On Error GoTo Error_EH + + moRS!METAL = 0 + + strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!summetal) + moRS!METAL = dblMETAL +' moRS!calcdate = Now + moRS!calcdate = Date + moRS.Update + txtMetal = dblMETAL + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module CalcMetal" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSuperSP_LostFocus() + txtSuperSP = Integer2Field(txtSuperSP) +End Sub + +Private Sub txtYardMemo_LostFocus() + txtYardMemo = UCase(txtYardMemo) +End Sub + +Private Sub PrintLathInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, intNMonth As Integer +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim intDUE1 As Integer, intDUE2 As Integer + + On Error GoTo Error_EH + + gintCOPY = 1 + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + If oRSE.EOF Then + + End If + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + gstrMODULE = "Line 28 " + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) +' If IsNumeric(moRS!lot_no) Then + If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str2(moRS!lot_no), "000") & "L" +' mstrINV = Field2Str(moRSProj!inv) & Format(CSng(Field2Str2(moRS!lot_no)), "###") & "L" + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" + mstrINV = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intNMonth = Month(Date) + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If mbool2Dates Then + intDUE1 = Integer2Field(moRSProj!DueDate) + intDUE2 = Integer2Field(moRSProj!duedate2) + Else + intDUE1 = Integer2Field(moRSProj!DueDate) + End If +' If intCDay > moRSProj!inv_due Then + If mbool2Dates Then + If intCDay > intDUE1 And intCDay < intDUE2 Then + + If intCDay > intDUE1 And intNMonth = intCMonth Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + + ElseIf intCDay > intDUE2 Or intCDay < intDUE1 Then +' ElseIf intCDay > intDUE1 And intCDay > intDUE2 Then + + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + End If '***May Be An Extra End If + Else + If intCDay > intDUE1 Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If +' intCDay = Field2Integer(moRSProj!inv_due) + intCDay = intDUE1 + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !non_tax_amt = Field2Str2(oRSE!l_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) + !sales_code = Field2Str(oRSE!l_code) + If IsNull(moRSProj!TAXCODE) Or moRSProj!TAXCODE = "" Then + !TAXCODE = "AZ" + Else + !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + !price = Field2Str2(oRSE!l_bill) + !amount = Field2Str2(oRSE!l_bill) + !invoice_no = mstrINV + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + gstrMODULE = "After Main Lath Information " + If Not moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "L" + !ship_date = Field2Str(moRS!lorder) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" + End If + intCMonth = Month(moRS!lorder) + intCDay = Day(moRS!lorder) + intCYear = Year(moRS!lorder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_L = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!lorder) + !disc_due_date = DateAdd("d", 3, moRS!lorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSP.MoveNext + End If + oRSO.MoveNext + Loop + End If + + gstrMODULE = "After Option Information " + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + gstrMODULE = "After Open for Totals Setup " + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + gstrMODULE = "After Totals Setup " + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form LotInfo - Module PrintLathInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintCompleteInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSC.EOF Then + If Field2Str(oRSC!Address2) = "" Then + strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + strADD3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + strADD4 = "" + Else + strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + End If + + dblINVTOTAL = 0 + dblRETENTION = 0 + If oRS.EOF Then + End If + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSS!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!s_bill) + !sales_code = Field2Str(oRSS!s_code) + If IsNull(moRSProj!TAXCODE) Or moRSProj!TAXCODE = "" Then + !TAXCODE = "AZ" + Else + !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(oRSS!s_bill) + !amount = Field2Str2(oRSS!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "C" + !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" + End If + intCMonth = Month(moRS!SORDER) + intCDay = Day(moRS!SORDER) + intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!SORDER) + !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) + + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Val(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + !c_add3 = strADD3 + !c_add4 = strADD4 + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + oRSO.MoveNext + End If + Loop + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintCompleteInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStuccoInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "B" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!TAXCODE) Or moRSProj!TAXCODE = "" Then + !TAXCODE = "AZ" + Else + !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' moRS!PRNT_S = Field2Str(strCDate) +' moRS.Update +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + End If + oRSO.MoveNext + Loop + End If + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStuccoInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintSynInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim oRSE As Recordset, strTEST As String +Dim strSQLE As String +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "#" ' ORDER BY effdate DESC" + Set oRSE = New Recordset + oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly + +' If oRSE.EOF Then +' MsgBox "No Billing Has Been Setup. Invoice Will Not Print", vbOKOnly, "Fix Billing" +' Exit Sub +' End If + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "E" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown +' !ship_date = Field2Str(moRS!SORDER) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "E" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "E" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "E" + strLEN = Len(strTEST2) + + If strLEN > 7 Then + strMSG = "The Invoice Number Is Longer Than 7 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "E" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" + End If +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !non_tax_amt = Field2Str2(oRSE!s_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) + !sales_code = Field2Str(oRSE!s_code) +' If IsNull(moRSProj!taxcode) Then +' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC +' Else +' !taxcode = "AZ" +' End If + If IsNull(moRSProj!TAXCODE) Or moRSProj!TAXCODE = "" Then + !TAXCODE = "AZ" + Else + !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + If chkSynthetic Then + !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + Else + !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) + End If + !price = Field2Str2(oRSE!s_bill) + !amount = Field2Str2(oRSE!s_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + If moRSProj!opt Then + strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID + Set oRSO = New Recordset + oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSO.EOF + strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" +' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + With oRS + .AddNew + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "S" + !ship_date = Field2Str(moRS!forder) +' !ship_date = Field2Str(moRS!SORDER) + !customer_no = Field2Str(moRSProj!ar) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "E" + Else + !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "E" + End If + intCMonth = Month(moRS!forder) + intCDay = Day(moRS!forder) + intCYear = Year(moRS!forder) +' intCMonth = Month(moRS!SORDER) +' intCDay = Day(moRS!SORDER) +' intCYear = Year(moRS!SORDER) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!sorder) + !disc_due_date = DateAdd("d", 3, moRS!forder) +' !disc_due_date = DateAdd("d", 3, moRS!SORDER) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + intDay = Field2Integer(moRSProj!DueDate) +' If intDay = 0 Then +' intDay = 1 +' End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !non_tax_amt = Field2Str2(oRSP!Amt) + dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) + !sales_code = Field2Str(oRSP!b_code) + !Description = Field2Str(oRSP!Desc) + !Quantity = 1 + !price = Field2Str2(oRSP!Amt) + !amount = Field2Str2(oRSP!Amt) + !header = vbUnchecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + End With + End If + oRSO.MoveNext + Loop + End If + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'E' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'E' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintSynInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintStoneInv() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String + + On Error GoTo Error_EH + + gintCOPY = 1 + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" + End If +' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + Set oRSC = New Recordset + oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + dblINVTOTAL = 0 + dblRETENTION = 0 + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = Field2Str(moRS!lot_no) + !address = Field2Str(moRS!address) + !inv_type = "V" + !customer_no = Field2Str(moRSProj!ar) + !ship_date = Field2Str(moRS!VOrder) + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) + If IsNumeric(moRS!lot_no) Then + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" +' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" +' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + Else + strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" + strLEN = Len(strTEST2) + + If strLEN > 11 Then + strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf + strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf + strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf + strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf + strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf + strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf + strMSG = strMSG & "Talk To The Billing Department If You Have Questions" + strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) + If strTEST2 = "" Then + Exit Sub + End If + + End If + !invoice_no = strTEST2 +' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" +' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" + mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" +' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" + End If + intCMonth = Month(moRS!VOrder) + intCDay = Day(moRS!VOrder) + intCYear = Year(moRS!VOrder) + If intCDay > moRSProj!inv_due Then + intCMonth = intCMonth + 1 + If intCMonth > 12 Then + intCMonth = intCMonth - 12 + intCYear = intCYear + 1 + End If + End If + intCDay = Field2Integer(moRSProj!inv_due) + If intCDay = 0 Then + Select Case intCMonth + Case 2 + intCDay = 28 + Case 1, 3, 5, 7, 8, 10, 12 + intCDay = 31 + Case 4, 6, 9, 11 + intCDay = 30 + End Select + End If + + strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear + !invoice_date = Field2Str(strCDate) +' !invoice_date = DateAdd("d", 3, moRS!vorder) + !job_number = Field2Str(moRS!jobcost) + intYear = Year(!invoice_date) + intMonth = Month(!invoice_date) + 1 + intDay = Field2Integer(moRSProj!DueDate) + If intMonth > 12 Then + intMonth = intMonth - 12 + intYear = intYear + 1 + End If + Select Case intMonth + Case 2 + If intDay = 0 Then + intDay = 28 + End If + If intDay > 28 Then + intDay = 28 + End If + Case 1, 3, 5, 7, 8, 10, 12 + If intDay = 0 Then + intDay = 31 + End If + If intDay > 31 Then + intDay = 31 + End If + + Case 4, 6, 9, 11 + If intDay = 0 Then + intDay = 30 + End If + If intDay > 30 Then + intDay = 30 + End If + End Select + + strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear + !inv_due_date = Field2Str(strDate) + !disc_due_date = DateAdd("d", 3, moRS!VOrder) + !non_tax_amt = Field2Str2(oRSS!st_bill) + dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) + !sales_code = "STONE" + If IsNull(moRSProj!TAXCODE) Or moRSProj!TAXCODE = "" Then + !TAXCODE = "AZ" + Else + !TAXCODE = Field2Str(moRSProj!TAXCODE) + End If + !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSS!Mod_Elv) + !price = Field2Str2(moRS!st_bill) + !amount = Field2Str2(moRS!st_bill) + !header = vbChecked + If Not oRSC.EOF Then + !c_add1 = Field2Str(oRSC!Name) + !c_add2 = Field2Str(oRSC!Address1) + If Field2Str(oRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + Else + !c_add3 = Field2Str(oRSC!Address2) + End If + If Field2Str(oRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !po_num = gstrPONUM + .Update + mlngINVID = mlngINVID + 1 + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + End With + + If Field2Integer(moRSProj!retention) > 0 Then + dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") + Else + dblRETENTION = 0 + End If + + If moRSProj!cocode = 0 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!non_tax_amt = dblINVTOTAL + oRS!retention_amt = dblRETENTION + oRS.Update + oRS.MoveNext + Loop + + If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" + ElseIf moRSProj!cocode = 1 Then + strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoiceM.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub JCSetup() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSProj!cocode = 0 Then + strSQL = "SELECT * FROM tblJCTrans" + ElseIf moRSProj!cocode = 1 Then + strSQL = "SELECT * FROM tblJCTransM" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If IsNull(moRSProj!ar) Then + MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" + Exit Sub + End If + With oRS + .AddNew + !Lot_ID = gintLOTID + !job_number = Field2Str(moRS!jobcost) + !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no + !address = Field2Str(moRS!address) + !customer_no = Field2Str(moRSProj!ar) + !retention_pct = Field2Str2(moRSProj!retention) + !setup_date = Date + !status_date = Date + .Update + End With + MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module JCSetup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POInvoice() +Dim strSELECT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSELECT = "{tblPOrder.PONum} = " & lstPO.ItemData(lstPO.ListIndex) + If moRSProj!cocode = 0 Then + crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" + ElseIf moRSProj!cocode = 1 Then + crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" + End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module POInvoice" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ElevLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!Folder = oRS!Folder + oRSS!FileName = oRS!FileName + oRSS!Primary = oRS!Primary + oRSS.Update + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo - Module ElevLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frx new file mode 100644 index 0000000..589ee4d Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfoE.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frm new file mode 100644 index 0000000..6f66b2e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frm @@ -0,0 +1,2644 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Begin VB.Form frmLotInfo + BorderStyle = 1 'Fixed Single + Caption = "Lot Information" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 225 + ClientWidth = 11910 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + Begin VB.TextBox txtOneKote + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 130 + Top = 420 + Width = 2475 + End + Begin VB.TextBox txtFinish + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 128 + Top = 60 + Width = 2475 + End + Begin VB.TextBox txtNotes + Height = 1275 + Left = 3660 + MultiLine = -1 'True + TabIndex = 77 + Top = 1200 + Width = 4875 + End + Begin VB.TextBox txtLaborAdj + Height = 315 + Left = 7920 + TabIndex = 76 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtFin2 + Height = 315 + Left = 5760 + TabIndex = 75 + Top = 420 + Width = 600 + End + Begin VB.TextBox txtLODate + Height = 315 + Left = 7200 + TabIndex = 74 + Top = 780 + Width = 1335 + End + Begin VB.TextBox txtFoamAdj + Height = 315 + Left = 7920 + TabIndex = 73 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtTtlYdge + Height = 315 + Left = 1440 + TabIndex = 72 + Top = 1860 + Width = 795 + End + Begin VB.TextBox txtCMUYdge + Height = 315 + Left = 1440 + TabIndex = 71 + Top = 2220 + Width = 795 + End + Begin VB.TextBox txt28Foam + Height = 315 + Left = 5760 + TabIndex = 70 + Top = 60 + Width = 600 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 1440 + TabIndex = 69 + Top = 60 + Width = 2895 + End + Begin VB.TextBox txtLotNo + Height = 315 + Left = 1440 + TabIndex = 68 + Top = 1500 + Width = 1095 + End + Begin VB.TextBox txtModel + Height = 315 + Left = 1440 + TabIndex = 6 + Top = 1140 + Width = 1095 + End + Begin VB.TextBox txtOwner + Height = 315 + Left = 1440 + TabIndex = 5 + Top = 780 + Width = 2895 + End + Begin VB.TextBox txtAddress + Height = 315 + Left = 1440 + TabIndex = 3 + Top = 420 + Width = 2895 + End + Begin TabDlg.SSTab SSTLotInfo + Height = 5655 + Left = 120 + TabIndex = 8 + Top = 2760 + Width = 11595 + _ExtentX = 20452 + _ExtentY = 9975 + _Version = 393216 + Tabs = 7 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + TabCaption(0) = "General Information" + TabPicture(0) = "frmLotInfo.frx":0000 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "cmdSaveLotInfo" + Tab(0).Control(1)= "cmdOrders" + Tab(0).Control(2)= "cmdExit" + Tab(0).Control(3)= "cmdCalc" + Tab(0).ControlCount= 4 + TabCaption(1) = "Super's Orders" + TabPicture(1) = "frmLotInfo.frx":001C + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblTake138" + Tab(1).Control(1)= "lblSuperBB" + Tab(1).Control(2)= "linSO" + Tab(1).Control(3)= "lblSuper12" + Tab(1).Control(4)= "lblSuper783" + Tab(1).Control(5)= "lblSuper78" + Tab(1).Control(6)= "lblSuper38" + Tab(1).Control(7)= "lblSuper138" + Tab(1).Control(8)= "lblSuperML" + Tab(1).Control(9)= "lblSuperRL" + Tab(1).Control(10)= "lblSuperDW" + Tab(1).Control(11)= "lblSuperSP" + Tab(1).Control(12)= "lblSupHelp" + Tab(1).Control(13)= "lblPreOrder" + Tab(1).Control(14)= "txtTake138" + Tab(1).Control(15)= "txtSuperBB" + Tab(1).Control(16)= "txtSuper12" + Tab(1).Control(17)= "txtSuper783" + Tab(1).Control(18)= "txtSuper78" + Tab(1).Control(19)= "txtSuper38" + Tab(1).Control(20)= "txtSuper1383" + Tab(1).Control(21)= "txtSuperRL" + Tab(1).Control(22)= "txtSuperML" + Tab(1).Control(23)= "txtSuperDW" + Tab(1).Control(24)= "txtSuperSP" + Tab(1).Control(25)= "lstPreOrder" + Tab(1).ControlCount= 26 + TabCaption(2) = "Materials" + TabPicture(2) = "frmLotInfo.frx":0038 + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblLMDesc" + Tab(2).Control(1)= "lblLMInvNo" + Tab(2).Control(2)= "lblQty" + Tab(2).Control(3)= "lblLMDFlag" + Tab(2).Control(4)= "lblLMType" + Tab(2).Control(5)= "lblLMetal" + Tab(2).Control(6)= "lblLMLength" + Tab(2).Control(7)= "lblOrderBalance" + Tab(2).Control(8)= "cmdAddMatrl" + Tab(2).Control(9)= "cmdSaveMatrl" + Tab(2).Control(10)= "cmdDelMatrl" + Tab(2).Control(11)= "lstLMaterial" + Tab(2).Control(12)= "txtLMDesc" + Tab(2).Control(13)= "txtLMInvNo" + Tab(2).Control(14)= "txtLMQty" + Tab(2).Control(15)= "txtLMLength" + Tab(2).Control(16)= "cboLMDFlag" + Tab(2).Control(17)= "cboLMType" + Tab(2).Control(18)= "cboLMMetal" + Tab(2).Control(19)= "txtLMBalance" + Tab(2).ControlCount= 20 + TabCaption(3) = "Options" + TabPicture(3) = "frmLotInfo.frx":0054 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblPOptions" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblLOptions" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblLODesc" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblLOYdge" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLOFin2" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblLOFAdj" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblLOTexture" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblLOMDesc" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblLOMInvNo" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblLOMQty" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblLOMDFlag" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLOMType" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblLOMetal" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblLOMLength" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lstPOptions" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "lstOptMatrl" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "cmdOptAdd" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "cmdOptDel" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lstLOptions" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "txtLODesc" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "txtLOYdge" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "txtLOFin2" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "txtLOFoam" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "txtLOTexture" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "txtLOMDesc" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "txtLOMInvNo" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "txtLOMQty" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "txtLOMLength" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "cboLOMDFlag" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "cboLOMType" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "cboLOMetal" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).ControlCount= 31 + TabCaption(4) = "Lath Orders" + TabPicture(4) = "frmLotInfo.frx":0070 + Tab(4).ControlEnabled= 0 'False + Tab(4).Control(0)= "lstLath" + Tab(4).Control(1)= "lstYard" + Tab(4).Control(2)= "lblLathOrd" + Tab(4).Control(3)= "lblYardOrd" + Tab(4).ControlCount= 4 + TabCaption(5) = "Stucco Orders" + TabPicture(5) = "frmLotInfo.frx":008C + Tab(5).ControlEnabled= 0 'False + Tab(5).Control(0)= "lblScrOrd" + Tab(5).Control(1)= "lblBrnOrd" + Tab(5).Control(2)= "lblTexOrd" + Tab(5).Control(3)= "lstScratch" + Tab(5).Control(4)= "lstBrown" + Tab(5).Control(5)= "lstTexture" + Tab(5).ControlCount= 6 + TabCaption(6) = "Purchase Orders" + TabPicture(6) = "frmLotInfo.frx":00A8 + Tab(6).ControlEnabled= 0 'False + Tab(6).Control(0)= "cmsDelPO" + Tab(6).Control(1)= "cmdPOEdit" + Tab(6).Control(2)= "cmdPONew" + Tab(6).Control(3)= "txtIssueTo" + Tab(6).Control(4)= "txtPONum" + Tab(6).Control(5)= "txtPONotes" + Tab(6).Control(6)= "lstPOMaterials" + Tab(6).Control(7)= "lstPO" + Tab(6).Control(8)= "lblPO" + Tab(6).Control(9)= "lblPONotes" + Tab(6).Control(10)= "lblPOMaterials" + Tab(6).Control(11)= "lblIssueTo" + Tab(6).Control(12)= "lblPONum" + Tab(6).ControlCount= 13 + Begin VB.CommandButton cmdSaveLotInfo + Caption = "Save Lot Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73080 + TabIndex = 133 + Top = 1920 + Width = 1335 + End + Begin VB.CommandButton cmdOrders + Caption = "Setup Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -73080 + TabIndex = 132 + Top = 1080 + Width = 1335 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 127 + Top = 1920 + Width = 1335 + End + Begin VB.CommandButton cmdCalc + Caption = "Calculate Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = -74520 + TabIndex = 126 + Top = 1080 + Width = 1335 + End + Begin VB.ComboBox cboLOMetal + Height = 315 + Left = 6900 + TabIndex = 125 + Text = "cboLOMetal" + Top = 4815 + Width = 1155 + End + Begin VB.ComboBox cboLOMType + Height = 315 + Left = 6900 + TabIndex = 124 + Text = "cboLOMType" + Top = 4485 + Width = 1155 + End + Begin VB.ComboBox cboLOMDFlag + Height = 315 + Left = 6900 + TabIndex = 123 + Text = "cboLOMDFlag" + Top = 4140 + Width = 1155 + End + Begin VB.TextBox txtLOMLength + Alignment = 1 'Right Justify + Height = 315 + Left = 6900 + TabIndex = 122 + Top = 5160 + Width = 915 + End + Begin VB.TextBox txtLOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = 6900 + TabIndex = 121 + Top = 3800 + Width = 915 + End + Begin VB.TextBox txtLOMInvNo + Height = 315 + Left = 6900 + TabIndex = 120 + Top = 3460 + Width = 915 + End + Begin VB.TextBox txtLOMDesc + Height = 315 + Left = 6900 + TabIndex = 119 + Top = 3120 + Width = 4155 + End + Begin VB.TextBox txtLOTexture + Height = 315 + Left = 7800 + TabIndex = 111 + Top = 2700 + Width = 1755 + End + Begin VB.TextBox txtLOFoam + Alignment = 1 'Right Justify + Height = 315 + Left = 7800 + TabIndex = 110 + Top = 2280 + Width = 915 + End + Begin VB.TextBox txtLOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 7800 + TabIndex = 109 + Top = 1860 + Width = 915 + End + Begin VB.TextBox txtLOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = 7800 + TabIndex = 108 + Top = 1440 + Width = 915 + End + Begin VB.TextBox txtLODesc + Height = 315 + Left = 7800 + TabIndex = 107 + Top = 1020 + Width = 2835 + End + Begin VB.ListBox lstLOptions + Height = 2010 + Left = 3360 + TabIndex = 100 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtLMBalance + Enabled = 0 'False + Height = 315 + Left = -68100 + TabIndex = 98 + Top = 3600 + Width = 915 + End + Begin VB.ComboBox cboLMMetal + Height = 315 + ItemData = "frmLotInfo.frx":00C4 + Left = -68100 + List = "frmLotInfo.frx":00CE + TabIndex = 97 + Top = 2790 + Width = 1215 + End + Begin VB.ComboBox cboLMType + Height = 315 + ItemData = "frmLotInfo.frx":00DF + Left = -68100 + List = "frmLotInfo.frx":00F5 + TabIndex = 96 + Top = 2388 + Width = 1215 + End + Begin VB.ComboBox cboLMDFlag + Height = 315 + ItemData = "frmLotInfo.frx":0127 + Left = -68100 + List = "frmLotInfo.frx":0131 + TabIndex = 95 + Top = 1986 + Width = 1215 + End + Begin VB.TextBox txtLMLength + Height = 315 + Left = -68100 + TabIndex = 93 + Top = 3192 + Width = 915 + End + Begin VB.TextBox txtLMQty + Height = 315 + Left = -68100 + TabIndex = 92 + Top = 1584 + Width = 915 + End + Begin VB.TextBox txtLMInvNo + Height = 315 + Left = -68100 + TabIndex = 91 + Top = 1182 + Width = 915 + End + Begin VB.TextBox txtLMDesc + Height = 315 + Left = -68100 + TabIndex = 90 + Top = 780 + Width = 4275 + End + Begin VB.ListBox lstLMaterial + Height = 4740 + Left = -74820 + TabIndex = 82 + Top = 780 + Width = 5535 + End + Begin VB.ListBox lstPreOrder + Height = 3180 + Left = -69240 + TabIndex = 81 + Top = 2160 + Width = 5445 + End + Begin VB.CommandButton cmdDelMatrl + Caption = "Delete Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65040 + TabIndex = 60 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdSaveMatrl + Caption = "Save Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67080 + TabIndex = 59 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdAddMatrl + Caption = "Add Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 58 + Top = 5040 + Width = 1335 + End + Begin VB.CommandButton cmdOptDel + Caption = "Delete Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 4320 + TabIndex = 57 + Top = 4920 + Width = 1392 + End + Begin VB.CommandButton cmdOptAdd + Caption = "Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 240 + TabIndex = 56 + Top = 4920 + Width = 1395 + End + Begin VB.CommandButton cmsDelPO + Caption = "Delete PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = -68280 + TabIndex = 49 + Top = 1260 + Width = 2175 + End + Begin VB.CommandButton cmdPOEdit + Caption = "Edit PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = -67140 + TabIndex = 48 + Top = 720 + Width = 1035 + End + Begin VB.CommandButton cmdPONew + Caption = "New PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = -68280 + TabIndex = 47 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtIssueTo + Height = 315 + Left = -70680 + TabIndex = 46 + Top = 2040 + Width = 3735 + End + Begin VB.TextBox txtPONum + Height = 315 + Left = -70680 + TabIndex = 45 + Top = 1560 + Width = 1335 + End + Begin VB.TextBox txtPONotes + Height = 1215 + Left = -71760 + TabIndex = 42 + Top = 2700 + Width = 5595 + End + Begin VB.ListBox lstPOMaterials + Height = 1230 + Left = -71760 + TabIndex = 41 + Top = 4260 + Width = 5535 + End + Begin VB.ListBox lstPO + Height = 4350 + Left = -74760 + TabIndex = 38 + Top = 1140 + Width = 2800 + End + Begin VB.ListBox lstTexture + Height = 4350 + Left = -67320 + TabIndex = 37 + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstBrown + Height = 4350 + Left = -71100 + TabIndex = 36 + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstScratch + Height = 4350 + Left = -74880 + TabIndex = 35 + Top = 1140 + Width = 3660 + End + Begin VB.ListBox lstLath + Height = 4155 + Left = -69180 + TabIndex = 34 + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstYard + Height = 4155 + Left = -74820 + Sorted = -1 'True + TabIndex = 33 + Top = 1140 + Width = 5445 + End + Begin VB.ListBox lstOptMatrl + Height = 1815 + ItemData = "frmLotInfo.frx":0145 + Left = 240 + List = "frmLotInfo.frx":014C + Sorted = -1 'True + TabIndex = 32 + Top = 3060 + Width = 5475 + End + Begin VB.ListBox lstPOptions + Height = 2010 + ItemData = "frmLotInfo.frx":015D + Left = 240 + List = "frmLotInfo.frx":0164 + TabIndex = 31 + Top = 1020 + Width = 3095 + End + Begin VB.TextBox txtSuperSP + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + TabIndex = 30 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuperDW + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + TabIndex = 29 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuperML + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + TabIndex = 28 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuperRL + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + TabIndex = 27 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuper1383 + Alignment = 1 'Right Justify + Height = 315 + Left = -70620 + TabIndex = 26 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtSuper38 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + TabIndex = 25 + Top = 4740 + Width = 795 + End + Begin VB.TextBox txtSuper78 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + TabIndex = 24 + Top = 4140 + Width = 795 + End + Begin VB.TextBox txtSuper783 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + TabIndex = 23 + Top = 3540 + Width = 795 + End + Begin VB.TextBox txtSuper12 + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + TabIndex = 22 + Top = 2940 + Width = 795 + End + Begin VB.TextBox txtSuperBB + Alignment = 1 'Right Justify + Height = 315 + Left = -73080 + TabIndex = 21 + Top = 2340 + Width = 795 + End + Begin VB.TextBox txtTake138 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = -73080 + TabIndex = 10 + Top = 1680 + Width = 795 + End + Begin VB.Label lblLOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = 5880 + TabIndex = 118 + Top = 5220 + Width = 975 + End + Begin VB.Label lblLOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = 6075 + TabIndex = 117 + Top = 4870 + Width = 780 + End + Begin VB.Label lblLOMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 5850 + TabIndex = 116 + Top = 4520 + Width = 1005 + End + Begin VB.Label lblLOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = 5895 + TabIndex = 115 + Top = 4170 + Width = 960 + End + Begin VB.Label lblLOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quanitity:" + Height = 195 + Left = 6195 + TabIndex = 114 + Top = 3820 + Width = 660 + End + Begin VB.Label lblLOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = 5895 + TabIndex = 113 + Top = 3470 + Width = 960 + End + Begin VB.Label lblLOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 6015 + TabIndex = 112 + Top = 3120 + Width = 840 + End + Begin VB.Label lblLOTexture + Caption = "Option Texture:" + Height = 255 + Left = 6585 + TabIndex = 106 + Top = 2760 + Width = 1155 + End + Begin VB.Label lblLOFAdj + AutoSize = -1 'True + Caption = "Option Foam Adj:" + Height = 195 + Left = 6525 + TabIndex = 105 + Top = 2340 + Width = 1215 + End + Begin VB.Label lblLOFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 6735 + TabIndex = 104 + Top = 1920 + Width = 1005 + End + Begin VB.Label lblLOYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Yardage:" + Height = 195 + Left = 6585 + TabIndex = 103 + Top = 1500 + Width = 1155 + End + Begin VB.Label lblLODesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 6900 + TabIndex = 102 + Top = 1080 + Width = 840 + End + Begin VB.Label lblLOptions + AutoSize = -1 'True + Caption = "Lot Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3420 + TabIndex = 101 + Top = 720 + Width = 990 + End + Begin VB.Label lblPOptions + AutoSize = -1 'True + Caption = "Plan Options" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 300 + TabIndex = 99 + Top = 720 + Width = 1095 + End + Begin VB.Label lblOrderBalance + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Balance:" + Height = 195 + Left = -69210 + TabIndex = 94 + Top = 3660 + Width = 1065 + End + Begin VB.Label lblLMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 89 + Top = 3252 + Width = 975 + End + Begin VB.Label lblLMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 88 + Top = 2850 + Width = 780 + End + Begin VB.Label lblLMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 87 + Top = 2448 + Width = 1005 + End + Begin VB.Label lblLMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69105 + TabIndex = 86 + Top = 2046 + Width = 960 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 85 + Top = 1644 + Width = 630 + End + Begin VB.Label lblLMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 84 + Top = 1242 + Width = 960 + End + Begin VB.Label lblLMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 83 + Top = 840 + Width = 840 + End + Begin VB.Label lblPreOrder + Alignment = 2 'Center + Caption = "Pre Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -69180 + TabIndex = 80 + Top = 1860 + Width = 3195 + End + Begin VB.Label lblSupHelp + Caption = $"frmLotInfo.frx":0175 + Height = 555 + Left = -74760 + TabIndex = 79 + Top = 900 + Width = 5115 + End + Begin VB.Label lblLathOrd + AutoSize = -1 'True + Caption = "Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -69120 + TabIndex = 55 + Top = 900 + Width = 915 + End + Begin VB.Label lblYardOrd + AutoSize = -1 'True + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74700 + TabIndex = 54 + Top = 900 + Width = 930 + End + Begin VB.Label lblTexOrd + AutoSize = -1 'True + Caption = "Texture Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67260 + TabIndex = 53 + Top = 840 + Width = 1185 + End + Begin VB.Label lblBrnOrd + AutoSize = -1 'True + Caption = "Brown Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71040 + TabIndex = 52 + Top = 840 + Width = 1065 + End + Begin VB.Label lblScrOrd + AutoSize = -1 'True + Caption = "Scratch Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -74820 + TabIndex = 51 + Top = 840 + Width = 1200 + End + Begin VB.Label lblPO + Caption = "Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -74700 + TabIndex = 50 + Top = 840 + Width = 2715 + End + Begin VB.Label lblPONotes + Caption = "P.O. Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = -71640 + TabIndex = 44 + Top = 2460 + Width = 1575 + End + Begin VB.Label lblPOMaterials + AutoSize = -1 'True + Caption = "P.O. Materials:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -71640 + TabIndex = 43 + Top = 4020 + Width = 1275 + End + Begin VB.Label lblIssueTo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Issued To:" + Height = 195 + Left = -71520 + TabIndex = 40 + Top = 2100 + Width = 750 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O. Number:" + Height = 195 + Left = -71760 + TabIndex = 39 + Top = 1560 + Width = 960 + End + Begin VB.Label lblSuperSP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sheer Panel:" + Height = 195 + Left = -71700 + TabIndex = 20 + Top = 4800 + Width = 915 + End + Begin VB.Label lblSuperDW + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Drywall:" + Height = 195 + Left = -71340 + TabIndex = 19 + Top = 4200 + Width = 555 + End + Begin VB.Label lblSuperRL + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rib Lath:" + Height = 195 + Left = -71460 + TabIndex = 18 + Top = 3000 + Width = 645 + End + Begin VB.Label lblSuperML + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Lath:" + Height = 195 + Left = -71580 + TabIndex = 17 + Top = 3600 + Width = 795 + End + Begin VB.Label lblSuper138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 3/8 X 3 JMB:" + Height = 195 + Left = -71880 + TabIndex = 16 + Top = 2400 + Width = 1080 + End + Begin VB.Label lblSuper38 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "3/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 15 + Top = 4800 + Width = 660 + End + Begin VB.Label lblSuper78 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8 JMB:" + Height = 195 + Left = -73965 + TabIndex = 14 + Top = 4200 + Width = 660 + End + Begin VB.Label lblSuper783 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "7/8X3 JMB:" + Height = 195 + Left = -74160 + TabIndex = 13 + Top = 3600 + Width = 855 + End + Begin VB.Label lblSuper12 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam:" + Height = 195 + Left = -74040 + TabIndex = 12 + Top = 3000 + Width = 735 + End + Begin VB.Line linSO + BorderWidth = 2 + X1 = -75000 + X2 = -69660 + Y1 = 2160 + Y2 = 2160 + End + Begin VB.Label lblSuperBB + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Blackboard:" + Height = 195 + Left = -74160 + TabIndex = 11 + Top = 2400 + Width = 855 + End + Begin VB.Label lblTake138 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Takeoff 1 3/8 J-Metal:" + Height = 195 + Left = -74895 + TabIndex = 9 + Top = 1740 + Width = 1590 + End + End + Begin VB.Label lblLathPrint + AutoSize = -1 'True + Caption = "Lath Order Printed" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 8940 + TabIndex = 131 + Top = 2040 + Visible = 0 'False + Width = 2580 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish:" + Height = 195 + Left = 8760 + TabIndex = 129 + Top = 120 + Width = 450 + End + Begin VB.Label lblNote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2925 + TabIndex = 78 + Top = 1260 + Width = 690 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 285 + TabIndex = 67 + Top = 2280 + Width = 1050 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Yardage:" + Height = 195 + Left = 6420 + TabIndex = 66 + Top = 460 + Width = 1410 + End + Begin VB.Label lblTtlYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yardage:" + Height = 195 + Left = 285 + TabIndex = 65 + Top = 1920 + Width = 1050 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Yardage:" + Height = 195 + Left = 6480 + TabIndex = 64 + Top = 120 + Width = 1395 + End + Begin VB.Label lblLathOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Order Date:" + Height = 195 + Left = 5940 + TabIndex = 63 + Top = 800 + Width = 1185 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = 4710 + TabIndex = 62 + Top = 460 + Width = 1005 + End + Begin VB.Label lbl28foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam %tge:" + Height = 195 + Left = 4560 + TabIndex = 61 + Top = 120 + Width = 1155 + End + Begin VB.Line linLotInfo + BorderWidth = 2 + X1 = 0 + X2 = 11940 + Y1 = 2640 + Y2 = 2640 + End + Begin VB.Label lblModel + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 120 + TabIndex = 7 + Top = 1200 + Width = 1215 + End + Begin VB.Label lblOwner + Alignment = 1 'Right Justify + Caption = "Owner:" + Height = 195 + Left = 660 + TabIndex = 4 + Top = 840 + Width = 675 + End + Begin VB.Label lblAddress + Alignment = 1 'Right Justify + Caption = "Address:" + Height = 195 + Left = 540 + TabIndex = 2 + Top = 480 + Width = 795 + End + Begin VB.Label lblLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 1065 + TabIndex = 1 + Top = 1560 + Width = 270 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + Caption = "SubDivision:" + Height = 195 + Left = 360 + TabIndex = 0 + Top = 120 + Width = 975 + End +End +Attribute VB_Name = "frmLotInfo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset +Dim moRSPOpt As Recordset +Dim moRSLOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPlan As Recordset + +Dim mboolShow As Boolean +Dim mboolAdding As Boolean +Dim mstrType As String +Dim mintTake138 As Integer + +Private Sub cboLMDFlag_Change() + If cboLMDFlag.Text = "Supplier" Then + moRSMat!D_Flag = "S" + Else + moRSMat!D_Flag = "Y" + End If + +End Sub + +Private Sub cboLMDFlag_Click() + If cboLMDFlag.Text = "Supplier" Then + moRSMat!D_Flag = "S" + Else + moRSMat!D_Flag = "Y" + End If +End Sub + +Private Sub cboLMMetal_Click() + If cboLMMetal.Text = "Metal" Then + moRSMat!Calc_Flag = "M" + txtLMLength.Text = 10 + moRSMat!Calc_Amt = 10 + Else + moRSMat!Calc_Flag = "" + txtLMLength.Text = 0 + moRSMat!Calc_Amt = 0 + End If + +End Sub + +Private Sub cboLMType_Click() + If cboLMType.Text = "Lath" Then + moRSMat!M_Type = "L" + ElseIf cboLMType.Text = "Scratch" Then + moRSMat!M_Type = "S" + ElseIf cboLMType.Text = "Brown" Then + moRSMat!M_Type = "B" + ElseIf cboLMType.Text = "Texture" Then + moRSMat!M_Type = "T" + ElseIf cboLMType.Text = "PreOrder" Then + moRSMat!M_Type = "P" + End If +End Sub + +Private Sub cmdOptAdd_Click() + If lstPOptions.ListIndex <> -1 Then + moRSLOpt.AddNew + moRSLOpt!lot_id = gintLOTID + moRSLOpt!opt_id = lstPOptions.ItemData(lstPOptions.ListIndex) + moRSLOpt.Update + Call LOptLoad + End If +End Sub + +Private Sub cmdOptDel_Click() + moRSLOpt.Delete + Call LOptLoad +End Sub + +Private Sub cmdSaveLotInfo_Click() + Call OptMatSave + Call OptSave + Call MatSave + Call FieldsSave +End Sub + +Private Sub cmdSaveMatrl_Click() + Call MatSave + Call MatLoad +End Sub + +Private Sub cmdOrders_Click() + Call OrderLoad +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMat = New Recordset + Set moRSPOpt = New Recordset + Set moRSLOpt = New Recordset + Set moRSOptMat = New Recordset + Set moRSPlan = New Recordset + + Call ProjLoad + If FormFind() Then + Call PlanFind + Call FormShow + Call MatLoad + Call POptLoad + Call LOptLoad + Call OptMatLoad + Call OrderLoad + End If + + +End Sub +Private Sub lstMod_Elv_Click() + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + Call PlanFind + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + + End If + End If +End Sub +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly +' Do Until oRS.EOF +' cboProject.AddItem oRS("Proj_desc") +' cboProject.ItemData(cboProject.NewIndex) = oRS("Proj_id") +' +' oRS.MoveNext +' Loop +' moRSProj.Close +' cboProject.ListIndex = 40 + +End Sub +Private Sub ListLoad() + Dim oRS As Recordset + Dim strSQL As String + +' gintPROJID = cboProject.ItemData(cboProject.ListIndex) + +' strSQL = "SELECT * from tblLotInfo WHERE Lot_ID = " & gintTOID +' +' Set oRS = New Recordset + +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstMod_Elv.Clear + +' Do Until oRS.EOF +' With lstMod_Elv +' .AddItem Field2Str(oRS!pln_elv) +' .ItemData(.NewIndex) = oRS("toid") +' End With + +' oRS.MoveNext +' Loop +' oRS.Close + +' If lstMod_Elv.ListCount Then +' lstMod_Elv.ListIndex = 0 +' End If + + +End Sub + +Private Sub FormShow() + mboolShow = True + gintLOTID = moRS!lot_id + txtProject = Trim$(moRSProj!proj_Code) & " " & moRSProj!proj_desc + With moRS + txtTtlYdge = Field2Str(!SQ_Yd) + txtAddress = Field2Str(!address) + txtOwner = Field2Str(!owner) + txtModel = Field2Str(!model) + txtCMUYdge = Field2Str(!CMU) + txtNotes = Field2Str(!NOTES) + txtFoamAdj = Field2Str(!f_adj) + txtLaborAdj = Field2Str(!l_adj) + txtFin2 = Field2Str(!FIN2) + txtLotNo = Field2Str(!lot_no) + txt28Foam = Field2Str(!FOAM) + txtLODate = Field2Str(!LORDER) + txtSuperBB = Field2Str(!SUP_BB) + txtSuper12 = Field2Str(!SUP_FD12) + txtSuper783 = Field2Str(!SUP_783) + txtSuper78 = Field2Str(!SUP_78) + txtSuper38 = Field2Str(!SUP_38) + txtSuper1383 = Field2Str(!SUP_138) + txtSuperRL = Field2Str(!SUP_RL) + txtSuperML = Field2Str(!SUP_ML) + txtSuperDW = Field2Str(!SUP_DW) + txtSuperSP = Field2Str(!SUP_SP) + + If !Texture = "SK" Then + txtFinish.Text = "SKIP TROWEL" + ElseIf !Texture = "SA" Then + txtFinish.Text = "Sand" + ElseIf !Texture = "S2" Then + txtFinish.Text = "Sand" + ElseIf !Texture = "S3" Then + txtFinish.Text = "Sand" + ElseIf !Texture = "DA" Then + txtFinish.Text = "Dash" + ElseIf !Texture = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + ElseIf !Texture = "SM" Then + txtFinish.Text = "Smooth" + ElseIf !Texture = "QU" Then + txtFinish.Text = "Quernavaca" + ElseIf !Texture = "MN" Then + txtFinish.Text = "Monterrey" + End If + + End With + txtTake138 = mintTake138 + + If moRSProj!STYPE = "S" Then + txtOneKote.Text = "Superwall" + ElseIf moRSProj!STYPE = "M" Then + txtOneKote.Text = "Magna Wall" + ElseIf moRSProj!STYPE = "T" Then + txtOneKote.Text = "Three Coat" + ElseIf moRSProj!STYPE = "N" Then + txtOneKote.Text = "Synthetic" + ElseIf moRSProj!STYPE = "B" Then + txtOneKote.Text = "Synthetic over 1 Kote" + ElseIf moRSProj!STYPE = "W" Then + txtOneKote.Text = "Western 1 Kote" + End If + + If moRS!l_flg = "P" Then + txtTtlYdge.Enabled = False + txtAddress.Enabled = False + txtOwner.Enabled = False + txtModel.Enabled = False + txtCMUYdge.Enabled = False + txtNotes.Enabled = False + txtFoamAdj.Enabled = False + txtLaborAdj.Enabled = False + txtFin2.Enabled = False + txtLotNo.Enabled = False + txt28Foam.Enabled = False + txtLODate.Enabled = False + txtSuperBB.Enabled = False + txtSuper12.Enabled = False + txtSuper783.Enabled = False + txtSuper78.Enabled = False + txtSuper38.Enabled = False + txtSuper1383.Enabled = False + txtSuperRL.Enabled = False + txtSuperML.Enabled = False + txtSuperDW.Enabled = False + txtSuperSP.Enabled = False + lblLathPrint.Visible = True + End If + mboolShow = False +End Sub + +Private Sub FormShowMat() + mboolShow = True + + With moRSMat + txtLMInvNo = Field2Str(!Inv_no) + txtLMDesc = Field2Str(!Desc) + txtLMQty = Field2Str(!Qty) + txtLMLength = Field2Str(!Calc_Amt) + If !D_Flag = "S" Then + cboLMDFlag.Text = "Supplier" + Else + cboLMDFlag.Text = "Yard" + End If + + If !M_Type = "L" Then + cboLMType.Text = "Lath" + ElseIf !M_Type = "B" Then + cboLMType.Text = "Brown" + ElseIf !M_Type = "S" Then + cboLMType.Text = "Scratch" + ElseIf !M_Type = "T" Then + cboLMType.Text = "Texture" + ElseIf !M_Type = "C" Then + cboLMType.Text = "CMU" + ElseIf !M_Type = "P" Then + cboLMType.Text = "PreOrder" + End If + + If !Calc_Flag = "M" Then + cboLMMetal.Text = "Metal" + Else + cboLMMetal.Text = "None" + End If + + + End With + mboolShow = False +End Sub +Private Sub FormShowOpt() + mboolShow = True +' gintOPTID = moRSLOpt!opt_id + + + With moRSPOpt + txtLOYdge = Field2Str(!yardage) + txtLODesc = Field2Str(!Desc) + txtLOFin2 = Field2Str(!FIN2) + txtLOFoam = Field2Str(!f_adj) + + If !Texture = "SK" Then + txtLOTexture.Text = "SKIP TROWEL" + ElseIf !Texture = "SA" Then + txtLOTexture.Text = "Sand" + ElseIf !Texture = "S2" Then + txtLOTexture.Text = "Sand" + ElseIf !Texture = "S3" Then + txtLOTexture.Text = "Sand" + ElseIf !Texture = "DA" Then + txtLOTexture.Text = "Dash" + ElseIf !Texture = "DF" Then + txtLOTexture.Text = "Skip and Sand Finish" + ElseIf !Texture = "SM" Then + txtLOTexture.Text = "Smooth" + ElseIf !Texture = "QU" Then + txtLOTexture.Text = "Quernavaca" + ElseIf !Texture = "MN" Then + txtLOTexture.Text = "Monterrey" + Else + txtLOTexture.Text = "" + End If + + + End With + mboolShow = False +End Sub +Private Sub FormShowOptMat() + mboolShow = True + + With moRSOptMat + txtLOMInvNo = Field2Str(!Inv_no) + txtLOMDesc = Field2Str(!Desc) + txtLOMQty = Field2Str(!Qty) + txtLOMLength = Field2Str(!Calc_Amt) + + If !D_Flag = "S" Then + cboLOMDFlag.Text = "Supplier" +' cboLOMDFlag.ListIndex = 0 + Else + cboLOMDFlag.Text = "Yard" +' cboLOMDFlag.ListIndex = 1 + End If + + If !M_Type = "L" Then + cboLOMType.Text = "Lath" + ElseIf !M_Type = "B" Then + cboLOMType.Text = "Brown" + ElseIf !M_Type = "S" Then + cboLOMType.Text = "Scratch" + ElseIf !M_Type = "T" Then + cboLOMType.Text = "Texture" + ElseIf !M_Type = "C" Then + cboLOMType.Text = "CMU" + ElseIf !M_Type = "P" Then + cboLOMType.Text = "PreOrder" + End If + + If !Calc_Flag = "M" Then + cboLOMetal.Text = "Metal" + Else + cboLOMetal.Text = "None" + End If + + + End With + mboolShow = False +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False +' strName = Trim$(txtLast) & ", " & Trim$(txtFirst) + ' Reload list box +' Call ListLoad + +' lstNames.Text = strName +' Else + ' Update List Box +' With lstNames +' .List(.ListIndex) = txtLast & ", " & _ +' txtFirst +' End With + End If + + Call ToggleButtons + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + If cmdClose.Caption = "&Close" Then + cmdClose.Caption = "&Cancel" + Else + cmdClose.Caption = "&Close" + End If + cmdSave.Enabled = Not cmdSave.Enabled + cmdNew.Enabled = Not cmdNew.Enabled + cmdDelete.Enabled = Not cmdDelete.Enabled + lstNames.Enabled = Not lstNames.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolShow Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + + If moRS.State = adStateOpen Then + moRS.Close + End If + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub PlanFind() + Dim oRS As Recordset + Dim strSQL As String, strPlan As String, strTest As String, intTest As Integer + On Error GoTo Open_EH + + strSQL = "SELECT est_id " + strSQL = strSQL & "FROM tblplans " + strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" + + + If moRSPlan.State = adStateOpen Then + moRSPlan.Close + End If + + moRSPlan.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + gintESTID = moRSPlan!est_id + strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = 1130" + + Set oRS = New Recordset + If oRS.State = adStateOpen Then + oRS.Close + End If + oRS.Open strPlan, goConn, _ + adOpenForwardOnly, adLockPessimistic + mintTake138 = oRS!Qty + oRS.Close + Exit Sub + +Open_EH: + Call ErrorHandler(goConn) + oRS.Close + Exit Sub + +End Sub +Private Function FormFindPOpt() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) + + If moRSPOpt.State = adStateOpen Then + moRSPOpt.Close + End If + + moRSPOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPOpt.EOF Then + FormFindPOpt = False + Else + FormFindPOpt = True + End If +End Function + +Private Function FormFindLOpt() As Boolean + + Dim strSQL As String + + strSQL = "SELECT Opt_ID, Lot_id " + strSQL = strSQL & "FROM tblLOption " + strSQL = strSQL & "WHERE Lot_id = " & gintLOTID + + If moRSLOpt.State = adStateOpen Then + moRSLOpt.Close + End If + + moRSLOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSLOpt.EOF Then + FormFindLOpt = False + Else + FormFindLOpt = True + gintOPTID = moRSLOpt!opt_id + End If +End Function +Private Function FormFindOptMat() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If +End Function +Private Function FormFindMat() As Boolean + Dim strSQL As String + Set moRSMat = New Recordset + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotMatrl " + strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = " & lstLMaterial.ItemData(lstLMaterial.ListIndex) + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If +End Function +Private Sub cmdExit_Click() + Unload Me +End Sub +Private Sub FieldsSave() + With moRS + !TTL_Yds = Str2Field(txtTTL_Yds) + !LATH_YDS = Str2Field(txtLathYds) + !OPENING = Str2Field(txtOpenings) + !OPENPR = Str2Field(txtPrcntge) + !CMUYDS = Str2Field(txtCMUYds) + !NOTES = Str2Field(txtNotes) + !f_adj = Str2Field(txtFoamAdj) + !l_adj = Str2Field(txtLaborAdj) + !FIN2 = Str2Field(txtFin2) + !SAND_TONS = Str2Field(txtSandTons) + !SAND = Str2Field(txtSandPrice) + !METAL = Str2Field(txtMetalFt) + !PL = Str2Field(txtStucLab) + !LL = Str2Field(txtLathLab) + !MLAB = Str2Field(txtMetLab) + !MISC = Str2Field(txtMisc) + !MATMUP = Str2Field(txtMatMU) + !BIDP = Str2Field(txtBidPrwCMU) + !BIDC = Str2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Str2Field(txtOH) + !SL_TG = Str2Field(txtScafGas) + !TP = Str2Field(txtTape) + !MATCOST = Str2Field(txtTtlMat) + !BRDN = Str2Field(txtLabBur) + !SR = Str2Field(txtSLRate) + !LR = Str2Field(txtLLRate) + !MR = Str2Field(txtMLRate) + !SCR = Str2Field(txtSGRate) + !TP = Str2Field(txtTPRate) + !MU = Str2Field(txtMURate) + !OHP = Str2Field(txtOHRate) + !CR = Str2Field(txtCMURate) + !CMULAB = Str2Field(txtCMUPrice) + !TPE = Str2Field(txtTape) + + End With +End Sub +Private Sub MatSave() + With moRSMat + !Inv_no = Str2Field(txtLMInvNo.Text) + !Desc = Str2Field(txtLMDesc.Text) + !Qty = Str2Field(txtLMQty.Text) + !Calc_Amt = Str2Field(txtLMLength.Text) + !O_Qty = Str2Field(txtLMBalance.Text) + + If cboLMType.Text = "Lath" Then + !M_Type = "L" + ElseIf cboLMType.Text = "Scratch" Then + !M_Type = "S" + ElseIf cboLMType.Text = "Brown" Then + !M_Type = "B" + ElseIf cboLMType.Text = "Texture" Then + !M_Type = "T" + ElseIf cboLMType.Text = "PreOrder" Then + !M_Type = "P" + End If + + If cboLMDFlag.Text = "Supplier" Then + !D_Flag = "S" + ElseIf cboLMDFlag.Text = "Yard" Then + !D_Flag = "Y" + End If + + If cboLMMetal.Text = "Metal" Then + !Calc_Flag = "M" + Else + !Calc_Flag = "" + !Calc_Amt = 0 + End If + End With + moRSMat.Update +End Sub + +Private Sub FormClear() + + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("MagnaWall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLMaterial.Clear + + Do Until oRS.EOF + With lstLMaterial + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLMaterial.ListCount Then + lstLMaterial.ListIndex = 0 + Else + txtLMInvNo = "" + txtLMDesc = "" + txtLMQty = "" + txtLMLength = "" + cboLMDFlag.ListIndex = -1 + cboLMType.ListIndex = -1 + cboLMMetal.ListIndex = -1 + End If + + +End Sub +Private Sub OptMatLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) 'gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtLOMInvNo = "" + txtLOMDesc = "" + txtLOMQty = "" + txtLOMLength = "" + cboLOMDFlag.ListIndex = -1 + cboLOMType.ListIndex = -1 + cboLOMetal.ListIndex = -1 + End If + + +End Sub +Private Sub POptLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOptions.Clear + + Do Until oRS.EOF + With lstPOptions + + strLine = oRS("Opt_no") & " " & oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOptions.ListCount Then + lstPOptions.ListIndex = -1 +' Else +' txtLOYdge = "" +' txtLODesc = "" +' txtLOFin2 = "" +' txtLOFoam = "" +' lstOptMatrl.Clear +' txtLOMInvNo = "" +' txtLOMDesc = "" +' txtLOMQty = "" +' txtLOMLength = "" +' cboLOMDFlag.ListIndex = -1 +' cboLOMType.ListIndex = -1 +' cboLMMetal.ListIndex = -1 +' gintOPTID = 0 + End If + + +End Sub +Private Sub LOptLoad() + Dim oRS As Recordset + Dim strSQL As String, intLoop As Integer, intPos As Integer + Dim strLine As String + + strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLOptions.Clear + + Do Until oRS.EOF + With lstLOptions + For intLoop = 0 To lstPOptions.ListCount - 1 + If lstPOptions.ItemData(intLoop) = oRS!opt_id Then + .AddItem (lstPOptions.List(intLoop)) + .ItemData(.NewIndex) = oRS!opt_id + End If + Next intLoop + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLOptions.ListCount Then + lstLOptions.ListIndex = 0 + gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) +' Else +' txtLOYdge = "" +' txtLODesc = "" +' txtLOFin2 = "" +' txtLOFoam = "" +' lstOptMatrl.Clear +' txtLOMInvNo = "" +' txtLOMDesc = "" +' txtLOMQty = "" +' txtLOMLength = "" +' cboLOMDFlag.ListIndex = -1 +' cboLOMType.ListIndex = -1 +' cboLOMetal.ListIndex = -1 +' gintOPTID = 0 + End If + +End Sub + +Private Sub lstLOptions_Click() + If lstLOptions.ListIndex <> -1 Then + If FormFindPOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "" + txtLOMDesc = "" + txtLOMQty = "" + txtLOMLength = "" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + Else + lstLOptions.Clear + txtLOYdge = "" + txtLODesc = "" + txtLOFin2 = "" + txtLOFoam = "" + txtLOTexture = "" + End If + If FormFindLOpt() Then + End If + End If + + +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtLOMInvNo = "" + txtLOMDesc = "" + txtLOMQty = "" +' txtOMPrice = "" + txtLOMLength = "" + cboLOMDFlag.Text = "" + cboLOMType.Text = "" + cboLOMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstLMaterial_Click() + If lstLMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstLMaterial.Clear + txtLMInvNo = "" + txtLMDesc = "" + txtLMQty = "" + txtLMLength = "" + cboLMDFlag.Text = "" + cboLMType.Text = "" + cboLMMetal.Text = "" + txtLMBalance = "" + End If + End If + +End Sub + + +Private Sub OrderLoad() + Dim oRS As Recordset + Dim strSQL As String, strLine As String, strSelect As String + On Error Resume Next + + strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID +' strSQL = strSQL & " and D_Flag = 'S' and M_Type = 'P'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + strSelect = "D_Flag = 'S' and M_Type = 'P'" + + oRS.Filter = strSelect + lstPreOrder.Clear + + Do Until oRS.EOF + With lstPreOrder + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSelect = "D_Flag = 'S' and M_Type = 'L'" + oRS.Filter = strSelect + lstLath.Clear + + Do Until oRS.EOF + With lstLath + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSelect = "D_Flag = 'Y' and M_Type = 'L'" + oRS.Filter = strSelect + lstYard.Clear + + Do Until oRS.EOF + With lstYard + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSelect = "D_Flag = 'S' and M_Type = 'S'" + oRS.Filter = strSelect + lstScratch.Clear + + Do Until oRS.EOF + With lstScratch + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSelect = "D_Flag = 'S' and M_Type = 'B'" + oRS.Filter = strSelect + lstBrown.Clear + + Do Until oRS.EOF + With lstBrown + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + oRS.MoveFirst + + strSelect = "D_Flag = 'S' and M_Type = 'T'" + oRS.Filter = strSelect + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + strLine = oRS!Qty & vbTab & oRS!Inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + + + oRS.Close + + If lstPreOrder.ListCount Then + lstPreOrder.ListIndex = -1 + End If + + If lstLath.ListCount Then + lstLath.ListIndex = -1 + End If + + If lstYard.ListCount Then + lstYard.ListIndex = -1 + End If + + If lstScratch.ListCount Then + lstScratch.ListIndex = -1 + End If + + If lstBrown.ListCount Then + lstBrown.ListIndex = -1 + End If + + If lstTexture.ListCount Then + lstTexture.ListIndex = -1 + End If + + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frx new file mode 100644 index 0000000..8fce729 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotInfobak.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList.frm new file mode 100644 index 0000000..79754fa --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList.frm @@ -0,0 +1,377 @@ +VERSION 5.00 +Begin VB.Form frmLotList3 + Caption = "Lot Information List" + ClientHeight = 8595 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6975 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8595 + ScaleWidth = 6975 + StartUpPosition = 3 'Windows Default + Begin VB.ListBox lstMatPO + Height = 1425 + Left = 60 + TabIndex = 7 + Top = 4200 + Width = 6855 + End + Begin VB.ListBox lstPO + Height = 1230 + Left = 60 + TabIndex = 5 + Top = 2580 + Width = 6855 + End + Begin VB.ListBox lstRepairs + Height = 1035 + Left = 60 + TabIndex = 2 + Top = 1200 + Width = 6855 + End + Begin VB.Label lblMatPO + AutoSize = -1 'True + Caption = "Material Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 6 + Top = 3900 + Width = 2160 + End + Begin VB.Label lblPO + AutoSize = -1 'True + Caption = "Special Purchase Orders" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 4 + Top = 2340 + Width = 2115 + End + Begin VB.Label lblRepairs + AutoSize = -1 'True + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 3 + Top = 960 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 3 + X1 = 0 + X2 = 6960 + Y1 = 900 + Y2 = 900 + End + Begin VB.Label Label3 + Alignment = 2 'Center + Caption = "Lot Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 60 + TabIndex = 1 + Top = 60 + Width = 6795 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 60 + TabIndex = 0 + Top = 480 + Width = 6855 + End +End +Attribute VB_Name = "frmLotList3" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub +Error_EH: + gstrMODULE = "Form LotList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + Call POLoad + Call RepairLoad + Call MatPOLoad + If FormFind() Then + Call FormShow + Else + Unload Me + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub RepairLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Repair_id, Proj_lot, Scheduled, completed, punch, yrend1, yrend2, wo, repair from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstRepairs.Clear + + Do Until oRS.EOF + With lstRepairs + If oRS!punch Then + strTYPE = "PUNCH " + ElseIf oRS!yrend1 Then + strTYPE = "1 YEAR END" + ElseIf oRS!yrend2 Then + strTYPE = "2 YEAR END" + ElseIf oRS!wo Then + strTYPE = "PO WORK " + ElseIf oRS!repair Then + strTYPE = "REPAIR " + End If + strLine = "" + strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " + strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine + .ItemData(.NewIndex) = oRS!repair_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module RepairLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatPOLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT lot_id, order_date, m_type, po_num FROM tblOrders WHERE ponum = 0 and lot_id = " & gintLOTID & " ORDER BY Order_Date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMatPO.Clear + + Do Until oRS.EOF + With lstMatPO + If Field2Str(oRS!m_type) = "L" Then + strTYPE = "LATH " + ElseIf Field2Str(oRS!m_type) = "B" Then + strTYPE = "BROWN " + ElseIf Field2Str(oRS!m_type) = "A" Then + strTYPE = "SAND " + ElseIf Field2Str(oRS!m_type) = "T" Then + strTYPE = "TEXTURE " + ElseIf Field2Str(oRS!m_type) = "P" Then + strTYPE = "PREORDER" + ElseIf Field2Str(oRS!m_type) = "S" Then + strTYPE = "SCRATCH " + End If + strLine = strTYPE & vbTab & Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!po_num) + .AddItem strLine + .ItemData(.NewIndex) = oRS!lot_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module MatPOLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum, towhom, desc, date from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + strLine = Field2Str(oRS!Date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!towhom) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + .ItemData(.NewIndex) = oRS!ponum + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + ' mboolSHOW = True + ' mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strProj As String, strMEMO As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + strProj = "SELECT * " + strProj = strProj & "FROM tblproject " + strProj = strProj & "WHERE proj_ID = " & Field2Integer(oRS!proj_id) + Set oRSS = New Recordset + oRSS.Open strProj, goConn, _ + adOpenKeyset, adLockPessimistic + + If oRSS.EOF Then + + End If + + If oRS.EOF Then + FormFind = False + Else + FormFind = True + lblProjLot.Caption = oRSS!proj_code & " " & oRS!lot_no & " " & oRSS!proj_desc + End If + oRS.Close + oRSS.Close + Exit Function + +Error_EH: + gstrMODULE = "Form LotList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstPO_DblClick() + gintPONUM = lstPO.ItemData(lstPO.ListIndex) + frmShowPO.Show 1 + +End Sub + +Private Sub lstRepairs_DblClick() +' If Not lstRepairs.ListIndex Then +' Else +' MsgBox "There are no Repairs Listed", vbOKOnly, "No Repairs" +' Exit Sub +' End If + gintREPAIRID = lstRepairs.ItemData(lstRepairs.ListIndex) + frmShowRepair.Show 1 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frm new file mode 100644 index 0000000..5389639 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frm @@ -0,0 +1,1198 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmLotList + Caption = "Lot Information List" + ClientHeight = 8595 + ClientLeft = 60 + ClientTop = 7245 + ClientWidth = 6975 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8595 + ScaleWidth = 6975 + Begin VB.TextBox txtPreOrder + Height = 285 + Left = 6555 + TabIndex = 16 + Top = 2100 + Visible = 0 'False + Width = 435 + End + Begin LpLib.fpList lstPO + Height = 1425 + Left = 75 + TabIndex = 15 + Top = 2325 + Width = 6855 + _Version = 196608 + _ExtentX = 12091 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotList2.frx":0000 + End + Begin LpLib.fpList lstInvoice + Height = 1245 + Left = 60 + TabIndex = 12 + Top = 7110 + Width = 6855 + _Version = 196608 + _ExtentX = 12091 + _ExtentY = 2196 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 8 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotList2.frx":03FF + End + Begin LpLib.fpList lstPOWO + Height = 1065 + Left = 60 + TabIndex = 11 + Top = 5700 + Width = 6855 + _Version = 196608 + _ExtentX = 12091 + _ExtentY = 1879 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmLotList2.frx":08A0 + End + Begin VB.CommandButton cmdSetYard + Caption = "Setup Yard List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3427 + TabIndex = 9 + Top = 3795 + Width = 1770 + End + Begin VB.CommandButton cmdYard + Caption = "Yard Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 5565 + TabIndex = 8 + Top = 3795 + Width = 1320 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2145 + TabIndex = 7 + Top = 3795 + Width = 915 + End + Begin VB.ListBox lstPayroll + Height = 1425 + Left = 60 + TabIndex = 6 + Top = 4095 + Width = 6855 + End + Begin VB.ListBox lstPO2 + Height = 1425 + Left = 60 + TabIndex = 5 + Top = 2340 + Visible = 0 'False + Width = 6855 + End + Begin VB.ListBox lstRepairs + Height = 1035 + Left = 60 + TabIndex = 2 + Top = 1065 + Width = 6855 + End + Begin VB.Label lblPOWOList + AutoSize = -1 'True + Caption = "Billable PO/WO List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 14 + Top = 5505 + Width = 1710 + End + Begin VB.Label lblInvoiceList + AutoSize = -1 'True + Caption = "Invoice List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 13 + Top = 6900 + Width = 1005 + End + Begin VB.Label lblMatPO + AutoSize = -1 'True + Caption = "Payroll Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 10 + Top = 3780 + Width = 1590 + End + Begin VB.Label lblPO + AutoSize = -1 'True + Caption = "Orders List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 4 + Top = 2130 + Width = 930 + End + Begin VB.Label lblRepairs + AutoSize = -1 'True + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 3 + Top = 855 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 3 + X1 = 15 + X2 = 6975 + Y1 = 810 + Y2 = 810 + End + Begin VB.Label lblLot + Alignment = 2 'Center + Caption = "Lot Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 60 + TabIndex = 1 + Top = 15 + Width = 6795 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 60 + TabIndex = 0 + Top = 360 + Width = 6855 + End +End +Attribute VB_Name = "frmLotList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mstrWTYPE As String, mstrWDone As String, mboolPROJ As Boolean + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSetYard_Click() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrdMatrl WHERE not x_flag and Order_Id = " & lstPO.ItemData(lstPO.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + strSql2 = "SELECT * FROM tblYardOrder" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Else + MsgBox "No Order Items to Process", vbOKOnly, "No Items" + Exit Sub + End If + + Do Until oRS.EOF + With oRSS + .AddNew + !Lot_ID = oRS!Lot_ID + !inv_no = oRS!inv_no + !Desc = oRS!Desc + !qty = oRS!o_qty + !qtyIssue = oRS!o_qty + !po_num = oRS!po_num + !createuser = gstrLOGIN + .Update + oRS!x_flag = vbChecked + oRS.Update + oRS.MoveNext + End With + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form LotList - Module cmdSetYard" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdYard_Click() + frmShowYardMat.Show 1 +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub +Error_EH: + gstrMODULE = "Form LotList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + + Call POWOLoad + Call RepairLoad + Call OrderLoad + Call PayrollLoad + Call InvoiceLoad + If FormFind() Then + Call FormShow + Else + Unload Me + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub RepairLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long + + On Error GoTo Error_EH + + aTabs(0) = 50 + aTabs(1) = 95 + aTabs(2) = 170 +' aTabs(3) = 190 + + strSQL = "SELECT Repair_id, Proj_lot, Scheduled, completed, punch, yrend1, yrend2, wo, repair, backcharge from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstRepairs.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) + lstRepairs.Clear + + Do Until oRS.EOF + With lstRepairs + If oRS!punch Then + strTYPE = "PUNCH " + ElseIf oRS!yrend1 Then + strTYPE = "1 YEAR END" + ElseIf oRS!yrend2 Then + strTYPE = "2 YEAR END" + ElseIf oRS!wo Then + strTYPE = "PO WORK " + ElseIf oRS!repair Then + strTYPE = "WARRANTY" + ElseIf oRS!backcharge Then + strTYPE = "BACKCHARGE" + Else + strTYPE = "UNKNOWN" + End If + strLine = "" + strLine = Field2Str(oRS!scheduled) & vbTab & Field2Str(oRS!completed) & vbTab +' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " + strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine + .ItemData(.NewIndex) = oRS!repair_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module RepairLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub InvoiceLoad() +Dim oRS As Recordset, strDONE As String +Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String, strINVT As String +'dim + + On Error GoTo Error_EH + + +' strSQL = "SELECT * FROM tblARINVOICE WHERE lot_id = " & gintLOTID & " ORDER BY INVOICE_DATE" + strSQL = "SELECT * FROM tblARINVOICE WHERE lot_id = " & gintLOTID & " and not delete ORDER BY INVOICE_DATE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInvoice.Clear + + Do Until oRS.EOF + With lstInvoice + strINVT = oRS!inv_type + If strINVT = "L" Then + strTYPE = "LATH" + ElseIf strINVT = "S" Then + strTYPE = "STUCCO" + ElseIf strINVT = "PE" Then + strTYPE = "PAINT EXTERIOR" + ElseIf strINVT = "PF" Then + strTYPE = "PAINT FINAL" + ElseIf strINVT = "PI" Then + strTYPE = "PAINT INTERNAL" + ElseIf strINVT = "V" Then + strTYPE = "STONE" + Else + strTYPE = "UNKNOWN" + End If + +' mstrWDone = Field2Str(oRS!workdone) +' Call GetWorkType +' strWORK = mstrWTYPE + If oRS!done And Not oRS!Delete Then + strDONE = "CMS" + Else + strDONE = "" + End If + strLine = "" + strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Field2Str(oRS!invoice_no) & vbTab & Field2Str(strTYPE) & vbTab +' strLine = strLine & Field2Str(oRS!strWORK) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab + strLine = strLine & Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "#,#.00") + strLine = strLine & vbTab & Format(Field2Str2(oRS!non_tax_amt), "#,#.00") & vbTab & strDONE +' strLine = strLine & Field2Str(oRS!SALES_CODE) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab +' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " +' strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!repair_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module InvoiceLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetWorkType() +Dim strSQL As String, oRSW As Recordset + + strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" + Set oRSW = New Recordset + oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSW.EOF Then + mstrWTYPE = Field2Str(oRSW!worktype) + End If + + oRSW.Close +End Sub + +Private Sub PayrollLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String +Dim lngRET As Long, aTabs(3) As Long + + On Error GoTo Error_EH + + aTabs(0) = 40 + aTabs(1) = 120 + aTabs(2) = 145 + aTabs(3) = 190 + + strSQL = "SELECT * FROM tblTime WHERE lot_id = " & gintLOTID ' & " ORDER BY Order_Date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPayroll.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + lstPayroll.Clear + + Do Until oRS.EOF + With lstPayroll + If Field2Str(oRS!pay_type) = "L" Then + strTYPE = "LATH" + ElseIf Field2Str(oRS!pay_type) = "C" Then + strTYPE = "SCAFFOLD" + ElseIf Field2Str(oRS!pay_type) = "S" Then + strTYPE = "STUCCO" + ElseIf Field2Str(oRS!pay_type) = "Y" Then + strTYPE = "SYNTHETIC" + ElseIf Field2Str(oRS!pay_type) = "V" Then + strTYPE = "STONE" + ElseIf Field2Str(oRS!pay_type) = "X" Then + strTYPE = "PAINT" + End If + mstrWDone = Field2Str(oRS!WorkDone) + Call GetWorkType + strWORK = mstrWTYPE + +' If Field2Str(oRS!workdone) = "C" Then +' strWORK = "COMPLETE" +' ElseIf Field2Str(oRS!workdone) = "B" Then +' strWORK = "BROWN" +' ElseIf Field2Str(oRS!workdone) = "F" Then +' strWORK = "FENCE" +' ElseIf Field2Str(oRS!workdone) = "T" Then +' strWORK = "TEXTURE" +' ElseIf Field2Str(oRS!workdone) = "W" Then +' strWORK = "WORK ORDER" +' ElseIf Field2Str(oRS!workdone) = "U" Then +' strWORK = "CMU WALL" +' ElseIf Field2Str(oRS!workdone) = "P" Then +' strWORK = "PARTIAL" +' ElseIf Field2Str(oRS!workdone) = "R" Then +' strWORK = "REPAIR" +' ElseIf Field2Str(oRS!workdone) = "S" Then +' strWORK = "SCRATCH" +' ElseIf Field2Str(oRS!workdone) = "Z" Then +' strWORK = "DOWN" +' ElseIf Field2Str(oRS!workdone) = "Y" Then +' strWORK = "UP" +' End If + + strLine = strTYPE & vbTab & strWORK & vbTab + strLine = strLine & Field2Str(oRS!paydt) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") +' strLine = strLine & Field2Str(oRS!prdate) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module PayrollLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ponum, towhom, desc, date from tblPOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPO.Clear + + Do Until oRS.EOF + With lstPO + strLine = Field2Str(oRS!Date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!towhom) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + .ItemData(.NewIndex) = oRS!ponum + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module POLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String +Dim strTYPE As String, strDESC As String +Dim lngRET As Long, aTabs(3) As Long + + On Error GoTo Error_EH + +' aTabs(0) = 45 +' aTabs(1) = 70 +' aTabs(2) = 145 +' aTabs(3) = 190 + + strSQL = "SELECT order_id, ponum, m_type, po_num, order_date, supplier from tblOrders WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lngRET = SendMessage(lstPO.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + lstPO.Clear + + Do Until oRS.EOF + With lstPO + Call SetType(oRS!m_type, strDESC) + + strLine = Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!po_num) & vbTab & strDESC & vbTab & Field2Str(oRS!supplier) & vbTab & Field2Str2(oRS!order_id) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!order_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderLoadHold() +Dim oRS As Recordset +Dim strSQL As String, strLine As String +Dim strTYPE As String, strDESC As String +Dim lngRET As Long, aTabs(3) As Long + + On Error GoTo Error_EH + + aTabs(0) = 45 + aTabs(1) = 70 + aTabs(2) = 145 + aTabs(3) = 190 + + strSQL = "SELECT order_id, ponum, m_type, po_num, order_date, supplier from tblOrders WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPO.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + lstPO.Clear + + Do Until oRS.EOF + With lstPO + Call SetType(oRS!m_type, strDESC) + + strLine = Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!ponum) & vbTab + strLine = strLine & Field2Str(oRS!po_num) & vbTab & strDESC & vbTab & Field2Str(oRS!supplier) + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + If lstRepairs.ListCount = 0 Then + lstRepairs.Enabled = False + Else + lstRepairs.Enabled = True + End If + If lstInvoice.ListCount = 0 Then + lstInvoice.Enabled = False + Else + lstInvoice.Enabled = True + End If + If lstPOWO.ListCount = 0 Then + lstPOWO.Enabled = False + Else + lstPOWO.Enabled = True + End If + If lstPO.ListCount = 0 Then + lstPO.Enabled = False + Else + lstPO.Enabled = True + End If + If lstPayroll.ListCount = 0 Then + lstPayroll.Enabled = False + Else + lstPayroll.Enabled = True + End If + + ' mboolSHOW = True + ' mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form LotList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strProj As String, strMEMO As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + strProj = "SELECT * " + strProj = strProj & "FROM tblproject " + strProj = strProj & "WHERE proj_ID = " & Field2Long(oRS!PROJ_ID) +' strProj = strProj & "WHERE proj_ID = " & Field2Integer(oRS!proj_id) + Set oRSS = New Recordset + oRSS.Open strProj, goConn, _ + adOpenKeyset, adLockPessimistic + + If oRSS.EOF Then + + End If + + If oRS.EOF Then + FormFind = False + Else + FormFind = True + lblProjLot.Caption = oRSS!Proj_Code & " " & oRS!lot_no & " " & oRSS!Proj_Desc + End If + oRS.Close + oRSS.Close + Exit Function + +Error_EH: + gstrMODULE = "Form LotList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstInvoice_DblClick() + MsgBox "Mouse has been DblClicked", vbOKOnly +End Sub + +Private Sub lstPayroll_DblClick() + + lstPO.ListIndex = -1 + lstRepairs.ListIndex = -1 + Load frmPayroll + frmPayroll.chkLOOK = vbChecked + frmPayroll.Show 1 + +End Sub + +Private Sub lstPO_DblClick() +Dim oRS As Recordset, strTYPE As String +Dim strSQL As String, boolPREORDER As Boolean +' Load frmShowOrderMat + boolPREORDER = False + lstPayroll.ListIndex = -1 + lstRepairs.ListIndex = -1 + lstPO.col = 3 + strTYPE = lstPO.ColText + If strTYPE = "Z-PreCast" Or strTYPE = "PreOrder" Then + boolPREORDER = True + Else + boolPREORDER = False + End If + lstPO.col = 5 + glngORDERID = lstPO.ColText + + strSQL = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS!ponum > 0 Then + glngORDERID = Field2Long(oRS!ponum) + frmShowPO.Show 1 + ElseIf boolPREORDER Then + If strTYPE = "Z-PreCast" Then + txtPreOrder = "Z" +' frmShowOrderMat.txtPreOrder = "Z" + ElseIf strTYPE = "PreOrder" Then + txtPreOrder = "P" +' frmShowOrderMat.txtPreOrder = "P" + Else + txtPreOrder = "" + End If + frmShowOrderMat.Show 1 + Else + txtPreOrder = "" + frmShowOrderMat.Show 1 + End If + +End Sub + +Private Sub lstPOHold_DblClick() +Dim oRS As Recordset +Dim strSQL As String + + lstPayroll.ListIndex = -1 + lstRepairs.ListIndex = -1 + glngORDERID = lstPO.ItemData(lstPO.ListIndex) + strSQL = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS!ponum > 0 Then + glngORDERID = Field2Long(oRS!ponum) + frmShowPO.Show 1 + Else +' glngORDERID = 0 + frmShowOrderMat.Show 1 + End If + +End Sub + +Private Sub lstPOWO_DblClick() + + lstPO.ListIndex = -1 + lstRepairs.ListIndex = -1 + lstPayroll.ListIndex = -1 + lstInvoice.ListIndex = -1 + lstPOWO.col = 0 + gintREPAIRID = Field2Str2(lstPOWO.ColText) + Load frmPOWOLot + frmPOWOLot.chkLOOK = vbChecked + frmPOWOLot.Show 1 + +End Sub + +Private Sub lstRepairs_DblClick() + + lstPayroll.ListIndex = -1 + lstPO.ListIndex = -1 + + gintREPAIRID = lstRepairs.ItemData(lstRepairs.ListIndex) + frmShowRepair.Show 1 +End Sub + +Private Sub POWOLoad() +Dim oRS As Recordset, intYN As Integer +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOWO WHERE LOT_ID = " & gintLOTID ' & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOWO.Clear + + Do Until oRS.EOF + With lstPOWO + strLine = Field2Str(oRS!repair_id) & vbTab & Field2Str(oRS!builder_PO) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + End With + + oRS.MoveNext + Loop + + If lstPOWO.ListCount Then + lstPOWO.ListIndex = 0 + mboolPROJ = False + lstPOWO.Enabled = True + Else + lstPOWO.ListIndex = -1 + lstPOWO.Enabled = False +' Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormLotList - Module POWOLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frx new file mode 100644 index 0000000..aa2d6f1 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotList2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frm new file mode 100644 index 0000000..2aa257e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frm @@ -0,0 +1,354 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmLotOrders + Caption = "Orders for 1 Lot" + ClientHeight = 6420 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 6420 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 1680 + TabIndex = 5 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 60 + Picture = "frmLotOrders.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 420 + Picture = "frmLotOrders.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 765 + Picture = "frmLotOrders.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 1125 + Picture = "frmLotOrders.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 5760 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5535 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 11700 + _ExtentX = 20638 + _ExtentY = 9763 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Order Date" + Columns(0).DataField= "Order_date" + Columns(0).DataWidth= 10 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "VWP PO Number" + Columns(1).DataField= "PONum" + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Supplier PO" + Columns(2).DataField= "PO_num" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 16 + Columns(3)._MaxComboItems= 5 + Columns(3).ValueItems(0)._DefaultItem= 0 + Columns(3).ValueItems(0).Value= "A" + Columns(3).ValueItems(0).Value.vt= 8 + Columns(3).ValueItems(0).DisplayValue= "Supplier" + Columns(3).ValueItems(0).DisplayValue.vt= 8 + Columns(3).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems(1)._DefaultItem= 0 + Columns(3).ValueItems(1).Value= "S" + Columns(3).ValueItems(1).Value.vt= 8 + Columns(3).ValueItems(1).DisplayValue= "Supplier" + Columns(3).ValueItems(1).DisplayValue.vt= 8 + Columns(3).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems(2)._DefaultItem= 0 + Columns(3).ValueItems(2).Value= "Y" + Columns(3).ValueItems(2).Value.vt= 8 + Columns(3).ValueItems(2).DisplayValue= "Yard" + Columns(3).ValueItems(2).DisplayValue.vt= 8 + Columns(3).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems.Count= 3 + Columns(3).Caption= "Delivery Type" + Columns(3).DataField= "d_flag" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 16 + Columns(4)._MaxComboItems= 5 + Columns(4).ValueItems(0)._DefaultItem= 0 + Columns(4).ValueItems(0).Value= "A" + Columns(4).ValueItems(0).Value.vt= 8 + Columns(4).ValueItems(0).DisplayValue= "Sand" + Columns(4).ValueItems(0).DisplayValue.vt= 8 + Columns(4).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(1)._DefaultItem= 0 + Columns(4).ValueItems(1).Value= "T" + Columns(4).ValueItems(1).Value.vt= 8 + Columns(4).ValueItems(1).DisplayValue= "Texture" + Columns(4).ValueItems(1).DisplayValue.vt= 8 + Columns(4).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(2)._DefaultItem= 0 + Columns(4).ValueItems(2).Value= "B" + Columns(4).ValueItems(2).Value.vt= 8 + Columns(4).ValueItems(2).DisplayValue= "Brown" + Columns(4).ValueItems(2).DisplayValue.vt= 8 + Columns(4).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(3)._DefaultItem= 0 + Columns(4).ValueItems(3).Value= "S" + Columns(4).ValueItems(3).Value.vt= 8 + Columns(4).ValueItems(3).DisplayValue= "Scratch" + Columns(4).ValueItems(3).DisplayValue.vt= 8 + Columns(4).ValueItems(3)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(4)._DefaultItem= 0 + Columns(4).ValueItems(4).Value= "L" + Columns(4).ValueItems(4).Value.vt= 8 + Columns(4).ValueItems(4).DisplayValue= "Lath" + Columns(4).ValueItems(4).DisplayValue.vt= 8 + Columns(4).ValueItems(4)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems.Count= 5 + Columns(4).Caption= "Material Type" + Columns(4).DataField= "m_type" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "Order Amount" + Columns(5).DataField= "orderamt" + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Supplier" + Columns(6).DataField= "supplier" + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 7 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=7" + Splits(0)._ColumnProps(1)= "Column(0).Width=1958" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1879" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=2408" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=2328" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=2884" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=2805" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=2725" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=2646" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=2725" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=2646" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=2725" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=2646" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=3942" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=3863" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowUpdate = 0 'False + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(50) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(51) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(52) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(53) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(54) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(55) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(56) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(57) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(58) = "Named:id=33:Normal" + _StyleDefs(59) = ":id=33,.parent=0" + _StyleDefs(60) = "Named:id=34:Heading" + _StyleDefs(61) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(62) = ":id=34,.wraptext=-1" + _StyleDefs(63) = "Named:id=35:Footing" + _StyleDefs(64) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(65) = "Named:id=36:Selected" + _StyleDefs(66) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(67) = "Named:id=37:Caption" + _StyleDefs(68) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(69) = "Named:id=38:HighlightRow" + _StyleDefs(70) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(71) = "Named:id=39:EvenRow" + _StyleDefs(72) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(73) = "Named:id=40:OddRow" + _StyleDefs(74) = ":id=40,.parent=33" + _StyleDefs(75) = "Named:id=41:RecordSelector" + _StyleDefs(76) = ":id=41,.parent=34" + _StyleDefs(77) = "Named:id=42:FilterBar" + _StyleDefs(78) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmLotOrders" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotOrders.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frm new file mode 100644 index 0000000..585d644 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frm @@ -0,0 +1,802 @@ +VERSION 5.00 +Begin VB.Form frmLotPrtJobs + Caption = "Lot Print Jobs" + ClientHeight = 8295 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4335 + LinkTopic = "Form1" + ScaleHeight = 8295 + ScaleWidth = 4335 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkStoneP + Alignment = 1 'Right Justify + Caption = "Print Stone" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2265 + TabIndex = 36 + Top = 1845 + Width = 1335 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 2535 + TabIndex = 33 + Top = 5820 + Width = 1050 + End + Begin VB.TextBox txtEX3Amt + Height = 300 + Left = 2640 + TabIndex = 30 + Top = 5475 + Width = 945 + End + Begin VB.TextBox txtEX3Desc + Height = 300 + Left = 90 + TabIndex = 29 + Top = 5475 + Width = 2535 + End + Begin VB.TextBox txtEX2Amt + Height = 300 + Left = 2640 + TabIndex = 28 + Top = 4830 + Width = 945 + End + Begin VB.TextBox txtEX2Desc + Height = 300 + Left = 90 + TabIndex = 27 + Top = 4830 + Width = 2535 + End + Begin VB.TextBox txtEX1Amt + Height = 300 + Left = 2640 + TabIndex = 25 + Top = 4260 + Width = 945 + End + Begin VB.TextBox txtEX1Desc + Height = 300 + Left = 90 + TabIndex = 24 + Top = 4260 + Width = 2535 + End + Begin VB.CheckBox chkCMUP + Alignment = 1 'Right Justify + Caption = "Print CMU" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2280 + TabIndex = 22 + Top = 3630 + Width = 1320 + End + Begin VB.CheckBox chkSuperP + Alignment = 1 'Right Justify + Caption = "Print Super Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 1650 + TabIndex = 20 + Top = 795 + Width = 1950 + End + Begin VB.CheckBox chkEX3P + Alignment = 1 'Right Justify + Caption = "Print Extra 3" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2160 + TabIndex = 10 + Top = 5205 + Width = 1440 + End + Begin VB.CheckBox chkEX2P + Alignment = 1 'Right Justify + Caption = "Print Extra 2" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2160 + TabIndex = 9 + Top = 4575 + Width = 1440 + End + Begin VB.CheckBox chkEX1P + Alignment = 1 'Right Justify + Caption = "Print Extra 1" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2160 + TabIndex = 8 + Top = 3990 + Width = 1440 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 90 + TabIndex = 7 + Top = 5820 + Width = 1050 + End + Begin VB.CheckBox chkCombine + Alignment = 1 'Right Justify + Caption = "Print Brown/ Texture Together" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 540 + Left = 1650 + TabIndex = 6 + Top = 270 + Width = 1950 + End + Begin VB.CheckBox chkTextureP + Alignment = 1 'Right Justify + Caption = "Print Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2040 + TabIndex = 5 + Top = 3270 + Width = 1560 + End + Begin VB.CheckBox chkBrownP + Alignment = 1 'Right Justify + Caption = "Print Brown" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2145 + TabIndex = 4 + Top = 2910 + Width = 1455 + End + Begin VB.CheckBox chkPopOutP + Alignment = 1 'Right Justify + Caption = "Print Popout" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2115 + TabIndex = 3 + Top = 2550 + Width = 1485 + End + Begin VB.CheckBox chkNescoP + Alignment = 1 'Right Justify + Caption = "Print Nesco" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2190 + TabIndex = 2 + Top = 2190 + Width = 1410 + End + Begin VB.CheckBox chkLathP + Alignment = 1 'Right Justify + Caption = "Print Lath" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2370 + TabIndex = 1 + Top = 1515 + Width = 1230 + End + Begin VB.CheckBox chkWrapP + Alignment = 1 'Right Justify + Caption = "Print Wrap " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2295 + TabIndex = 0 + Top = 1155 + Width = 1305 + End + Begin VB.Label lblStone + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 37 + Top = 1883 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 60 + TabIndex = 35 + Top = 0 + Width = 4215 + End + Begin VB.Label lblDirections + Caption = $"frmLotPrtJobs.frx":0000 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1620 + Left = 60 + TabIndex = 34 + Top = 6630 + Width = 4245 + End + Begin VB.Label lblEX3P + AutoSize = -1 'True + Caption = "Desc && Amount" + Height = 195 + Left = 120 + TabIndex = 32 + Top = 5280 + Width = 1095 + End + Begin VB.Label lblEX2P + AutoSize = -1 'True + Caption = "Desc && Amount" + Height = 195 + Left = 105 + TabIndex = 31 + Top = 4650 + Width = 1095 + End + Begin VB.Label lblEX1P + AutoSize = -1 'True + Caption = "Desc && Amount" + Height = 195 + Left = 120 + TabIndex = 26 + Top = 4065 + Width = 1095 + End + Begin VB.Label lblTex + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 23 + Top = 3300 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblSuperD + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 21 + Top = 855 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblEX3 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 19 + Top = 5235 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblEX2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 18 + Top = 4605 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblEX1 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 17 + Top = 4020 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblCMU + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 16 + Top = 3660 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblBrown + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 15 + Top = 2955 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblPopOut + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 14 + Top = 2595 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblNesco + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 13 + Top = 2235 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblLath + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 12 + Top = 1560 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblWrap + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3750 + TabIndex = 11 + Top = 1200 + Visible = 0 'False + Width = 465 + End +End +Attribute VB_Name = "frmLotPrtJobs" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim moRS As Recordset, moRSProj As Recordset +Dim intCOUNT As Integer, mstrPROJLOT As String ', mboolBADD As Boolean +Dim mboolSupD, mboolWrapD, mboolLathD, mboolNescoD, mboolPopOutD As Boolean +Dim mboolBrownD, mboolTexD, mboolCMUD, mboolEX1D, mboolEX2D, mboolEX3D As Boolean +Dim mboolStoneD As Boolean + +Private Sub cmdExit_Click() + Unload Me + +End Sub + +Private Sub cmdSave_Click() + + With moRS + !superp = Field2CheckBox(chkSuperP) + !WrapP = Field2CheckBox(chkWrapP) + !LathP = Field2CheckBox(chkLathP) + !StoneP = Field2CheckBox(chkStoneP) + !NescoP = Field2CheckBox(chkNescoP) + !PopoutP = Field2CheckBox(chkPopOutP) + !BrownP = Field2CheckBox(chkBrownP) + !TexP = Field2CheckBox(chkTextureP) + !CMUP = Field2CheckBox(chkCMUP) + !EX1P = Field2CheckBox(chkEX1P) + !EX1Purpose = Field2Str(txtEX1Desc) + !EX1Amt = Field2Str2(txtEX3Amt) + !EX2P = Field2CheckBox(chkEX2P) + !EX2Purpose = Field2Str(txtEX2Desc) + !EX2Amt = Field2Str2(txtEX3Amt) + !EX3P = Field2CheckBox(chkEX3P) + !EX3Purpose = Field2Str(txtEX3Desc) + !EX3Amt = Field2Str2(txtEX3Amt) + !combine = Field2CheckBox(chkCombine) + .Update + End With + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + + + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + lblProjLot = mstrPROJLOT +' If moRS!Split Then +' mboolSPLIT = True +' Else +' mboolSPLIT = False +' End If + End If + + Exit Function + +End Function + +Private Sub Form_Load() + + Call ProjLoad + If FormFind() Then + Call FormShow + End If +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRSProj!stone Then +' mboolStone = True +' End If +' mstrWIRE = Field2Str(moRSProj!wire) + +' gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form LotInfo5 - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_ID + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + + With moRS + chkCombine = Field2CheckBox(!combine) + chkSuperP = Field2CheckBox(!superp) + chkWrapP = Field2CheckBox(!WrapP) + chkLathP = Field2CheckBox(!LathP) + chkStoneP = Field2CheckBox(!StoneP) + chkNescoP = Field2CheckBox(!NescoP) + chkPopOutP = Field2CheckBox(!PopoutP) + chkBrownP = Field2CheckBox(!BrownP) + chkTextureP = Field2CheckBox(!TexP) + chkCMUP = Field2CheckBox(!CMUP) + chkEX1P = Field2CheckBox(!EX1P) + chkEX2P = Field2CheckBox(!EX2P) + chkEX3P = Field2CheckBox(!EX3P) +' mboolSupD = Field2TrueFalse(!superd) + mboolWrapD = Field2TrueFalse(!WrapD) + mboolLathD = Field2TrueFalse(!LathD) + mboolStoneD = Field2TrueFalse(!StoneD) + mboolNescoD = Field2TrueFalse(!NescoD) + mboolPopOutD = Field2TrueFalse(!PopOutD) + mboolBrownD = Field2TrueFalse(!BrownD) + mboolTexD = Field2TrueFalse(!TexD) + mboolCMUD = Field2TrueFalse(!CMUD) + mboolEX1D = Field2TrueFalse(!EX1D) + mboolEX2D = Field2TrueFalse(!EX2D) + mboolEX3D = Field2TrueFalse(!EX3D) + End With +' If mboolSupD Then +' chkSuperP.Enabled = False +' lblSuperD.Visible = True +' End If + If mboolWrapD Then + chkWrapP.Enabled = False + lblWrap.Visible = True + End If + If mboolLathD Then + chkLathP.Enabled = False + lblLath.Visible = True + End If + If mboolStoneD Then + chkStoneP.Enabled = False + lblStone.Visible = True + End If + If mboolNescoD Then + chkNescoP.Enabled = False + lblNesco.Visible = True + End If + If mboolPopOutD Then + chkPopOutP.Enabled = False + lblPopOut.Visible = True + End If + If mboolBrownD Then + chkBrownP.Enabled = False + lblBrown.Visible = True + End If + If mboolTexD Then + chkTextureP.Enabled = False + lblTex.Visible = True + End If + If mboolCMUD Then + chkCMUP.Enabled = False + lblCMU.Visible = True + End If + If mboolEX1D Then + chkEX1P.Enabled = False + lblEX1.Visible = True + End If + If mboolEX2D Then + chkEX2P.Enabled = False + lblEX2.Visible = True + End If + If mboolEX3D Then + chkEX3P.Enabled = False + lblEX3.Visible = True + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo5 - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frx new file mode 100644 index 0000000..612a949 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotPrtJobs.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frm new file mode 100644 index 0000000..eb5fbeb --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frm @@ -0,0 +1,260 @@ +VERSION 5.00 +Begin VB.Form frmLotSearch + Caption = "Lot Search Form" + ClientHeight = 6315 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9930 + LinkTopic = "Form1" + ScaleHeight = 6315 + ScaleWidth = 9930 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdCancel + Caption = "Cancel" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3780 + TabIndex = 10 + Top = 1140 + Width = 1515 + End + Begin VB.CommandButton cmdContinue + Caption = "Continue" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3780 + TabIndex = 4 + Top = 1920 + Width = 1515 + End + Begin VB.ListBox lstLots + Height = 3570 + Left = 2760 + Sorted = -1 'True + TabIndex = 9 + TabStop = 0 'False + Top = 2580 + Width = 7155 + End + Begin VB.CommandButton cmdFName + Height = 435 + Left = 120 + Picture = "frmLotSearch.frx":0000 + Style = 1 'Graphical + TabIndex = 3 + Top = 1980 + Width = 555 + End + Begin VB.CommandButton cmdFCode + Height = 435 + Left = 120 + Picture = "frmLotSearch.frx":0442 + Style = 1 'Graphical + TabIndex = 1 + Top = 1200 + Width = 555 + End + Begin VB.ListBox lstProject + Height = 3570 + Left = 120 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 2580 + Width = 2595 + End + Begin VB.TextBox txtSName + Height = 375 + Left = 780 + TabIndex = 2 + Top = 2040 + Width = 2595 + End + Begin VB.TextBox txtSCode + Height = 375 + Left = 780 + TabIndex = 0 + Top = 1260 + Width = 2595 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Name:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 7 + Top = 1680 + Width = 1965 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Code:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 6 + Top = 900 + Width = 1905 + End + Begin VB.Label lblInstruct + Caption = $"frmLotSearch.frx":0884 + Height = 675 + Left = 900 + TabIndex = 5 + Top = 180 + Width = 3795 + End +End +Attribute VB_Name = "frmLotSearch" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Private Sub cmdCancel_Click() + Unload Me +End Sub + +Private Sub cmdContinue_Click() + gintTOID = lstLots.ItemData(lstLots.ListIndex) + Unload Me + frmLotInfo.Show + +End Sub + +Private Sub cmdFCode_Click() + Call CodeLoad +End Sub + +Private Sub cmdFName_Click() + Call NameLoad + +End Sub +Private Sub CodeLoad() + Dim oRS As Recordset + Dim strSQL As String, strSelect As String, strCode As String + strCode = Trim$(txtSCode.Text) + strSelect = "proj_code LIKE '" & strCode & "*'" ' & """" + + strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject " + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRS.Filter = strSelect + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem oRS("Proj_desc") + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + + oRS.MoveNext + Loop + oRS.Close + lstProject.ListIndex = 0 +End Sub + +Private Sub NameLoad() + Dim oRS As Recordset + Dim strSQL As String, strSelect As String, strCode As String + strCode = Trim$(txtSName.Text) + strSelect = "proj_desc LIKE '" & strCode & "*'" ' & """" + + strSQL = "SELECT Proj_id, Proj_desc FROM tblProject " + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRS.Filter = strSelect + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem oRS("Proj_desc") + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + + oRS.MoveNext + Loop + oRS.Close + lstProject.ListIndex = 0 +End Sub + + +Private Sub txtSCode_LostFocus() + txtSCode.Text = UCase(txtSCode.Text) +End Sub +Private Sub lstProject_Change() + Call LotLoad +End Sub + +Private Sub lstProject_Click() + Call LotLoad +End Sub +Private Sub LotLoad() + Dim oRS As Recordset + Dim strSQL As String, strLine As String + + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strSQL = "SELECT lot_id, lot_no, address, model, owner from tbllotinfo WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLots.Clear + + Do Until oRS.EOF + With lstLots +' strLine = oRS!lot_no & " " & Format$(oRS!address, " ") & vbTab & oRS!model & vbTab & oRS!owner + strLine = oRS!lot_no & vbTab & oRS!model & vbTab & oRS!address & " --- " & oRS!owner + .AddItem Field2Str(strLine) + .ItemData(.NewIndex) = oRS("lot_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLots.ListCount Then + lstLots.ListIndex = 0 + End If + + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frx new file mode 100644 index 0000000..86c129e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmLotSearch.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frm new file mode 100644 index 0000000..4a827db --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frm @@ -0,0 +1,1111 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmMANBILL + Caption = "Manual Billing" + ClientHeight = 7020 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10740 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7020 + ScaleWidth = 10740 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpCombo cboARCode + Height = 315 + Left = 6030 + TabIndex = 19 + Top = 345 + Width = 4710 + _Version = 196608 + _ExtentX = 8308 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 5 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmMANBILL.frx":0000 + End + Begin LpLib.fpList lstHeader + Height = 3000 + Left = 90 + TabIndex = 15 + Top = 2685 + Width = 4470 + _Version = 196608 + _ExtentX = 7885 + _ExtentY = 5292 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmMANBILL.frx":043E + End + Begin VB.TextBox txtTax + Height = 315 + Left = 5490 + TabIndex = 14 + Top = 5100 + Width = 495 + End + Begin Crystal.CrystalReport crAR + Left = 4650 + Top = 5250 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "RePrint Invoice" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6090 + TabIndex = 12 + Top = 5775 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6135 + TabIndex = 11 + Top = 6510 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6090 + TabIndex = 10 + Top = 5055 + Width = 1275 + End + Begin VB.CheckBox chkReady + Alignment = 1 'Right Justify + Caption = "Ready to Transfer to CMS:" + Height = 255 + Left = 5100 + TabIndex = 5 + Top = 4365 + Width = 2205 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 6150 + MaxLength = 10 + TabIndex = 4 + Top = 4035 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 6150 + MaxLength = 7 + TabIndex = 3 + Top = 3615 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6150 + MaxLength = 10 + TabIndex = 2 + Top = 3195 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + Height = 315 + Left = 6150 + MaxLength = 10 + TabIndex = 1 + Top = 2775 + Width = 1200 + End + Begin VB.ListBox lstDetail + Height = 1230 + Left = 90 + TabIndex = 0 + Top = 5760 + Width = 5895 + End + Begin VB.Label lblDone + AutoSize = -1 'True + Caption = "Already Transfered To CMS" + BeginProperty Font + Name = "Arial" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 285 + Left = 4620 + TabIndex = 18 + Top = 4665 + Visible = 0 'False + Width = 3135 + End + Begin VB.Label lblProjLotDesc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1245 + TabIndex = 17 + Top = 45 + Width = 9450 + End + Begin VB.Label lblProjLot + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project - Lot" + Height = 195 + Left = 195 + TabIndex = 16 + Top = 75 + Width = 855 + End + Begin VB.Label lblTax + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code" + Height = 195 + Left = 4740 + TabIndex = 13 + Top = 5190 + Width = 690 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Sales Code:" + Height = 195 + Left = 4830 + TabIndex = 9 + Top = 3720 + Width = 1245 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 5145 + TabIndex = 8 + Top = 4140 + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payment Due Date:" + Height = 195 + Left = 4680 + TabIndex = 7 + Top = 3300 + Width = 1395 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Date:" + Height = 195 + Left = 5100 + TabIndex = 6 + Top = 2880 + Width = 960 + End +End +Attribute VB_Name = "frmMANBILL" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSDetail As Recordset +Dim moRSProj As Recordset, moRS As Recordset +Dim mstrARCode As String +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and Lot_ID = " & gintLOTID '& "'" ' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Lot_ID) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!invoice_date) & vbTab + strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & vbTab & Format(Field2Str2(oRS!Lot_ID), "000000") +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub HMAS90Load() +Dim oRS As Recordset +Dim strSQL As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' strSQL = "SELECT * FROM tblARInvoice WHERE shipped and header and Lot_ID = " & gintLOTID '& "'" ' and not done" + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE Lot_ID = " & gintLOTID '& "'" ' and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = "" + strLine = Field2Str2(oRS!Lot_ID) & vbTab & Field2Str(oRS!InvoiceNumber) & vbTab & Field2Str(oRS!InvoiceDate) & vbTab + strLine = strLine & Format(Field2Str2(oRS!NonTaxableSalesAmount), "Currency") & vbTab & Format(Field2Str2(oRS!Lot_ID), "000000") +' strLine = "" +' strLine = Field2Str(oRS!invoice_no) & " " & Field2Str(oRS!invoice_date) & vbTab +' strLine = strLine & Format(Field2Str2(oRS!non_tax_amt), "Currency") & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 + cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module HMAS90Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub DetailLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + lstHeader.col = 1 + mstrINVNO = lstHeader.ColText +' strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and lot_id = " & gintLOTID & " and not done" + strSQL = "SELECT trans_ID, sales_code, lot_id, header, shipped, description, amount from tblARInvoice WHERE shipped and Invoice_no = '" & mstrINVNO & "'" ' and not done" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' msglInvTotal = 0 + lstDetail.Clear + + Do Until oRS.EOF + strLine = "" +' msglInvTotal = msglInvTotal + field2single(oRS!amount) + If Len(Format(Field2Str2(oRS!amount), "currency")) > 7 Then + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & Field2Str(oRS!Description) + Else + strLine = Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "currency") & vbTab & vbTab & Field2Str(oRS!Description) + End If + lstDetail.AddItem strLine + lstDetail.ItemData(lstDetail.NewIndex) = Field2Long(oRS!Trans_ID) + oRS.MoveNext + Loop + oRS.Close + + If lstDetail.ListCount Then + lstDetail.ListIndex = 0 + Else + lstDetail.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module DetailLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboARCode_Change() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub cboARCode_Click() + lstHeader.Clear + lstDetail.Clear + Call HeaderLoad +End Sub + +Private Sub chkReady_Click() + cmdSave.Enabled = True +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT trans_id, ProjLot, PO_Num FROM tblARINVOICE WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gstrPONUM = Field2Str(oRS!po_num) + mstrPROJLOT = Field2Str(oRS!ProjLot) + Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\invoice.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module PrintStoneInv" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSDetail.State = adStateOpen Then + moRSDetail.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form MANBILL - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + lstDetail.Enabled = True + lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() +Dim mstrProj, mstrLotNo, mstrProjDesc, mstrLotAddress As String + + + Call ARCodeLoad + frmMANBILL.Caption = "Manual Billing - " & gstrLOGIN + Call ProjLoad + Call LotLoad + Call HeaderLoad +' Call HMAS90Load + Call DetailLoad + +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LotLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblLotInfo where Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not moRS.EOF Then +' mstrARCode = moRSProj!ar + If Not moRSProj.EOF Then +' mstrARCode = moRS!ar + lblProjLotDesc = Trim(Field2Str(moRSProj!Proj_Code)) & " -- " & Trim(Field2Str(moRS!lot_no)) & " -- " + lblProjLotDesc = lblProjLotDesc & Trim(Field2Str(moRS!model)) & " -- " & Trim(Field2Str(moRS!address)) + + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module LotLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ARCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim lngLOTID As Long, strINVNO As String +Dim row, col As Long + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE Lot_ID = " & gintLOTID & " ORDER BY InvoiceNumber" +' strSQL = "SELECT AR_ID, InvoiceNumber, InvoiceDate, JobNumber, NonTaxableSalesAmount FROM ARN_InvHistoryHeader WHERE Lot_ID = " & gintLOTID +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If Not strINVNO = Field2Str(oRS!InvoiceNumber) And Not lngLOTID = Field2Str2(oRS!Lot_ID) Then + strLine = Field2Str(oRS!AR_ID) & vbTab & Field2Str(oRS!InvoiceNumber) & vbTab & Field2Str(oRS!InvoiceDate) & vbTab & Field2Str(oRS!JobNumber) & vbTab & Format(Field2Str(oRS!NonTaxableSalesAmount), "#,#.00") + cboARCode.AddItem strLine + strINVNO = Field2Str(oRS!InvoiceNumber) + lngLOTID = Field2Str2(oRS!Lot_ID) + Else +' cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!Bill_Id) + strINVNO = Field2Str(oRS!InvoiceNumber) + lngLOTID = Field2Str2(oRS!Lot_ID) + End If + oRS.MoveNext + Loop + oRS.Close + cboARCode.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module ARCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSDetail + txtInvDate = Field2Str(!invoice_date) + txtDueDate = Field2Str(!inv_due_date) + txtItemAmt = Format(Field2Str2(!amount), "currency") + txtSalesCode = Field2Str(!sales_code) + If !done Then + lblDone.Visible = True + Else + lblDone.Visible = False + End If + txtTAX = Field2Str(!taxcode) + If txtTAX = "AZ" Then + txtTAX.BackColor = &H80FFFF + txtTAX.ForeColor = &HFF& + txtTAX.FontBold = True + Else + txtTAX.BackColor = &H80000005 + txtTAX.ForeColor = &H80000008 + txtTAX.FontBold = False + End If + chkReady = Field2CheckBox(!ready) + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindDetail() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblARInvoice " + strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) + Set moRSDetail = New Recordset + moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSDetail.EOF Then + FormFindDetail = False + Else + FormFindDetail = True + msglInvTotal = moRSDetail!non_tax_amt + mstrType = moRSDetail!inv_type + gintPROJID = moRSDetail!PROJ_ID + Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form MANBILL - Module FormFindDetail" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lblARCode_Click() + +End Sub + +Private Sub lstDetail_Click() + If lstDetail.ListIndex <> -1 Then + If FormFindDetail() Then + Call FormShow + + End If + End If +End Sub +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSDetail + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !price = Str2Field(txtItemAmt) + !amount = Str2Field(txtItemAmt) + !sales_code = Str2Field(txtSalesCode) + .Update + End With + + strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + msglInvTotal = Field2Str2(oRS!sglTOTAL) + + strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + With oRS + !invoice_date = Str2Field(txtInvDate) + !inv_due_date = Str2Field(txtDueDate) + !ready = chkReady + !non_tax_amt = msglInvTotal + !taxcode = Str2Field(txtTAX) + If Field2Str2(moRSProj!retention) > 0 Then + !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") + Else + !retention_amt = 0 + End If + .Update + End With + oRS.MoveNext + Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + cmdPrint.Enabled = True + lstHeader.col = 4 + gintLOTID = lstHeader.ColText +' gintLOTID = lstHeader.ItemData(lstHeader.ListIndex) + Call DetailLoad + If lstDetail.ListIndex <> -1 Then + Else + lstDetail.Clear + Call FormClear + End If + Else + cmdPrint.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form MANBILL - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + End If + End If + ElseIf IsDate(txtInvDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + End If + +End Sub + +Private Sub txtItemAmt_GotFocus() + Call FieldSelect(txtItemAmt) + msglItemAmt = Single2Field(txtItemAmt) +End Sub + +Private Sub txtItemAmt_LostFocus() + If msglItemAmt < Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then + msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) + txtItemAmt = Format(txtItemAmt, "#,#.00") + ElseIf msglItemAmt = Field2Str(txtItemAmt) Then + txtItemAmt = Format(txtItemAmt, "#,#.00") + End If +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTAX) +End Sub + +Private Sub txtTax_LostFocus() + If Not IsNull(txtTAX) Or txtTAX = "" Then + txtTAX = UCase(txtTAX) + Else + MsgBox "You Must Enter A Sales Tax Code", vbOKOnly, "No Tax Code" + txtTAX.SetFocus + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frx new file mode 100644 index 0000000..3b51080 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMANBILL.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frm new file mode 100644 index 0000000..8269b58 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frm @@ -0,0 +1,7348 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmMain + BorderStyle = 1 'Fixed Single + Caption = "Valley Wide Plastering" + ClientHeight = 8595 + ClientLeft = 150 + ClientTop = 720 + ClientWidth = 11880 + BeginProperty Font + Name = "Microsoft Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Icon = "frmMain.frx":0000 + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 8595 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPOBill + Caption = "Process WO && PO Bills" + Height = 495 + Left = 8220 + TabIndex = 49 + Top = 2700 + Width = 1515 + End + Begin VB.CommandButton cmdFJCCode + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 135 + Picture = "frmMain.frx":068A + Style = 1 'Graphical + TabIndex = 47 + Top = 2835 + Width = 555 + End + Begin VB.TextBox txtSJCCode + Height = 375 + Left = 780 + TabIndex = 46 + Top = 2880 + Width = 2475 + End + Begin LpLib.fpList lstContains + Height = 2835 + Left = 105 + TabIndex = 44 + Top = 4230 + Visible = 0 'False + Width = 11625 + _Version = 196608 + _ExtentX = 20505 + _ExtentY = 5001 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 8 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmMain.frx":0ACC + End + Begin VB.TextBox txtSContain + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 780 + TabIndex = 5 + Top = 2190 + Width = 2475 + End + Begin VB.CommandButton cmdFContain + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 135 + Picture = "frmMain.frx":108D + Style = 1 'Graphical + TabIndex = 6 + Top = 2160 + Width = 555 + End + Begin VB.CommandButton cmdUpRGard + Caption = "Update OptNum" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5655 + TabIndex = 42 + Top = 8025 + Visible = 0 'False + Width = 960 + End + Begin VB.CommandButton cmdReNum + Caption = "ReNumber" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3975 + TabIndex = 41 + Top = 8025 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdFixBill + Caption = "Setup Billing" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1980 + TabIndex = 40 + Top = 8025 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdHourly + Caption = "Hourly Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 39 + Top = 2700 + Width = 1515 + End + Begin VB.CommandButton cmdJCList + Caption = "Select JC List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 37 + Top = 2175 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdFindSPO + Caption = "Find Special PO Info." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 36 + Top = 2175 + Width = 1515 + End + Begin VB.CommandButton cmdFindOrder + Caption = "Find Purchase Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4965 + TabIndex = 35 + Top = 2175 + Width = 1515 + End + Begin MSComDlg.CommonDialog cdMain + Left = 840 + Top = 8085 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + CancelError = -1 'True + DialogTitle = "Select Bank Rec File" + InitDir = "c:\BankOne" + End + Begin VB.CommandButton cmdChecks + Caption = "Verify Checks" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 34 + TabStop = 0 'False + Top = 2175 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdProjNotes + Caption = "Pro&Ject Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6555 + TabIndex = 33 + TabStop = 0 'False + Top = 2175 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdInvoice + Caption = "Builder Invoice List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 32 + TabStop = 0 'False + Top = 80 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdShip + Caption = "Lot Invoice && Shipping" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 31 + TabStop = 0 'False + Top = 600 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdBilling + Caption = "Billing &Grid" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9825 + TabIndex = 30 + TabStop = 0 'False + Top = 1110 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdScafList + Caption = "Scaffold List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9840 + TabIndex = 29 + TabStop = 0 'False + Top = 1650 + Width = 1515 + End + Begin VB.CommandButton cmdPrintJCRpt + Caption = "Print Only - Job Cost Reports" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 28 + TabStop = 0 'False + Top = 1650 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdJCRpt + Caption = "Calculate && Print Job Cost" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6555 + TabIndex = 27 + TabStop = 0 'False + Top = 1650 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdJCUpdate + Caption = "&Update Lot Job Code Info" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4965 + TabIndex = 26 + TabStop = 0 'False + Top = 1650 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdScaffold + Caption = "Scaffold Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3345 + TabIndex = 25 + TabStop = 0 'False + Top = 1650 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdPOInfo + Caption = "PO Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 23 + TabStop = 0 'False + Top = 600 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdLotInfo + Caption = "Lot &Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 22 + TabStop = 0 'False + Top = 1125 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdSchedule + Caption = "&Schedule Repair" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6585 + TabIndex = 21 + TabStop = 0 'False + Top = 1125 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdRepairList + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 20 + TabStop = 0 'False + Top = 1125 + Width = 1515 + End + Begin Crystal.CrystalReport crMain + Left = 195 + Top = 8055 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdYardOrder + Caption = "&Yard Order Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 19 + TabStop = 0 'False + Top = 600 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdPOList + Caption = "Process Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3360 + TabIndex = 18 + TabStop = 0 'False + Top = 1125 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdDates + Caption = "Order &Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 17 + TabStop = 0 'False + Top = 600 + Visible = 0 'False + Width = 1515 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 16 + TabStop = 0 'False + Top = 600 + Width = 1515 + End + Begin VB.CommandButton cmdPayroll + Caption = "&Payroll Information" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6600 + TabIndex = 15 + TabStop = 0 'False + Top = 80 + Width = 1515 + End + Begin VB.CommandButton cmdNewSearch + Caption = "&New Search" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8220 + TabIndex = 14 + TabStop = 0 'False + Top = 80 + Width = 1515 + End + Begin VB.CommandButton cmdPlans + Caption = "&Plans" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1740 + TabIndex = 13 + TabStop = 0 'False + Top = 80 + Width = 1515 + End + Begin VB.TextBox txtSCode + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 780 + TabIndex = 0 + Top = 840 + Width = 2475 + End + Begin VB.TextBox txtSName + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 795 + TabIndex = 2 + Top = 1485 + Width = 2475 + End + Begin VB.CommandButton cmdFCode + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 120 + Picture = "frmMain.frx":14CF + Style = 1 'Graphical + TabIndex = 1 + Top = 780 + Width = 555 + End + Begin VB.CommandButton cmdFName + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 135 + Picture = "frmMain.frx":1911 + Style = 1 'Graphical + TabIndex = 3 + Top = 1470 + Width = 555 + End + Begin VB.CommandButton cmdTakeR + Caption = "&Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3375 + TabIndex = 7 + TabStop = 0 'False + Top = 80 + Width = 1515 + End + Begin VB.CommandButton cmdOrderR + Caption = "&Orders" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4980 + TabIndex = 10 + Top = 80 + Width = 1515 + End + Begin VB.CommandButton cmdLotSearch + Caption = "&Lot Search" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 105 + TabIndex = 4 + TabStop = 0 'False + Top = 80 + Width = 1515 + End + Begin VB.ListBox lstProject + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 3570 + Left = 705 + Sorted = -1 'True + TabIndex = 9 + TabStop = 0 'False + Top = 3990 + Visible = 0 'False + Width = 2640 + End + Begin VB.ListBox lstLots + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 3570 + Left = 3405 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 3990 + Visible = 0 'False + Width = 6000 + End + Begin VB.Label lblJCCode + AutoSize = -1 'True + Caption = "Search JC Code" + BeginProperty Font + Name = "Microsoft Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 48 + Top = 2580 + Width = 1680 + End + Begin VB.Label lblCALC + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Calculating - Be Patient" + BeginProperty Font + Name = "Arial Black" + Size = 24 + Charset = 0 + Weight = 900 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 630 + Left = 1140 + TabIndex = 45 + Top = 7185 + Visible = 0 'False + Width = 6885 + End + Begin VB.Label lblContain + AutoSize = -1 'True + Caption = "Search Address Info" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 43 + Top = 1905 + Width = 2115 + End + Begin VB.Label lblDesc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 705 + TabIndex = 38 + Top = 3630 + Visible = 0 'False + Width = 9030 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 705 + TabIndex = 24 + Top = 3315 + Visible = 0 'False + Width = 9030 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Code:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 105 + TabIndex = 12 + Top = 555 + Width = 1905 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision Name:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 105 + TabIndex = 11 + Top = 1245 + Width = 1965 + End + Begin VB.Menu mnuFile + Caption = "&File" + Begin VB.Menu mnuExit + Caption = "E&xit" + End + End + Begin VB.Menu mnuPrograms + Caption = "&Programs" + Begin VB.Menu mnuOrders + Caption = "&Orders" + Enabled = 0 'False + Begin VB.Menu mnuOrderR + Caption = "Orders Regular" + Checked = -1 'True + End + Begin VB.Menu mnuOrder5 + Caption = "Orders PreMix/Typar" + End + Begin VB.Menu mnuOrderE + Caption = "Orders Synthetic" + End + End + Begin VB.Menu mnuPlans + Caption = "&Plans" + Enabled = 0 'False + End + Begin VB.Menu mnuTake + Caption = "&Takeoff" + Enabled = 0 'False + Begin VB.Menu mnuTakeR + Caption = "TakeOff Regular" + Checked = -1 'True + End + Begin VB.Menu mnuTake5 + Caption = "TakeOff PreMix/Typar" + End + Begin VB.Menu mnuTakeE + Caption = "TakeOff Synthetic" + End + End + Begin VB.Menu mnuPayroll + Caption = "&Payroll Informaton" + Enabled = 0 'False + End + Begin VB.Menu mnuPOList + Caption = "Purchase Order &List" + End + Begin VB.Menu mnuMARUpdate + Caption = "Update Metro Stucco AR Master File" + End + Begin VB.Menu mnuARUPDATE + Caption = "Update AR Master File" + End + Begin VB.Menu mnuFIXAR + Caption = "Fix AR Invoice JC Information" + End + Begin VB.Menu mnuAPUPDATE + Caption = "Update AP Master File" + End + Begin VB.Menu mnuFIXAP + Caption = "Fix AP Invoice JC Information" + End + Begin VB.Menu mnuUpCheck + Caption = "&Update Check Information" + Visible = 0 'False + End + Begin VB.Menu mnuEstInv + Caption = "Estimator Inventory" + End + Begin VB.Menu mnuMARTransfer + Caption = "Setup Metro AR Transfer" + Enabled = 0 'False + End + Begin VB.Menu mnuTransfer + Caption = "Setup AR &Transfer" + Enabled = 0 'False + End + Begin VB.Menu mnuMJCTrans + Caption = "Metro JC Transfer Complete" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuJCTrans + Caption = "&JC Transfer Complete" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuCMSAP + Caption = "Import CMS AP Info" + Enabled = 0 'False + End + Begin VB.Menu mnuCMSAR + Caption = "Import CMS AR Info" + Enabled = 0 'False + End + Begin VB.Menu mnuCMSPP + Caption = "Import CMS PosPay Info VWP" + Enabled = 0 'False + Begin VB.Menu mnuCMSPPVW + Caption = "Valley Wide" + End + Begin VB.Menu mnuCMSPPSW + Caption = "SuperWall" + End + End + Begin VB.Menu mnuAddPPay + Caption = "Enter PosPay Checks For Upload To Bank" + Enabled = 0 'False + Begin VB.Menu mnuAddPPayV + Caption = "Valley Wide" + End + Begin VB.Menu mnuAddPPayS + Caption = "SuperWall" + End + Begin VB.Menu mnuAddPPayC + Caption = "Casa Rica" + End + End + Begin VB.Menu mnuAck + Caption = "Orders Shipped &Acknowlegement" + End + Begin VB.Menu mnuFoamOrder + Caption = "Foam Order Information" + End + Begin VB.Menu mnuPosPay + Caption = "Set&Up PosPay File" + Enabled = 0 'False + Begin VB.Menu mnuABTPosPayV + Caption = "AZ Bank and Trust - VWP" + End + Begin VB.Menu mnuABTPosPayS + Caption = "AZ Bank and Trust - SWI" + End + Begin VB.Menu mnuABTPosPayC + Caption = "AZ Bank and Trust - CRD" + End + End + Begin VB.Menu mnuUInv + Caption = "Update Inventory Delivery Flag" + Enabled = 0 'False + Visible = 0 'False + End + Begin VB.Menu mnuSetupSWMAR + Caption = "Setup SW Metro AR Transfer" + End + Begin VB.Menu mnuSWTRANSFER + Caption = "Setup SW AR Transfer" + End + Begin VB.Menu mnuMAPTransfer + Caption = "Setup Metro AP Transfer" + End + Begin VB.Menu mnuAPTransfer + Caption = "Setup AP Transfer" + End + Begin VB.Menu mnuFindPO + Caption = "&Find PO ID Number" + End + End + Begin VB.Menu mnuUtilities + Caption = "&Utilities" + Begin VB.Menu mnuLabor + Caption = "&Labor Rates" + Enabled = 0 'False + End + Begin VB.Menu mnuSupplier + Caption = "&Suppliers" + Enabled = 0 'False + End + Begin VB.Menu mnuBP + Caption = "&Black Paper" + Enabled = 0 'False + End + Begin VB.Menu mnuTexture + Caption = "&Texture" + Enabled = 0 'False + End + Begin VB.Menu mnuContractor + Caption = "Cont&ractors" + Enabled = 0 'False + End + Begin VB.Menu mnuCrew + Caption = "Lath/Stucco &Crews" + Enabled = 0 'False + End + Begin VB.Menu mnuRCrew + Caption = "&Repair Crews" + Enabled = 0 'False + End + Begin VB.Menu mnuSCrew + Caption = "Scaffolding Drivers" + End + Begin VB.Menu mnuProject + Caption = "&Projects" + Enabled = 0 'False + End + Begin VB.Menu mnuScaffold + Caption = "Scaffold Setup" + Visible = 0 'False + End + Begin VB.Menu mnuInvList + Caption = "&Inventory List" + Enabled = 0 'False + End + Begin VB.Menu mnuInvPrice + Caption = "Inventory &Price" + Enabled = 0 'False + End + Begin VB.Menu mnuYInvList + Caption = "&Yard Inventory List" + Enabled = 0 'False + End + Begin VB.Menu mnuSand + Caption = "Sand &Zone" + Enabled = 0 'False + End + Begin VB.Menu mnuUser + Caption = "&Users" + Enabled = 0 'False + End + End + Begin VB.Menu mnuReports + Caption = "&Reports" + Begin VB.Menu mnuInvCount + Caption = "Inventory Count" + End + Begin VB.Menu mnuYardRange + Caption = "Yard Orders - Date Range" + End + Begin VB.Menu mnuYard1Date + Caption = "Yard Orders - 1 Date" + End + Begin VB.Menu mnuOrdersDate + Caption = "Texture Orders - Date Range" + Visible = 0 'False + End + Begin VB.Menu mnuLathList + Caption = "Lath Orders - Date Range" + Visible = 0 'False + End + Begin VB.Menu mnuPlanUse + Caption = "Plan Usage by Project" + End + Begin VB.Menu mnuProjPlan + Caption = "Project Plan Information" + End + Begin VB.Menu mnuBid + Caption = "&Bid Report" + End + Begin VB.Menu mnuVoid + Caption = "&Void Check List" + Visible = 0 'False + End + Begin VB.Menu mnuPOListdesc + Caption = "PO List in Descending Order" + End + Begin VB.Menu mnuMAPEdit + Caption = "Metro AP Edit List" + End + Begin VB.Menu mnuAPEdit + Caption = "AP &Edit List" + End + Begin VB.Menu mnuMAREdit + Caption = "Metro AR Edit List" + End + Begin VB.Menu mnuAREditMenu + Caption = "AR Edit List" + Begin VB.Menu mnuAREdit + Caption = "AR Edit for SW" + End + Begin VB.Menu mnuAREdit2 + Caption = "AR Edit List For Lots" + End + End + Begin VB.Menu mnuProjJC + Caption = "Project JC Summary" + Visible = 0 'False + End + Begin VB.Menu mnuRepList + Caption = "Report List" + End + End + Begin VB.Menu mnuMainHelp + Caption = "&Help" + Begin VB.Menu mnuHelp + Caption = "&Help" + End + Begin VB.Menu mnuLine + Caption = "-" + End + Begin VB.Menu mnuAbout + Caption = "&About" + End + End + Begin VB.Menu mnuTOI + Caption = "Tie Options" + Visible = 0 'False + End +End +Attribute VB_Name = "frmMain" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSProj As Recordset, moRS As Recordset, moRSPPay As Recordset, moRSAPHist As Recordset +Dim mstrBegDate As String, mstrEndDate As String, moRSARHist As Recordset +Dim mboolSHOW As Boolean, mboolMARK As Boolean +Dim mboolPRINT As Boolean, mboolREPORT As Boolean, mboolWINDOW As Boolean + +Private Sub cmdBilling_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmBilling.Show 1 +End Sub + +Private Sub UpTOMatrl() +Dim strSQL As String, oRS As Recordset, strSQLL As String, oRSS As Recordset + + lblCALC.Caption = "Updating tblTOMatrl" + lblCALC.Visible = True + DoEvents + + strSQL = "SELECT * FROM tblTOMAT" +' strSQL = "SELECT * FROM tblTOMATRLxx WHERE TOID < 2000" + Set oRS = New Recordset + oRS.Open strSQL, goConn ', adOpenDynamic, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + MsgBox "tblTOMat Not Open - EXITING", vbOKOnly + lblCALC.Visible = False + Exit Sub + End If + + strSQLL = "SELECT * FROM tblTOMatrl" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + MsgBox "tblTOMatrl Not Open - EXITING", vbOKOnly + lblCALC.Visible = False + Exit Sub + End If + + oRS.MoveFirst + + Do Until oRS.EOF + oRSS.AddNew + oRSS!toid = oRS!toid + oRSS!inv_no = oRS!inv_no + oRSS!Desc = oRS!Desc + oRSS!qty = oRS!qty + oRSS!price = oRS!price + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!calc_flag = oRS!calc_flag + oRSS!calc_amt = oRS!calc_amt + oRSS!trnsflag = oRS!trnsflag + oRSS!cflag = oRS!cflag + oRSS.Update + + oRS.MoveNext + Loop + oRS.Close + oRSS.Close + MsgBox ("TakeOff MATERIAL Inventory Number is UpDated") + lblCALC.Visible = False + +End Sub + +Private Sub UpLOTMatrl() +Dim strSQL As String, oRS As Recordset, strSQLL As String, oRSS As Recordset + + lblCALC.Caption = "Updating tblLOTMatrl" + lblCALC.Visible = True + DoEvents + + strSQL = "SELECT * FROM tblLOTMAT" +' strSQL = "SELECT * FROM tblTOMATRLxx WHERE TOID < 2000" + Set oRS = New Recordset + oRS.Open strSQL, goConn4 ', adOpenDynamic, adLockOptimistic +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + MsgBox "tblLOTMAT Not Open - EXITING", vbOKOnly + lblCALC.Visible = False + Exit Sub + End If + + strSQLL = "SELECT * FROM tblLOTMatrl" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn4, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + MsgBox "tblLOTMatrl Not Open - EXITING", vbOKOnly + lblCALC.Visible = False + Exit Sub + End If + + oRS.MoveFirst + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = oRS!Lot_ID + oRSS!inv_no = oRS!inv_no + oRSS!Desc = oRS!Desc + oRSS!qty = oRS!qty + oRSS!price = oRS!price + oRSS!d_flag = oRS!d_flag + oRSS!m_type = oRS!m_type + oRSS!calc_flag = oRS!calc_flag + oRSS!calc_amt = oRS!calc_amt + oRSS!ch_flag = oRS!ch_flag + oRSS!rc_flag = oRS!rc_flag + oRSS!o_qty = oRS!o_qty + oRSS!Prnt_Flag = oRS!Prnt_Flag + oRSS.Update + + oRS.MoveNext + Loop + oRS.Close + oRSS.Close + MsgBox ("LOT MATERIAL Inventory Number is UpDated") + lblCALC.Visible = False + +End Sub + +Private Sub ImportCMSPPVW() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim oRSS As Recordset, strSQLL As String, boolNEW As Boolean +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCOUNT As Integer +Dim strVend As String, strINVOICE As String, strTYPE As String, strINVDATE As String, strJCCODE As String, dblAmt As String +Dim strVNAME As String, strSQLV As String, oRSAPV As Recordset +Dim strName As String + + On Error GoTo Error_EH + boolNEW = False +' cdMain.InitDir = "G:\Access\PosPay\" + cdMain.InitDir = "G:\A_PosPay\PosPayVW\" + cdMain.Action = 1 + strFile = cdMain.FileName + intCOUNT = 0 + + strSQL = "Select * FROM tblPosPayVWP" + Set moRSPPay = New Recordset + moRSPPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + strF = Split(strLine, vbTab) + If intCOUNT = 0 Then + strVend = Mid(Field2Str(strF(0)), 4, 15) + intCOUNT = 99 + Else + strVend = Field2Str(strF(0)) + End If + strINVOICE = Field2Str(strF(2)) + strTYPE = Format(Field2Str(strF(4)), "0000000.00") + strJCCODE = Field2Str(strF(5)) + strJOBNUM = Left(strJCCODE, 10) + strName = Field2Str(strF(7)) + strSQLV = "SELECT * FROM tblPosPayVWP WHERE CKNumber = '" & strINVOICE & "'" + Set oRSS = New Recordset + oRSS.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + If oRSS.EOF Then + With oRSS + boolNEW = True + .AddNew + !CKNumber = strINVOICE + !CKAmt = Field2Str2(strTYPE) + !CKDate = strJOBNUM + !Name = Left(strName, 30) + .Update + End With +' End If + End If +' moRSAPHist.MoveNext + Loop + moRSPPay.Close + Close #1 + If boolNEW Then + MsgBox ("Import of VWP CMS AP Data is Complete"), vbInformation + vbOKOnly, "Import Complete" + Else + MsgBox ("No New Items Were Added"), vbOKOnly, "No PosPay" + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSPPVW " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub ImportCMSPPSW() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim oRSS As Recordset, strSQLL As String, boolNEW As Boolean +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCOUNT As Integer +Dim strVend As String, strINVOICE As String, strTYPE As String, strINVDATE As String, strJCCODE As String, dblAmt As String +Dim strVNAME As String, strSQLV As String, oRSAPV As Recordset +Dim strName As String + + On Error GoTo Error_EH + boolNEW = False + cdMain.InitDir = "G:\A_PosPay\PosPaySW\" + cdMain.Action = 1 + strFile = cdMain.FileName + intCOUNT = 0 + + strSQL = "Select * FROM tblPosPaySWI" + Set moRSPPay = New Recordset + moRSPPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + strF = Split(strLine, vbTab) + If intCOUNT = 0 Then + strVend = Mid(Field2Str(strF(0)), 4, 15) + intCOUNT = 99 + Else + strVend = Field2Str(strF(0)) + End If + strINVOICE = Field2Str(strF(2)) + strTYPE = Format(Field2Str(strF(4)), "0000000.00") + strJCCODE = Field2Str(strF(5)) + strName = Field2Str(strF(7)) + strJOBNUM = Left(strJCCODE, 10) + strSQLV = "SELECT * FROM tblPosPaySWI WHERE CKNumber = '" & strINVOICE & "'" + Set oRSS = New Recordset + oRSS.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + If oRSS.EOF Then + With oRSS + boolNEW = True + .AddNew + !CKNumber = strINVOICE + !CKAmt = Field2Str2(strTYPE) + !CKDate = strJOBNUM + !Name = Left(strName, 30) + .Update + End With +' End If + End If +' moRSAPHist.MoveNext + Loop + moRSPPay.Close + Close #1 + If boolNEW Then + MsgBox ("Import of SWI CMS AP Data is Complete"), vbInformation + vbOKOnly, "Import Complete" + Else + MsgBox ("No New Items Were Added"), vbOKOnly, "No PosPay" + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSPPSW " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub ImportCMSAP() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCOUNT As Integer +Dim strVend As String, strINVOICE As String, strTYPE As String, strINVDATE As String, strJCCODE As String, dblAmt As String +Dim strVNAME As String, strSQLV As String, oRSAPV As Recordset, strFILEX As String, strLineX As String +Dim strSQLLL As String, oRSI As Recordset, boolJCGood As Boolean, boolRSIOpen As Boolean + + On Error GoTo Error_EH + + boolJCGood = False + cdMain.InitDir = "G:\Access\Export\" + cdMain.Action = 1 + strFile = cdMain.FileName + strFILEX = "G:\Access\EXPORT\" + strFILEX = strFILEX & Format(Date, "YYYYMMDD_APError.txt") + intCOUNT = 0 + + strSQLV = "SELECT * FROM tblJCVENDOR" + Set oRSAPV = New Recordset + oRSAPV.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + +' mstrDEVICE = InputBox("Enter The Device Number (SYM#) To Import", "Import Prompts") +' mstrDEVICE = UCase(mstrDEVICE) + strSQL = "Select * FROM APH_JobDistDetail" + Set moRSAPHist = New Recordset + moRSAPHist.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + Open strFILEX For Output As #2 + + Do Until EOF(1) + Line Input #1, strLine + strLineX = strLine + strF = Split(strLine, vbTab) + If intCOUNT = 0 Then + strVend = Mid(Field2Str(strF(0)), 4, 15) +' strVend = Mid(Field2Str(strF(0)), 4, 15) + intCOUNT = 99 + Else + strVend = Field2Str(strF(0)) + End If + strINVOICE = Field2Str(strF(1)) + strTYPE = Field2Str(strF(2)) + strINVDATE = Field2Str(strF(3)) + strJCCODE = Field2Str(strF(4)) + strJOBNUM = Left(strJCCODE, 7) + dblAmt = Field2Str2(strF(5)) + strSQLV = "SELECT * FROM tblJCVENDOR WHERE ARCode = '" & strVend & "'" + Set oRSAPV = New Recordset + oRSAPV.Open strSQLV, goConn, adOpenDynamic, adLockPessimistic + If Not oRSAPV.EOF Then + strSQL = "SELECT * FROM APH_JobDistDetail WHERE InvoiceNumber = '" & strINVOICE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +'*Need to get a list of vendors that are JC Vendors to compare against this file +' If Left(strJOBNUM, 2) = "A0" Or Left(strJOBNUM, 2) = "B0" Then + If oRS.EOF Then + With moRSAPHist + .AddNew + !Division = "00" + !VendorNumber = Left(Field2Str(strVend), 30) + !InvoiceNumber = Field2Str2(strINVOICE) + gstrMODULE = strJOBNUM & " Inv# " & strINVOICE + !JobNumber = Field2Str(strJOBNUM) + !CostCode = "201200000" + !CostType = "0" + !distributionamount = dblAmt + !RetentionAmount = 0 + !Balance = 0 + !AmountAppliedToday = 0 + !InvoiceDate = strINVDATE + !InvType = Field2Str(strTYPE) + strSQLLL = "SELECT PROJ_ID, LOT_ID FROM tblLOTINFO WHERE JobCost = '" & Field2Str(strJOBNUM) & "'" + Set oRSI = New Recordset + oRSI.Open strSQLLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSI.EOF Then + !PROJ_ID = Field2Str2(oRSI!PROJ_ID) + !Lot_ID = Field2Str2(oRSI!Lot_ID) + boolRSIOpen = True + Else + boolRSIOpen = False + End If + .Update + End With + Else + Print #2, strLineX +' Write #2, strLineX + End If + End If +' moRSAPHist.MoveNext + Loop + moRSAPHist.Close + If boolRSIOpen Then + oRSI.Close + End If + +' oRSI.Close + Close #1 + Close #2 + MsgBox ("Import of CMS AP Data is Complete"), vbInformation + vbOKOnly, "Import Complete" +' intYN = MsgBox("Do You Want To Rename The Import File?", vbYesNo, "Rename File") +' If intYN = vbYes Then +' strOLD = "PPCINV.TXT" +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, lngLOC - 8, lngLOC - 1) +' strOLD = strHOLD +' lngLOC = InStr(1, strFILE, ".", 1) +' strHOLD = Mid(strFILE, 1, lngLOC - 1) +' strOLD = strHOLD +' strOLD = strFILE +' strNEW = "PPCINV" & Trim$(strMIN) & Trim$(strSEC) & ".TXT" +' strNEW = Trim$(strMONTH) & Trim$(strDAY) & Trim$(strSEC) & Trim$(strHOLD) & ".TXT" +' strNEW = Trim$(strMIN) & Trim$(strSEC) & Trim$(strMONTH) & Trim$(strDAY) & Trim$(strHOLD) ' & ".TXT" +' Name strFILE As strNEW +' End If + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSAP " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub ImportCMSAR() +Dim intYN As Integer, strSQL As String, strFile As String, oRS As Recordset, strLine As String +Dim strF() As String, strOLD As String, strNEW As String, strJOBNUM As String, intCOUNT As Integer +Dim strINVOICE As String, strINVDATE As String, strCustomer As String, strJCCODE As String +Dim strTAXSALESAMT As String, strNONTAXSALESAMT As String, strSALESTAXAMT As String +Dim bytINVTYPE As Byte, strSEQUENCENum As String, strCUSTNAME As String, lngUNIQUEID As Long +Dim strFILEX As String, strLineX As String, boolJCGood As Boolean, lngCNT As Long +Dim strSQLLL As String, oRSI As Recordset, strFILEXX As String, strLineXX As String +'Dim sglNum2 As Single, lngNum3 As Long +'Dim lngLOC As Long, strHOLD As String +'Dim strSEC As String, strMIN As String, strDAY As String, strMONTH As String + + On Error GoTo Error_EH + boolJCGood = False +' mstrDEVICE = "" +' strSEC = Second(Time) +' strMIN = Minute(Time) +' strDAY = Format(Day(Date), "00") +' strMONTH = Format(Month(Date), "00") + cdMain.InitDir = "G:\Access\Export\" + cdMain.Action = 1 + strFile = cdMain.FileName + strFILEX = "G:\Access\EXPORT\" + strFILEX = strFILEX & Format(Date, "YYYYNNDD_ARError.txt") + strFILEXX = "G:\Access\EXPORT\" + strFILEXX = strFILEXX & Format(Date, "YYYYNNDD_ARError2.txt") + intCOUNT = 0 + lngCNT = 1 + +' mstrDEVICE = InputBox("Enter The Device Number (SYM#) To Import", "Import Prompts") +' mstrDEVICE = UCase(mstrDEVICE) + strSQL = "Select * FROM ARN_InvHistoryHeader" + Set moRSARHist = New Recordset + moRSARHist.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Open strFile For Input As #1 + Open strFILEX For Output As #2 + Open strFILEXX For Output As #3 + + Do Until EOF(1) + Line Input #1, strLine + strLineX = strLine + strLineXX = lngCNT & " " & strLine + lngCNT = lngCNT + 1 + strF = Split(strLine, vbTab) + If intCOUNT = 0 Then + lngUNIQUEID = Mid(Field2Str(strF(0)), 4, 1) + intCOUNT = 99 + Else + lngUNIQUEID = Field2Str2(strF(0)) + End If +' lngUNIQUEID = Field2Str2(strF(0)) + bytINVTYPE = Field2Str2(strF(1)) + strCustomer = Field2Str(strF(2)) + strCUSTNAME = Field2Str(strF(3)) + strINVOICE = Field2Str(strF(4)) + strINVDATE = Left(Field2Str(strF(5)), 10) + strJCCODE = Field2Str(strF(6)) + If Len(strJCCODE) = 7 Then + boolJCGood = True + Else + boolJCGood = False + End If + strNONTAXSALESAMT = Field2Str2(strF(7)) + strTAXSALESAMT = 0 +' strTAXSALESAMT = Field2Str2(strF(7)) + + strSQL = "SELECT * FROM ARN_InvHistoryHeader WHERE InvoiceNumber = '" & strINVOICE & "' AND JOBNUMBER = '" & strJCCODE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +' If Left(strJOBNUM, 2) = "A0" Or Left(strJOBNUM, 2) = "B0" Then + If oRS.EOF Then + If boolJCGood Then + With moRSARHist + .AddNew + ' !I = "00" + !InvoiceNumber = Left(Field2Str2(strINVOICE), 20) + !InvoiceDate = strINVDATE + !CustomerNumber = Left(Field2Str(strCustomer), 20) + gstrMODULE = "Job " & strJCCODE & " Inv# " & strINVOICE + !JobNumber = Field2Str(strJCCODE) + !TaxableSalesAmount = Field2Str2(strTAXSALESAMT) + !NonTaxableSalesAmount = Field2Str2(strNONTAXSALESAMT) + !InvoiceType = bytINVTYPE + !CustName = Field2Str(strCUSTNAME) + !intunique = lngUNIQUEID + !SalesTaxAmount = 0 + ' !AmountAppliedToday = 0 + ' !InvType = Field2Str(strTYPE) + strSQLLL = "SELECT PROJ_ID, LOT_ID FROM tblLOTINFO WHERE JobCost = '" & Field2Str(strJCCODE) & "'" + Set oRSI = New Recordset + oRSI.Open strSQLLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSI.EOF Then + !PROJ_ID = Field2Str2(oRSI!PROJ_ID) + !Lot_ID = Field2Str2(oRSI!Lot_ID) + '! + End If + .Update + End With + Else +' oRS!JobNumber = Field2Str(strJCCODE) +' ors!InvoiceDate +' oRS.Update + Print #2, strLineX + End If + Else +' oRS!JobNumber = Field2Str(strJCCODE) +' oRS.Update + Print #3, strLineXX 'Items not in ARN_InvHistoryHeader + End If +' moRSAPHist.MoveNext + Loop + moRSARHist.Close + Close #1 + Close #2 + Close #3 + +' Call cmdNewSearch_Click +' lblCALC.Visible = True +' DoEvents +' Call cmdFixBill_Click +' lblCALC.Visible = False +' DoEvents + + MsgBox ("Import of CMS AR Data is Complete - Go To OrderDates to Update Billing Date (U)"), vbInformation + vbOKOnly, "Import Complete" + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ImportCMSAR " & gstrMODULE + Call ErrorHandler2 + gstrMODULE = "" + Close #1 + Exit Sub +End Sub + +Private Sub FixAPH() +Dim oRS As Recordset, strSQL As String, strJCCODE As String, strVENDOR As String, strINVOICE As String +Dim oRSS As Recordset, strSQLL As String, strJCCode2 As String, strV2 As String, strI2 As String + + strSQL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail WHERE JobNumber = ' '" +' strSQL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail ORDER By VendorNumber, InvoiceNumber, JobNumber" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strJCCODE = Trim(Field2Str(oRS!JobNumber)) + If strJCCODE = "" Then + strVENDOR = Field2Str(oRS!VendorNumber) + strINVOICE = Field2Str(oRS!InvoiceNumber) + strSQLL = "SELECT VendorNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail WHERE VendorNumber = '" + strSQLL = strSQLL & strVENDOR & "' AND InvoiceNumber = '" & strINVOICE & "' AND JobNumber <> ''" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + strJCCode2 = Field2Str(oRSS!JobNumber) + strV2 = Field2Str(oRSS!VendorNumber) + strI2 = Field2Str(oRSS!InvoiceNumber) + oRS!JobNumber = strJCCode2 + oRS.Update + oRSS.Close + End If + oRS.MoveNext + End If + Loop + End If + oRS.Close + + MsgBox "AP_JobDistDetail JCCode has been updated.", vbOKOnly, "Completed" + +End Sub + +Private Sub FixARH() +Dim oRS As Recordset, strSQL As String, strJCCODE As String, strCustomer As String, strINVOICE As String +Dim oRSS As Recordset, strSQLL As String, strJCCode2 As String, strV2 As String, strI2 As String, intCOUNT As Long + + + strSQL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM ARN_InvHistoryHeader WHERE JobNumber = ' '" +' strSQL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM APH_JobDistDetail ORDER By CustomerNumber, InvoiceNumber, JobNumber" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strJCCODE = Trim(Field2Str(oRS!JobNumber)) + If strJCCODE = "" Then + strCustomer = Field2Str(oRS!CustomerNumber) + strINVOICE = Field2Str(oRS!InvoiceNumber) + strSQLL = "SELECT CustomerNumber, InvoiceNumber, JobNumber FROM ARN_InvHistoryHeader WHERE CustomerNumber = '" + strSQLL = strSQLL & strCustomer & "' AND InvoiceNumber = '" & strINVOICE & "' AND JobNumber <> ''" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + intCOUNT = oRSS.RecordCount + strJCCode2 = Field2Str(oRSS!JobNumber) + strV2 = Field2Str(oRSS!CustomerNumber) + strI2 = Field2Str(oRSS!InvoiceNumber) + oRS!JobNumber = strJCCode2 + oRS.Update + oRSS.Close + End If + oRS.MoveNext + End If + Loop + End If + oRS.Close + + MsgBox "ARN_InvHistoryHeader JCCode has been updated.", vbOKOnly, "Completed" + +End Sub + +Private Sub cmdChecks_Click() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String, strMSG As String +Dim strINPUT As String, strFile As String +Dim intCOUNT As Integer, dblAmt As Double, intResponse As Integer +Dim intYear As Integer, intMonth As Integer, intDay As Integer + + On Error GoTo CancelOpen + strSQL = "DELETE * FROM tblCheckRec" + goConn.Execute strSQL + + cdMain.Filter = "Text Files|*.txt" + cdMain.Action = 1 + strFile = cdMain.FileName + + strSQL = "SELECT * FROM tblCheckRec" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Open strFile For Input As #1 + Do While Not EOF(1) + strINPUT = Input(152, #1) + oRS.AddNew + oRS!check_no = Mid(strINPUT, 36, 6) + oRS!ck_name = Mid(strINPUT, 80, 15) + dblAmt = Mid(strINPUT, 43, 18) + oRS!ck_amt = dblAmt / 100 + intYear = Mid(strINPUT, 62, 4) + intMonth = Mid(strINPUT, 66, 2) + intDay = Mid(strINPUT, 68, 2) + oRS!ck_date = DateSerial(intYear, intMonth, intDay) + oRS.Update + Loop + Close #1 + + strSQL = "SELECT * FROM tblCheckRec" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + Do Until oRS.EOF + strSql2 = "SELECT * FROM BR1_Transaction WHERE BankCode = '4' and TransactionType = 'C' and CheckNumber = '" & oRS!check_no & "' and SeqNo = '000'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + With oRS + !m90_amt = Field2Str2(oRSS!amount) + !m90_name = Left(Field2Str(oRSS!CheckPayeeName), 15) + If !ck_amt <> !m90_amt Then + !bad = vbChecked + End If + .Update + End With + Else + With oRS + !m90_amt = 0 + !m90_name = "No MAS 90 Check Found" + !bad = vbChecked + .Update + End With + End If +' End With +' End If + oRS.MoveNext + Loop + strSQL = "SELECT * FROM tblCheckRec WHERE Bad" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + intCOUNT = oRS.RecordCount + + strMSG = "Bank Reconcilliation Files have been Compared" & vbLf & vbCr + strMSG = strMSG & intCOUNT & " Checks did not match - Do You Want A Report" + intResponse = MsgBox(strMSG, vbYesNo, "Done") + If intResponse = vbYes Then + gintCOPY = 1 + crMain.ReportFileName = App.Path & "\CheckRecErrors.rpt" +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + Else + Exit Sub + End If + +CancelOpen: + Exit Sub +End Sub + +Private Sub cmdCrewsNew_Click() + frmCrewsOLD.Show 1 +End Sub + +Private Sub cmdDates_Click() + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Else + gintLOTID = 0 + End If + frmOrderDates.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFContain_Click() + If Len(txtSContain) > 0 Then + txtSContain.Enabled = False + txtSName.Enabled = False + Call ContainLoad + Else + MsgBox "Information To Find Must Be Entered", , "No Information" + txtSContain.SetFocus + End If + + + + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + If mboolSHOW Then +' cmdLotSearch.Enabled = True +' cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "JDV" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstContains.SetFocus + Else + cmdNewSearch.Enabled = True +' txtSContain.Enabled = False +' txtSContain.SetFocus + End If + +End Sub + +Private Sub cmdFindOrder_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + gstrPONUM = UCase(InputBox("Enter The VWP PO Number You Want", "PO Number")) + If gstrPONUM = "" Then +' MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + strSQL = "SELECT PO_Num, Lot_ID FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then +' gintLOTID = Field2Integer(oRS!Lot_id) + gintLOTID = Field2Long(oRS!Lot_ID) + strSql2 = "SELECT lot_id, proj_id FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + gintPROJID = Field2Integer(oRSS!PROJ_ID) + End If + Else + MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' gintORDER = 8 + gintORDER = 9 + frmOrders.Show 1 +End Sub + +Private Sub cmdFindSPO_Click() +' gintPONUM = Field2Integer(lblD_SPO) + On Error GoTo EH_ERROR + gintPONUM = UCase(InputBox("Enter The Special PO Number You Want", "PO Number")) + frmPOInfo.Show 1 + Exit Sub +EH_ERROR: + MsgBox "Invalid Response", vbOKOnly, "Invalid" + Exit Sub +End Sub + +Private Sub cmdFixBill_Click() +Dim oRSPlan As Recordset, oRSPlanBIll As Recordset, oRSOPT As Recordset, oRSOptBill As Recordset, oRSProjDate As Recordset +Dim strSQL As String, strSQL1 As String, strSql2 As String, strSQL3 As String, strSQL4 As String +Dim lngESTID As Long, lngPROJID As Long, strCONVERT As String, lngUsedProj As Long + + Call FixBilling +' Call FixLOTOptionCnt +' Call FixOpenPR2 + +'' strCONVERT = "07/01/2004" + +'' strSQL = "SELECT * FROM tblLotInfo WHERE STARTDATE is null" ' ORDER BY Proj_ID" +'' Set oRSPlan = New Recordset +'' oRSPlan.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' strSQL1 = "SELECT * FROM tblPlanBill" +' Set oRSPlanBIll = New Recordset +' oRSPlanBIll.Open strSQL1, goConn, adOpenKeyset, adLockOptimistic + +' strSql2 = "SELECT * FROM tblPOption" ' WHERE Est_id = " & lngESTID +' Set oRSOPT = New Recordset +' oRSOPT.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + +' strSQL3 = "SELECT * FROM tblPoptbill" +' Set oRSOptBill = New Recordset +' oRSOptBill.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic + +' strSQL4 = "SELECT * FROM tblprojdate" +' Set oRSProjDate = New Recordset +' oRSProjDate.Open strSQL4, goConn, adOpenKeyset, adLockOptimistic + +'' Do Until oRSPlan.EOF +' On Error GoTo EH_ERROR_PLANS +'' strCONVERT = "01/01/2005" +'' oRSPlan!startdate = strCONVERT +'' oRSPlan.Update +'' oRSPlan.MoveNext +'' Loop +' lngProjID = Field2Long(oRSPlan!proj_id) +' lngESTID = Field2Long(oRSPlan!est_id) +' With oRSPlanBIll +' .AddNew +' !proj_id = Field2Long(oRSPlan!proj_id) +' !est_id = Field2Long(oRSPlan!est_id) +' !mod_elv = Field2Str(oRSPlan!mod_elv) +' !l_bill = Field2Str2(oRSPlan!l_bill) +' !s_bill = Field2Str2(oRSPlan!s_bill) +' !Create = oRSPlan!Create +' !LSave = oRSPlan!LSave +' !LSUser = Field2Str(oRSPlan!LSUser) +' !createuser = (oRSPlan!createuser) +' !CreateUser = Field2Str(oRSPlan!CreateUser) +' !notes = Field2Str(oRSPlan!notes) +' !BUpdate = oRSPlan!BUpdate +' !BUUser = oRSPlan!BUUser +' !BUUSer = Field2Str(oRSPlan!BUUSer) +' !l_code = Field2Str(oRSPlan!l_code) +' !s_code = Field2Str(oRSPlan!s_code) +' !st_bill = Field2Str2(oRSPlan!st_bill) +' !st_code = Field2Str(oRSPlan!st_code) +' !Update = oRSPlan!Update +' !LUUser = (oRSPlan!LUUser) +'' !LUUser = Field2Str(oRSPlan!LUUser) +' If IsNull(oRSPlan!effdate) Then +' !effdate = strCONVERT +' Else +' !effdate = oRSPlan!effdate +' strCONVERT = oRSPlan!effdate +' End If +' .Update +' End With +'' On Error GoTo EH_ERROR_PROJDATE +' If lngUsedProj <> lngProjID Then +' oRSProjDate.AddNew +' oRSProjDate!proj_id = lngProjID +' oRSProjDate!startdate = strCONVERT +' lngUsedProj = Field2Long(oRSPlan!proj_id) +' oRSProjDate.Update +' End If +'' oRSPlan.MoveNext +'' Loop +' On Error GoTo EH_ERROR_OPT +' strSql2 = "SELECT * FROM tblPOption WHERE Est_id = " & lngESTID +' Set oRSOPT = New Recordset +' oRSOPT.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' +' Do Until oRSOPT.EOF +' With oRSOptBill +' .AddNew +' !est_id = Field2Long(oRSOPT!est_id) +' !OPTID = Field2Long(oRSOPT!OPTID) +' !opt_no = Field2Str2(oRSOPT!opt_no) +' !Desc = Field2Str(oRSOPT!Desc) +' !b_code = (oRSOPT!b_code) +'' !created = Field2Str2(oRSOPT!created) +' !Updated = (oRSOPT!Updated) +' !C_USER = (oRSOPT!C_USER) +' !U_USER = (oRSOPT!U_USER) +' !amt = Field2Str2(oRSOPT!amt) +' If IsNull(oRSOPT!effdate) Then +' !effdate = strCONVERT +'' Else +' !effdate = Field2Str2(oRSOPT!effdate) +' End If +'' .Update +' oRSOPT.MoveNext +' End With +' Loop +' +'' On Error GoTo EH_ERROR_PROJDATE +' oRSProjDate.AddNew +' oRSProjDate!proj_id = lngProjID +' oRSProjDate!startdate = strCONVERT +' oRSProjDate.Update +' oRSPlan.MoveNext +' Loop +' MsgBox "Plan Opening Percentage Update COmpleted" +Exit Sub +'EH_ERROR_PLANS: +' oRSPlanBIll.Cancel +' Resume Next + +'EH_ERROR_OPT: +' oRSOptBill.Cancel +' Resume Next + +'EH_ERROR_PROJDATE: +' oRSProjDate.Cancel +' Resume Next +End Sub + +Private Sub cmdFJCCode_Click() +Dim oRSJC As Recordset, strSQL As String +Dim oRSP As Recordset, strSQLP As String +Dim strProjLot, strPROJDESC As String + + + If Len(txtSJCCode) > 0 Then + txtSCode.Enabled = False + txtSContain.Enabled = False + txtSName.Enabled = False + + strSQL = "SELECT * FROM tblLOTINFO WHERE JobCost = '" & txtSJCCode & "'" + Set oRSJC = New Recordset + oRSJC.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSJC.EOF Then + strSQLP = "SELECT * FROM tblPROJECT WHERE Proj_ID = " & oRSJC!PROJ_ID + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSP.EOF Then + lblProjCode.FontSize = 8 + strProjLot = Trim(Field2Str(oRSP!Proj_Code)) & Trim(Field2Str(oRSJC!lot_no)) + strPROJDESC = Trim(Field2Str(oRSP!Proj_Desc)) + lblProjCode.Visible = True + lblDesc.Visible = True + lblProjCode.ForeColor = &HFF& + lblDesc.ForeColor = &HFF& + lblProjCode = strProjLot & " -- " & Trim(Field2Str(oRSP!Proj_Cont)) & " -- " & strPROJDESC + lblDesc = txtSJCCode & " -- " & Trim(Field2Str(oRSJC!address)) + End If + Else + Exit Sub + End If + + + Else + MsgBox "A Job Cost Number Must Be Entered", , "No JC Number" + txtSJCCode.SetFocus + End If + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + +' If mboolSHOW Then +' cmdLotSearch.Enabled = True +' cmdProjNotes.Visible = True +' If gbytSECURITY < 3 Then +' cmdTakeR.Enabled = True +' mnuTake.Enabled = True +' cmdPlans.Enabled = True +' mnuPlans.Enabled = True +' cmdBilling.Visible = True +' ElseIf gstrLOGIN = "JDV" Then +'' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then +' cmdPlans.Enabled = True +' mnuPlans.Enabled = True +' cmdBilling.Visible = True +' ElseIf gbytSECURITY = 6 Then +' cmdPlans.Enabled = True +' mnuPlans.Enabled = True +' cmdTakeR.Enabled = True +' mnuTake.Enabled = True +' cmdBilling.Visible = True +' ElseIf gbytSECURITY = 7 Then +' cmdBilling.Visible = True +' End If +' lstProject.SetFocus +' Else +' txtSName.SetFocus +' End If + +End Sub + +Private Sub cmdHourly_Click() + frmHourList.Show 1 +End Sub + +Private Sub cmdInvoice_Click() + frmAR.Show 1 +End Sub + +Private Sub cmdJCList_Click() + frmJCList.Show +End Sub + +Private Sub cmdJCRpt_Click() + + mboolPRINT = False + Screen.MousePointer = vbHourglass + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Call CalcJobCost + If mboolPRINT Then + Call cmdPrintJCRpt_Click + End If + Call ToggleButtons1 + Screen.MousePointer = vbDefault + lstLots.SetFocus +End Sub + +Private Sub ToggleButtons1() + cmdJCUpdate.Enabled = Not cmdJCUpdate.Enabled + cmdExit.Enabled = Not cmdExit.Enabled + cmdDates.Enabled = Not cmdDates.Enabled + cmdLotInfo.Enabled = Not cmdLotInfo.Enabled + cmdLotSearch.Enabled = Not cmdLotSearch.Enabled + cmdNewSearch.Enabled = Not cmdNewSearch.Enabled + cmdOrderR.Enabled = Not cmdOrderR.Enabled + cmdPayroll.Enabled = Not cmdPayroll.Enabled + cmdPrintJCRpt.Enabled = Not cmdPrintJCRpt.Enabled + cmdJCRpt.Enabled = Not cmdJCRpt.Enabled + cmdPOInfo.Enabled = Not cmdPOInfo.Enabled + cmdPOList.Enabled = Not cmdPOList.Enabled + cmdRepairList.Enabled = Not cmdRepairList.Enabled + cmdScaffold.Enabled = Not cmdScaffold.Enabled + cmdSchedule.Enabled = Not cmdSchedule.Enabled + cmdYardOrder.Enabled = Not cmdYardOrder.Enabled + cmdScafList.Enabled = Not cmdScafList.Enabled + cmdBilling.Enabled = Not cmdBilling.Enabled +End Sub + +Private Sub CalcJobCost2() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String + + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(oRS!jobcost) Or oRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strJOBCOST = Field2Str(oRS!jobcost) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblORDERS WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" + End If + + oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!Crew_Boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + If !WorkDone = "C" Then + oRSD!desc3 = "COMPLETE" + ElseIf !WorkDone = "P" Then + oRSD!desc3 = "PARTIAL" + ElseIf !WorkDone = "T" Then + oRSD!desc3 = "TEXTURE" + ElseIf !WorkDone = "S" Then + oRSD!desc3 = "SCRATCH" + ElseIf !WorkDone = "B" Then + oRSD!desc3 = "BROWN" + ElseIf !WorkDone = "U" Then + oRSD!desc3 = "CMU" + ElseIf !WorkDone = "F" Then + oRSD!desc3 = "FENCE" + ElseIf !WorkDone = "W" Then + oRSD!desc3 = "WORKORDER/REPAIR" + End If + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD.Update + End With + oRSC.MoveNext + Loop + + MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form Main - Module CalcJobCost2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CalcJobCost() +Dim oRS As Recordset, oRSC As Recordset, oRSD As Recordset, oRSF As Recordset +Dim strSQL As String, strCALC As String, strSql2 As String, dblCALC As Double +Dim intCALC As Integer, strJOBCOST As String, strREPORT As String, strFIND As String +Dim strCont As String, strProj As String, strPROJCODE As String, strLOTNO As String +Dim strMODEL As String, strADD As String, strOWNER As String +Dim intYDS As Integer, intMETAL As Integer + + + On Error GoTo Error_EH + +' Call ToggleButtons1 + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "No Lot Was Found, Try Again", vbOKOnly, "Select Lot" + Exit Sub + Else + If IsNull(oRS!jobcost) Or oRS!jobcost = "" Then + MsgBox "There is No Job Cost Code For This Lot - Enter One", vbOKOnly, "Enter JobCost Code" + Exit Sub + Else + strCALC = "SELECT * FROM tblproject WHERE proj_id = " & Field2Long(oRS!PROJ_ID) + Set oRSC = New Recordset + oRSC.Open strCALC, goConn, adOpenForwardOnly, adLockReadOnly + strJOBCOST = Field2Str(oRS!jobcost) + strMODEL = Field2Str(oRS!model) + strADD = Field2Str(oRS!address) + strOWNER = Field2Str(oRS!Owner) + strLOTNO = Field2Str(oRS!lot_no) + strCont = Field2Str(oRSC!Proj_Cont) + strProj = Field2Str(oRSC!Proj_Desc) + strPROJCODE = Field2Str(oRSC!Proj_Code) + intYDS = Field2Integer(oRS!sq_yd) + intMETAL = Field2Integer(oRS!METAL) + End If + End If + + strSQL = "DELETE * FROM tblJobCost WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblJobCost_Rpt WHERE lot_id = " & gintLOTID + goConn.Execute strSQL + + strSQL = "SELECT * FROM tbljobcost WHERE lot_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strREPORT = "SELECT * FROM tblJobCost_Rpt where Lot_id = 1" + Set oRSD = New Recordset + oRSD.Open strREPORT, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblORDERS WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 1 + oRSD!desc1 = Field2Str(!po_num) + oRSD!desc2 = Field2Str2(!supplier) + + If !d_flag = "Y" Then + oRSD!desc3 = "Yard" + Else + oRSD!desc3 = "Supplier" + End If + + If !m_type = "L" Then + oRSD!desc4 = "Lath" + ElseIf !m_type = "P" Then + oRSD!desc4 = "PreOrder" + ElseIf !m_type = "R" Then + oRSD!desc4 = "PO" + ElseIf !m_type = "A" Then + oRSD!desc4 = "Sand" + ElseIf !m_type = "S" Then + oRSD!desc4 = "Scratch" + ElseIf !m_type = "B" Then + oRSD!desc4 = "Brown" + ElseIf !m_type = "T" Then + oRSD!desc4 = "Texture" + End If + + oRSD!date1 = Field2Str2(!order_date) + oRSD!amount1 = Field2Str2(!orderamt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(pay_amt) as SUMPAY FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + If oRSC.EOF Then + MsgBox "No Payroll Information For This Lot", vbOKOnly, "No Payroll" + Else + dblCALC = Field2Str2(oRSC!sumpay) + strCALC = "TOTAL PAYROLL" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblTIME WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 4 + If !pay_type = "S" Then + oRSD!desc1 = "STUCCO" + ElseIf !pay_type = "L" Then + oRSD!desc1 = "LATH" + End If + + strFIND = "SELECT crew_id, crew_boss FROM tblCREW WHERE crew_id = " & Field2Str2(!crew) + Set oRSF = New Recordset + oRSF.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSF.EOF Then + oRSD!desc2 = Field2Str2(oRSF!Crew_Boss) + Else + oRSD!desc2 = "NO CREW FOUND" + End If + + If !WorkDone = "C" Then + oRSD!desc3 = "COMPLETE" + ElseIf !WorkDone = "P" Then + oRSD!desc3 = "PARTIAL" + ElseIf !WorkDone = "T" Then + oRSD!desc3 = "TEXTURE" + ElseIf !WorkDone = "S" Then + oRSD!desc3 = "SCRATCH" + ElseIf !WorkDone = "B" Then + oRSD!desc3 = "BROWN" + ElseIf !WorkDone = "U" Then + oRSD!desc3 = "CMU" + ElseIf !WorkDone = "F" Then + oRSD!desc3 = "FENCE" + ElseIf !WorkDone = "W" Then + oRSD!desc3 = "WORKORDER/REPAIR" + End If + oRSD!date1 = !prdate + oRSD!desc4 = Field2Str2(!prcheck) + oRSD!amount1 = Field2Str2(!pay_amt) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(distributionAmount) as SUMAP FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Payables Information For This Lot", vbOKOnly, "No Payables" + Else + dblCALC = Field2Str2(oRSC!sumap) + strCALC = "TOTAL ACCOUNTS PAYABLE" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT VendorNumber, JobNumber, InvoiceNumber, DistributionAmount FROM APH_JobDistDetail WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 2 + oRSD!desc1 = Field2Str(!VendorNumber) + oRSD!desc2 = Field2Str2(!InvoiceNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!amount1 = Field2Str2(!distributionamount) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "SELECT sum(TaxableSalesAmount+NonTaxableSalesAmount+SalesTaxAmount) as SUMBILL from ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Billing Information For This Lot", vbOKOnly, "No Billings" + Else + dblCALC = Field2Str2(oRSC!sumbill) + strCALC = "TOTAL BILLINGS" + intCALC = 0 + GoSub Save_Info + End If + + strSql2 = "SELECT CustomerNumber, JobNumber, TaxableSalesAmount, NonTaxableSalesAmount, SalesTaxAmount, InvoiceNumber, InvoiceDate FROM ARN_invHistoryHeader WHERE JobNumber = '" & strJOBCOST & "'" + Set oRSC = New Recordset + oRSC.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 5 + oRSD!desc1 = Field2Str(!InvoiceNumber) + oRSD!desc2 = Field2Str2(!CustomerNumber) + oRSD!desc3 = Field2Str2(!JobNumber) + oRSD!date1 = Field2Str(!InvoiceDate) + oRSD!amount1 = (CDec(Field2Str2(!TaxableSalesAmount)) + CDec(Field2Str2(!NonTaxableSalesAmount)) + CDec(Field2Str2(!SalesTaxAmount))) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + + strSql2 = "SELECT sum(QtyIssue*Price) as SUMYARD FROM tblYardOrder WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If oRSC.EOF Then + MsgBox "No Yard Order Information For This Lot", vbOKOnly, "No Yard Order" + Else + dblCALC = Field2Str2(oRSC!sumyard) + strCALC = "TOTAL YARD ORDER" + intCALC = 1 + GoSub Save_Info + End If + + strSql2 = "SELECT * FROM tblYardORDER WHERE lot_id = " & gintLOTID + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSC.EOF + With oRSC + oRSD.AddNew + oRSD!Lot_ID = gintLOTID + oRSD!Type = 3 + oRSD!desc1 = Field2Str(!inv_no) + oRSD!desc2 = Field2Str2(!Desc) + oRSD!date1 = !issued +' oRSD!date1 = Field2Str2(!issued) + oRSD!number1 = Field2Str2(!qtyIssue) + oRSD!amount1 = Field2Str2(!price) + oRSD!Create = gstrLOGIN + oRSD!contr = strCont + oRSD!project = strProj + oRSD!projcode = strPROJCODE + oRSD!lotno = strLOTNO + oRSD!jc = strJOBCOST + oRSD!model = strMODEL + oRSD!address = strADD + oRSD!Owner = strOWNER + oRSD!SQYDS = intYDS + oRSD!METAL = intMETAL + oRSD.Update + End With + oRSC.MoveNext + Loop + +' MsgBox "Job Cost Summary Calculation is Complete", vbOKOnly, "JC Calculation" + mboolPRINT = True + + If oRS.State = adStateOpen Then + oRS.Close + Set oRS = Nothing + End If + If oRSF.State = adStateOpen Then + oRSF.Close + Set oRSF = Nothing + End If + If oRSD.State = adStateOpen Then + oRSD.Close + Set oRSD = Nothing + End If + If oRSC.State = adStateOpen Then + oRSC.Close + Set oRSC = Nothing + End If + + Exit Sub + +Save_Info: + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!calc_date = Date + oRS!Amt = Field2Str2(dblCALC) + oRS!Desc = Field2Str(strCALC) + oRS!Type = intCALC + oRS!Create = gstrLOGIN + oRS.Update + Return + +Error_EH: + gstrMODULE = "Form Main - Module CalcJobCost" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdJCUpdate_Click() +Dim strSQL As String, strJC As String, strJCNumber As String +Dim oRS As Recordset, strNOTES As String + + On Error GoTo Error_EH + + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Else + MsgBox "You Must Select A Lot Before Pressing This Button", vbOKOnly, "Select Lot" + gintLOTID = 0 + Exit Sub + End If + + strSQL = "SELECT lot_id, jobcost, lot_no, lotnotes FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + With oRS + strNOTES = Field2Str(!lotnotes) + strJCNumber = Field2Str(!jobcost) + If strJCNumber = "" Then + strJCNumber = " NO JC NUMBER" + End If + If Not IsNull(!jobcost) Then + strJC = InputBox("Enter the JC Code for the HiLited Lot", "Update JC Code", Field2Str(!jobcost)) + Else + !jobcost = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(!lot_no), 3), "000") + strJC = InputBox("Enter the JC Code for the HiLited Lot", "Update JC Code", Field2Str(!jobcost)) + End If + !lotnotes = strNOTES & " Old JC Number " & strJCNumber + !jobcost = UCase$(Field2Str(strJC)) +' !notes = + .Update + End With + + End If + lstLots.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module cmdPrintPOInfo_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLotInfo_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmLotList.Show 1 +End Sub + +Private Sub cmdOrderR_Click() + +' Call ListChanges + + If cmdOrderR.Caption = "Orders" Then + If gboolBAG = True Or gboolSYN = True Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrder_Click + End If + End If + + If cmdOrderR.Caption = "Orders PreMix" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrder5_Click + End If + End If + + If cmdOrderR.Caption = "Orders Synthetic" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Lot Information For This Project - Change The Project Info", vbOKOnly + Exit Sub + Else + Call cmdOrderE_Click + End If + End If +End Sub + +Private Sub cmdPayroll_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmPayroll.Show 1 +End Sub + +Private Sub cmdPOBill_Click() +Dim strTEST As String + +' MsgBox "This Feature Is Not Functioning", vbOKOnly, "Not Working" +' Exit Sub + + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) +' Load frmPOWOLot +' frmPOWOLot.chkADD = vbChecked + frmWOList.Show 1 +' frmPOWOLot.Show 1 +' frmPOWOLot.chkADD = vbTrue + Else + MsgBox "You Must Display And Select A Lot To Process A PO/WO", vbOKOnly, "Select A Lot" + gintLOTID = 0 + gintPROJID = 0 + End If + +' If LotFind() Then +' lstLots.ToolTipText = Field2Str(moRS!jobcost) +' strTEST = lstLots.ToolTipText +' End If + +End Sub + +Private Sub cmdPOInfo_Click() +Dim strSQL As String + + On Error GoTo Error_EH + + gintPRINT = 1 + + strSQL = "{tblOrders.Lot_id} = " & lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POInfo.rpt" + crMain.SelectionFormula = strSQL + crMain.Destination = crptToWindow +' crmain.Destination = crptToPrinter + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module cmdPrintPOInfo_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPOList_Click() + frmPayList.Show ' 1 + +End Sub + +Private Sub ListChanges() +Dim oRS As Recordset, strSQL As String, strMSG As String + + strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If Not oRS.EOF Then + Do Until oRS.EOF + strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) + strMSG = strMSG & vbCrLf & vbCrLf + If Not oRS.EOF Then + oRS.MoveNext + End If + Loop +' End If + + MsgBox strMSG, vbOKOnly, "Click OK To Continue" +End Sub + +Private Sub cmdPrintJCRpt_Click() +Dim strSQL As String, strYN As String + + On Error GoTo Error_EH + + strYN = MsgBox("Do You Want To Print Report", vbYesNo, "Print?") + If strYN = vbYes Then + mboolREPORT = True + mboolWINDOW = False + Else + mboolWINDOW = True + mboolREPORT = False + End If + + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintCOPY = 1 + crMain.Reset + + strSQL = "{tblJOBCOST_RPT.LOT_ID} = " & gintLOTID + crMain.ReportFileName = App.Path & "\jobcost.rpt" + crMain.SelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crMain.Destination = crptToWindow + End If + If mboolREPORT = True Then + crMain.Destination = crptToPrinter + End If + crMain.Action = 1 + + crMain.Reset + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crMain.ReportFileName = App.Path & "\jobcost2.rpt" + crMain.SelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY + If mboolWINDOW = True Then + crMain.Destination = crptToWindow + End If + If mboolREPORT = True Then + crMain.Destination = crptToPrinter + End If + crMain.Action = 1 + +' crMain.ReportFileName = App.Path & "\lath.rpt" +'' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID +'' crMain.ReportFileName = App.Path & "\jobcost2.rpt" +'' crMain.SelectionFormula = strSQL +'' crMain.CopiesToPrinter = gintCOPY +' crmain.Destination = crptToWindow +'' crMain.Destination = crptToPrinter +'' crMain.WindowState = crptMaximized +'' crMain.Action = 1 + + crMain.Reset + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintJCRpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdProjNotes_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmProjNotes.Show 1 +End Sub + +Private Sub cmdReNum_Click() +Dim oRSP As Recordset, oRSL As Recordset, strSQLP As String, strSQLL As String +Dim lngPRJID As Long +Dim oRSCNT As Recordset, strSQLC As String, intLOTCNT As Integer, COUNTLot As Integer + + strSQLP = "SELECT Proj_id, Proj_Desc, Proj_Code, Create FROM tblProject WHERE CREATE < #01/01/2012#" + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLL = "SELECT * FROM tblPrjLCnt2" + Set oRSL = New Recordset + oRSL.Open strSQLL, goConn, adOpenStatic, adLockOptimistic + If oRSL.EOF Then + + End If + If Not oRSP.EOF Then + oRSP.MoveFirst + Do Until oRSP.EOF + lngPRJID = Field2Long(oRSP!PROJ_ID) + intLOTCNT = 0 + strSQLC = "SELECT COUNT(Lot_ID) as COUNTLot FROM tblLOTINFO WHERE LOrder < #01/01/2013# and Proj_ID = " & lngPRJID ' & " ORDER BY LOrder""" +' strSQLC = "SELECT COUNT(Lot_ID) as COUNTLot FROM tblLOTINFO WHERE LOrder < #01/01/2013# and Proj_ID = " & lngPRJID & " ORDER BY LOrder""" + Set oRSCNT = New Recordset + oRSCNT.Open strSQLC, goConn, adOpenDynamic, adLockBatchOptimistic + intLOTCNT = oRSCNT!COUNTLot + + oRSL.AddNew + oRSL!PROJ_ID = lngPRJID + oRSL!Proj_Desc = oRSP!Proj_Desc + oRSL!Proj_Code = oRSP!Proj_Code + oRSL!Create = oRSP!Create + oRSL!Lot_CNT = intLOTCNT + oRSL.Update + oRSP.MoveNext + Loop + End If + +'************************************************* Setup Purge archived informaton + +'SELECT COUNT(column_name) +'From table_name +'WHERE condition; + +' strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + +' Set oRSMAX = New Recordset + +' oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' mintOPTID = oRSMAX!maxoptid +' oRSMAX.Close + + +' Dim oRS As Recordset, strSQL As String, strUPDATE As String + +' strSQL = "SELECT * FROM tblLotMatrl" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + +' strUPDATE = "UPDATE tblYardOrder set SPLIT=0 " +' goConn.Execute strUPDATE + +End Sub + +Private Sub cmdRepairList_Click() + frmRepair.Show 1 +End Sub + +Private Sub cmdScaffold_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmScaffold.Show 1 +End Sub + +Private Sub cmdScafList_Click() + frmScafList.Show 1 +End Sub + +Private Sub cmdSchedule_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmRepairLot.Show 1 +End Sub + +Private Sub cmdShip_Click() + frmBillingStatus.Show 1 +End Sub + +Private Sub cmdTakeR_Click() + + If cmdTakeR.Caption = "Takeoff" Then +' If cmdTakeR.Caption = "&Takeoff" And gboolBAG = True Then + If gboolBAG = True Or gboolSYN = True Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else +' ElseIf Not gboolSYN Then + Call cmdTake_Click + End If + End If +' If cmdTakeR.Caption = "Takeoff Pre&Mix" Or cmdTakeR.Caption = "Takeoff S&ynthetic" Then + If cmdTakeR.Caption = "Takeoff PreMix" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else + Call cmdTake5_Click + End If + End If +' If cmdTakeR.Caption = "Takeoff Pre&Mix" Or cmdTakeR.Caption = "Takeoff S&ynthetic" Then +' If gboolBAG = False And gboolSYN = False Then +' MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly +' Exit Sub +' Else +' Call cmdTake5_Click +' End If +' End If + If cmdTakeR.Caption = "Takeoff Synthetic" Then + If gboolBAG = False And gboolSYN = False Then + MsgBox "This Is The Wrong Takeoff For This Project - Change The Takeoff Type", vbOKOnly + Exit Sub + Else + Call cmdTakeE_Click + End If + End If +End Sub + +Private Sub cmdUpRGard_Click() + +'Dim strSQL As String, oRS As Recordset + +' strSQL = "SELECT * FROM tblTOLabor" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' oRS.MoveFirst + +' Do Until oRS.EOF +' If IsNull(oRS!OptNum) Then +' oRS!OptNum = 1 +' oRS.Update +' End If +' oRS.MoveNext +' Loop +' oRS.Close +' MsgBox ("Texture Option Number is UpDated") + +End Sub + +Private Sub cmdYardOrder_Click() + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmYardOrder.Show 1 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdNewSearch_Click() + gboolSYN = False + gboolBAG = False + gintLOTID = 0 + gintPROJID = 0 + txtSCode.Enabled = True + txtSName.Enabled = True + txtSContain.Enabled = True + txtSCode = "" + txtSName = "" + txtSJCCode = "" +' txtSCode.Text = "" +' txtSName.Text = "" + txtSContain = "" + lstProject.Clear + lstLots.Clear + lstContains.Clear + lblProjCode.FontSize = 10 + lblProjCode.Caption = "" + lblDesc = "" + lblDesc.ForeColor = &H80000012 + lblProjCode.ForeColor = &H80000012 + lstLots.Visible = False + lblProjCode.Visible = False + lblDesc.Visible = False + cmdLotSearch.Enabled = False + cmdNewSearch.Enabled = False + cmdJCUpdate.Visible = False + cmdJCRpt.Visible = False + cmdPrintJCRpt.Visible = False + cmdTakeR.Enabled = False + mnuTake.Enabled = False + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + cmdPlans.Enabled = False + mnuPlans.Enabled = False + cmdPayroll.Enabled = False + mnuPayroll.Enabled = False + cmdFCode.Enabled = False + cmdFName.Enabled = False + cmdFJCCode.Enabled = False + cmdFContain.Enabled = False + lstContains.Visible = False + lstProject.Visible = False + cmdDates.Visible = False + cmdYardOrder.Visible = False + cmdSchedule.Visible = False + cmdLotInfo.Visible = False + cmdProjNotes.Visible = False + cmdBilling.Visible = False + txtSCode.SetFocus +End Sub + +Private Sub cmdPlans_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + frmPlans.Show 1 +End Sub + +Private Sub cmdOrder_Click() + On Error GoTo Error_EH + cmdDates.Visible = True +' cmdDates.Visible = False +' cmdYardOrder.Visible = False + cmdYardOrder.Visible = True + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfo.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdOrder5_Click() + On Error GoTo Error_EH + cmdDates.Visible = True +' cmdDates.Visible = False +' cmdYardOrder.Visible = False + cmdYardOrder.Visible = True + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfo5.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdOrderE_Click() + On Error GoTo Error_EH + cmdDates.Visible = True +' cmdDates.Visible = False +' cmdYardOrder.Visible = False + cmdYardOrder.Visible = True + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + frmLotInfoE.Show 1 + If gstrFLAG = "D" Then + Call cmdLotSearch_Click + End If + If gstrFLAG = "P" Then + Call cmdNewSearch_Click + End If + Exit Sub + +Error_EH: + If Err = 364 Then + Exit Sub + Else + Call ErrorHandler2 + Exit Sub + End If +End Sub + +Private Sub cmdTake_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTake + frmTake.Show 1 +End Sub + +Private Sub cmdTake5_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTake5 + frmTake5.Show 1 +End Sub + +Private Sub cmdTakeE_Click() + cmdDates.Visible = False + cmdYardOrder.Visible = False + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Load frmTakeE + frmTakeE.Show 1 +End Sub + +Private Sub Form_Load() +Dim oRS As Recordset, strSQL As String + + Me.Move (Screen.Width - Me.Width - 600) / 2, (Screen.Height - Me.Height) / 2 + + strSQL = "SELECT * FROM tblSYSINFO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + gdteUPDATE = oRS!LastUP - 45 + + cmdNewSearch.Enabled = False + If gbytSECURITY = 6 Then + mnuContractor.Enabled = True +' mnuProject.Enabled = True + cmdShip.Visible = True +' mnuJCTrans.Enabled = True + mnuAddPPay.Enabled = True + mnuSWTRANSFER.Enabled = True + mnuAPTransfer.Enabled = True + End If + If gbytSECURITY = 7 Then + mnuContractor.Enabled = True +' mnuProject.Enabled = True + mnuTransfer.Enabled = True + cmdInvoice.Visible = True + cmdShip.Visible = True + cmdPOBill.Enabled = True +' mnuJCTrans.Enabled = True + End If + If gbytSECURITY = 1 Then + mnuUser.Enabled = True + mnuRCrew.Enabled = True + mnuCrew.Enabled = True + cmdPOBill.Enabled = True + cmdPOList.Visible = True + mnuUpCheck.Visible = True + mnuTransfer.Enabled = True + ' mnuJCTrans.Enabled = True + cmdInvoice.Visible = True + mnuVoid.Visible = True + mnuPosPay.Enabled = True + mnuAddPPay.Enabled = True + +' mnuTOI.Visible = True + cmdJCList.Visible = True + If gstrLOGIN = "DWW" Then + cmdChecks.Visible = True + cmdUpRGard.Visible = False + End If + End If + If gbytSECURITY < 3 Then + mnuSand.Enabled = True + mnuLabor.Enabled = True + mnuSupplier.Enabled = True + mnuBP.Enabled = True + mnuTexture.Enabled = True + mnuContractor.Enabled = True + mnuProject.Enabled = True + mnuInvList.Enabled = True + mnuYInvList.Enabled = True + mnuInvPrice.Enabled = True + cmdShip.Visible = True + mnuOrdersDate.Visible = True + mnuLathList.Visible = True + cmdHourly.Enabled = True + mnuCMSAP.Visible = True + mnuCMSAP.Enabled = True + mnuCMSAR.Visible = True + mnuCMSAR.Enabled = True + mnuCMSPP.Visible = True + mnuCMSPP.Enabled = True + mnuUInv.Enabled = True + mnuSWTRANSFER.Enabled = True + mnuAPTransfer.Enabled = True + mnuProjJC.Visible = True + End If + If gbytSECURITY = 8 Or gbytSECURITY = 10 Then + mnuCrew.Enabled = True + mnuRCrew.Enabled = True + End If + If gbytSECURITY = 9 Or gbytSECURITY = 8 Then + mnuInvList.Enabled = True + mnuYInvList.Enabled = True + mnuInvPrice.Enabled = True + If gstrLOGIN = "TDR" Then + mnuRCrew.Enabled = True + End If + End If + If gbytSECURITY = 10 Then + cmdPOList.Visible = True + mnuUpCheck.Visible = True + End If + If gstrLOGIN = "TC" Then + mnuVoid.Visible = True + mnuPosPay.Visible = True + End If + If gstrLOGIN = "GK" Then + cmdJCList.Visible = True + End If +' If gstrLOGIN = "KA" Then +' cmdScaffold.Visible = False +' cmdScafList.Visible = False +' End If +End Sub + +Private Function LotFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + LotFind = False + Else + LotFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form LotInfo - Module LotFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstLots_Click() +Dim strTEST As String + + If lstLots.ListCount > 0 Then + gintLOTID = lstLots.ItemData(lstLots.ListIndex) +' gintLOTID = lstLots.ItemData(lstLots.ListIndex) +' gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Else + gintLOTID = 0 + End If + + If LotFind() Then + If moRS!SCert Then + lstLots.ToolTipText = Field2Str(moRS!jobcost) & " --- " & Field2Str(moRS!Lot_ID) & " --- " & " Stucco Cert Done" + strTEST = lstLots.ToolTipText + Else + lstLots.ToolTipText = Field2Str(moRS!jobcost) & " --- " & Field2Str(moRS!Lot_ID) + strTEST = lstLots.ToolTipText + End If + End If +End Sub + +Private Sub lstLots_DblClick() + Call cmdOrderR_Click +End Sub + +Private Sub lstProject_Click() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + Call FindProject + +End Sub +Private Sub FixStart() +Dim oRS As Recordset +Dim strSQL As String, strSTARTDATE As String, strNEWSTART As String + + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + + strSQL = "SELECT * FROM tblLOTINFO WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSTARTDATE = Field2Str(oRS!startdate) + + strNEWSTART = InputBox("Enter The Start Date For The Highlighted Lot (mm/dd/yyyy)", "New Start Date", strSTARTDATE) + If Not IsDate(strNEWSTART) Then + MsgBox "You Entered An Invalid Date, StartDate Will Not Be Updated", vbOKOnly, "Invalid Date" + Exit Sub + Else + oRS!startdate = Str2Field(strNEWSTART) + oRS.Update + End If +End Sub + +Private Sub FixPOCount() +Dim oRS As Recordset +Dim strSQL As String + +Dim bytPOMAX As Byte, bytNEWMAX As Integer + + strSQL = "SELECT pomax, proj_id FROM tblPROJECT WHERE proj_id = " & gintPROJID + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + bytPOMAX = Field2Str2(oRS!pomax) + + bytNEWMAX = Field2Str2(InputBox("Enter the New Maximum PO Count for this Project", "Update PO MAX", bytPOMAX)) + If bytNEWMAX > 254 Then + MsgBox "You Entered an Invalid Number - 254 is the MAX allowed", vbOKOnly, "Update Max POCount" + Exit Sub + ElseIf bytNEWMAX = 0 Then + Exit Sub + Else + oRS!pomax = bytNEWMAX + oRS.Update + End If +End Sub +Private Sub FixPrinting() +Dim oRS As Recordset, strSQL As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + oRS!l_FLG = "P" + oRS!y_FLG = "P" + oRS!s_FLG = "P" + oRS!z_FLG = "P" + '***** May need to add the check box for B_FLG also. + oRS.Update + End If +End Sub +Private Sub FixBilling() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim lngINVOICE As Long, lngLOTINFO As Long, strTYPE As String +Dim strDATE1 As Date, strFIND As String + + strDATE1 = Date - 45 + + strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= " & strDATE1 '& "#'" +' strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= '#" & strDATE1 & "#'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + + strSQLL = "SELECT * FROM tblLotInfo" ' WHERE lot_id = " & lngLOTINFO + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRS.EOF + lngLOTINFO = oRS!Lot_ID + strTYPE = Field2Str(oRS!inv_type) + oRSS.MoveFirst + strFIND = "lot_id = " & lngLOTINFO + oRSS.Find strFIND +' If Not oRSS.EOF Then +' oRSS!notes = Field2Str(oRS!notes) +' oRSS.Update +' End If +' oRS.MoveNext + + If Not oRSS.EOF Then + If strTYPE = "L" Then + If Not IsDate(oRSS!BILLDT_L) Then + oRSS!BILLDT_L = oRS!invoice_date + oRSS.Update + End If + End If + If strTYPE = "S" Or strTYPE = "C" Then + If Not IsDate(oRSS!BILLDT_S) Then + oRSS!BILLDT_S = oRS!invoice_date + oRSS.Update + End If + End If + End If + oRS.MoveNext + Loop + MsgBox "Billing Date Update is Complete", vbOKOnly, "Update Complete" +End Sub + +Private Sub FixBillingM() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim lngINVOICE As Long, lngLOTINFO As Long, strTYPE As String +Dim strDATE1 As Date, strFIND As String + + strDATE1 = Date - 30 + + strSQL = "SELECT * FROM tblARINVOICEM WHERE Header and Invoice_date >= " & strDATE1 '& "#'" +' strSQL = "SELECT * FROM tblARINVOICE WHERE Header and Invoice_date >= '#" & strDATE1 & "#'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockReadOnly + + strSQLL = "SELECT * FROM tblLotInfo" ' WHERE lot_id = " & lngLOTINFO + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRS.EOF + lngLOTINFO = oRS!Lot_ID + strTYPE = Field2Str(oRS!inv_type) + oRSS.MoveFirst + strFIND = "lot_id = " & lngLOTINFO + oRSS.Find strFIND +' If Not oRSS.EOF Then +' oRSS!notes = Field2Str(oRS!notes) +' oRSS.Update +' End If +' oRS.MoveNext + + If Not oRSS.EOF Then + If strTYPE = "L" Then + If Not IsDate(oRSS!BILLDT_L) Then + oRSS!BILLDT_L = oRS!invoice_date + oRSS.Update + End If + End If + If strTYPE = "S" Or strTYPE = "C" Then + If Not IsDate(oRSS!BILLDT_S) Then + oRSS!BILLDT_S = oRS!invoice_date + oRSS.Update + End If + End If + End If + oRS.MoveNext + Loop +' MsgBox "Billing Date Update is Complete", vbOKOnly, "Update Complete" +End Sub + +Private Sub FixLOTINFO() +Dim strSQL As String +Dim oRS As Recordset + + strSQL = "SELECT TOID, origtoid FROM tblTAKE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!origTOID = oRS!toid + oRS.Update + oRS.MoveNext + Loop +' End If +End Sub + +Private Sub FixLOTOptionCnt() +Dim strSQL As String, strDate As String +Dim strSQLL As String, oRSO As Recordset, oRSP As Recordset +Dim lngCNT As Long, lngPOptID As Long + + lngCNT = 0 + + strSQL = "SELECT * FROM tblPOption" 'WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + Set oRSP = New Recordset + oRSP.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + oRSP.MoveFirst +' If moRSOpt.EOF Then +' FormFindOpt = False +' Else +' strDate = Field2Str(moRSOpt!effdate) +' If Len(strDate) = 0 Then +' moRSOpt!effdate = Field2Str(txtEffDate) +' moRSOpt.Update +' Call AddOptBill3 +' End If + Do Until lngCNT = oRSP.RecordCount + lngPOptID = Field2Str2(oRSP!OPTID) + + strSQLL = "SELECT * FROM tblLOPTION WHERE OPT_ID = " & lngPOptID + Set oRSO = New Recordset + oRSO.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSO.EOF Then + ' mboolOPTUSED = True + oRSP!USED = vbTrue + oRSP.Update + Else + ' mboolOPTUSED = False + End If + lngCNT = lngCNT + 1 + oRSP.MoveNext + Loop +' Exit Function + MsgBox "POption USED Field Update Is Completed", vbOKOnly +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strSQL As String, intBOOKMARK As Integer + +' Q Finish processing on an AR transfer to CMS +' U Reprint Order Check List Report +' R Open The Repair Scheduling Screen - Only For Address Lookup +' Z Update The Job Cost Code in AP History File +' X Update The Job Cost Code in AR History File +' T Show The PaySheets That Have Been Printed For The Highlighted Lot +' Y Mark The HiLited lot as a test lot and to not print in selected lists + + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyU Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\OrdChkList.rpt" + strSQL = "{tblLOTINFO.LOT_ID} = " & gintLOTID + crMain.SelectionFormula = (strSQL) +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID +' crMain.ReplaceSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyI And gbytSECURITY = 1 Then ' Change INV_NO in TOMatrl to a String + If CtrlDown Then + Call UpTOMatrl + End If + End If + + If KeyCode = vbKeyL And gbytSECURITY = 1 Then ' Change INV_NO in LotMatrl to a string + If CtrlDown Then + Call UpLOTMatrl + End If + End If + + If KeyCode = vbKeyY And mboolMARK Then 'gbytSECURITY = 1 Then ' Change INV_NO in LotMatrl to a string + If CtrlDown Then + moRS!Skip = True + moRS.Update + End If + End If + + If KeyCode = vbKeyR Then + If CtrlDown Then + If lstContains.Visible = False Then + MsgBox "This Only Works With The SEARCH ADDRESS Lookup", vbOKOnly, "Invalid Lookup" + Exit Sub + End If + lstContains.col = 0 + gintLOTID = lstContains.ColText +' gintLOTID = lstLots.ItemData(lstLots.ListIndex) + frmRepairLot.Show 1 + End If + End If + + If KeyCode = vbKeyZ Then ' Update The Job Cost Code in AP History File + If CtrlDown Then + Call FixAPH + End If + End If + + If KeyCode = vbKeyX Then ' Update The Job Cost Code in AR History File + If CtrlDown Then + Call FixARH + End If + End If + + If KeyCode = vbKeyW Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POMatS.rpt" + strSQL = "{tblLOTINFO.LOT_ID} = " & gintLOTID + crMain.SelectionFormula = (strSQL) +' crMain.ReplaceSelectionFormula = ("{tblLOTINFO.LOT_ID} = " & gintLOTID) +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyD Then 'And gbytSECURITY = 1 Then + If CtrlDown Then + If lstLots.ListIndex >= 0 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + crMain.ReportFileName = App.Path & "\POMatD.rpt" +' strSQL = "{tblORDERS.LOT_ID} = " & gintLOTID & " AND {tblORDERS.M_TYPE} = 'R'" + strSQL = "{tblORDERS.LOT_ID} = " & gintLOTID '& " AND {tblORDERS.M_TYPE} = 'R'" + crMain.SelectionFormula = (strSQL) +' crMain.ReplaceSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID +' crMain.GroupSelectionFormula = "{tblLOTINFO.LOT_ID} = " & gintLOTID + ' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = gintCOPY + crMain.WindowState = crptMaximized + crMain.Action = 1 + crMain.Reset + End If +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyM And gbytSECURITY = 1 Then + If CtrlDown Then + Call FixPOCount +' MsgBox "Takeoff UpDate Complete", vbOKOnly, "Update Takeoff" + End If + Exit Sub + End If + + If KeyCode = vbKeyT And gbytSECURITY < 3 Then ' Display the Pay SHeet information + If CtrlDown Then + If lstLots.Visible = False Then + MsgBox "Need To Select A Lot First", vbOKOnly, "Invalid Selection" + Exit Sub + End If + intBOOKMARK = lstLots.ListIndex + gintPROJID = Field2Str2(lstProject.ItemData(lstProject.ListIndex)) + gintLOTID = Field2Str2(lstLots.ItemData(lstLots.ListIndex)) + frmPaySheet.Show 1 + lstLots.ListIndex = intBOOKMARK + End If + Exit Sub + End If + + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + Call FixPrinting + End If + Exit Sub + End If + + If KeyCode = vbKeyA And (gbytSECURITY < 3 Or gstrLOGIN = "JDV") Then ' Fix BIlling Date + If CtrlDown Then + Call cmdNewSearch_Click + lblCALC.Visible = True + Call cmdFixBill_Click + lblCALC.Visible = False + End If + Exit Sub + End If + + If KeyCode = vbKeyS And (gbytSECURITY < 3 Or gbytSECURITY = 6) Then ' Display key combinations. + If lstLots.ListCount > 0 Then + If CtrlDown Then + Call FixStart + End If + Exit Sub + End If + End If + + If KeyCode = vbKeyB And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Display key combinations. + If CtrlDown Then + Call UpStart + End If + Exit Sub + End If + + If KeyCode = vbKeyQ And (gbytSECURITY < 3) Then ' Complete the setup of a transfer to cms + If CtrlDown Then + Call CMSTransfer ' this command must be removed for production + End If + Exit Sub + End If + +End Sub + +Private Sub UpStart() +Dim strEffDate As String +Dim strSQL As String, oRS As Recordset + + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strEffDate = InputBox("Enter the New Effective Date for This Project", "New Effective Date", Date) + If IsDate(strEffDate) Then + strSQL = "SELECT * FROM tblProjDate" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = strEffDate + oRS.Update + End If +End Sub + +Private Sub lstProject_DblClick() + Call cmdLotSearch_Click +End Sub + +Private Sub mnuABTPosPayC_Click() + Call ABTPosPayC +End Sub + +Private Sub mnuABTPosPayS_Click() + Call ABTPosPayS +End Sub + +Private Sub mnuABTPosPayV_Click() + Call ABTPosPayV +End Sub + +Private Sub mnuAck_Click() + frmAck.Show 1 +End Sub + +Private Sub mnuAddPPayS_Click() + frmPosPayS.Show 1 + +End Sub + +Private Sub mnuAddPPayV_Click() + frmPosPayV.Show 1 + +End Sub + +Private Sub mnuAddPPayC_Click() + frmPosPayC.Show 1 + +End Sub + +Private Sub mnuAPEdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\APEdit.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuAREdit_Click() +Dim strSQL As String, strYN As String, strYN2 As String, strMSG As String + +' cdMain.CancelError = True + cdMain.Action = 5 +' If cdMain.CancelError Then +' MsgBox ("Printer Selection Canceled") +' Exit Sub +' End If + +'' strMSG = "To Print A Summary Report, Click YES" & vbCrLf & vbCrLf +'' strMSG = strMSG & "To Print A Detailed Report, Click No" +'' strYN2 = MsgBox(strMSG, vbYesNo, "Select YES or NO") + + crMain.ReportFileName = App.Path & "\AREdit.rpt" + +'' If strYN2 = vbYes Then +'' crMain.ReportFileName = App.Path & "\ARTransSum.rpt" +'' ElseIf strYN2 = vbNo Then +'' crMain.ReportFileName = App.Path & "\ARTrans.rpt" +'' End If + + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuAREdit2_Click() +Dim strSQL As String, strYN As String, strYN2 As String, strMSG As String + +' cdMain.CancelError = True + cdMain.Action = 5 +' If cdMain.CancelError Then +' MsgBox ("Printer Selection Canceled") +' Exit Sub +' End If + +'' strMSG = "To Print A Summary Report, Click YES" & vbCrLf & vbCrLf +'' strMSG = strMSG & "To Print A Detailed Report, Click No" +'' strYN2 = MsgBox(strMSG, vbYesNo, "Select YES or NO") + +' crMain.ReportFileName = App.Path & "\AREdit.rpt" + +'' If strYN2 = vbYes Then +'' crMain.ReportFileName = App.Path & "\ARTransSum.rpt" +'' ElseIf strYN2 = vbNo Then + crMain.ReportFileName = App.Path & "\ARTrans.rpt" +'' End If + + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then +' cdMain.Action = 5 + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuBid_Click() +Dim strSQL As String + + crMain.ReportFileName = App.Path & "\BidReport.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + + +End Sub + +Private Sub mnuCMSAP_Click() + Call ImportCMSAP +End Sub + +Private Sub mnuCMSAR_Click() + Call ImportCMSAR +End Sub + +Private Sub mnuCMSPPSW_Click() + Call ImportCMSPPSW +End Sub + +Private Sub mnuCMSPPVW_Click() + Call ImportCMSPPVW +End Sub + +Private Sub mnuFindPO_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + gstrPONUM = UCase(InputBox("Enter The PO Number You Want (From Upper Left)", "PO Number")) + If gstrPONUM = "" Then +' MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + strSQL = "SELECT PONum, Lot_ID FROM tblOrders WHERE ponum = " & Int(gstrPONUM) ' & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + gintLOTID = Field2Long(oRS!Lot_ID) +' gintLOTID = Field2Integer(oRS!Lot_id) + strSql2 = "SELECT lot_id, proj_id FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + gintPROJID = Field2Long(oRSS!PROJ_ID) +' gintPROJID = Field2Integer(oRSS!proj_id) + End If + Else + MsgBox "You Must Enter A Valid VWP PO Number", vbOKOnly, "No Valid PO" + Exit Sub + End If + If oRSS.State = adStateOpen Then + oRSS.Close + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +' gintORDER = 8 + gintORDER = 9 + frmOrders.Show 1 + +End Sub + +Private Sub mnuFIXAP_Click() + frmAPFIX.Show 1 +End Sub + +Private Sub mnuFIXAR_Click() + frmARFIX.Show 1 +End Sub + +Private Sub mnuFoamOrder_Click() + frmFoam.Show 1 +End Sub + +Private Sub mnuJCTrans_Click() +Dim strSQL As String, intYN As Integer + intYN = MsgBox("Are You Sure You Want Clear The Job Cost File for VWP?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblJCTrans" + goConn.Execute strSQL + + MsgBox "VWP Job Cost Transfer Is Complete", vbOKOnly, "Job Cost" + +End Sub + +Private Sub mnuJPPosPay_Click() + Call BOPosPay +End Sub + +Private Sub mnuMAPEdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\APEditM.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuMAREdit_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\AREditM.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuMJCTrans_Click() +Dim strSQL As String, intYN As Integer + intYN = MsgBox("Are You Sure You Want Clear The Job Cost File for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblJCTransM" + goConn.Execute strSQL + + MsgBox "Metro Stucco Job Cost Transfer Is Complete", vbOKOnly, "Job Cost" + +End Sub + +Private Sub mnuAbout_Click() + frmAbout.Show +End Sub + +Private Sub mnuARUPDATE_Click() + + frmARMaster.Show 1 +End Sub + +Private Sub mnuAPUPDATE_Click() + + frmAPMaster.Show 1 +End Sub + +Private Sub mnuARUPDATExx_Click() +Dim strSQL As String, strSELECT As String, strTEST As String +Dim oRS As Recordset, oRSS As Recordset + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strTEST = "DELETE * FROM tblARMASTER" + goConn.Execute strTEST + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AR1_CustomerMaster WHERE SORTFIELD <> '99'" + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + If Trim(oRS!SortField) = "99" Then + + Else + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblARMaster WHERE Cust_NO = '" & oRS!CustomerNumber & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!Cust_NO = Field2Str(oRS!CustomerNumber) + oRSS!Name = Field2Str(oRS!customername) + oRSS!Address1 = Field2Str(oRS!addressline1) + oRSS!Address2 = Field2Str(oRS!addressline2) + ' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!City = Field2Str(oRS!City) + oRSS!State = Field2Str(oRS!State) + oRSS!ZipCode = Left(Field2Str(oRS!ZipCode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + End If + + frmMain.MousePointer = vbArrow + MsgBox "AR Master file update is complete" + +End Sub + +Private Sub mnuAPUPDATExx_Click() +Dim strSQL As String, strSELECT As String, strTEST As String +Dim oRS As Recordset, oRSS As Recordset + +' If Not gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strTEST = "DELETE * FROM tblAPMASTER" + goConn.Execute strTEST + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AP1_VendorMaster WHERE SORTFIELD <> '99'" + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + If Trim(oRS!SortField) = "99" Then + + Else + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblAPMaster WHERE Cust_NO = """ & oRS!VendorNumber & """" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!Cust_NO = Field2Str(oRS!VendorNumber) + oRSS!Name = Field2Str(oRS!VendorName) + oRSS!Address1 = Field2Str(oRS!addressline1) + oRSS!Address2 = Field2Str(oRS!addressline2) +' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!City = Field2Str(oRS!City) + oRSS!State = Field2Str(oRS!State) + oRSS!ZipCode = Left(Field2Str(oRS!ZipCode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + End If + + frmMain.MousePointer = vbArrow + MsgBox "AP Master file update is complete" + +End Sub + +Private Sub mnuBP_Click() + frmBlackPaper.Show +End Sub + +Private Sub mnuContractor_Click() + frmContractor.Show +End Sub + +Private Sub mnuCrew_Click() + frmCrews.Show +End Sub + +Private Sub mnuCrews_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM tblTime" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT Crew_id, Old_id, type FROM tblCrew WHERE type = '" & oRS!pay_type & "' and Old_id = " & oRS!crew + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + oRS!crew = Field2Str(oRSS!CREW_ID) + oRS.Update + Else + oRS!crew = 0 + oRS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + + frmMain.MousePointer = vbArrow + MsgBox "Crew conversion is complete" + +End Sub + +Private Sub mnuEstInv_Click() + frmInvType.Show 1 + frmInvTake.Show 1 +End Sub + +Private Sub mnuInvCount_Click() + crMain.ReportFileName = App.Path & "\InventoryReport.rpt" + crMain.Destination = crptToPrinter + crMain.Action = 1 + +End Sub + +Private Sub mnuNotes_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + frmMain.MousePointer = vbHourglass + strSQL = "SELECT lot_id, notes FROM lotnote ORDER BY lot_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT lot_id, notes FROM tblLotInfo" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "lot_id = " & oRS!Lot_ID + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + strSQL = "SELECT toid, notes FROM takenote ORDER BY toid" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, notes FROM tblTake" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "toid = " & oRS!toid + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + strSQL = "SELECT est_id, notes FROM plannote ORDER BY est_id" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT est_id, notes FROM tblplans" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.MoveFirst + strFIND = "est_id = " & oRS!est_id + oRSS.Find strFIND + If Not oRSS.EOF Then + oRSS!notes = Field2Str(oRS!notes) + oRSS.Update + End If + oRS.MoveNext + + Loop + oRSS.Close + oRS.Close + + frmMain.MousePointer = vbArrow + MsgBox "Notes conversion is complete" + +End Sub + +Private Sub mnuExit_Click() + Unload Me +End Sub +''Private Sub mnuFixTOM_Click() +''Dim strSQL As String, strSql2 As String, strSQL3 As String +''Dim oRS As Recordset, oRSS As Recordset +''Dim strID As String + +'' strSQL = "SELECT * FROM tblCrewList" ' where Order_date > #12/31/2001#" +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' strSql2 = "SELECT * FROM tblLotInfo" ' where proj_id = " & Field2Integer(oRS!proj_id) & " and pln_elv = '" & Field2Str(oRS!mod_elv) & "'" +' Set oRSS = New Recordset +' oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + +'' Do Until oRS.EOF +'' strID = oRS!emp_id +'' strSql2 = "SELECT Department, EmployeeNumber, LastName, FirstName, DefaultWCCode FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & strID & "'" +'' Set oRSS = New Recordset +'' oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic +' strSQL3 = "lot_id = " & Field2Integer(oRS!Lot_id) ' & " and pln_elv = '" & Field2Str(oRS!mod_elv) & "'" + ' oRSS.BOF +' oRSS.Filter = strSQL3 +'' If Not oRSS.EOF Then + 'With oRSS +'' oRS!wc_code = Field2Str(oRSS!defaultwccode) ' * Field2Str(!openpr)) / 100) + 0.99) +'' oRS.Update + 'End With + 'oRSS.MoveFirst +'' End If +' oRSS.MoveFirst +'' oRS.MoveNext +'' Loop + +'' MsgBox "The WCCode Update is Complete" + +''End Sub + +Private Sub mnuLathList_Click() +Dim strSELECT As String + + On Error GoTo Error_EH + gintPRINT = 9 + frmReport.Show 1 + + crMain.ReportFileName = App.Path & "\LathOrderDateList.rpt" + crMain.GroupSelectionFormula = strSELECT + crMain.CopiesToPrinter = gintCOPY + crMain.Destination = gintDEST + crMain.WindowState = crptMaximized + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuLathList" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuMAPTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AP Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupMAPTransfer + +End Sub + +Private Sub mnuMARUpdate_Click() +Dim strSQL As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + frmMain.MousePointer = vbHourglass + strSQL = "SELECT * FROM AR1_CustomerMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn3, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblARMasterM WHERE Cust_NO = '" & oRS!CustomerNumber & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.EOF Then + oRSS.AddNew + oRSS!Division = Field2Str(oRS!Division) + oRSS!Cust_NO = Field2Str(oRS!CustomerNumber) + oRSS!Name = Field2Str(oRS!customername) + oRSS!Address1 = Field2Str(oRS!addressline1) + oRSS!Address2 = Field2Str(oRS!addressline2) +' oRSS!address2 = Trim$(field2str(oRS!addressline2)) + oRSS!City = Field2Str(oRS!City) + oRSS!State = Field2Str(oRS!State) + oRSS!ZipCode = Left(Field2Str(oRS!ZipCode), 5) + oRSS.Update + End If + oRS.MoveNext + + Loop +' oRSS.Close +' oRS.Close + + + frmMain.MousePointer = vbArrow + MsgBox "Metro Stucco AR Master file update is complete" + +End Sub + +Private Sub mnuOrder5_Click() + cmdOrderR.Caption = "Orders PreMix" + mnuOrder5.Checked = True + mnuOrderR.Checked = False + mnuOrderE.Checked = False + +End Sub + +Private Sub mnuOrderE_Click() + cmdOrderR.Caption = "Orders Synthetic" + mnuOrder5.Checked = False + mnuOrderR.Checked = False + mnuOrderE.Checked = True + +End Sub + +Private Sub mnuOrderR_Click() + cmdOrderR.Caption = "Orders" + mnuOrder5.Checked = False + mnuOrderR.Checked = True + mnuOrderE.Checked = False +End Sub + +Private Sub mnuPayroll_Click() + Call cmdPayroll_Click +End Sub + +Private Sub mnuPlanUse_Click() +Dim strSQL As String + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + crMain.GroupSelectionFormula = "{tblLOTINFO.PROJ_ID} = " & gintPROJID + crMain.ReportFileName = App.Path & "\PlanUsage.rpt" +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuPOList_Click() + frmPOList.Show 1 +End Sub + +Private Sub mnuPOListdesc_Click() +Dim strSQL As String, strYN As String + + crMain.ReportFileName = App.Path & "\POListDescend.rpt" +' crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID + strYN = MsgBox("Do You Want To Print To Printer", vbYesNo, "Print?") + If strYN = vbYes Then + crMain.Destination = crptToPrinter + Else + crMain.Destination = crptToWindow + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub BOPosPay() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") + strBANK = "4" + strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module BOPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub ABTPosPayV() +Dim strEXPORT As String * 80, strSQL As String, strSql2 As String +Dim strCHECK As String * 10, strAMT As String * 10, strSTART As String +Dim strDate As String * 6, strName As String * 34 +Dim oRS As Recordset, strFile As String, strMSG As String, strMAX As String +Dim strBegDate As String, strEndDate As String, strFILE2 As String +Dim strBegDate2 As String, strEndDate2 As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + strMAX = FindMax("tblPosPayVWP", "Sequence") + strMAX = Val(strMAX) + 1 +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBANK = "5" + strBANK = "8" +' strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + +' strBegDate2 = Format(strBegDate, "MMDDYY") +' strEndDate2 = Format(strEndDate, "MMDDYY") + +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + strSQL = "SELECT * FROM tblPosPayVWP WHERE Not SUBMIT" ' TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' If oRS.EOF Then +' MsgBox "Did not open bank code", vbOKOnly +' Exit Sub +' End If + strName = Space(34) + strFILE2 = "PosPay" & strMAX & ".TXT" + strFile = "G:\A_PosPay\PosPayVW\" & strFILE2 +' strFile = "C:\AZBank\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CKDate, "MMDDYY") + strAMT = Format(Field2Str(!CKAmt), "0000000.00") + strCHECK = Format(!CKNumber, "0000000000") +' strName = Field2Str(!CheckPayeeName) + strEXPORT = "C008009361183601 RA " & strCHECK & strAMT & strDate & strName +' If strDate >= strBegDate2 And strDate <= strEndDate2 Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!CKAmt) + Print #1, strEXPORT +' End If + !Submit = True + !SubDate = Date + !sequence = strMAX + !User = gstrLOGIN + .Update + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File --> " & strFILE2 & " <--" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & " has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ABTPosPayV" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub ABTPosPayS() +Dim strEXPORT As String * 80, strSQL As String, strSql2 As String +Dim strCHECK As String * 10, strAMT As String * 10, strSTART As String +Dim strDate As String * 6, strName As String * 34 +Dim oRS As Recordset, strFile As String, strMSG As String, strMAX As String +Dim strBegDate As String, strEndDate As String, strFILE2 As String +Dim strBegDate2 As String, strEndDate2 As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + strMAX = FindMax("tblPosPaySWI", "Sequence") + strMAX = Val(strMAX) + 1 +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBANK = "5" + strBANK = "7" +' strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + +' strBegDate2 = Format(strBegDate, "MMDDYY") +' strEndDate2 = Format(strEndDate, "MMDDYY") + +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + strSQL = "SELECT * FROM tblPosPaySWI WHERE Not SUBMIT" ' TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' If oRS.EOF Then +' MsgBox "Did not open bank code", vbOKOnly +' Exit Sub +' End If + strName = Space(34) + strFILE2 = "PosPay" & strMAX & ".TXT" + strFile = "G:\A_PosPay\PosPaySW\" & strFILE2 +' strFile = "C:\AZBank\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CKDate, "MMDDYY") + strAMT = Format(Field2Str(!CKAmt), "0000000.00") + strCHECK = Format(!CKNumber, "0000000000") +' strName = Field2Str(!CheckPayeeName) + strEXPORT = "C007009361131056 RA " & strCHECK & strAMT & strDate & strName +' If strDate >= strBegDate2 And strDate <= strEndDate2 Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!CKAmt) + Print #1, strEXPORT +' End If + !Submit = True + !SubDate = Date + !sequence = strMAX + !User = gstrLOGIN + .Update + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File --> " & strFILE2 & " <--" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & " has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ABTPosPayS" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub ABTPosPayC() +Dim strEXPORT As String * 80, strSQL As String, strSql2 As String +Dim strCHECK As String * 10, strAMT As String * 10, strSTART As String +Dim strDate As String * 6, strName As String * 34 +Dim oRS As Recordset, strFile As String, strMSG As String, strMAX As String +Dim strBegDate As String, strEndDate As String, strFILE2 As String +Dim strBegDate2 As String, strEndDate2 As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + + strMAX = FindMax("tblPosPayCRD", "Sequence") + strMAX = Val(strMAX) + 1 +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + +' strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBANK = "5" + strBANK = "7" +' strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + +' strBegDate2 = Format(strBegDate, "MMDDYY") +' strEndDate2 = Format(strEndDate, "MMDDYY") + +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + strSQL = "SELECT * FROM tblPosPayCRD WHERE Not SUBMIT" ' TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' If oRS.EOF Then +' MsgBox "Did not open bank code", vbOKOnly +' Exit Sub +' End If + strName = Space(34) + strFILE2 = "PosPay" & strMAX & ".TXT" + strFile = "G:\A_PosPay\PosPayCR\" & strFILE2 +' strFile = "C:\AZBank\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CKDate, "MMDDYY") + strAMT = Format(Field2Str(!CKAmt), "0000000.00") + strCHECK = Format(!CKNumber, "0000000000") +' strName = Field2Str(!CheckPayeeName) + strEXPORT = "C007009361131080 RA " & strCHECK & strAMT & strDate & strName +' If strDate >= strBegDate2 And strDate <= strEndDate2 Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!CKAmt) + Print #1, strEXPORT +' End If + !Submit = True + !SubDate = Date + !sequence = strMAX + !User = gstrLOGIN + .Update + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File --> " & strFILE2 & " <--" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & " has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module ABTPosPayS" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuPosPayHold_Click() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRSP As Recordset, strSQLP As String +Dim oRSP2 As Recordset, strSQLP2 As String +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") +' strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") +' strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + mstrBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + mstrEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", mstrBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + +'' strSQLP = "SELECT * FROM PR_23PerptHistoryDetail WHERE CheckNumber = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + +'' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +'' Set oRS = New Recordset +'' oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module mnuPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuPosPay2_Click() +Dim strEXPORT As String * 66, strSQL As String, strSql2 As String +Dim strCHECK As String * 6, strAMT As String * 13 +Dim strDate As String * 8, strName As String * 30 +Dim oRS As Recordset, strFile As String, strMSG As String +Dim strBegDate As String, strEndDate As String +Dim intCOUNT As Integer, dblTotal As Double, strBANK As String + + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strBANK = InputBox("Enter the Bank Code you want to Export", "Bank Code", "4") + strBegDate = InputBox("Enter the Beginning Date (MM/DD/YY)", "Beginning Date") + strEndDate = InputBox("Enter the Ending Date (MM/DD/YY)", "Ending Date", strBegDate) + MousePointer = 11 + + strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '" & strBANK & "' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate +' strSQL = "SELECT * FROM BR1_Transaction WHERE TransactionType = 'C' and BankCode = '4' and Amount > 0 and ClearedBank = 'N'" ' where checktransdate >= " & strBegDate & " and checktransdate <= " & strEndDate + Set oRS = New Recordset + oRS.Open strSQL, goConn2, adOpenKeyset, adLockOptimistic + + strName = Space(30) + strFile = "C:\BankOne\PosPay.txt" + intCOUNT = 0 + dblTotal = 0 + Open strFile For Output As #1 + + Do Until oRS.EOF + With oRS + strDate = Format(!CheckTransDate, "MM/DD/YY") + strAMT = Format(Field2Str(!amount), "#.00") + strCHECK = Format(!CheckNumber, "000000") + strName = Field2Str(!CheckPayeeName) + strEXPORT = "06279209" & strDate & strCHECK & strAMT & strName + If strDate >= strBegDate And strDate <= strEndDate Then + intCOUNT = intCOUNT + 1 + dblTotal = dblTotal + Field2Str2(!amount) + Print #1, strEXPORT + End If + End With + oRS.MoveNext + Loop + strMSG = "PosPay Export File has been Created With" & Chr(10) & Chr(13) & Chr(10) & Chr(13) + strMSG = strMSG & intCOUNT & " Checks And A Total Of " & Format(dblTotal, "#,#.00") + MsgBox strMSG, vbOKOnly, "Export File Ready" + Close #1 + MousePointer = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Main - Module mnuPosPay" +' Call ErrorHandler(oRS.ActiveConnection) + + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuProjJC_Click() +Dim strYN As String + + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strYN = MsgBox("Do You Want To Print to the Printer", vbYesNo, "Print to Printer") + + crMain.ReportFileName = App.Path & "\JCSummary.rpt" + crMain.ReplaceSelectionFormula "{tblPROJECT.PROJ_ID} = " & gintPROJID & " and {tblLOTINFO.BILL}>0" + If strYN = vbNo Then + crMain.Destination = crptToWindow + Else + crMain.Destination = crptToPrinter + End If + crMain.WindowState = crptMaximized + crMain.Action = 1 +End Sub + +Private Sub mnuProjPlan_Click() +Dim strSQL As String + If lstProject.ListIndex = -1 Then + MsgBox "You Need To Select A Project First", vbOKOnly, "No Project" + Exit Sub + End If + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + crMain.ReportFileName = App.Path & "\PlansInfo.rpt" + crMain.ReplaceSelectionFormula "{tblPLANS.PROJ_ID} = " & gintPROJID +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + + +End Sub + +Private Sub mnuRCrew_Click() + frmRCrew.Show +End Sub + +Private Sub mnuInvList_Click() +' frmInventory.Load + frmInventory.Show +End Sub + +Private Sub mnuRepList_Click() + frmRepList.Show 1 +End Sub + +Private Sub mnuSand_Click() + frmSand.Show +End Sub + +Private Sub mnuSCrew_Click() + frmSCrew.Show +End Sub + +Private Sub mnuSetupSWMAR_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The SW AR Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupARMTransfer + + MsgBox "SW Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" + +End Sub + +Private Sub mnuTake5_Click() + cmdTakeR.Caption = "Takeoff PreMix" + mnuTake5.Checked = True + mnuTakeR.Checked = False + mnuTakeE.Checked = False +End Sub + +Private Sub mnuTakeE_Click() + cmdTakeR.Caption = "Takeoff Synthetic" + mnuTakeE.Checked = True + mnuTake5.Checked = False + mnuTakeR.Checked = False +End Sub + +Private Sub mnuTakeR_Click() + cmdTakeR.Caption = "Takeoff" + mnuTakeR.Checked = True + mnuTake5.Checked = False + mnuTakeE.Checked = False +End Sub + +Private Sub mnuTransfer_Click() +Dim intYN As Integer, strMSG As String + + + strMSG = "Are You Sure You Are Ready To Setup The Invoice Transfer?" + strMSG = strMSG & vbCrLf & "If You Answer YES And Have Not Made Corrections, The File Will Be Lost" + strMSG = strMSG & vbCrLf & "And You Will Not Be Able To Transfer To CMS" + intYN = MsgBox(strMSG, vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupTransfer +' Call CMSTransfer ' this command must be removed for production + +' MsgBox "Invoices are now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto CMS" +' MsgBox "Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuMARTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AR Transfer for Metro Stucco?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupMARTransfer + + MsgBox "Metro Stucco Accounts Receivable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuSWTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The SW AR Transfer?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + + Call SetupARTransfer + + MsgBox "SW Accounts Receivable is now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub mnuAPTransfer_Click() +Dim intYN As Integer + + intYN = MsgBox("Are You Sure You Are Ready To Setup The AP Transfer?", vbYesNo + vbQuestion, "Are You Sure?") + If intYN = vbNo Then + Exit Sub + End If + +' Call CMSAPTransfer + Call SetupAPTransfer + +End Sub + +Private Sub mnuUInv_Click() +Dim intTAKE As Integer, intPLAN As Integer, intLOT As Integer +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSql2 As String + + intTAKE = MsgBox("This will take as much as 10 minutes per file - Do You Want To Continue?", vbQuestion + vbYesNo + 256, "Just Do It") + If intTAKE <> 6 Then + Exit Sub + End If + + intTAKE = MsgBox("Do You Want to Update Takeoff Inventory?", vbYesNo + 256, "Takeoff Inventory") + intPLAN = MsgBox("Do You Want to Update Plan Inventory?", vbYesNo + 256, "Plans Inventory") + intLOT = MsgBox("Do You Want to Update Lot Orders Inventory?", vbYesNo + 256, "Lot Orders Inventory") + + strSQL = "SELECT * FROM tblINVTRY" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSS.EOF Then + If intTAKE = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblTOMatrl set d_flag = '" & oRSS!d_flag & "', m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' strSQL2 = "UPDATE tblTOMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 +' strSQL2 = "UPDATE tblTOMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' goConn.Execute strSQL2 + strSql2 = "UPDATE tblOPTMatrl set d_flag = '" & oRSS!d_flag & "', m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' strSQL2 = "UPDATE tblOPTMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 +' strSQL2 = "UPDATE tblOPTMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no +' goConn.Execute strSQL2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "TakeOff Material Has Been Updated", vbOKOnly, "Update Complete" + End If + + If intPLAN = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblPlanMat set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPlanMat set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPOMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblPOMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "Plan Material Has Been Updated", vbOKOnly, "Update Complete" + End If + + If intLOT = 6 Then + MousePointer = vbHourglass + frmMain.Enabled = False + oRSS.MoveFirst + Do While Not oRSS.EOF + strSql2 = "UPDATE tblLOTMatrl set d_flag = '" & oRSS!d_flag & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + strSql2 = "UPDATE tblLOTMatrl set m_type = '" & oRSS!m_type & "' WHERE inv_no = " & oRSS!inv_no + goConn.Execute strSql2 + oRSS.MoveNext + Loop + MousePointer = vbArrow + frmMain.Enabled = True + MsgBox "Lot Order Material Has Been Updated", vbOKOnly, "Update Complete" + End If + End If +End Sub + +Private Sub mnuUpCheck_Click() +Dim strPayDate As String, strMSG As String +Dim strSQL As String, strSql2 As String, strSQL3 As String, strSQL4 As String, strSql5 As String +Dim oRS As Recordset, oRSC As Recordset, oRST As Recordset, oRSCH As Recordset +Dim strRDate As String + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strMSG = "Enter the Payroll Date to Process (MM/DD/YYYY)" & vbCrLf + strMSG = strMSG & "If you have not exported the check information" & vbCrLf + strMSG = strMSG & "from MAS90, then EXIT and do it before processing!!" + strPayDate = InputBox(strMSG, "Process Checks") + If IsDate(strPayDate) Then + strSql5 = "SELECT Department, EmployeeNumber, CheckDate, CheckNumber FROM PR5_CheckHistory " 'WHERE PR5_CheckHistory.CheckDate = '04/20/2001'" '& strPayDate '& "'" + Set oRSCH = New Recordset + oRSCH.Open strSql5, goConn2, adOpenForwardOnly, adLockReadOnly + If oRSCH.RecordCount = 0 Then + MsgBox "There Were No Checks Found In The MAS90 Check File", vbOKOnly, "NO CHECKS" + Exit Sub + End If + + strSQL = "SELECT Crew_id, Pay_id FROM tblPayHeader WHERE Pay_date = #" & Field2Str(strPayDate) & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSql2 = "SELECT Empno FROM tblCREW WHERE crew_id = " & Field2Str2(oRS!CREW_ID) + Set oRSC = New Recordset + oRSC.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + If IsNull(oRSC!EmpNo) Or oRSC!EmpNo = "0000000" Then + strMSG = "No Employee Number was found for crew # " & Field2Str(oRS!CREW_ID) + strMSG = strMSG & vbCrLf & "Add the Employee Number and ReProcess Checks" + MsgBox strMSG, vbOKOnly, "No Employee Number" + Exit Sub + End If + + strSQL3 = "EmployeeNumber = '" & Field2Str(oRSC!EmpNo) & "' AND CheckDate = '" & strPayDate & "'" +' strSQL3 = "EmployeeNumber = '" & Field2Str(oRSC!empno) & "'" + oRSCH.Filter = strSQL3 +' Set oRSCH = New Recordset +' oRSCH.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSCH.EOF Then + strMSG = "No Check Was Found For Employee Number " & Field2Str(oRSC!EmpNo) + strMSG = strMSG & vbCrLf & "Check to See Why There is No Check and ReProcess Checks" + MsgBox strMSG, vbOKOnly, "No Check" + Exit Sub + Else + strSQL4 = "UPDATE tblTIME SET prcheck = '" & Field2Str(oRSCH!CheckNumber) & "' WHERE pay_id = " & Field2Str(oRS!pay_id) + goConn.Execute strSQL4 + strSQL4 = "UPDATE tblTIME SET prdate = '" & Field2Str(strPayDate) & "' WHERE pay_id = " & Field2Str(oRS!pay_id) + goConn.Execute strSQL4 + End If + oRS.MoveNext + Loop + Else + MsgBox "The Date You Entered Is Invalid -- ReEnter", vbOKOnly, "Invalid Date" + Exit Sub + End If + + MsgBox "Check Number Update Is Complete", vbOKOnly, "UPDATE CHECKS" + + crMain.ReportFileName = App.Path & "\PRCheckList.rpt" + crMain.CopiesToPrinter = 1 + strRDate = Format(strPayDate, "yyyy,mm,dd") +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.ParameterFields(0) = "StartDate;date(" & strRDate & ");TRUE" + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuVoid_Click() +Dim intResponse As Integer + + crMain.ReportFileName = App.Path & "\VoidCk.rpt" + intResponse = MsgBox("Do You Want to View the Report Instead of Printing?", vbYesNo, "Print Where?") + If intResponse = vbYes Then + crMain.Destination = crptToWindow + Else + crMain.Destination = crptToPrinter + End If + crMain.CopiesToPrinter = 1 + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuYInvList_Click() + frmYInventory.Show +End Sub + +Private Sub mnuInvPrice_Click() + frmInvPrice.Show +End Sub + +Private Sub mnuLabor_Click() + frmLabor.Show +End Sub + +Private Sub mnuOrders_Click() + Call cmdOrder_Click +End Sub + +Private Sub mnuOrdersDate_Click() +Dim strSELECT As String + + On Error GoTo Error_EH + gintPRINT = 9 + frmReport.Show 1 + + crMain.ReportFileName = App.Path & "\TextureOrderDateList.rpt" + crMain.GroupSelectionFormula = strSELECT + crMain.CopiesToPrinter = gintCOPY + crMain.Destination = gintDEST + crMain.WindowState = crptMaximized + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuOrdersDate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuPlans_Click() + Call cmdPlans_Click +End Sub + +Private Sub cmdLotSearch_Click() + + mboolMARK = True + + lstLots.Width = 6000 + lstLots.Visible = True + lstProject.Width = 2595 + Call LotLoad + cmdJCUpdate.Visible = True + cmdNewSearch.Enabled = True + cmdYardOrder.Visible = True + cmdSchedule.Visible = True + cmdLotInfo.Visible = True + cmdPOInfo.Visible = True + cmdScaffold.Visible = True + If gbytSECURITY < 10 Then + cmdOrderR.Enabled = True + mnuOrders.Enabled = True + cmdDates.Visible = True + End If + If gbytSECURITY = 8 Or gbytSECURITY = 1 Or gbytSECURITY = 10 Or gstrLOGIN = "TYF" Then + cmdPayroll.Enabled = True + mnuPayroll.Enabled = True + End If + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = False + mnuTake.Enabled = False +' cmdJCRpt.Visible = True + cmdPrintJCRpt.Visible = True +' cmdJCRpt.Visible = True +' cmdPrintJCRpt.Visible = True + End If + If gbytSECURITY < 7 Then + cmdPlans.Enabled = False + mnuPlans.Enabled = False + End If + +' If gstrLOGIN = "KA" Then +' cmdScaffold.Visible = False +' cmdScafList.Visible = False +' End If + + If gstrLOGIN = "JDV" Then + cmdPlans.Enabled = False + mnuPlans.Enabled = False + End If + lstLots.SetFocus +End Sub + +Private Sub cmdFCode_Click() + If Len(txtSCode) > 0 Then + txtSCode.Enabled = False + txtSName.Enabled = False + Call CodeLoad + Else + MsgBox "A Project Code Must Be Entered", , "No Project Code" + txtSCode.SetFocus + End If + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + If mboolSHOW Then + cmdLotSearch.Enabled = True + cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "JDV" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstProject.SetFocus + Else + txtSCode.SetFocus + End If +End Sub + +Private Sub cmdFName_Click() + If Len(txtSName) > 0 Then + txtSCode.Enabled = False + txtSName.Enabled = False + Call NameLoad + Else + MsgBox "A Project Name Must Be Entered", , "No Project Name" + txtSName.SetFocus + End If + cmdOrderR.Enabled = False + mnuOrders.Enabled = False + + If mboolSHOW Then + cmdLotSearch.Enabled = True + cmdProjNotes.Visible = True + If gbytSECURITY < 3 Then + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gstrLOGIN = "JDV" Then +' ElseIf gstrLOGIN = "AOB" Or gstrLOGIN = "CKW" Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 6 Then + cmdPlans.Enabled = True + mnuPlans.Enabled = True + cmdTakeR.Enabled = True + mnuTake.Enabled = True + cmdBilling.Visible = True + ElseIf gbytSECURITY = 7 Then + cmdBilling.Visible = True + End If + lstProject.SetFocus + Else + txtSName.SetFocus + End If +End Sub + +Private Sub ContainLoad() + Dim oRS As Recordset, oRSP As Recordset + Dim strSQL As String, strSELECT As String, strContain As String + Dim strSQLP As String, intYN As Integer, strADDRESS As String, strLine As String + Dim strProj_Desc As String, strProj_Cont As String, strProj_Code As String + + mboolSHOW = False + + lstContains.Visible = True + lstContains.Left = 60 + lstContains.Height = 4815 + lstContains.Top = 3600 + lstContains.Width = 11775 + lstContains.Clear + DoEvents + lstLots.Visible = False + lstProject.Visible = False + lblProjCode.Visible = False +' lblProjCode.Visible = True +' lblDesc.Visible = True + +' lstContains.Clear + + strContain = Trim$(txtSContain.Text) +' strSELECT = "Lot_ID,Proj_ID, Lot_No, Address FROM tblLOTINFO" +' strSELECT = "Lot_ID,Proj_ID, Lot_No, Address FROM tblLOTINFO" + + strSQL = "SELECT Lot_ID, Proj_ID, Lot_No, Address, JobCost FROM tblLOTINFO" +' strSQLP = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject " + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + + If Len(oRS!address) = 0 Then '1 + intYN = 0 + Else + strADDRESS = Field2Str(oRS!address) + intYN = InStr(1, UCase(Trim(strADDRESS)), UCase(Trim(txtSContain))) ', vbTextCompare) + End If + + If intYN > 0 Then + + strSQLP = "SELECT Proj_ID, Proj_Desc, Proj_Cont, Proj_Code FROM tblPROJECT WHERE Proj_ID = " & Field2Str2(oRS!PROJ_ID) + Set oRSP = New Recordset + oRSP.Open strSQLP, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSP.EOF Then + strProj_Desc = Field2Str(oRSP!Proj_Desc) + strProj_Cont = Field2Str(oRSP!Proj_Cont) + strProj_Code = Field2Str(oRSP!Proj_Code) + strLine = Field2Str2(oRS!Lot_ID) & vbTab & Left(strProj_Cont, 24) & vbTab & RTrim(strProj_Code) & vbTab & RTrim(strProj_Desc) ' & " -- " & oRS!Desc + strLine = strLine & vbTab & RTrim(Field2Str(oRS!lot_no)) & vbTab & RTrim(strADDRESS) & vbTab & Field2Str2(oRS!PROJ_ID) & vbTab & Field2Str(oRS!jobcost) + lstContains.AddItem strLine + oRSP.Close + End If + End If + ' strLINE = Field2Str2(oRS!lot_ID) & vbTab & RTrim(Field2Str(oRS!Proj_Cont)) & vbTab & RTrim(strProj_Desc) & vbTab & RTrim(strProj_Code) ' & " -- " & oRS!Desc + ' strLINE = strLINE & vbTab & RTrim(Field2Str(oRS!Lot_NO)) & vbTab & RTrim(strADDRESS) & vbTab & Field2Str2(oRS!Proj_ID) + ' lstContains.AddItem strLINE + ' lstContains.ItemData(lstContains.NewIndex) = oRS("Proj_id") + + oRS.MoveNext +' mboolSHOW = True + Loop + oRS.Close + If lstContains.ListCount = 0 Then + MsgBox "No Address Information Found" + Call cmdNewSearch_Click + Else + lstContains.ListIndex = 0 + End If +' End If '1 + +End Sub + +Private Sub CodeLoad() + Dim oRS As Recordset, intCNT As Integer, intCOUNT As Integer + Dim strSQL As String, strSELECT As String, strCODE As String + mboolSHOW = False + intCOUNT = 1 + lstProject.Visible = True + lstProject.Width = 4035 + lstLots.Visible = False + lblProjCode.Visible = True +' lblDesc.Visible = True + + strCODE = Trim$(txtSCode.Text) +' strSELECT = "proj_code LIKE '" & strCode & "*'" ' & """" +' strSELECT = "proj_code LIKE '" & strCode & "%'" ' & """" + +' strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject " +' strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject WHERE Proj_Code = '" & strCode & "%'" + strSQL = "SELECT Proj_id, Proj_desc, proj_code FROM tblProject WHERE Proj_Code LIKE '" & strCODE & "%'" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly +' oRS.Filter = strSELECT +' intCNT = oRS.RecordCount + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem RTrim(oRS("Proj_desc")) ' & " -- " & oRS!Desc + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + intCOUNT = intCOUNT + 1 + + oRS.MoveNext + mboolSHOW = True + Loop + oRS.Close + If lstProject.ListCount = 0 Then + MsgBox "No Project/Subdivisions Found" + Call cmdNewSearch_Click + Else + lstProject.ListIndex = 0 + End If +End Sub + +Private Sub FindProject() + Dim strSQL As String, strSELECT As String, strCODE As String + + strSQL = "SELECT proj_id, proj_code, proj_cont, jccode, proj_desc, bag100, pomax, inv_type, p_sw, synthetic FROM tblProject WHERE proj_id = " & gintPROJID +' strSQL = "SELECT proj_code, proj_cont, jccode, desc FROM tblProject WHERE proj_id = " & lstProject.ItemData(lstProject.ListIndex) + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lblProjCode.Caption = moRSProj!Proj_Code & " -- " & moRSProj!Proj_Cont +' lblDesc = Field2Str(moRSProj!Desc) + If Len(lblDesc) > 0 Then + lblDesc.Visible = True + Else + lblDesc.Visible = False + End If + lstProject.ToolTipText = Field2Str(moRSProj!PROJ_ID) + If moRSProj!bag100 Or moRSProj!P_SW Then +' If moRSProj!bag100 Then + gboolBAG = True + cmdTakeR.Caption = "Takeoff PreMix" + mnuTakeR.Checked = False + mnuTake5.Checked = True + cmdOrderR.Caption = "Orders PreMix" + ElseIf moRSProj!SYNTHETIC Then + gboolSYN = True + cmdTakeR.Caption = "Takeoff Synthetic" + mnuTakeR.Checked = False + mnuTake5.Checked = True + cmdOrderR.Caption = "Orders Synthetic" + Else + gboolBAG = False + cmdTakeR.Caption = "Takeoff" + mnuTakeR.Checked = True + mnuTake5.Checked = False + cmdOrderR.Caption = "Orders" + End If + gbytINV_TYPE = Field2Str2(moRSProj!inv_type) +End Sub + +Private Sub NameLoad() + Dim oRS As Recordset, intCNT As Integer + Dim strSQL As String, strSELECT As String, strCODE As String + mboolSHOW = False + + lstProject.Visible = True + lstProject.Width = 4035 + lstLots.Visible = False + lblProjCode.Visible = True +' lblDesc.Visible = True + + strCODE = Trim$(txtSName.Text) +' strSELECT = "proj_desc LIKE '" & strCode & "*'" ' & """" + strSELECT = "proj_desc LIKE '" & strCODE & "%'" ' & """" + + strSQL = "SELECT Proj_id, Proj_desc FROM tblProject WHERE proj_desc LIKE '" & strCODE & "%'" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' intCNT = oRS.RecordCount +' oRS.Filter = strSELECT + lstProject.Clear + + Do Until oRS.EOF +' intCNT = oRS.RecordCount + lstProject.AddItem RTrim(oRS("Proj_desc")) ' & " -- " & oRS!Desc + lstProject.ItemData(lstProject.NewIndex) = oRS("Proj_id") + + oRS.MoveNext + mboolSHOW = True + Loop + oRS.Close + If lstProject.ListCount = 0 Then + MsgBox "No Project/Subdivisions Found" + Call cmdNewSearch_Click + Else + lstProject.ListIndex = 0 + End If +End Sub + +Private Sub mnuProject_Click() + frmProject.Show +End Sub + +Private Sub mnuScaffold_Click() + frmScaffold.Show +End Sub + +Private Sub mnuSupplier_Click() + frmSupplier.Show +End Sub + +Private Sub mnuTake_Click() +' Call cmdTake_Click +End Sub + +Private Sub mnuTexture_Click() + frmTexture.Show +End Sub + +Private Sub mnuTOI_Click() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim lngTOID As Long, lngOPTID As Long, lngPROJID As Long +Dim strMOD_ELV As String, intCOUNT As Integer, lngCount As Long +Dim oRS As Recordset, oRSS As Recordset + On Error Resume Next + + strSQL = "SELECT * FROM tblPOption" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + lngCount = lngCount + 1 + strSql2 = "SELECT * FROM tblPlans WHERE est_id = " & Field2Long(oRS!est_id) + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + strMOD_ELV = Field2Str(oRSS!Mod_Elv) + lngPROJID = Field2Long(oRSS!PROJ_ID) + strSql2 = "SELECT * FROM tblTAKE WHERE proj_id = " & lngPROJID & " AND pln_elv = '" & strMOD_ELV & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + intCOUNT = oRSS.RecordCount + If intCOUNT <> 0 Then + lngTOID = Field2Long(oRSS!toid) + strSql2 = "SELECT * FROM tblOption WHERE toid = " & lngTOID & " and desc = '" & Field2Str(oRS!Desc) & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + ' If Not IsNull(oRSS!Create) Then + oRS!T_OptID = oRSS!OPTID + oRS.Update + ' End If + End If + End If + oRS.MoveNext + Loop + + MsgBox "Options Are Tied Together" + On Error GoTo 0 +End Sub + +Private Sub mnuTOI2_Click() +Dim strSQL As String + + strSQL = "UPDATE tblTake SET mtmu = (mtmu/100) where mtmu > 0" + goConn.Execute strSQL + strSQL = "UPDATE tblTake SET mu = (mu/100) where mu > 0" + goConn.Execute strSQL + MsgBox "Transfer Flag Setup is Complete" +End Sub + +Private Sub mnuUser_Click() + frmUser.Show +End Sub + +Private Sub mnuYard1Date_Click() + crMain.ReportFileName = App.Path & "\YardOrder.rpt" +' crMain.SelectionFormula = strSQL +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub mnuYardRange_Click() + crMain.ReportFileName = App.Path & "\YardOrderRange.rpt" +' crMain.SelectionFormula = strSQL +' crMain.Destination = crptToWindow + crMain.Destination = crptToPrinter + crMain.WindowState = crptMaximized + crMain.Action = 1 + +End Sub + +Private Sub txtSCode_Change() + cmdNewSearch.Enabled = True + +End Sub + +Private Sub txtSCode_LostFocus() + txtSCode.Text = UCase(txtSCode.Text) + If Len(txtSCode) > 0 Then + cmdFCode.Enabled = True + cmdFCode.SetFocus + End If +End Sub +Private Sub LotLoad() + Dim oRS As Recordset + Dim strSQL As String, strLine As String + + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + + strSQL = "SELECT lot_id, lot_no, address, model, owner from tbllotinfo WHERE Proj_ID = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstLots.Clear + + Do Until oRS.EOF + With lstLots + strLine = oRS!lot_no & vbTab & oRS!model & vbTab & oRS!address & " --- " & oRS!Owner + .AddItem Field2Str(strLine) + .ItemData(.NewIndex) = oRS("lot_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstLots.ListCount Then + lstLots.ListIndex = 0 + End If + +End Sub + +Private Sub txtSContain_GotFocus() + txtSContain.SelStart = 0 + txtSContain.SelLength = 100 +' If Len(txtSContain) > 0 Then +' txtSContain.SelText +' End If +End Sub + +Private Sub txtSContain_LostFocus() + txtSContain.Text = UCase(txtSContain.Text) + If Len(txtSContain) > 0 Then + cmdFContain.Enabled = True + cmdFContain.SetFocus + End If + +End Sub + +Private Sub txtSJCCode_Change() + cmdNewSearch.Enabled = True + +End Sub + +Private Sub txtSJCCode_GotFocus() + Call FieldSelect(txtSJCCode) +End Sub + +Private Sub txtSJCCode_LostFocus() + txtSJCCode = UCase(txtSJCCode) + If Len(txtSJCCode) > 0 Then + cmdFJCCode.Enabled = True + cmdFJCCode.SetFocus + End If +End Sub + +Private Sub txtSName_Change() + cmdNewSearch.Enabled = True + +End Sub + +'Private Sub txtSName_Change() +' cmdNewSearch.Enabled = True +'End Sub + +Private Sub txtSName_LostFocus() + txtSName.Text = UCase(txtSName.Text) + If Len(txtSName) > 0 Then + cmdFName.Enabled = True + cmdFName.SetFocus + End If +End Sub + +Private Sub SetupTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim strYN As String, strMSG As String, intCNT As Integer +Dim strYN2 As String, strMSG2 As String + + On Error GoTo Error_EH + + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready and not DELETE ORDER By Invoice_NO, DETNUM" '**** Need to make a report showing this information before processng +' strSQL = "SELECT * FROM tblARINVOICE WHERE ready ORDER By Invoice_NO, DETNUM" '**** Need to make a report showing this information before processng + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + intCNT = oRS.RecordCount + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Field2Str(oRS!Description) +' !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = Field2Str(oRS!po_num) +' !comment = "LOT " & oRS!lot_no & "-" & Left$(Field2Str(oRS!address), 20) + !taxcode = UCase(oRS!taxcode) + !CodeDesc = Field2Str(oRS!CodeDesc) + !DETNUM = oRS!DETNUM + !DETTOT = oRS!DETNUM + !State = Field2Str(oRS!State) + !zip = Field2Str(oRS!zip) + !City = Field2Str(oRS!City) + !UDF2 = "LOT " & oRS!lot_no & "-" & Left$(Trim$(Field2Str(oRS!address)), 38) +' !UDF2 = Trim$(Field2Str(oRS!projcode)) & "-" & Left$(Trim$(Field2Str(oRS!address)), 43) + .Update +' oRS!ready = False +' oRS!done = True +' oRS.Update + oRS.MoveNext + End With + Loop + + strMSG = "Do You Want To Print An Edit Report For This Transfer Batch? Y/N" + strYN = MsgBox(strMSG, vbYesNo, "Print Edit Report?") + + If strYN = vbYes Then + Call mnuAREdit2_Click + End If + + strMSG2 = "Click On YES To Continue CMS Transfer, NO To Exit And Make Corrections" + strYN2 = MsgBox(strMSG2, vbDefaultButton2 + vbYesNo) +' vbYesNo) + + If strYN2 = vbYes Then + Call MarkDONE +' Call SetTransNumber + Call CMSTransfer + ElseIf strYN2 = vbNo Then + Exit Sub + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MarkDONE() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim strYN As String, strMSG As String, intCNT As Integer +Dim strYN2 As String, strMSG2 As String + + + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready ORDER By Invoice_NO, DETNUM" '**** Need to make a report showing this information before processng + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + Do Until oRS.EOF + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + Loop + +End Sub + +Private Sub SetTransNumber() +Dim strSQL As String, strFIX As String, intMAX As Integer, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset +Dim strINVNO1 As String, strINVNOHold As String + + strSQL = "Select * FROM tblARTRANS ORDER By INVOICE_NO" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If oRS.EOF Then + MsgBox "No Invoices In The Transfer File - ReSelect", vbOKOnly, "No Invoices" + Exit Sub + End If + + Do Until oRS.EOF + strINVNO1 = Field2Str(oRS!invoice_no) + If strINVNO1 <> strINVNOHold Then + strSQLL = "SELECT * FROM tblARTRANS WHERE INVOICE_NO = '" & strINVNO1 & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + If Not oRSS.EOF Then + intMAX = oRSS.RecordCount + End If + strFIX = "Update tblARTRANS SET DETTOT = " & intMAX & " WHERE INVOICE_NO = '" & strINVNO1 & "'" + goConn.Execute strFIX +' Else + strINVNOHold = strINVNO1 + End If + oRS.MoveNext + Loop + +End Sub + +Private Sub SetupTransferTest() + Call SetTransNumber + +End Sub +Private Sub SetupTransferOLD() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + !taxcode = UCase(oRS!taxcode) + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + +'''' Call mnuAREdit_Click +'' crMain.Reset +'' crMain.ReportFileName = App.Path & "\AREdit.rpt" +' crMain.Formulas(1) = "Sand = " & intORDER +' crMain.ReplaceSelectionFormula (strSQL) +'' crMain.CopiesToPrinter = 1 +'' crMain.Destination = crptToWindow +' crMain.Destination = crptToPrinter +'' crMain.Action = 1 + +'''' Call FixBilling + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupMARTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICEM WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + !taxcode = oRS!taxcode + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + crMain.Reset + crMain.ReportFileName = App.Path & "\ARTransM.rpt" +' crMain.Formulas(1) = "Sand = " & intORDER +' crMain.ReplaceSelectionFormula (strSQL) + crMain.CopiesToPrinter = 1 + crMain.Destination = crptToWindow +' crMain.Destination = crptToPrinter + crMain.Action = 1 + + Call FixBillingM + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupMARTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupARTransfer() +Dim strSQL As String, strSql2 As String, strSql5 As String +Dim oRS As Recordset, oRSS As Recordset +Dim oRL As Recordset, oRP As Recordset, oRLL As Recordset +Dim strSQL3 As String, strSQL4 As String +Dim strDueDate As String +'************************************* +'******* Need to setup the sub routine to create the transfer file for CMS +'************************************* + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AR and CoCode = 0" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblSWARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblSWARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT lot_id, proj_id, jobcost, lot_no, address FROM tblLotInfo WHERE lot_id = " & Field2Long(oRS!Lot_ID) + Set oRL = New Recordset + oRL.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSQL4 = "SELECT proj_id, proj_desc FROM tblProject WHERE proj_id = " & oRL!PROJ_ID + Set oRP = New Recordset + oRP.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly +' strSql5 = "SELECT lot_id, Lot_NO FROM tblLotInfo WHERE lot_id = " & oRL!Lot_ID +' Set oRLL = New Recordset +' oRLL.Open strSql5, goConn, adOpenForwardOnly, adLockReadOnly + Else + MsgBox "No Lot Found", vbOKOnly, "No Lot" + Exit Sub + End If + .AddNew + !invoice_no = oRS!Vend_Inv +' !invoice_no = oRS!sup_inv +' !customer_no = oRS!customer_no + !customer_no = "VALLEY" + !invoice_date = oRS!inv_date + !job_number = oRL!jobcost +' !job_number = oRS!po_num + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + !inv_due_date = DateAdd("d", 33, oRS!inv_date) + !disc_due_date = DateAdd("d", 33, oRS!inv_date) + !non_tax_amt = oRS!orderamt + !retention_amt = 0 + If Field2Str(oRS!m_type) = "L" Then + !sales_code = "LATH" + !Description = "LATH MATERIALS" + ElseIf Field2Str(oRS!m_type) = "R" Then + !sales_code = "SPO" + !Description = "SPECIAL PURCHASE ORDER" + ElseIf Field2Str(oRS!m_type) = "S" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "B" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "T" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + End If + !price = oRS!orderamt + !amount = oRS!orderamt + !ready = True + !shipping = Left$(Field2Str(oRP!Proj_Desc), 15) + !comment = "Lot " & oRL!lot_no & "-" & Left$(Field2Str(oRL!address), 20) +' !DETNUM = oRS!DETNUM +' !DETTOT = oRS!DETNUM + !UDF2 = "Lot " & oRL!lot_no & "," & Left$(Trim$(Field2Str(oRL!address)), 38) +' !UDF2 = "Lot " & oRL!lot_no & ", " & Left$(Field2Str(oRL!address), 20) + !DETNUM = 0 + !DETTOT = 0 + .Update + oRS!ar = False + oRS!ar_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + Call CMSSWTransfer + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupARTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupARMTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset +Dim oRL As Recordset, oRP As Recordset +Dim strSQL3 As String, strSQL4 As String +Dim strDueDate As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AR and CoCode = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblSWARTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblSWARTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT lot_id, proj_id, jobcost, lot_no, address FROM tblLotInfo WHERE lot_id = " & Field2Long(oRS!Lot_ID) + Set oRL = New Recordset + oRL.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSQL4 = "SELECT proj_id, proj_desc FROM tblProject WHERE proj_id = " & oRL!PROJ_ID + Set oRP = New Recordset + oRP.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + Else + MsgBox "No Lot Found", vbOKOnly, "No Lot" + Exit Sub + End If + .AddNew + !invoice_no = oRS!Vend_Inv +' !invoice_no = oRS!sup_inv +' !customer_no = oRS!customer_no + !invoice_date = oRS!inv_date + !job_number = oRS!po_num + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + !inv_due_date = DateAdd("d", 30, oRS!inv_date) + !disc_due_date = DateAdd("d", 30, oRS!inv_date) + !non_tax_amt = oRS!orderamt + !retention_amt = 0 + If Field2Str(oRS!m_type) = "L" Then + !sales_code = "LATH" + !Description = "LATH MATERIALS" + ElseIf Field2Str(oRS!m_type) = "R" Then + !sales_code = "SPO" + !Description = "SPECIAL PURCHASE ORDER" + ElseIf Field2Str(oRS!m_type) = "S" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "B" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + ElseIf Field2Str(oRS!m_type) = "T" Then + !sales_code = "STUC" + !Description = "STUCCO MATERIAL" + End If + !price = oRS!orderamt + !amount = oRS!orderamt + !ready = True + !shipping = Left$(Field2Str(oRP!Proj_Desc), 15) + !comment = "Lot " & oRL!lot_no & "," & Left$(Field2Str(oRL!address), 20) + .Update + oRS!ar = False + oRS!ar_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupARMTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupAPTransferTEST() + Call CMSAPTransfer +End Sub +Private Sub SetupAPTransfer() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim oRS As Recordset, oRSS As Recordset, oRSP As Recordset +Dim intDay As Integer, intMonth As Integer, intYear As Integer +Dim strDUE As String, strJC As String, strPONM As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AP and CoCode = 0" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblAPTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblAPTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT * FROM tblSupplier WHERE supplier = '" & Field2Str(oRS!supplier) & "'" + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If oRSP.EOF Then + MsgBox "No Supplier Information Was Found - Correct and ReTransfer", vbOKOnly, "Invalid Supplier" + Exit Sub + End If + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + intDay = Day(oRS!inv_date) + intMonth = Month(oRS!inv_date) + intYear = Format(Year(oRS!inv_date), "0000") + Select Case intDay + Case 1 To 25 + If intMonth > 11 Then + intMonth = 1 + intYear = intYear + 1 + Else + intMonth = intMonth + 1 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + Case 26 To 31 + If intMonth > 10 Then + intMonth = (intMonth + 2) - 12 + intYear = intYear + 1 + Else + intMonth = intMonth + 2 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + End Select + .AddNew + !invoice_no = Field2Str2(oRS!Vend_Inv) +' !invoice_no = Field2Str2(oRS!sup_inv) + !Vendor_no = Left$(Field2Str(oRSP!Vendor_no), 7) + !invoice_date = Field2Str(oRS!inv_date) + !job_number = Field2Str(oRS!jobcost) + !inv_due_date = Field2Str2(strDUE) + !disc_due_date = DateAdd("d", 30, strDUE) + !non_tax_amt = Field2Str2(oRS!orderamt) + !net_invc_amt = Field2Str2(oRS!orderamt) + !INVOICE_AMT = Field2Str2(oRS!orderamt) + !DISCOUNT_AMT = Format(Field2Str2((oRS!orderamt * (oRSP!disc / 100))), "#,#.00") + !Terms_Code = Field2Str(oRSP!terms) +' !PO_NUMBER = Trim$((oRS!jobcost)) & Trim$((oRS!po_num)) + !PO_NUMBER = Trim$(Field2Str(oRS!jobcost)) & Trim$(Field2Str(oRS!po_num)) + !ready = True + .Update + oRS!ap = False + oRS!ap_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + + Call CMSAPTransfer + + MsgBox "VWP Accounts Payable is now ready for Transfer - Go to CMS to Import", vbOKOnly, "Goto CMS" + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupAPTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SetupMAPTransfer() +Dim strSQL As String, strSql2 As String, strSQL3 As String +Dim oRS As Recordset, oRSS As Recordset, oRSP As Recordset +Dim intDay As Integer, intMonth As Integer, intYear As Integer +Dim strDUE As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblOrders WHERE AP and CoCode = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblAPTRANSM" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblAPTRANSM" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + strSQL3 = "SELECT * FROM tblSupplier WHERE supplier = '" & Field2Str(oRS!supplier) & "'" + Set oRSP = New Recordset + oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly + If oRSP.EOF Then + MsgBox "No Supplier Information Was Found - Correct and ReTransfer", vbOKOnly, "Invalid Supplier" + Exit Sub + End If + If Not IsDate(oRS!inv_date) Then + MsgBox "An Invalid Date Was Encountered - Fix & ReTransfer", vbOKOnly, "Invalid Date" + Exit Sub + End If + intDay = Day(oRS!inv_date) + intMonth = Month(oRS!inv_date) + intYear = Format(Year(oRS!inv_date), "0000") + Select Case intDay + Case 1 To 25 + If intMonth > 11 Then + intMonth = 1 + intYear = intYear + 1 + Else + intMonth = intMonth + 1 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + Case 26 To 31 + If intMonth > 10 Then + intMonth = (intMonth + 2) - 12 + intYear = intYear + 1 + Else + intMonth = intMonth + 2 + End If + strDUE = CStr(intMonth) & "/15/" & CStr(intYear) + End Select + .AddNew + !invoice_no = Field2Str2(oRS!Vend_Inv) +' !invoice_no = Field2Str2(oRS!sup_inv) + !Vendor_no = Field2Str(oRSP!Vendor_no) + !invoice_date = Field2Str(oRS!inv_date) + !job_number = Field2Str(oRS!jobcost) + !inv_due_date = Field2Str2(strDUE) + !disc_due_date = DateAdd("d", 30, strDUE) + !non_tax_amt = Field2Str2(oRS!orderamt) + !net_invc_amt = Field2Str2(oRS!orderamt) + !INVOICE_AMT = Field2Str2(oRS!orderamt) + !DISCOUNT_AMT = Format(Field2Str2((oRS!orderamt * (oRSP!disc / 100))), "#,#.00") + !Terms_Code = Field2Str(oRSP!terms) + !ready = True + .Update + oRS!ap = False + oRS!ap_trans = True + oRS.Update + oRS.MoveNext + End With + Loop + MsgBox "Metro Accounts Payable is now ready for Transfer - Go to MAS90 to Import", vbOKOnly, "Goto MAS90" + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupMAPTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixOpenPR() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim lngPROJID As Long, strMODELV As String +Dim dblMatCost As Double + + strSELECT = "SELECT * FROM tblPlans" ' where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRS.RecordCount > 0 Then + Do Until oRS.EOF + With oRS + lngPROJID = oRS!PROJ_ID + strMODELV = Field2Str(oRS!Mod_Elv) + strSQL = "SELECT * FROM tblTake where proj_id = " & lngPROJID & " and Pln_Elv = '" & strMODELV & "' AND Not SuperSede" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!openpr = Field2Integer(oRSS!openpr) + oRS.Update + End If + End With + oRS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module FixOpenPR" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixOpenPR2() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim lngESTID As Long +Dim dblMatCost As Double + + + strSELECT = "SELECT * FROM tblLotInfo" ' where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + If oRS.RecordCount > 0 Then + Do Until oRS.EOF + If Not IsNull(oRS!est_id) Then + With oRS + lngESTID = oRS!est_id + strSQL = "SELECT * FROM tblPlans where EST_ID = " & lngESTID '& " and Pln_Elv = '" & strMODELV & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!openpr = Field2Integer(oRSS!openpr) + oRS.Update + End If + End With + End If + oRS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module FixOpenPR2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +'Remove cmdExport_Click if there are no problems with exporting to cms + +'Private Sub cmdExport_Click() +'Dim strSQL As String, oRS As Recordset, strSQLL As String, oRSS As Recordset +'Dim strFLAG As String, strSTOCKNO As String, strDESC As String +'Dim strONHAND As String, strCOUNT As String, strCost1 As String +'Dim strCost2 As String, strNumber1 As String, strNumber2 As String, strNumber3 As String +'Dim strINVDATE As String, strDueDate As String, strDISCDATE As String +'Dim strCHKDATE As String, strGLDATE As String, strFILLER As String +'Dim strLinType As String, strSTOCK As String, strFILLER1 As String +'Dim strEXPDate As String, strQTY As String, strCOST As String +'Dim strFILLER2 As String, lngPOID As Long, intYN As Integer, lngPOID2 As Long +'Dim strFile As String, strLINE1 As String, strLINE2 As String +'Dim strTDATE1, strTDATE2, strDept1, strDept2, strDept3 As String +'Dim dblRU1D1, dblOT1U1D1, dblVU1D1, dblHU1D1, dblATG1 As Double +'Dim dblRU2D1, dblOT1U2D1, dblVU2D1, dblHU2D1, dblATG2 As Double +'Dim dblRU1D2, dblOT1U1D2, dblVU1D2, dblHU1D2 As Double +'Dim dblRU2D2, dblOT1U2D2, dblVU2D2, dblHU2D2 As Double +'Dim dblRU1D3, dblOT1U1D3, dblVU1D3, dblHU1D3 As Double +'Dim dblRU2D3, dblOT1U2D3, dblVU2D3, dblHU2D3 As Double +'Dim strEMPNO As String +'Dim FSys As New FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +'Dim dblCHANGE As Double, lngDIF As Long, strMSG As String +'Dim lngCount As Long, lngSALES As Long, lngPO As Long +'Dim strMONTH As String, strDAY As String, strSEC As String +'Dim dteWK1, dteWK2 As Date +'Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String + + +' dteWK2 = DTPickerDateEnd +' dteWK1 = DTPickerDateEnd - 7 +' strTDATE1 = Format(dteWK2, "YYYYMMDD ") +' strTDATE2 = Format(dteWK2, "YYYYMMDD ") +'' dteWK1 = mdteENDDATE +'' dteWK2 = mdteENDDATE - 7 +'' strDAY = Format(Day(Date), "00") +'' strMONTH = Format(Month(Date), "00") + +' strSQLLL = "SELECT * FROM tblSummary WHERE PPID = " & mintPPID +' strSQLLL = "SELECT * FROM tblSummary WHERE not NoPrint AND PPID = " & mintPPID & " ORDER BY DEPT1, CMSEMP" +' Set oRSSS = New Recordset +' oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic +'' strSTORE = gstrCOMPANY & "DATA" + +' strEXT = "E:\CMSWIN\PREXT." & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "c:\CMSWIN\PREXT." & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + +' Set TStream = FSys.CreateTextFile(strEXT, True) + +' Do Until oRSSS.EOF +' strEMPNO = Field2Str(oRSSS!CMSEmp) +' dblRU1D1 = Field2Str2(oRSSS!D1W1) +' dblRU2D1 = Field2Str2(oRSSS!D1W2) +' dblRU1D2 = Field2Str2(oRSSS!D2W1) +' dblRU2D2 = Field2Str2(oRSSS!D2W2) +' dblRU1D3 = Field2Str2(oRSSS!D3W1) +' dblRU2D3 = Field2Str2(oRSSS!D3W2) +' If dblRU1D1 > 0 Or dblRU2D1 > 0 Then +' dblOT1U1D1 = Field2Str2(oRSSS!OTW1) +' dblOT1U2D1 = Field2Str2(oRSSS!OTW2) +' dblHU1D1 = Field2Str2(oRSSS!HW1) +' dblHU2D1 = Field2Str2(oRSSS!HW2) +' dblVU1D1 = Field2Str2(oRSSS!VW1) +' dblVU2D1 = Field2Str2(oRSSS!VW2) +' dblATG1 = Field2Str2(oRSSS!ATGW1) +' dblATG2 = Field2Str2(oRSSS!ATGW2) +' strDept1 = Field2Str(oRSSS!Dept1) +' strRate1 = Field2Str(oRSSS!Rate1) +' +'' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDEPT1 & vbTab & vbTab & Format(dblRU1D1, "00000000.0000") +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept1 & vbTab & mstrRate1 & vbTab & Format(dblRU1D1, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & Format(dblOT1U1D1, "00000000.0000") & vbTab & vbTab & Format(dblVU1D1, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & Format(dblHU1D1, "00000000.0000") & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & Format(dblATG1, "00000000.0000") & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +'' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDEPT1 & vbTab & vbTab & Format(dblRU2D1, "00000000.0000") +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept1 & vbTab & mstrRate1 & vbTab & Format(dblRU2D1, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & Format(dblOT1U2D1, "00000000.0000") & vbTab & vbTab & Format(dblVU2D1, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & Format(dblHU2D1, "00000000.0000") & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & Format(dblATG2, "00000000.0000") & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If + +' If dblRU1D2 > 0 Or dblRU2D2 > 0 Then +' strDept2 = Field2Str(oRSSS!Dept2) +' strRate2 = Field2Str(oRSSS!Rate2) + +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept2 & vbTab & strRate2 & vbTab & Format(dblRU1D2, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept2 & vbTab & strRate2 & vbTab & Format(dblRU2D2, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If + +' If dblRU1D3 > 0 Or dblRU2D3 > 0 Then +' strDept3 = Field2Str(oRSSS!Dept3) +' strRate3 = Field2Str(oRSSS!Rate3) + +' strLINE1 = strEMPNO & vbTab & strTDATE1 & vbTab & strDept3 & vbTab & strRate3 & vbTab & Format(dblRU1D3, "00000000.0000") +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE1 = strLINE1 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE1) + +' strLINE2 = strEMPNO & vbTab & strTDATE2 & vbTab & strDept3 & vbTab & strRate3 & vbTab & Format(dblRU2D3, "00000000.0000") +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strLINE2 = strLINE2 & vbTab & vbTab & vbTab & vbTab & vbTab '& vbCrLf + +' TStream.WriteLine (strLINE2) + +' End If +' oRSSS!lock = vbChecked +' oRSSS.Update +' oRSSS.MoveNext +' Loop +' strMSG = "Export Complete - Go To CMS Payroll and IMPORT DAILY using an External File" ', vbInformation + vbOKOnly, "Export Complete") +' strMSG = strMSG & vbCrLf & "File Name: " & strEXT +' MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + +' Close #1 + +'End Sub + +Private Sub CMSTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strPONUM, strDept, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long +Dim strMONTH As String, strDAY As String, strSEC As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strHR As String +Dim strCODEDESC As String, strSHIPINFO As String, bytQTY As Byte +Dim strCITY, strZIP, strSTATE As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + + If strHR > 12 Then + strHR = Field2Str2(strHR) - 12 + strHR = Format(strHR, "00") + End If + + strFile = "OE" & strMONTH & strDAY & strHR & strMIN + + strSQLLL = "SELECT * FROM tblARTrans ORDER BY INVOICE_NO, DETNUM" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + strLastInvNo = "" + + Do Until oRSSS.EOF + strINVNO = oRSSS!invoice_no + If strLastInvNo = strINVNO Then + GoTo Detail + End If + + strHeadID = "H" + strCUSTNo = oRSSS!customer_no + strSHIPADD = oRSSS!shipping + strCHG = "3" + strTType = "0" + strLastInvNo = strINVNO + strPONUM = Field2Str(oRSSS!comment) +' strPONUM = "" + strDept = "Dept01" + strTaxCode = oRSSS!taxcode + strINVDATE = oRSSS!invoice_date + strShipDate = oRSSS!invoice_date + strCITY = Field2Str(oRSSS!City) + strSTATE = Field2Str(oRSSS!State) + strZIP = Field2Str(oRSSS!zip) + strUDF1 = oRSSS!job_number + strUDF2 = oRSSS!UDF2 + strUDF2 = Left(strUDF2, 34) + strCODEDESC = Field2Str(oRSSS!CodeDesc) + strSHIPINFO = Left(strCODEDESC, 34) + '*****need to remove strPONUM from position after the strINVNO field +' strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & strUDF2 & vbTab & vbTab & vbTab & vbTab & vbTab + +' strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strHEADER = strHEADER & strCHG & vbTab & strTType & vbTab & strINVNO & vbTab & vbTab & vbTab & strDept & vbTab +' strHEADER = strHEADER & vbTab & strTaxCode & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab +' strHEADER = strHEADER & vbTab & strINVDATE & vbTab & strINVDATE & vbTab & strShipDate & vbTab & strUDF1 & vbTab & strUDF2 + + strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strUDF2 & vbTab & vbTab & strCITY & vbTab & strSTATE & vbTab & strZIP & vbTab & vbTab + strHEADER = strHEADER & strCHG & vbTab & strTType & vbTab & strINVNO & vbTab & strPONUM & vbTab & vbTab & strDept & vbTab + strHEADER = strHEADER & vbTab & strTaxCode & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & vbTab & strINVDATE & vbTab & strINVDATE & vbTab & strShipDate & vbTab & strUDF1 & vbTab & strUDF2 + + TStream.WriteLine (strHEADER) + +Detail: + strDetID = "D" + strSTOCK = oRSSS!sales_code + strDESC = oRSSS!Description + strTXABLE = "1" + If strSTOCK = "WINS" Then + strLType = "11" + strOQty = "-1" + strSQty = "-1" + strPRICE = (oRSSS!price * -1) + Else + strLType = "1" + strOQty = "1" + strSQty = "1" + strPRICE = oRSSS!price + End If +' strOQty = oRSSS!Quantity +' strSQty = oRSSS!Quantity +' strPRICE = oRSSS!price + + strDETAIL = strDetID & vbTab & strLType & vbTab & strSTOCK & vbTab & vbTab & strDESC ' & vbTab & Format(dblRU2D1, "00000000.0000") + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & strTaxCode & vbTab & vbTab & strTXABLE + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & vbTab & strOQty & vbTab & strSQty & vbTab & vbTab & strPRICE 'vbTab & vbTab & vbTab & vbTab + + TStream.WriteLine (strDETAIL) + + oRSSS.Update + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Sales Module then " + strMSG = strMSG & vbCrLf & "Order Entry - GENERATE ORDERS Using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + +End Sub + +Private Sub CMSAPTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strPONUM, strDept, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String, strINV_DUE_Date As String, strDISC_Date As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long, strHR As String +Dim strMONTH As String, strDAY As String, strSEC As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strDISC_PCT As String, strDISCYN As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + strFile = "APEXT" & strMONTH & strDAY & strHR & strMIN + strSQLLL = "SELECT * FROM tblAPTrans ORDER BY INVOICE_NO" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + strLastInvNo = "" + + Do Until oRSSS.EOF + strINVNO = oRSSS!invoice_no + + strHeadID = "H" + strCUSTNo = oRSSS!Vendor_no + If Field2Str(oRSSS!Terms_Code) = "04" Then + strDISC_PCT = Field2Str2(oRSSS!DISCOUNT_AMT) +' strDISC_PCT = "2" + strDISCYN = "0" + Else + strDISC_PCT = "0" + strDISCYN = "0" + End If + strTType = "1" + strPONUM = oRSSS!PO_NUMBER + strINVDATE = oRSSS!invoice_date + strShipDate = oRSSS!invoice_date + strINV_DUE_Date = oRSSS!inv_due_date + strDISC_Date = oRSSS!disc_due_date + strUDF1 = oRSSS!job_number + + strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strINVNO & vbTab & vbTab & vbTab & strPONUM & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & "0" & vbTab & "0" & vbTab & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINVDATE & vbTab & strDISCYN & vbTab +' strHEADER = strHEADER & "0" & vbTab & "0" & vbTab & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + strHEADER = strHEADER & strDISC_PCT & vbTab & "7" & vbTab & "10150" & vbTab & "0" ' & vbTab & vbTab & vbTab & vbTab & vbTab + + TStream.WriteLine (strHEADER) + +'Detail: + strDetID = "D" + strLType = "1" + strTXABLE = "1" + strPRICE = oRSSS!INVOICE_AMT + + strDETAIL = strDetID & vbTab & strLType & vbTab & "MATERIALS" & vbTab & "50050" & vbTab & vbTab & strDISCYN & vbTab & strDISC_PCT + strDETAIL = strDETAIL & vbTab & vbTab & strUDF1 & vbTab & strINVDATE & vbTab & "1" & vbTab & strPRICE ' & vbTab & vbTab & strTXABLE + + TStream.WriteLine (strDETAIL) + + oRSSS.Update + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Accounts Payable - Enter Bills and " + strMSG = strMSG & vbCrLf & "GENERATE BILLS using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + +End Sub + +Private Sub CMSSWTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strPONUM, strDept, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long +Dim strMONTH As String, strDAY As String, strSEC As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strHR As String +Dim strCODEDESC As String, strSHIPINFO As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + + If strHR > 12 Then + strHR = Field2Str2(strHR) - 12 + strHR = Format(strHR, "00") + End If + + strFile = "OE" & strMONTH & strDAY & strHR & strMIN + + strSQLLL = "SELECT * FROM tblSWARTrans ORDER BY INVOICE_NO" ', DETNUM" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".SWI018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "G:\CMSTrans\" & strFile & ".SWI018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + strLastInvNo = "" + + Do Until oRSSS.EOF + strINVNO = oRSSS!invoice_no +' If strLastInvNo = strINVNO Then +' GoTo Detail +' End If + + strHeadID = "H" + strCUSTNo = oRSSS!customer_no + strSHIPADD = oRSSS!shipping + strCHG = "3" + strTType = "0" + strLastInvNo = strINVNO + strPONUM = Field2Str(oRSSS!comment) +' strPONUM = "" + strDept = "Dept01" + strTaxCode = "NT" +' strTaxCode = oRSSS!taxcode + strINVDATE = oRSSS!invoice_date + strShipDate = oRSSS!invoice_date + strUDF1 = oRSSS!job_number + strUDF2 = oRSSS!UDF2 + strCODEDESC = Field2Str(oRSSS!CodeDesc) + strSHIPINFO = Left(strCODEDESC, 34) + '*****need to remove strPONUM from position after the strINVNO field +' strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & strUDF2 & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHeadID & vbTab & strCUSTNo & vbTab & strSHIPINFO & vbTab & strSHIPINFO & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & strCHG & vbTab & strTType & vbTab & strINVNO & vbTab & vbTab & vbTab & strDept & vbTab + strHEADER = strHEADER & vbTab & strTaxCode & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab + strHEADER = strHEADER & vbTab & strINVDATE & vbTab & strINVDATE & vbTab & strShipDate & vbTab & strUDF1 & vbTab & strUDF2 + + TStream.WriteLine (strHEADER) + +Detail: + strDetID = "D" + strLType = "1" + strSTOCK = oRSSS!sales_code + strDESC = oRSSS!Description + strTXABLE = "1" + strOQty = "1" + strSQty = "1" +' strOQty = oRSSS!Quantity +' strSQty = oRSSS!Quantity + strPRICE = oRSSS!price + + strDETAIL = strDetID & vbTab & strLType & vbTab & strSTOCK & vbTab & vbTab & strDESC ' & vbTab & Format(dblRU2D1, "00000000.0000") + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & strTaxCode & vbTab & vbTab & strTXABLE + strDETAIL = strDETAIL & vbTab & vbTab & vbTab & vbTab & strOQty & vbTab & strSQty & vbTab & vbTab & strPRICE 'vbTab & vbTab & vbTab & vbTab + + TStream.WriteLine (strDETAIL) + + oRSSS.Update + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Sales Module then " + strMSG = strMSG & vbCrLf & "Order Entry - GENERATE ORDERS Using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frx new file mode 100644 index 0000000..16833e3 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmMain.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrderDates.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrderDates.frm new file mode 100644 index 0000000..aa8043e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrderDates.frm @@ -0,0 +1,1415 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmOrderDates + Caption = "Lot Date Information" + ClientHeight = 7335 + ClientLeft = 60 + ClientTop = 405 + ClientWidth = 5415 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7335 + ScaleWidth = 5415 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtStoneBill + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 34 + Top = 4485 + Width = 1335 + End + Begin VB.CommandButton cmdRePrint + Caption = "RePrint" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3780 + TabIndex = 27 + Top = 2235 + Visible = 0 'False + Width = 1395 + End + Begin VB.Frame fraEdit + Height = 4725 + Left = 3060 + TabIndex = 17 + Top = 210 + Width = 435 + Begin VB.OptionButton optSTB + Height = 285 + Left = 120 + TabIndex = 38 + Top = 4305 + Width = 195 + End + Begin VB.OptionButton optSB + Height = 195 + Left = 120 + TabIndex = 24 + Top = 3630 + Width = 195 + End + Begin VB.OptionButton optLB + Height = 195 + Left = 120 + TabIndex = 23 + Top = 2805 + Width = 195 + End + Begin VB.OptionButton optTexture + Height = 195 + Left = 120 + TabIndex = 22 + Top = 2265 + Width = 195 + End + Begin VB.OptionButton optScratch + Height = 195 + Left = 120 + TabIndex = 21 + Top = 1740 + Width = 195 + End + Begin VB.OptionButton optBrown + Height = 195 + Left = 120 + TabIndex = 20 + Top = 1245 + Width = 195 + End + Begin VB.OptionButton optSand + Height = 195 + Left = 120 + TabIndex = 19 + Top = 735 + Width = 195 + End + Begin VB.OptionButton optLO + Height = 195 + Left = 105 + TabIndex = 18 + Top = 210 + Value = -1 'True + Width = 195 + End + End + Begin VB.TextBox txtSandDate + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 2 + Top = 840 + Width = 1335 + End + Begin VB.CommandButton cmdEdit + Caption = "E&dit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3780 + TabIndex = 9 + Top = 1275 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3780 + TabIndex = 8 + Top = 3195 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 3780 + TabIndex = 16 + TabStop = 0 'False + Top = 315 + Width = 1395 + End + Begin VB.TextBox txtStuccoBill + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 7 + Top = 3735 + Width = 1335 + End + Begin VB.TextBox txtLathBill + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 6 + Top = 2955 + Width = 1335 + End + Begin VB.TextBox txtTextureDate + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 5 + Top = 2430 + Width = 1335 + End + Begin VB.TextBox txtScratchDate + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 4 + Top = 1875 + Width = 1335 + End + Begin VB.TextBox txtBrownDate + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 3 + Top = 1380 + Width = 1335 + End + Begin VB.TextBox txtLathOrder + Enabled = 0 'False + Height = 315 + Left = 1680 + MaxLength = 10 + TabIndex = 1 + Top = 315 + Width = 1335 + End + Begin Crystal.CrystalReport crOrder + Left = 60 + Top = 840 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.Label lblStoneBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Billing Date:" + Height = 195 + Left = 210 + TabIndex = 37 + Top = 4560 + Width = 1305 + End + Begin VB.Label lblStoneInv + Height = 315 + Left = 1695 + TabIndex = 36 + Top = 4815 + Width = 1335 + End + Begin VB.Label lblStonePO + Height = 450 + Left = 75 + TabIndex = 35 + Top = 4830 + Visible = 0 'False + Width = 1455 + End + Begin VB.Label lblLathInv + Height = 315 + Left = 1710 + TabIndex = 33 + Top = 3353 + Width = 1335 + End + Begin VB.Label lblLathPO + Height = 450 + Left = 45 + TabIndex = 32 + Top = 3285 + Visible = 0 'False + Width = 1455 + End + Begin VB.Label lblUpdate + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Updating Billing Dates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 405 + Left = 465 + TabIndex = 31 + Top = 6570 + Visible = 0 'False + Width = 4380 + End + Begin VB.Label lblStartDate + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 285 + TabIndex = 30 + Top = 0 + Width = 4875 + End + Begin VB.Label lblStuccoPO + Height = 450 + Left = 75 + TabIndex = 29 + Top = 4080 + Visible = 0 'False + Width = 1455 + End + Begin VB.Label lblStuccoInv + Height = 315 + Left = 1695 + TabIndex = 28 + Top = 4065 + Width = 1335 + End + Begin VB.Label txtTTLYds + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1680 + TabIndex = 26 + Top = 5505 + Width = 1335 + End + Begin VB.Label lblTtlYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 660 + TabIndex = 25 + Top = 5565 + Width = 855 + End + Begin VB.Label lblStuccoBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Billing Date:" + Height = 195 + Left = 120 + TabIndex = 15 + Top = 3795 + Width = 1395 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Billing Date:" + Height = 195 + Left = 315 + TabIndex = 14 + Top = 3030 + Width = 1200 + End + Begin VB.Label lblTextureDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture Date:" + Height = 195 + Left = 540 + TabIndex = 13 + Top = 2490 + Width = 975 + End + Begin VB.Label lblScratchDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scratch Date:" + Height = 195 + Left = 525 + TabIndex = 12 + Top = 1965 + Width = 990 + End + Begin VB.Label lblBrownDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown Date:" + Height = 195 + Left = 630 + TabIndex = 11 + Top = 1440 + Width = 885 + End + Begin VB.Label lblSandDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand Date:" + Height = 195 + Left = 705 + TabIndex = 10 + Top = 900 + Width = 810 + End + Begin VB.Label lblLathDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Date:" + Height = 195 + Left = 765 + TabIndex = 0 + Top = 375 + Width = 750 + End +End +Attribute VB_Name = "frmOrderDates" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset, mstrTexture As String, mstrBrown As String, mstrSand As String, mstrLath As String +Dim mboolSHOW As Boolean, mstrScratch As String +Dim strCHECK As String + +Private Sub cmdEdit_Click() + + If gbytSECURITY < 3 Then + If optLO Then + txtLathOrder.Enabled = True + txtLathOrder.SetFocus + cmdSave.Visible = True + ElseIf optSand Then + txtSandDate.Enabled = True + txtSandDate.SetFocus + cmdSave.Visible = True + ElseIf optBrown Then + txtBrownDate.Enabled = True + txtBrownDate.SetFocus + cmdSave.Visible = True + ElseIf optScratch Then + txtScratchDate.Enabled = True + txtScratchDate.SetFocus + cmdSave.Visible = True + ElseIf optTexture Then + txtTextureDate.Enabled = True + txtTextureDate.SetFocus + cmdSave.Visible = True + ElseIf optLB Then + txtLathBill.Enabled = True + txtLathBill.SetFocus + cmdSave.Visible = True + ElseIf optSB Then + txtStuccoBill.Enabled = True + txtStuccoBill.SetFocus + cmdSave.Visible = True + End If + End If + If gbytSECURITY = 6 Then + If optLO Then + txtLathOrder.Enabled = True + txtLathOrder.SetFocus + cmdSave.Visible = True + ElseIf optSand Then + txtSandDate.Enabled = True + txtSandDate.SetFocus + cmdSave.Visible = True + ElseIf optBrown Then + txtBrownDate.Enabled = True + txtBrownDate.SetFocus + cmdSave.Visible = True + ElseIf optScratch Then + txtScratchDate.Enabled = True + txtScratchDate.SetFocus + cmdSave.Visible = True + ElseIf optTexture Then + txtTextureDate.Enabled = True + txtTextureDate.SetFocus + cmdSave.Visible = True + ElseIf optLB Then + txtLathBill.Enabled = True + txtLathBill.SetFocus + cmdSave.Visible = True + ElseIf optSB Then + txtStuccoBill.Enabled = True + txtStuccoBill.SetFocus + cmdSave.Visible = True + End If + End If + If gbytSECURITY = 7 Then + If optLB Then + txtLathBill.Enabled = True + txtLathBill.SetFocus + cmdSave.Visible = True + ElseIf optSB Then + txtStuccoBill.Enabled = True + txtStuccoBill.SetFocus + cmdSave.Visible = True + End If + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdRePrint_Click() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +'***** Need to make information for LOTINFO5 get updated when updating print dates for brown and sand and texture + + If optSand Then + If txtBrownDate = "" Then + strSQL = "SELECT * FROM tblOrders WHERE percentage = 100 and m_type = 'A' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS!notes = " Order Not Printed & Reset On " & Now() & " by " & gstrLOGIN + oRS.Update + oRS.MoveNext + Loop + moRS!a_flg = vbFalse + moRS!Border = Null + moRS.Update + txtSandDate = "" + Else + MsgBox "Brown Date Must Be ReSet First", vbOKOnly, "Reset Brown" + Exit Sub + End If + ElseIf optBrown Then + If txtScratchDate = "" And txtTextureDate = "" Then + strSQL = "SELECT * FROM tblOrders WHERE percentage = 100 and m_type = 'B' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS!notes = " Order Not Printed & Reset On " & Now() & " by " & gstrLOGIN + oRS.Update + oRS.MoveNext + Loop + moRS!b_flg = vbFalse + moRS!forder = Null + moRS!BrownP = vbFalse + moRS!BrownD = vbFalse + moRS.Update + txtBrownDate = "" + Else + MsgBox "Scratch/Texture Date Must Be ReSet First", vbOKOnly, "Reset Dates" + Exit Sub + End If + ElseIf optScratch Then + If txtTextureDate = "" Then + strSQL = "SELECT * FROM tblOrders WHERE percentage = 100 and m_type = 'S' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS!notes = " Order Not Printed & Reset On " & Now() & " by " & gstrLOGIN + oRS.Update + oRS.MoveNext + Loop + moRS!c_flg = vbFalse + moRS!ScratchP = vbFalse + moRS!ScratchD = vbFalse + moRS!TORDER = Null + moRS.Update + txtScratchDate = "" + Else + MsgBox "Texture Date Must Be ReSet First", vbOKOnly, "Reset Dates" + Exit Sub + End If + ElseIf optLB Then + Call RePrintLathInv + ElseIf optSB Then + Call RePrintStuccoInv + ElseIf optSTB Then + Call RePrintStoneInv + ElseIf optTexture Then + strSQL = "SELECT * FROM tblOrders WHERE percentage = 100 and m_type = 'T' and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!m_type = "H" + oRS!d_flag = "X" + oRS!ar_trans = vbChecked + oRS!ap_trans = vbChecked + oRS!notes = " Order Not Printed & Reset On " & Now() & " by " & gstrLOGIN + oRS.Update + oRS.MoveNext + Loop + moRS!t_flg = vbFalse + moRS!SORDER = Null + moRS!TexP = vbFalse + moRS!TexD = vbFalse + moRS.Update + txtTextureDate = "" + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'S' and lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'V' and lot_id = " & gintLOTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'C' and lot_id = " & gintLOTID + goConn.Execute strSQL + End If + + txtLathOrder.Enabled = False + txtSandDate.Enabled = False + txtBrownDate.Enabled = False + txtScratchDate.Enabled = False + txtTextureDate.Enabled = False + txtLathBill.Enabled = False + txtStuccoBill.Enabled = False + cmdSave.Visible = False + cmdRePrint.Visible = False + Call FieldsSave +End Sub + +Private Sub cmdSave_Click() + txtLathOrder.Enabled = False + txtSandDate.Enabled = False + txtBrownDate.Enabled = False + txtScratchDate.Enabled = False + txtTextureDate.Enabled = False + txtLathBill.Enabled = False + txtStuccoBill.Enabled = False + cmdSave.Visible = False + Call FieldsSave +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + If gbytSECURITY < 3 Then + optLO.Enabled = True + optBrown.Enabled = True + optSand.Enabled = True + optScratch.Enabled = True + optTexture.Enabled = True + optLB.Enabled = True + optSB.Enabled = True + fraEdit.Visible = True + cmdEdit.Visible = True + ElseIf gbytSECURITY = 6 Then + optLO.Enabled = True + optBrown.Enabled = True + optSand.Enabled = True + optScratch.Enabled = True + optTexture.Enabled = True + fraEdit.Visible = True + cmdEdit.Visible = True + ElseIf gbytSECURITY = 7 Then + optLB.Enabled = True + optSB.Enabled = True + fraEdit.Visible = True + cmdEdit.Visible = True + End If + + If FormFind() Then + Call FormShow + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form OrderDates - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form OrderDates - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FixDates() +Dim oRS As Recordset, oRSS As Recordset, strSQL As String, strSQLL As String +Dim lngLOTID As Long, strTYPE As String +Dim strOLATH As String, strOSTUCCO As String, strBLATH As String, strBSTUCCO As String + + On Error GoTo Error_EH + + lblUpdate.Visible = True + DoEvents + +' strSQL = "SELECT Lot_ID, BILLDT_L, BILLDT_S, LORDER, FORDER FROM tblLotInfo WHERE LORDER > " & date(2018,01,01) & " AND LORDER < " & date(2030,12,29) + strSQL = "SELECT Lot_ID, BILLDT_L, BILLDT_S, LORDER, FORDER FROM tblLotInfo WHERE LORDER > #1/1/2017# AND LORDER < #12/29/2030#" +' strSQL = "SELECT * FROM tblLotInfo WHERE LORDER > #1/1/2018# AND LORDER < #12/29/2030#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRS.EOF + lngLOTID = Field2Long(oRS!Lot_ID) + strBLATH = Field2Str(oRS!BILLDT_L) + strBSTUCCO = Field2Str(oRS!BILLDT_S) + strOLATH = Field2Str(oRS!lorder) + strOSTUCCO = Field2Str(oRS!forder) +' If lngLOTID = 41553 Then + If strBLATH = "" Then + strSQLL = "SELECT * FROM ARN_InvHistoryHeader WHERE LOT_ID = " & lngLOTID + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRSS.EOF + strTYPE = Right(Field2Str(oRSS!InvoiceNumber), 1) + If strTYPE = "L" Then + oRS!BILLDT_L = oRSS!InvoiceDate + oRS.Update +' End + End If + oRSS.MoveNext + Loop + End If + If strBSTUCCO = "" Then + strSQLL = "SELECT * FROM ARN_InvHistoryHeader WHERE LOT_ID = " & lngLOTID + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + Do Until oRSS.EOF + strTYPE = Right(Field2Str(oRSS!InvoiceNumber), 1) + If strTYPE = "S" Then + oRS!BILLDT_S = oRSS!InvoiceDate + oRS.Update +' End + End If + oRSS.MoveNext + Loop + End If +' End If + oRS.MoveNext + Loop + + lblUpdate.Visible = False + + Exit Sub +Error_EH: + gstrMODULE = "Form OrderDates - Module FixDates" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() +Dim strSQL As String, oRS As Recordset, strLathINV As String, strSuccoINV As String + + On Error GoTo Error_EH + + mboolSHOW = True + + lblStartDate = "STARTDATE -- " & Field2Str(moRS!startdate) + With moRS + txtLathOrder = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) + txtSandDate = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) + txtScratchDate = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) + txtBrownDate = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) + txtTextureDate = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) + txtLathBill = IIf(Field2Str(!BILLDT_L) = "12:00:00 AM", "", Field2Str(!BILLDT_L)) + txtStuccoBill = IIf(Field2Str(!BILLDT_S) = "12:00:00 AM", "", Field2Str(!BILLDT_S)) + txtStoneBill = IIf(Field2Str(!BILLDT_S) = "12:00:00 AM", "", Field2Str(!BILLDT_S)) + txtTTLYds = Field2Str(!sq_yd) + End With + + strSQL = "SELECT Lot_id, Invoice_NO, Inv_Type, Header, PO_NUM FROM tblARINVOICE WHERE INV_TYPE = 'L' AND LOT_ID = " & Field2Str2(moRS!Lot_ID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + lblLathInv = Field2Str(oRS!invoice_no) + lblLathPO = Field2Str(oRS!po_num) + End If + oRS.Close + + strSQL = "SELECT Lot_id, Invoice_NO, Inv_Type, Header, PO_NUM FROM tblARINVOICE WHERE HEADER AND INV_TYPE = 'S' AND LOT_ID = " & Field2Str2(moRS!Lot_ID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + lblStuccoInv = Field2Str(oRS!invoice_no) + lblStuccoPO = Field2Str(oRS!po_num) + End If + + strSQL = "SELECT Lot_id, Invoice_NO, Inv_Type, Header, PO_NUM FROM tblARINVOICE WHERE HEADER AND INV_TYPE = 'V' AND LOT_ID = " & Field2Str2(moRS!Lot_ID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + lblStoneInv = Field2Str(oRS!invoice_no) + lblStonePO = Field2Str(oRS!po_num) + End If + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form OrderDates - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optBrown_Click() + cmdRePrint.Visible = True +End Sub + +Private Sub optLB_Click() + If gbytSECURITY < 3 Then +' If gbytSECURITY < 3 Or gstrLOGIN = "JDV" Then + If Len(lblLathInv) > 2 Then + cmdRePrint.Visible = True + End If + End If +End Sub + +Private Sub optSand_Click() + cmdRePrint.Visible = True +End Sub + +Private Sub optSB_Click() + If gbytSECURITY < 3 Then +' If gbytSECURITY < 3 Or gstrLOGIN = "JDV" Then + If Len(lblStuccoInv) > 2 Then + cmdRePrint.Visible = True + End If + End If +End Sub + +Private Sub optSTB_Click() + If gbytSECURITY < 3 Then +' If gbytSECURITY < 3 Or gstrLOGIN = "JDV" Then + If Len(lblStoneInv) > 2 Then + cmdRePrint.Visible = True + End If + End If +End Sub + +Private Sub optScratch_Click() + cmdRePrint.Visible = True +End Sub + +Private Sub optTexture_Click() + cmdRePrint.Visible = True +End Sub + +Private Sub txtBrownDate_GotFocus() + Call FieldSelect(txtBrownDate) + mstrBrown = txtBrownDate +End Sub + +Private Sub txtBrownDate_LostFocus() +Dim lngPOS As Long + +' If Len(txtBrownDate) < 3 Then +' MsgBox "You Must Enter A Valid Date. It Cannot Be Blank", vbOKOnly, "InValid Date" +' txtBrownDate = mstrBrown +' txtBrownDate.SetFocus +' Exit Sub +' End If + + If IsDate(txtBrownDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtBrownDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBrownDate) > 0 Then + txtBrownDate = Format(txtBrownDate, "00/00/####") + If Not IsDate(txtBrownDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBrownDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBrownDate.SetFocus + End If +End Sub + +Private Sub txtBrownDate_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtBrownDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtBrownDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBrownDate) > 0 Then + txtBrownDate = Format(txtBrownDate, "00/00/####") + If Not IsDate(txtBrownDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBrownDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBrownDate.SetFocus + End If + +End Sub + +Private Sub txtLathBill_GotFocus() + Call FieldSelect(txtLathBill) +End Sub + +Private Sub txtLathBill_LostFocus() +Dim lngPOS As Long + + If IsDate(txtLathBill) Then + Exit Sub + End If + lngPOS = InStr(1, txtLathBill, "/", 1) + If lngPOS = 0 Then + If Len(txtLathBill) > 0 Then + txtLathBill = Format(txtLathBill, "00/00/####") + If Not IsDate(txtLathBill) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtLathBill.SetFocus + Exit Sub + Else + txtLathBill.Enabled = False + ' cmdLathBilling.Enabled = False + End If + moRS!BILLDT_L = Str2Field(txtLathBill) + moRS.Update + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtLathBill.SetFocus + End If + +End Sub + +Private Sub txtLathBill_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtLathBill) Then + Exit Sub + End If + lngPOS = InStr(1, txtLathBill, "/", 1) + If lngPOS = 0 Then + If Len(txtLathBill) > 0 Then + txtLathBill = Format(txtLathBill, "00/00/####") + If Not IsDate(txtLathBill) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtLathBill.SetFocus + Exit Sub + Else + txtLathBill.Enabled = False + ' cmdLathBilling.Enabled = False + End If + moRS!BILLDT_L = Str2Field(txtLathBill) + moRS.Update + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtLathBill.SetFocus + End If + +End Sub + +Private Sub txtLathOrder_GotFocus() + Call FieldSelect(txtLathOrder) +End Sub + +Private Sub txtLathOrder_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtLathOrder) Then + Exit Sub + End If + lngPOS = InStr(1, txtLathOrder, "/", 1) + If lngPOS = 0 Then + If Len(txtLathOrder) > 0 Then + txtLathOrder = Format(txtLathOrder, "00/00/####") + If Not IsDate(txtLathOrder) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtLathOrder.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtLathOrder.SetFocus + End If +End Sub + +Private Sub txtSandDate_GotFocus() + Call FieldSelect(txtSandDate) +' mstrSand = txtSandDate +End Sub + +Private Sub txtSandDate_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtSandDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtSandDate, "/", 1) + If lngPOS = 0 Then + If Len(txtSandDate) > 0 Then + txtSandDate = Format(txtSandDate, "00/00/####") + If Not IsDate(txtSandDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtSandDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtSandDate.SetFocus + End If +End Sub + +Private Sub txtScratchDate_GotFocus() + Call FieldSelect(txtScratchDate) +' mstrScratch = txtScratchDate +End Sub + +Private Sub txtScratchDate_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtScratchDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtScratchDate, "/", 1) + If lngPOS = 0 Then + If Len(txtScratchDate) > 0 Then + txtScratchDate = Format(txtScratchDate, "00/00/####") + If Not IsDate(txtScratchDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScratchDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtScratchDate.SetFocus + End If +End Sub + +Private Sub txtStuccoBill_GotFocus() + Call FieldSelect(txtStuccoBill) +End Sub + +Private Sub txtStuccoBill_LostFocus() +Dim lngPOS As Long + + If IsDate(txtStuccoBill) Then + Exit Sub + End If + lngPOS = InStr(1, txtStuccoBill, "/", 1) + If lngPOS = 0 Then + If Len(txtStuccoBill) > 0 Then + txtStuccoBill = Format(txtStuccoBill, "00/00/####") + If Not IsDate(txtStuccoBill) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtStuccoBill.SetFocus + Exit Sub + Else + txtStuccoBill.Enabled = False + End If + moRS!BILLDT_S = Str2Field(txtStuccoBill) + moRS.Update + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtStuccoBill.SetFocus + End If +End Sub + +Private Sub txtLathOrder_LostFocus() +Dim lngPOS As Long + + If Len(txtLathOrder) < 3 Then + MsgBox "You Must Enter A Valid Date. It Cannot Be Blank", vbOKOnly, "InValid Date" + txtLathOrder = mstrLath + txtLathOrder.SetFocus + Exit Sub + End If + + If IsDate(txtLathOrder) Then + Exit Sub + End If + lngPOS = InStr(1, txtLathOrder, "/", 1) + If lngPOS = 0 Then + If Len(txtLathOrder) > 0 Then + txtLathOrder = Format(txtLathOrder, "00/00/####") + If Not IsDate(txtLathOrder) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtLathOrder.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtLathOrder.SetFocus + End If +End Sub + +Private Sub txtSandDate_LostFocus() +Dim lngPOS As Long + + If Len(txtSandDate) < 3 Then + MsgBox "You Must Enter A Valid Date. It Cannot Be Blank", vbOKOnly, "InValid Date" + txtSandDate = mstrSand + txtSandDate.SetFocus + Exit Sub + End If + + If IsDate(txtSandDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtSandDate, "/", 1) + If lngPOS = 0 Then + If Len(txtSandDate) > 0 Then + txtSandDate = Format(txtSandDate, "00/00/####") + If Not IsDate(txtSandDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtSandDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtSandDate.SetFocus + End If +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strSQL As String + +' U Fix the Lath and Stucco Billing Dates + + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyU And gbytSECURITY = 1 Then ' Update The Billing Date in LotInfo File + If CtrlDown Then + Call FixDates + End If + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub txtScratchDate_LostFocus() +Dim lngPOS As Long + +' If Len(txtScratchDate) < 3 Then +' MsgBox "You Must Enter A Valid Date. It Cannot Be Blank", vbOKOnly, "InValid Date" +' txtScratchDate = mstrScratch +' txtScratchDate.SetFocus +' Exit Sub +' End If + If IsDate(txtScratchDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtScratchDate, "/", 1) + If lngPOS = 0 Then + If Len(txtScratchDate) > 0 Then + txtScratchDate = Format(txtScratchDate, "00/00/####") + If Not IsDate(txtScratchDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScratchDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtScratchDate.SetFocus + End If +End Sub + +Private Sub txtStuccoBill_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtStuccoBill) Then + Exit Sub + End If + lngPOS = InStr(1, txtStuccoBill, "/", 1) + If lngPOS = 0 Then + If Len(txtStuccoBill) > 0 Then + txtStuccoBill = Format(txtStuccoBill, "00/00/####") + If Not IsDate(txtStuccoBill) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtStuccoBill.SetFocus + Exit Sub + Else + txtStuccoBill.Enabled = False + End If + moRS!BILLDT_S = Str2Field(txtStuccoBill) + moRS.Update + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtStuccoBill.SetFocus + End If + +End Sub + +Private Sub txtTextureDate_GotFocus() + Call FieldSelect(txtTextureDate) +' mstrTexture = txtTextureDate +End Sub + +Private Sub txtTextureDate_LostFocus() +Dim lngPOS As Long +' If Len(txtTextureDate) < 3 Then +' MsgBox "You Must Enter A Valid Date. It Cannot Be Blank", vbOKOnly, "InValid Date" +' txtTextureDate = mstrTexture +' txtTextureDate.SetFocus +' Exit Sub +' End If + If IsDate(txtTextureDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtTextureDate, "/", 1) + If lngPOS = 0 Then + If Len(txtTextureDate) > 0 Then + txtTextureDate = Format(txtTextureDate, "00/00/####") + If Not IsDate(txtTextureDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtTextureDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtTextureDate.SetFocus + End If + +End Sub + +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRS + !lorder = Date2Field(txtLathOrder) + !SORDER = Str2Field(txtTextureDate) + !Border = Str2Field(txtSandDate) + !TORDER = Str2Field(txtScratchDate) + !forder = Str2Field(txtBrownDate) + !BILLDT_L = Str2Field(txtLathBill) + !BILLDT_S = Str2Field(txtStuccoBill) + !LUUser = gstrLOGIN + !Update = Date + End With + moRS.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form OrderDates - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtTextureDate_Validate(Cancel As Boolean) +Dim lngPOS As Long + + If IsDate(txtTextureDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtTextureDate, "/", 1) + If lngPOS = 0 Then + If Len(txtTextureDate) > 0 Then + txtTextureDate = Format(txtTextureDate, "00/00/####") + If Not IsDate(txtTextureDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtTextureDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtTextureDate.SetFocus + End If + +End Sub + +Private Sub RePrintLathInv() +Dim strSELECT As String + + gintCOPY = 1 + +' If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & lblLathPO & "'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & lblLathPO & "'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" +' End If +' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoice.rpt" + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + +'End If +End Sub + +Private Sub RePrintStuccoInv() +Dim strSELECT As String + +' If moRSProj!cocode = 0 Then + strSELECT = "{tblARInvoice.po_num} = '" & lblStuccoPO & "'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & lblStuccoPO & "'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" +' End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + +End Sub + +Private Sub RePrintStoneInv() +Dim strSELECT As String, strMSG As String + +' If moRSProj!cocode = 0 Then + If lblStonePO = "" Or IsNull(lblStonePO) Then + strMSG = "There is not PO for this Invoice so it can not be reprinted" + MsgBox strMSG, vbOKOnly, "No Invoice Reprint" + Else + strSELECT = "{tblARInvoice.po_num} = '" & lblStonePO & "'" +' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crOrder.ReportFileName = App.Path & "\invoice.rpt" +' ElseIf moRSProj!cocode = 1 Then +' strSELECT = "{tblARInvoiceM.po_num} = '" & lblStuccoPO & "'" +' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" + ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" +' crOrder.ReportFileName = App.Path & "\invoiceM.rpt" +' End If + crOrder.ReplaceSelectionFormula (strSELECT) + crOrder.CopiesToPrinter = gintCOPY + ' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + End If + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frm new file mode 100644 index 0000000..fa17904 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frm @@ -0,0 +1,2300 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmOrders + Caption = "Orders Information" + ClientHeight = 8340 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11415 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8340 + ScaleWidth = 11415 + StartUpPosition = 2 'CenterScreen + Visible = 0 'False + Begin LpLib.fpList lstInventory + Height = 2205 + Left = 6360 + TabIndex = 54 + Top = 6030 + Visible = 0 'False + Width = 4920 + _Version = 196608 + _ExtentX = 8678 + _ExtentY = 3889 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmOrders.frx":0000 + End + Begin VB.TextBox txtOrdCnt + Height = 300 + Left = 11025 + TabIndex = 53 + Top = 510 + Visible = 0 'False + Width = 405 + End + Begin VB.CheckBox chkCalc + Caption = "Check1" + Enabled = 0 'False + Height = 285 + Left = 11220 + TabIndex = 52 + Top = 240 + Width = 210 + End + Begin VB.TextBox txtInvDate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 3360 + TabIndex = 48 + TabStop = 0 'False + Top = 5400 + Width = 2115 + End + Begin VB.CommandButton cmdMisc + Caption = "Add Misc Item" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9915 + TabIndex = 47 + Top = 1380 + Width = 1455 + End + Begin VB.TextBox txtNotes + Height = 1995 + Left = 6360 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 45 + TabStop = 0 'False + Top = 6300 + Width = 5055 + End + Begin VB.CommandButton cmdFindPO + Caption = "PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 2820 + Picture = "frmOrders.frx":0303 + Style = 1 'Graphical + TabIndex = 44 + TabStop = 0 'False + Top = 6240 + Visible = 0 'False + Width = 795 + End + Begin Crystal.CrystalReport crOrder + Left = 10200 + Top = 180 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdAR + Caption = "Setup S&W AR Transfer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 8400 + TabIndex = 42 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Invoice" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 6900 + TabIndex = 41 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.TextBox txtVendorInv + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 4020 + MaxLength = 10 + TabIndex = 40 + TabStop = 0 'False + Top = 7080 + Width = 1755 + End + Begin VB.CommandButton cmdAP + Caption = "Setup A&P Transfer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9900 + TabIndex = 38 + TabStop = 0 'False + Top = 5160 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9900 + TabIndex = 37 + TabStop = 0 'False + Top = 4380 + Width = 1455 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update Total" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 6900 + TabIndex = 36 + TabStop = 0 'False + Top = 4380 + Width = 1455 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 8400 + TabIndex = 8 + Top = 4380 + Width = 1455 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 7 + Top = 2160 + Width = 2175 + End + Begin VB.TextBox txtAQty + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 6 + Top = 1740 + Width = 1035 + End + Begin VB.ListBox lstMaterials + Height = 3375 + Left = 2100 + TabIndex = 10 + Top = 720 + Width = 4155 + End + Begin VB.ListBox lstOrders + Height = 3375 + Left = 60 + TabIndex = 3 + TabStop = 0 'False + Top = 720 + Width = 1995 + End + Begin VB.Label lblHelp + AutoSize = -1 'True + Caption = "U/W" + Height = 195 + Left = 11040 + TabIndex = 51 + Top = 30 + Width = 360 + End + Begin VB.Label lblJobCost + BorderStyle = 1 'Fixed Single + Height = 375 + Left = 3735 + TabIndex = 50 + Top = 6240 + Width = 1050 + End + Begin VB.Label lblInvDate + AutoSize = -1 'True + Caption = "Inv. Date:" + Height = 195 + Left = 5520 + TabIndex = 49 + Top = 5520 + Width = 705 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6420 + TabIndex = 46 + Top = 6060 + Width = 570 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 6360 + X2 = 11400 + Y1 = 6000 + Y2 = 6000 + End + Begin VB.Label lblLocked + Caption = "This Invoice Has Been Transfered To AP And Is Now Locked" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 1155 + Left = 120 + TabIndex = 43 + Top = 4140 + Visible = 0 'False + Width = 6075 + End + Begin VB.Label lblVendorInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor Invoice #:" + Height = 195 + Left = 2640 + TabIndex = 39 + Top = 7155 + Width = 1275 + End + Begin VB.Label lblD_Update + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 35 + Top = 3900 + Width = 4575 + End + Begin VB.Label lblD_Create + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 34 + Top = 3240 + Width = 4575 + End + Begin VB.Label lblD_Flag + BackColor = &H80000005& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 375 + Left = 7500 + TabIndex = 33 + Top = 2580 + Width = 3855 + End + Begin VB.Label lblD_OQty + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 32 + Top = 1320 + Width = 1035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 31 + Top = 3660 + Width = 975 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 30 + Top = 3000 + Width = 900 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = 6930 + TabIndex = 29 + Top = 2340 + Width = 405 + End + Begin VB.Label lblAQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Actual Qty:" + Height = 195 + Left = 6555 + TabIndex = 28 + Top = 1800 + Width = 780 + End + Begin VB.Label lblOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Original Qty:" + Height = 195 + Left = 6480 + TabIndex = 27 + Top = 1320 + Width = 855 + End + Begin VB.Label lblD_Desc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 26 + Top = 900 + Width = 3855 + End + Begin VB.Label lblD_InvNo + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 25 + Top = 480 + Width = 2625 + End + Begin VB.Label lblInv_No + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory:" + Height = 195 + Left = 6630 + TabIndex = 24 + Top = 600 + Width = 705 + End + Begin VB.Label lblD_Type + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 23 + Top = 7920 + Width = 3555 + End + Begin VB.Label lblD_Supplier + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 22 + Top = 7500 + Width = 4575 + End + Begin VB.Label lblD_Percent + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 21 + Top = 7080 + Width = 1035 + End + Begin VB.Label lblD_Amount + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 20 + Top = 6660 + Width = 1545 + End + Begin VB.Label lblD_SPO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 19 + Top = 6240 + Width = 1545 + End + Begin VB.Label lblD_PO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 18 + Top = 5820 + Width = 3555 + End + Begin VB.Label lblD_ODate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 17 + Top = 5400 + Width = 2115 + End + Begin VB.Label lblSPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Special PO #:" + Height = 195 + Left = 120 + TabIndex = 16 + Top = 6345 + Width = 990 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Type:" + Height = 195 + Left = 270 + TabIndex = 15 + Top = 7980 + Width = 840 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supplier:" + Height = 195 + Left = 495 + TabIndex = 14 + Top = 7575 + Width = 615 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 240 + TabIndex = 13 + Top = 7155 + Width = 870 + End + Begin VB.Label lblAmount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Amount:" + Height = 195 + Left = 90 + TabIndex = 12 + Top = 6750 + Width = 1020 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Number:" + Height = 195 + Left = 240 + TabIndex = 11 + Top = 5925 + Width = 870 + End + Begin VB.Label lblO_Date + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 285 + TabIndex = 9 + Top = 5520 + Width = 825 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 0 + Y2 = 6000 + End + Begin VB.Label lblTotal + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 5 + Top = 60 + Width = 1695 + End + Begin VB.Label lblInvTotal + AutoSize = -1 'True + Caption = "PO Total:" + Height = 195 + Left = 6720 + TabIndex = 4 + Top = 120 + Width = 675 + End + Begin VB.Label lblMatList + AutoSize = -1 'True + Caption = "Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2160 + TabIndex = 2 + Top = 480 + Width = 780 + End + Begin VB.Label lblPOList + AutoSize = -1 'True + Caption = "PO Number" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 1 + Top = 480 + Width = 975 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 6195 + End +End +Attribute VB_Name = "frmOrders" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSORDER As Recordset +Dim moRSOrdMat As Recordset +Dim moRSProj As Recordset +Dim moRS As Recordset + +Dim mboolSHOW As Boolean, mstrORDERTYPE As String +Dim mboolAdding As Boolean, mstrPROJLOT As String +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mstrType As String, mstrMODEL As String, mintBOOKMARK4 As Integer +Dim mlngORDERID As Long, mdblTOTAL As Double + +Dim mstrSQL As String + +Private Sub AddInventory() + + If moRSORDER!ap Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ap_trans Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar_trans Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + + txtNotes.Visible = False + lstInventory.Visible = True + Call InventoryLoad + +End Sub + +Private Sub ADDItems() +Dim strSql2 As String, strTYPE As String, strPONUM As String +Dim lngORDERID As Long, intBOOKMARK As Integer +Dim strINVNO As String, strINVDesc As String +Dim oRSS As Recordset + + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strINVDesc = lstInventory.ColText + +' If moRSORDER!ap Then +' MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" +' Exit Sub +' End If +' If moRSORDER!ap_trans Then +' MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" +' Exit Sub +' End If +' If moRSORDER!ar Then +' MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" +' Exit Sub +' End If +' If moRSORDER!ar_trans Then +' MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" +' Exit Sub +' End If + + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + With oRSS + strTYPE = moRSORDER!m_type + strPONUM = moRSORDER!po_num + lngORDERID = moRSORDER!order_id + .AddNew + !order_id = lngORDERID + !Lot_ID = gintLOTID + !po_num = strPONUM + !d_flag = "S" + !m_type = strTYPE +' !inv_no = "9990A" +' !Desc = "MISC CHARGE - SEE NOTES" + !inv_no = strINVNO + !Desc = strINVDesc + !o_qty = 0 + !a_qty = 0 + !price = 0 + !Update = Date + !U_USER = gstrLOGIN + !C_USER = gstrLOGIN + .Update + End With + + intBOOKMARK = lstOrders.ListIndex + Call OrderLoad + lstOrders.ListIndex = intBOOKMARK + oRSS.Close + + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module cmdMisc" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String + + On Error GoTo Error_EH + mstrORDERTYPE = "" + If gintORDER = 9 Then + strSQL = "SELECT * from tblOrders WHERE Lot_id = " & gintLOTID & " ORDER BY PO_Num" + End If + If gintORDER = 8 Then + strSQL = "SELECT * from tblOrders WHERE PO_Num = '" & gstrPONUM & "'" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrORDERTYPE = Field2Str(oRS!m_type) + Else + mstrORDERTYPE = "" + End If + + + lstOrders.Clear + + Do Until oRS.EOF + With lstOrders + + strLine = oRS!po_num ' & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + txtOrdCnt = Field2Str(lstOrders.ListCount) + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAP_Click() +Dim intBOOKMARK As Integer + moRSORDER!ap = vbTrue + moRSORDER!cocode = moRSProj!cocode + moRSORDER.Update + intBOOKMARK = lstOrders.ListIndex + Call OrderLoad + lstOrders.ListIndex = intBOOKMARK +End Sub + +Private Sub cmdAR_Click() +Dim oRS As Recordset +Dim strSQL As String, lngINVNO As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngINVNO = Field2Long(oRS!swinvno) + lngINVNO = lngINVNO + 1 + If lngINVNO > 99999 Then + lngINVNO = 19999 + End If + oRS!swinvno = lngINVNO + oRS.Update + + moRSORDER!Vend_Inv = lngINVNO +' moRSORDER!SUP_INV = lngINVNO + txtVendorInv = lngINVNO + moRSORDER!ar = vbTrue + moRSORDER!cocode = moRSProj!cocode + moRSORDER.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module cmdAR" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindPO_Click() + gintPONUM = Field2Long(lblD_SPO) + frmPOInfo.Show 1 +End Sub + +Private Sub cmdMisc_Click() +Dim strSql2 As String, strTYPE As String, strPONUM As String +Dim lngORDERID As Long, intBOOKMARK As Integer +Dim oRSS As Recordset + + On Error GoTo Error_EH + + If moRSORDER!ap Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ap_trans Then + MsgBox "AP has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + If moRSORDER!ar_trans Then + MsgBox "AR has been transfered, No Adding Allowed", vbOKOnly, "No Adding" + Exit Sub + End If + strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' gstrMODULE = "Before Setup Materials " + With oRSS + strTYPE = moRSORDER!m_type + strPONUM = moRSORDER!po_num + lngORDERID = moRSORDER!order_id + .AddNew + !order_id = lngORDERID + !Lot_ID = gintLOTID + !po_num = strPONUM + !d_flag = "S" + !m_type = strTYPE + !inv_no = "9990A" + !Desc = "MISC CHARGE - SEE NOTES" + !o_qty = 0 + !a_qty = 0 + !price = 0 + !Update = Date + !U_USER = gstrLOGIN + !C_USER = gstrLOGIN + .Update + End With + intBOOKMARK = lstOrders.ListIndex + Call OrderLoad + lstOrders.ListIndex = intBOOKMARK + oRSS.Close + + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module cmdMisc" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "{tblORDERS.order_id} = " & mlngORDERID + crOrder.ReportFileName = App.Path & "\POPrice.rpt" + crOrder.GroupSelectionFormula = strSQL + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpdate_Click() +Dim intBOOK As Integer + On Error GoTo Error_EH + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + moRSORDER!orderamt = Field2Str2(lblTotal) + moRSORDER!notes = Field2Str(txtNotes) + moRSORDER!Vend_Inv = Field2Str(txtVendorInv) +' moRSORDER!SUP_INV = Field2Str(txtVendorInv) + moRSORDER!inv_date = Field2Str(txtInvDate) + moRSORDER.Update + Call OrderLoad + Call OrderMatLoad + cmdUpdate.Enabled = False + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module cmdUpdate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + +' R Reset Purchase Order for AR(Not Allowed if VOIDED) +' P Reset Purchase Order for AP(Not Allowed if VOIDED) +' V Will Void The PO if it has not been processed +' U Update the Costs for the materials in the HiLited PO for all item numbers over 1000 +' W Update the Costs for the materials in all PO's for all items numbers over 1000 +' H Update the Costs for the Hi-lited inventory item. +' I Update cost for items under inventory # 1000. Will prompt for the amount and move to the next item. +' A Add Inventory Items + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSORDER!d_flag = "X" Then + MsgBox "This PO Has Been Voided - Reset Not Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + moRSORDER!ar_trans = vbUnchecked + moRSORDER!ar = vbUnchecked + Call cmdUpdate_Click + End If + Exit Sub + End If + + If KeyCode = vbKeyA And gboolAP Then + Call AddInventory + End If + + If KeyCode = vbKeyP And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSORDER!d_flag = "X" Then + MsgBox "This PO Has Been Voided - Reset Not Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + moRSORDER!ap_trans = vbUnchecked + moRSORDER!ap = vbUnchecked + Call cmdUpdate_Click + End If + Exit Sub + End If + If KeyCode = vbKeyV And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + If moRSORDER!ar_trans Or moRSORDER!ap_trans Then + MsgBox "This PO Has Already Been Processed - No Void Allowed", vbCritical + vbOKOnly, "No Void Allowed" + Exit Sub + End If + Call LotChange(mstrPROJLOT, "VOID Purchase Order") + moRSORDER!m_type = "H" + moRSORDER!d_flag = "X" + moRSORDER!ar_trans = vbChecked + moRSORDER!ap_trans = vbChecked + moRSORDER.Update + Call FormShow + End If + Exit Sub + End If + + If KeyCode = vbKeyU And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices + Call OrderMatLoad + End If + Exit Sub + End If + + If KeyCode = vbKeyW And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices2 + Call OrderMatLoad + End If + Exit Sub + End If + + If KeyCode = vbKeyH And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices4 + mintBOOKMARK4 = lstMaterials.ListIndex + mintBOOKMARK2 = lstOrders.ListIndex + Call OrderMatLoad + lstMaterials.ListIndex = mintBOOKMARK4 + lstOrders.ListIndex = mintBOOKMARK2 + mintBOOKMARK4 = 0 + mintBOOKMARK2 = 0 + End If + Exit Sub + End If + + If KeyCode = vbKeyI And (gbytSECURITY = 1 Or gbytSECURITY = 6) Then + If CtrlDown Then + Call OrderMatPrices3 + Call OrderMatLoad + End If + Exit Sub + End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "PO Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + If moRSOrdMat.State = adStateOpen Then + moRSOrdMat.Close + End If + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub OrderMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(1) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + + aTabs(0) = 130 + aTabs(1) = 155 + + mdblTOTAL = 0 + + strSQL = "SELECT Item_id, Inv_no, Desc, A_Qty, Price from tblOrdMatrl WHERE Order_id = " & mlngORDERID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstMaterials.hwnd, LB_SETTABSTOPS, 2, aTabs(0)) + + lstMaterials.Clear + + Do Until oRS.EOF + With lstMaterials + + strLine = oRS!Desc & vbTab & oRS!a_qty & vbTab & Format(oRS!price, "#,#.00") + .AddItem strLine + .ItemData(.NewIndex) = oRS!Item_ID + End With + dblSUM = (Field2Str2(oRS!a_qty) * Field2Str2(oRS!price)) + mdblTOTAL = mdblTOTAL + dblSUM + oRS.MoveNext + Loop + oRS.Close + + If mdblTOTAL <> Field2Str2(lblD_Amount) Then + lblD_Amount = Format(mdblTOTAL, "#,#,#.00") + moRSORDER!orderamt = mdblTOTAL + moRSORDER.Update + End If + + If lstMaterials.ListCount Then + lstMaterials.ListIndex = 0 + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + + lblTotal = Format(mdblTOTAL, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() +' Set moRSORDER = New Recordset +' Set moRSOrdMat = New Recordset + +' If gbytSECURITY < 3 Then +' cmdUpdate.Visible = True +' End If + Call ProjLoad + Call OrderLoad + If gstrPONUM = "" Then + Else + Call CBFindString(lstOrders, gstrPONUM) +' lstOrders.SetFocus + End If +' Call ListLoad +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + mlngORDERID = moRSORDER!order_id + glngORDERID = moRSORDER!order_id + lblProjLot = Trim$(moRSProj!Proj_Code) & " " & Trim$(moRSProj!Proj_Desc) & " " & moRS!lot_no + mstrPROJLOT = lblProjLot + With moRSORDER + txtVendorInv = Field2Str(!Vend_Inv) +' txtVendorInv = Field2Str(!SUP_INV) + txtNotes = Field2Str(!notes) + chkCalc = Field2CheckBox(!calc) + lblJobCost = Field2Str(!jobcost) + lblD_ODate = Field2Str(!order_date) + If !d_flag = "X" Then + lblD_Flag = "This PO Voided - Do Not Pay" + Else + lblD_Flag = "" + End If + If IsNull(!inv_date) Then + txtInvDate = Field2Str(!order_date) + Else + txtInvDate = Field2Str(!inv_date) + End If + lblD_PO = Field2Str(!po_num) + lblD_Supplier = Field2Str(!supplier) + lblD_SPO = Field2Long(!ponum) + lblD_Percent = Field2Str(!percentage) + lblD_Amount = Format(Field2Str2(!orderamt), "#,#.00") + If !m_type = "H" Then + lblD_Type = "ORDER REPRINTED" + ElseIf !m_type = "L" Then + lblD_Type = "LATH ORDER" + ElseIf !m_type = "A" Then + lblD_Type = "SAND ORDER" + ElseIf !m_type = "B" Then + lblD_Type = "BROWN ORDER" + ElseIf !m_type = "T" Then + lblD_Type = "TEXTURE ORDER" + ElseIf !m_type = "R" Then + lblD_Type = "SPECIAL PO" + ElseIf !m_type = "P" Then + lblD_Type = "PREORDER" + ElseIf !m_type = "S" Then + lblD_Type = "SCRATCH ORDER" + ElseIf !m_type = "V" Then + lblD_Type = "STONE VENEER ORDER" + ElseIf !m_type = "W" Then + lblD_Type = "TYPAR WRAP ORDER" + Else + lblD_Type = "UNKNOWN" + End If + lblLocked.Caption = "" + cmdAP.Caption = "Setup AP Transfer" + cmdAR.Caption = "Setup AR Transfer" + cmdAP.Enabled = True + cmdAR.Enabled = True + If !ap Then + lblLocked.Caption = "This Invoice Ready To Be Transfered To AP" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfer Setup" +' cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If !ap_trans Then + lblLocked.Caption = "This Invoice Has Been Transfered To AP" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfered" +' If !ar_trans Then +' cmdAR.Caption = "AR Transfered" +' End If +' cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If !ar Then + lblLocked.Caption = lblLocked.Caption & " This Invoice Ready To Be Transfered To AR" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAR.Caption = "AR Transfer Setup" + cmdAR.Enabled = False +' cmdAP.Enabled = True + End If + If !ar_trans Then + lblLocked.Caption = lblLocked.Caption & " This Invoice Has Been Transfered To AR" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAR.Caption = "AR Transfered" + cmdAR.Enabled = False +' cmdAP.Enabled = True + End If + If !ar_trans And !ap_trans Then + lblLocked.Caption = lblLocked.Caption & " And Is Now Locked" + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + txtInvDate.Enabled = False + cmdAP.Caption = "AP Transfered" + cmdAR.Caption = "AR Transfered" + cmdAR.Enabled = False + cmdAP.Enabled = False + End If + If Not !ar_trans And Not !ap_trans And Not !ap And Not !ar Then + lblLocked.Visible = False + txtVendorInv.Enabled = True + txtAQty.Enabled = True + txtPrice.Enabled = True + txtInvDate.Enabled = True + cmdAP.Caption = "Setup A&P Transfer" + cmdAR.Caption = "Setup S&W AR Transfer" + cmdAR.Enabled = True + cmdAP.Enabled = True + End If + + If lblD_SPO > 0 Then + cmdFindPO.Visible = True + Else + cmdFindPO.Visible = False + End If + txtNotes = Field2Str(!notes) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOrdMat() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSOrdMat +' lblD_InvNo = Field2Long(!inv_no) + lblD_InvNo = Field2Str(!inv_no) + lblD_Desc = Field2Str(!Desc) + lblD_OQty = Field2Str(!o_qty) + txtPrice = Format$(Field2Str2(!price), "##,###.00") + txtAQty = Field2Integer(!a_qty) + lblD_Create = Field2Str(!Create) + lblD_Update = Field2Str(!Update) & " " & Field2Str(!U_USER) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub FormClear() + + lblD_ODate = "" + lblD_PO = "" + lblSupplier = "" + lblD_SPO = "" + lblD_Percent = "" + lblD_Amount = "" + lblD_Type = "" + lblD_Flag = "" + +End Sub + +Private Sub FormClearOrdMat() + + lblD_InvNo = "" + lblD_Desc = "" + lblD_OQty = 0 + txtPrice = 0 + txtAQty = 0 + lblCreate = "" + lblUpdate = "" + +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + + Call FieldsSave + + moRSOrdMat.Update + + + + Call OrderMatLoad +' Call ToggleButtons + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE order_id = " & _ + lstOrders.ItemData(lstOrders.ListIndex) + + Set moRSORDER = New Recordset + + moRSORDER.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSORDER.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOrdMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrdMatrl " + strSQL = strSQL & "WHERE Item_ID = " & lstMaterials.ItemData(lstMaterials.ListIndex) + + Set moRSOrdMat = New Recordset + + moRSOrdMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOrdMat.EOF Then + FormFindOrdMat = False + txtAQty.Enabled = False + txtPrice.Enabled = False + Else + FormFindOrdMat = True +' txtAQty.Enabled = True +' txtPrice.Enabled = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFindOrdMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSOrdMat + !a_qty = Single2Field(txtAQty) + !price = Format(Single2Field(txtPrice), "#,#.00") +' If txtAQty > 0 Then +' !SWAR = True +' End If +' !notes = Str2Field(txtNotes) + !Update = Date + !U_USER = gstrLOGIN + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + If lstOrders.ListCount = 0 Then + intResponse = MsgBox("No Orders Have Been Processed For This Lot", vbOKOnly + vbQuestion, "No Orders") + Unload Me + End If + +End Sub + +Private Sub lstInventory_DblClick() + + txtNotes.Visible = True + lstInventory.Visible = False + + Call ADDItems + + lstMaterials.ListIndex = lstMaterials.ListCount - 1 + cmdSave.Enabled = True + txtAQty.SetFocus +End Sub + +Private Sub lstMaterials_DblClick() + If Not moRSORDER!ap_trans Then + cmdSave.Enabled = True + End If +End Sub + +Private Sub lstOrders_Click() + On Error GoTo Error_EH + If lstOrders.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call OrderMatLoad + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + txtAQty.Enabled = False + txtPrice.Enabled = False + Call FormClearOrdMat + End If + Else + txtAQty.Enabled = False + txtPrice.Enabled = False + End If + Else + lstOrders.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstOrders_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMaterials_Click() + On Error GoTo Error_EH + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstMaterials_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String +Dim strSql2 As String + +' On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not moRSProj.EOF Then + gbytINV_TYPE = Field2Str2(moRSProj!inv_type) + End If + + strSql2 = "SELECT * FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intBOOK As Integer + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdUpdate.Enabled = True + Call FormSave + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub lstOrders_DblClick() + If chkCalc Then + chkCalc = vbUnchecked + moRSORDER!calc = False + moRSORDER.Update + Else + chkCalc = vbChecked + moRSORDER!calc = True + moRSORDER.Update + End If +End Sub + +Private Sub txtAQty_GotFocus() + Call FieldSelect(txtAQty) +End Sub + +Private Sub txtInvDate_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtInvDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtInvDate, "/", 1) + If Not IsDate(txtInvDate) Then + If lngPOS = 0 Then + If Len(txtInvDate) > 0 Then + txtInvDate = Format(txtInvDate, "00/00/####") + If Not IsDate(txtInvDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtInvDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtInvDate.SetFocus + Exit Sub + End If + End If + cmdUpdate.SetFocus + +End Sub + +Private Sub txtNotes_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtNotes_GotFocus() + txtNotes.SelStart = 1000 +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + txtVendorInv.SetFocus +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtVendorInv_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtVendorInv_GotFocus() + Call FieldSelect(txtVendorInv) +End Sub + +Private Sub txtVendorInv_LostFocus() + txtVendorInv = UCase(txtVendorInv) + cmdUpdate.SetFocus +End Sub + +Private Sub SetupTransfer() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICE WHERE ready" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + strSql2 = "DELETE * FROM tblARTRANS" + goConn.Execute strSql2 + + strSql2 = "SELECT * FROM tblARTRANS" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRSS + .AddNew + !invoice_no = oRS!invoice_no + !customer_no = oRS!customer_no + !invoice_date = oRS!invoice_date + !job_number = oRS!job_number + !inv_due_date = oRS!inv_due_date + !disc_due_date = oRS!disc_due_date + !non_tax_amt = oRS!non_tax_amt + !retention_amt = oRS!retention_amt + !sales_code = oRS!sales_code + !Description = Left$(Field2Str(oRS!Description), 30) + !price = oRS!price + !amount = oRS!amount + !ready = True + !shipping = Left$(Field2Str(oRS!project), 15) + !comment = "Lot " & oRS!lot_no & "," & Left$(Field2Str(oRS!address), 20) + .Update + oRS!ready = False + oRS!done = True + oRS.Update + oRS.MoveNext + End With + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form MAIN - Module SetupTransfer" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub WrapMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module WrapMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices() +Dim oRS As Recordset, oRSS As Recordset, strINV As String +Dim strSQL As String, strSQLL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & glngORDERID +' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else +' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + If Field2Str2(oRS!price) = 0 Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices2() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) + intCOUNT = 1 + + lstOrders.ListIndex = 0 + lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + + Do Until intCOUNT = intLSTCNT + If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & glngORDERID + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + End If + intCOUNT = intCOUNT + 1 + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices3() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) + intCOUNT = 1 + + lstOrders.ListIndex = 0 + lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) + + Do Until intCOUNT = intLSTCNT + If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, Price, ORDER_ID FROM tblORDMATRL WHERE ORDER_ID = " & lngORDERID & " AND INV_NO = " + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + If strINV < "1000" Then + + Else + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" + strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!inv_no) ' & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + oRS!price = Field2Str2(oRSS!price) + oRS.Update + End If + oRSS.Close + End If + oRS.MoveNext + Loop + End If + End If + intCOUNT = intCOUNT + 1 + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OrderMatPrices4() +Dim oRS As Recordset, oRSS As Recordset, strINV As String, lngORDERID As Long, strCOST As String +Dim strSQL As String, strSQLL As String, intLSTCNT As Integer, intCOUNT As Integer, dblCOST As Double +Dim strDESC As String + + On Error GoTo Error_EH + intLSTCNT = Field2Integer(txtOrdCnt) +' intCOUNT = 1 + +' lstOrders.ListIndex = 0 +' lngORDERID = lstOrders.ItemData(lstOrders.ListIndex) +' lstMaterials.ListIndex = 0 + lngORDERID = lstMaterials.ItemData(lstMaterials.ListIndex) + +' Do Until intCOUNT = intLSTCNT +' If chkCalc Then + strSQL = "SELECT Lot_ID, INV_NO, DESC, Price, ITEM_ID FROM tblORDMATRL WHERE ITEM_ID = " & lngORDERID ' & " AND INV_NO = " + ' strSQL = "SELECT Lot_ID, M_Type, INV_NO, QTY, Price FROM tblLOTMATRL WHERE M_TYPE = 'W' and LOT_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then +' Do Until oRS.EOF + strINV = Field2Str(oRS!inv_no) + strDESC = Field2Str(oRS!Desc) + If Field2Str2(oRS!price) = 0 Then + strCOST = InputBox("Enter The New Cost For '" & Trim(Field2Str(oRS!inv_no)) & " - " & Trim(Field2Str(oRS!Desc)) & "'", "Update Material Cost", 0) + oRS!price = Field2Str2(strCOST) + oRS.Update + Else + MsgBox "Price Is Not Zero So Cannot Be Updated", vbOKOnly, "Cannot Update" + ' strSQLL = "SELECT INV_NO, M_TYPE, Price, Inv_Type FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = '" & Field2Str(oRS!inv_no) & "'" +' strSQLL = "SELECT * FROM tblINVTRY WHERE INV_TYPE = " & gbytINV_TYPE & " AND INV_NO = " & Field2Str(oRS!Inv_NO) ' & "'" +' Set oRSS = New Recordset +' oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSS.EOF Then +' oRS!price = Field2Str2(oRSS!price) +' oRS.Update +' End If +' oRSS.Close + End If +' oRS.MoveNext +' Loop + End If +' End If +' intCOUNT = intCOUNT + 1 +' Loop + Exit Sub +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatPrices4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frx new file mode 100644 index 0000000..8157be0 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrders.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrdersBK.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrdersBK.frm new file mode 100644 index 0000000..dcb2e85 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmOrdersBK.frm @@ -0,0 +1,1278 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "CRYSTL32.OCX" +Begin VB.Form frmOrders + Caption = "Orders Information" + ClientHeight = 7935 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11415 + Icon = "frmOrders.frx":0000 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7935 + ScaleWidth = 11415 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + Begin VB.CommandButton cmdFindPO + Caption = "PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 2820 + Picture = "frmOrders.frx":0442 + Style = 1 'Graphical + TabIndex = 44 + Top = 5820 + Width = 675 + End + Begin Crystal.CrystalReport crOrder + Left = 10200 + Top = 180 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton Command2 + Caption = "Setup S&W AR Transfer" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9660 + TabIndex = 42 + TabStop = 0 'False + Top = 7140 + Width = 1455 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Invoice" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 7560 + TabIndex = 41 + TabStop = 0 'False + Top = 7140 + Width = 1455 + End + Begin VB.TextBox txtVendorInv + Height = 375 + Left = 4020 + TabIndex = 40 + TabStop = 0 'False + Top = 6660 + Width = 1755 + End + Begin VB.CommandButton cmdAP + Caption = "Setup &AP Transfer" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9660 + TabIndex = 38 + TabStop = 0 'False + Top = 6120 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 9660 + TabIndex = 37 + TabStop = 0 'False + Top = 5100 + Width = 1455 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update Total" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 7560 + TabIndex = 36 + TabStop = 0 'False + Top = 6120 + Width = 1455 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 7560 + TabIndex = 8 + Top = 5100 + Width = 1455 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 7 + Top = 2460 + Width = 2175 + End + Begin VB.TextBox txtAQty + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 6 + Top = 1980 + Width = 1035 + End + Begin VB.ListBox lstMaterials + Height = 4155 + Left = 2100 + TabIndex = 10 + Top = 720 + Width = 4155 + End + Begin VB.ListBox lstOrders + Height = 4155 + Left = 60 + TabIndex = 3 + TabStop = 0 'False + Top = 720 + Width = 1995 + End + Begin VB.Label lblLocked + Caption = "This Invoice Has Been Transfered To AP And Is Now Locked" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 1575 + Left = 4800 + TabIndex = 43 + Top = 4980 + Visible = 0 'False + Width = 2595 + End + Begin VB.Label lblVendorInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor Invoice #:" + Height = 195 + Left = 2640 + TabIndex = 39 + Top = 6735 + Width = 1275 + End + Begin VB.Label lblD_Update + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 35 + Top = 4440 + Width = 4575 + End + Begin VB.Label lblD_Create + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 6780 + TabIndex = 34 + Top = 3720 + Width = 4575 + End + Begin VB.Label lblD_Flag + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 33 + Top = 2940 + Width = 3855 + End + Begin VB.Label lblD_OQty + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 32 + Top = 1500 + Width = 1035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 31 + Top = 4140 + Width = 975 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 6780 + TabIndex = 30 + Top = 3420 + Width = 900 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = 6930 + TabIndex = 29 + Top = 2640 + Width = 405 + End + Begin VB.Label lblAQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Actual Qty:" + Height = 195 + Left = 6555 + TabIndex = 28 + Top = 2040 + Width = 780 + End + Begin VB.Label lblOQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Original Qty:" + Height = 195 + Left = 6480 + TabIndex = 27 + Top = 1500 + Width = 855 + End + Begin VB.Label lblD_Desc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 26 + Top = 1020 + Width = 3855 + End + Begin VB.Label lblD_InvNo + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 25 + Top = 540 + Width = 1695 + End + Begin VB.Label lblInv_No + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory:" + Height = 195 + Left = 6630 + TabIndex = 24 + Top = 660 + Width = 705 + End + Begin VB.Label lblD_Type + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 23 + Top = 7500 + Width = 3555 + End + Begin VB.Label lblD_Supplier + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 22 + Top = 7080 + Width = 4575 + End + Begin VB.Label lblD_Percent + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 21 + Top = 6660 + Width = 1035 + End + Begin VB.Label lblD_Amount + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 20 + Top = 6240 + Width = 1545 + End + Begin VB.Label lblD_SPO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 19 + Top = 5820 + Width = 1545 + End + Begin VB.Label lblD_PO + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 18 + Top = 5400 + Width = 3555 + End + Begin VB.Label lblD_ODate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1200 + TabIndex = 17 + Top = 4980 + Width = 2115 + End + Begin VB.Label lblSPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Special PO #:" + Height = 195 + Left = 120 + TabIndex = 16 + Top = 5925 + Width = 990 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Type:" + Height = 195 + Left = 270 + TabIndex = 15 + Top = 7560 + Width = 840 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supplier:" + Height = 195 + Left = 495 + TabIndex = 14 + Top = 7155 + Width = 615 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 240 + TabIndex = 13 + Top = 6735 + Width = 870 + End + Begin VB.Label lblAmount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Amount:" + Height = 195 + Left = 90 + TabIndex = 12 + Top = 6330 + Width = 1020 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Number:" + Height = 195 + Left = 240 + TabIndex = 11 + Top = 5505 + Width = 870 + End + Begin VB.Label lblO_Date + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 285 + TabIndex = 9 + Top = 5100 + Width = 825 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 60 + Y2 = 7920 + End + Begin VB.Label lblTotal + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7500 + TabIndex = 5 + Top = 60 + Width = 1695 + End + Begin VB.Label lblInvTotal + AutoSize = -1 'True + Caption = "PO Total:" + Height = 195 + Left = 6720 + TabIndex = 4 + Top = 120 + Width = 675 + End + Begin VB.Label lblMatList + AutoSize = -1 'True + Caption = "Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2160 + TabIndex = 2 + Top = 480 + Width = 780 + End + Begin VB.Label lblPOList + AutoSize = -1 'True + Caption = "PO Number" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 1 + Top = 480 + Width = 975 + End + Begin VB.Label lblProjLot + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 6195 + End +End +Attribute VB_Name = "frmOrders" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSORDER As Recordset +Dim moRSOrdMat As Recordset +Dim moRSProj As Recordset +Dim moRS As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mstrType As String, mstrMODEL As String +Dim mlngORDERID As Long, mdblTOTAL As Double + +Dim mstrSQL As String + +Private Sub OrderLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String + + On Error GoTo Error_EH + If gintORDER = 9 Then + strSQL = "SELECT * from tblOrders WHERE Lot_id = " & gintLOTID & " ORDER BY PO_Num" + End If + If gintORDER = 8 Then + strSQL = "SELECT * from tblOrders WHERE PO_Num = '" & gstrPONUM & "'" + End If + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOrders.Clear + + Do Until oRS.EOF + With lstOrders + + strLine = oRS!po_Num ' & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOrders.ListCount Then + lstOrders.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintCOPY = 1 + + strSQL = "{tblORDERS.order_id} = " & mlngORDERID + crOrder.ReportFileName = App.Path & "\POPrice.rpt" + crOrder.GroupSelectionFormula = strSQL + crOrder.CopiesToPrinter = gintCOPY +' crOrder.Destination = crptToWindow + crOrder.Destination = crptToPrinter + crOrder.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module PrintJCRpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpdate_Click() +Dim intBOOK As Integer + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + moRSORDER!orderamt = Field2Str2(lblTotal) + moRSORDER.Update + Call OrderLoad + Call OrderMatLoad + cmdUpdate.Enabled = False + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "PO Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + If moRSOrdMat.State = adStateOpen Then + moRSOrdMat.Close + End If + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub OrderMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(1) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + + aTabs(0) = 130 + aTabs(1) = 155 + + mdblTOTAL = 0 + strSQL = "SELECT Item_id, Inv_no, Desc, A_Qty, Price from tblOrdMatrl WHERE Order_id = " & mlngORDERID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstMaterials.hwnd, LB_SETTABSTOPS, 2, aTabs(0)) + + lstMaterials.Clear + + Do Until oRS.EOF + With lstMaterials + + strLine = oRS!Desc & vbTab & oRS!a_qty & vbTab & Format(oRS!price, "#,#.00") + .AddItem strLine + .ItemData(.NewIndex) = oRS!Item_ID + End With + dblSUM = (Field2Str2(oRS!a_qty) * Field2Str2(oRS!price)) + mdblTOTAL = mdblTOTAL + dblSUM + oRS.MoveNext + Loop + oRS.Close + + If lstMaterials.ListCount Then + lstMaterials.ListIndex = 0 + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + + lblTotal = Format(mdblTOTAL, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module OrderMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() +' Set moRSORDER = New Recordset +' Set moRSOrdMat = New Recordset + +' If gbytSECURITY < 3 Then +' cmdUpdate.Visible = True +' End If + Call ProjLoad + Call OrderLoad +' lstOrders.SetFocus +' Call ListLoad +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + mlngORDERID = moRSORDER!order_id + lblProjLot = Trim$(moRSProj!proj_code) & " " & Trim$(moRSProj!proj_desc) & " " & moRS!lot_no + + With moRSORDER + txtVendorInv = Field2Str(!sup_inv) + lblD_ODate = Field2Str(!order_date) + lblD_PO = Field2Str(!po_Num) + lblD_Supplier = Field2Str(!supplier) + lblD_SPO = Field2Integer(!ponum) + lblD_Percent = Field2Str(!percentage) + lblD_Amount = Format(Field2Str2(!orderamt), "#,#.00") + If !m_type = "H" Then + lblD_Type = "ORDER REPRINTED" + ElseIf !m_type = "L" Then + lblD_Type = "LATH ORDER" + ElseIf !m_type = "A" Then + lblD_Type = "SAND ORDER" + ElseIf !m_type = "B" Then + lblD_Type = "BROWN ORDER" + ElseIf !m_type = "T" Then + lblD_Type = "TEXTURE ORDER" + ElseIf !m_type = "R" Then + lblD_Type = "SPECIAL PO" + ElseIf !m_type = "P" Then + lblD_Type = "PREORDER" + ElseIf !m_type = "S" Then + lblD_Type = "SCRATCH ORDER" + Else + lblD_Type = "UNKNOWN" + End If + If !ap_trans Then + lblLocked.Visible = True + txtVendorInv.Enabled = False + txtAQty.Enabled = False + txtPrice.Enabled = False + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowOrdMat() + On Error GoTo Error_EH + mboolSHOW = True + + With moRSOrdMat + lblD_InvNo = Field2Integer(!inv_no) + lblD_Desc = Field2Str(!Desc) + lblD_OQty = Field2Str(!o_qty) + txtPrice = Format$(Field2Str2(!price), "##,###.00") + txtAQty = Field2Integer(!a_qty) + If !X_flag Then + lblD_Flag = "This Order Not Delivered" + Else + lblD_Flag = "" + End If + lblD_Create = Field2Str(!Create) + lblD_Update = Field2Str(!Update) & " " & Field2Str(!U_USER) + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub FormClear() + + lblD_ODate = "" + lblD_PO = "" + lblSupplier = "" + lblD_SPO = "" + lblD_Percent = "" + lblD_Amount = "" + lblD_Type = "" + +End Sub + +Private Sub FormClearOrdMat() + + lblD_InvNo = "" + lblD_Desc = "" + lblD_OQty = 0 + txtPrice = 0 + txtAQty = 0 + lblD_Flag = "" + lblCreate = "" + lblUpdate = "" + +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRS.AddNew +' moRS!mod_elv = Str2Field(txtNewModel.Text) +' moRS!proj_id = gintPROJID +' moRS!createuser = gstrLOGIN +' End If + + Call FieldsSave + + moRSOrdMat.Update + + +' If mboolAdding Then +' mboolAdding = False +' cmdExit.Caption = "E&xit" +' End If + + Call OrderMatLoad +' Call ToggleButtons + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE order_id = " & _ + lstOrders.ItemData(lstOrders.ListIndex) + + Set moRSORDER = New Recordset + + moRSORDER.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSORDER.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOrdMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrdMatrl " + strSQL = strSQL & "WHERE Item_ID = " & lstMaterials.ItemData(lstMaterials.ListIndex) + + Set moRSOrdMat = New Recordset + + moRSOrdMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOrdMat.EOF Then + FormFindOrdMat = False + Else + FormFindOrdMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Orders - Module FormFindOrdMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSOrdMat + !a_qty = Single2Field(txtAQty) + !price = Format(Single2Field(txtPrice), "#,#.00") + !Update = Date + !U_USER = gstrLOGIN + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + If lstOrders.ListCount = 0 Then + If gintORDER = 9 Then + intResponse = MsgBox("No Orders Have Been Processed For This Lot", vbOKOnly + vbQuestion, "Add Records") + ElseIf gintORDER = 8 Then + intResponse = MsgBox("No Orders Have Been Processed For This Lot", vbOKOnly + vbQuestion, "Add Records") + End If +' If intResponse = vbYes Then +' strSQL = "SELECT * FROM tblplans WHERE est_id = 1" +' Set moRS = New Recordset +' moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc +' Call cmdNewPlan_Click +' cmdCopyTakeoff.Enabled = True +' Else + Unload Me +' End If + End If + +End Sub + +Private Sub lstMaterials_DblClick() + If Not moRSORDER!ap_trans Then + cmdSave.Enabled = True + End If +End Sub + +Private Sub lstOrders_Click() + On Error GoTo Error_EH + If lstOrders.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call OrderMatLoad + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + End If + Else + lstOrders.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstOrders_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMaterials_Click() + On Error GoTo Error_EH + If lstMaterials.ListIndex <> -1 Then + If FormFindOrdMat() Then + Call FormShowOrdMat + Else + lstMaterials.Clear + Call FormClearOrdMat + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module lstMaterials_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String +Dim strSql2 As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Orders - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intBOOK As Integer + mintBOOKMARK = lstOrders.ListIndex + intBOOK = lstMaterials.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdUpdate.Enabled = True + Call FormSave + lstOrders.ListIndex = mintBOOKMARK + lstMaterials.ListIndex = intBOOK + mintBOOKMARK = 0 +End Sub + +Private Sub txtAQty_GotFocus() + Call FieldSelect(txtAQty) +End Sub + +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtVendorInv_Change() + cmdUpdate.Enabled = True +End Sub + +Private Sub txtVendorInv_GotFocus() + Call FieldSelect(txtVendorInv) +End Sub + +Private Sub txtVendorInv_LostFocus() + txtVendorInv = UCase(txtVendorInv) + cmdUpdate.SetFocus +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frm new file mode 100644 index 0000000..cdbce87 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frm @@ -0,0 +1,9647 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPO + Caption = "Purchase Order Selection " + ClientHeight = 8670 + ClientLeft = 165 + ClientTop = 735 + ClientWidth = 12045 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8670 + ScaleWidth = 12045 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + WindowState = 2 'Maximized + Begin VB.CommandButton cmdPONotes + Caption = "PO Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 10935 + TabIndex = 55 + Top = 5145 + Visible = 0 'False + Width = 1080 + End + Begin LpLib.fpList lstHistory + Height = 840 + Left = 3735 + TabIndex = 53 + Top = 4290 + Width = 8010 + _Version = 196608 + _ExtentX = 14129 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 16578720 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 195 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":0000 + End + Begin VB.CheckBox chkHistory + Caption = "Check to Use CMS Inventory List for CTRL-O" + Height = 240 + Left = 105 + TabIndex = 51 + Top = 7530 + Width = 3600 + End + Begin VB.CommandButton cmdAlias + Caption = "Alias" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6555 + TabIndex = 49 + Top = 900 + Visible = 0 'False + Width = 735 + End + Begin VB.CheckBox chkNoDisplay + Caption = "Skip Display" + Height = 240 + Left = 2115 + TabIndex = 48 + Top = 7320 + Visible = 0 'False + Width = 585 + End + Begin VB.CheckBox chkOKPO + Caption = "Do Not Create" + Height = 240 + Left = 1365 + TabIndex = 47 + Top = 7335 + Visible = 0 'False + Width = 510 + End + Begin VB.CheckBox chkByDesc + Caption = "PO By Description" + Height = 210 + Left = 4845 + TabIndex = 46 + Top = 1245 + Width = 1620 + End + Begin VB.CommandButton cmdAPAR + Caption = "AP/AR Check" + Height = 300 + Left = 3915 + TabIndex = 45 + Top = 7530 + Visible = 0 'False + Width = 1245 + End + Begin VB.CommandButton cmdPromo + Caption = "Promo" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 44 + Top = 495 + Width = 1035 + End + Begin VB.CommandButton cmdOnOrder + Caption = "OnOrder List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9990 + TabIndex = 43 + ToolTipText = "This Will Display The Outstanding PO's For The Hi-Lited Inventory Item" + Top = 900 + Width = 840 + End + Begin VB.CommandButton cmdAltVend2 + Caption = "Vendor Stock List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 40 + Top = 15 + Width = 1035 + End + Begin VB.CheckBox chkKEEP + Caption = "Keep Search Info" + Height = 210 + Left = 1770 + TabIndex = 38 + Top = 1245 + Value = 1 'Checked + Width = 1680 + End + Begin VB.Timer tmrAltVend + Left = 3375 + Top = 7215 + End + Begin VB.CommandButton cmdAltVendor + Caption = "Vendor Stock #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8355 + TabIndex = 37 + Top = 600 + Visible = 0 'False + Width = 1650 + End + Begin VB.CheckBox chkZero + Caption = "No Zero Qty" + Height = 210 + Left = 3510 + TabIndex = 36 + Top = 1245 + Value = 1 'Checked + Width = 1260 + End + Begin VB.CommandButton cmdMinMax2 + Caption = "Update Order List Min/Max" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 2535 + TabIndex = 30 + Top = 4305 + Width = 1215 + End + Begin VB.CommandButton cmdSales + Caption = "Calc Sales" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 7260 + TabIndex = 29 + Top = 585 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 285 + Left = 5580 + TabIndex = 26 + Top = 660 + Width = 975 + End + Begin VB.TextBox txtEndDate + Height = 285 + Left = 5580 + TabIndex = 25 + Top = 960 + Width = 975 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Order Checklist" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7305 + TabIndex = 24 + Top = 900 + Width = 1050 + End + Begin VB.CommandButton cmdMINMAX + Caption = "Update Inv List - MIN/MAX && Type" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8370 + TabIndex = 23 + Top = 900 + Width = 1620 + End + Begin VB.CommandButton cmdLabel + Caption = "Setup BC Labels" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 480 + Left = 10830 + TabIndex = 21 + Top = 975 + Width = 1035 + End + Begin VB.ComboBox cboSortOrder + Height = 315 + ItemData = "frmPO.frx":06F9 + Left = 1920 + List = "frmPO.frx":070C + Style = 2 'Dropdown List + TabIndex = 20 + Top = 240 + Width = 1755 + End + Begin MSComDlg.CommonDialog cdPO + Left = 3855 + Top = 7185 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin Crystal.CrystalReport crPO + Left = 2865 + Top = 7185 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtOrderQty + Alignment = 1 'Right Justify + Height = 285 + Left = 9975 + TabIndex = 16 + Tag = """OrderQty""" + Top = 5130 + Width = 795 + End + Begin VB.TextBox txtEndSelect + Height = 285 + Left = 5580 + TabIndex = 8 + Top = 360 + Width = 4845 + End + Begin VB.TextBox txtBegSelect + Height = 285 + Left = 5580 + TabIndex = 7 + Top = 60 + Width = 4845 + End + Begin VB.ComboBox cboSort + Height = 315 + ItemData = "frmPO.frx":0749 + Left = 45 + List = "frmPO.frx":075F + Style = 2 'Dropdown List + TabIndex = 3 + Top = 240 + Width = 1755 + End + Begin LpLib.fpList lstInventory + Height = 2535 + Left = 90 + TabIndex = 0 + Top = 1470 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 4471 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 21 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 2 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 450 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":07A9 + End + Begin LpLib.fpList lstProcess + Height = 2040 + Left = 90 + TabIndex = 50 + Top = 5445 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 16 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":11B2 + End + Begin LpLib.fpCombo cboVendor + Height = 315 + Left = 3750 + TabIndex = 41 + Top = 240 + Visible = 0 'False + Width = 5730 + _Version = 196608 + _ExtentX = 10107 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPO.frx":1A84 + End + Begin LpLib.fpList lstCompare + Height = 780 + Left = 90 + TabIndex = 52 + Top = 7800 + Width = 11715 + _Version = 196608 + _ExtentX = 20664 + _ExtentY = 1376 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Courier New" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 8454143 + ForeColor = -2147483640 + Columns = 8 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":20DB + End + Begin VB.TextBox txtSearch + Height = 285 + Left = 60 + TabIndex = 5 + Top = 840 + Width = 2520 + End + Begin VB.Label lblMessage + BackColor = &H0000FFFF& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 270 + Left = 75 + TabIndex = 54 + Top = 4005 + Visible = 0 'False + Width = 11670 + End + Begin VB.Label lblWait + Alignment = 2 'Center + BackColor = &H00FF0000& + Caption = "Please Wait" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H0000FFFF& + Height = 645 + Left = 2580 + TabIndex = 31 + Top = 615 + Visible = 0 'False + Width = 1800 + End + Begin VB.Label lblSelectVend + Caption = "Select Vendor and Press ENTER to Complete PO" + Height = 240 + Left = 3720 + TabIndex = 42 + Top = 0 + Visible = 0 'False + Width = 6045 + End + Begin VB.Label lblTest + BeginProperty Font + Name = "Arial" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 720 + Left = 90 + TabIndex = 39 + Top = 4350 + Width = 2250 + End + Begin VB.Label txtPOTotal + Height = 195 + Left = 10665 + TabIndex = 35 + Top = 7545 + Width = 1065 + End + Begin VB.Label lblPOTotalAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated PO Total:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8895 + TabIndex = 34 + Top = 7545 + Width = 1710 + End + Begin VB.Label lblWeight + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "TTL Weight" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6780 + TabIndex = 33 + Top = 7545 + Width = 1020 + End + Begin VB.Label txtWeight + Alignment = 2 'Center + Height = 195 + Left = 7890 + TabIndex = 32 + Top = 7545 + Width = 975 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Date:" + Height = 195 + Left = 4560 + TabIndex = 28 + Top = 1020 + Width = 930 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Date:" + Height = 195 + Left = 4380 + TabIndex = 27 + Top = 720 + Width = 1140 + End + Begin VB.Label lblUser + Caption = "User: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3150 + TabIndex = 22 + Top = 885 + Width = 1185 + End + Begin VB.Label lblSort2 + Caption = "Sort Field - Order List" + Height = 255 + Left = 1920 + TabIndex = 19 + Top = 0 + Width = 1635 + End + Begin VB.Label lblSort1 + Caption = "Sort Field - Inventory" + Height = 240 + Left = 0 + TabIndex = 18 + Top = 0 + Width = 1635 + End + Begin VB.Label lblOrderHold + Height = 315 + Left = 11490 + TabIndex = 17 + Top = 3945 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Qty:" + Height = 195 + Left = 9180 + TabIndex = 15 + Top = 5145 + Width = 720 + End + Begin VB.Label lblShowDesc + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 4560 + TabIndex = 14 + Top = 5115 + Width = 4515 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 3660 + TabIndex = 13 + Top = 5145 + Width = 840 + End + Begin VB.Label lblStock + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 255 + Left = 1860 + TabIndex = 12 + Top = 5115 + Width = 1755 + End + Begin VB.Label lblStockNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stock #:" + Height = 195 + Left = 1170 + TabIndex = 11 + Top = 5115 + Width = 615 + End + Begin VB.Label lblEndSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Selection: " + Height = 195 + Left = 4245 + TabIndex = 10 + Top = 420 + Width = 1290 + End + Begin VB.Label lblBegSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Selection: " + Height = 195 + Left = 4035 + TabIndex = 9 + Top = 120 + Width = 1500 + End + Begin VB.Label lblSearch + Caption = "Enter Stock Number to Find" + Height = 255 + Left = 60 + TabIndex = 6 + Top = 600 + Width = 3075 + End + Begin VB.Label lblSort + Caption = "Sort Field - Inventory" + Height = 255 + Left = 60 + TabIndex = 4 + Top = 0 + Width = 1635 + End + Begin VB.Label lblProcess + AutoSize = -1 'True + Caption = "Order List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 15 + TabIndex = 2 + Top = 5130 + Width = 840 + End + Begin VB.Label lblCMS + AutoSize = -1 'True + Caption = "CMS Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 1 + Top = 1260 + Width = 1620 + End + Begin VB.Menu mnuSelect + Caption = "Set Selection" + Begin VB.Menu mnuBegin + Caption = "Beginning Selection" + End + Begin VB.Menu mnuEnding + Caption = "Ending Selection" + End + Begin VB.Menu mnuBegDate + Caption = "Beginning Date" + End + Begin VB.Menu mnuEndDate + Caption = "Ending Date" + End + End + Begin VB.Menu mnuPartial + Caption = "Select By Criteria" + Begin VB.Menu mnuMinMax + Caption = "Select by Min/Max" + End + Begin VB.Menu mnuPOSSales + Caption = "Select by POS Sales" + End + Begin VB.Menu mnuSelAll + Caption = "Select ALL For 1 Vendor" + End + End + Begin VB.Menu mnuCreate2 + Caption = "Create PO" + End + Begin VB.Menu mnuClear + Caption = "c&Lear" + End + Begin VB.Menu mnuReports + Caption = "&Reports" + End + Begin VB.Menu cmdOpenPO + Caption = "Open PO List" + End + Begin VB.Menu mnuImport + Caption = "Import Electronic Invoices" + Begin VB.Menu mnuCPet + Caption = "Central Pet" + End + Begin VB.Menu mnuSunburst + Caption = "Sunburst Pet" + Visible = 0 'False + End + Begin VB.Menu mnuTVet + Caption = "Thompson Vet" + End + Begin VB.Menu mnuLextron + Caption = "Lextron" + Visible = 0 'False + End + Begin VB.Menu mnuPurina1 + Caption = "Purina (Land O Lakes)" + End + Begin VB.Menu mnuPurina2 + Caption = "Purina (CSV Detail Old)" + End + Begin VB.Menu mnuPurina + Caption = "Purina (CSV Detail 2016)" + End + Begin VB.Menu mnuEagle + Caption = "Eagle - Create PO" + Visible = 0 'False + End + End + Begin VB.Menu cmdImpCMS + Caption = "Import CMS PO's" + Visible = 0 'False + End + Begin VB.Menu mnuLabels + Caption = "Labels" + End + Begin VB.Menu mnuUpdate + Caption = "Update" + Begin VB.Menu mnuUpVendor + Caption = "Primary Vendor" + End + Begin VB.Menu mnuUpDesc + Caption = "Description" + End + Begin VB.Menu mnuUpWgt + Caption = "Weight" + End + Begin VB.Menu mnuUpCase + Caption = "Units in a Case" + End + End + Begin VB.Menu mnuAddInv + Caption = "Add Inventory" + Begin VB.Menu mnuAddV + Caption = "Add From Vendor" + End + Begin VB.Menu mnuAddS + Caption = "Add From Another Store" + End + End + Begin VB.Menu mnuExit + Caption = "E&Xit" + End + Begin VB.Menu mnuHelp + Caption = "&Help" + End +End +Attribute VB_Name = "frmPO" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim moRSPOList As Recordset, moRSUpdate As Recordset, moRSAV As Recordset +Dim moRSPOHeader As Recordset, moRSPODetail As Recordset +Dim mstrBEGDATE As String, mstrENDDATE As String, mboolCTRLO As Boolean +Dim mstrCUSTOMER As String * 20, mintYN As String +'Dim mstrVSTOCK As String, mstrAVENDOR As String, mstrSTOCK As String +Dim mstrVSTOCK As String * 20, mstrAVENDOR As String * 20, mstrSTOCK As String * 20 +Dim mstrADDVStock As String, mintBOOKMARK3 As Integer, mstrNSTOCK As String * 20 +Dim mstrLine As String, strCode As String, strCompany As String +Dim mstrName As String, strCUST As String, strVend As String, strTYPE As String +Dim mstrCP_PO As String, mstrDATE As String, mstrTABLE As String +Dim mstrALIAS As String, mboolALIASFOUND As Boolean, mstrOldVendor As String +Dim mstrVENDOR As String, mboolNOVSTOCK As Boolean, mintBOOKMARK2 As Integer +Dim mstrDESC As String, mintBOOKMARK As Integer, mlngCOUNT As Long, mintBOOKMARK5 As Integer +Dim mdblQORDER As Double, mboolALL As Boolean, mstrVFIND As String * 20 +Dim mbytSort As Byte, mintBOOKMARK12 As Integer, mintBOOKMARK13 As Integer +Dim mintCnt1 As Integer, mintCnt2 As Integer +Dim mdteBegin As Date, mdteEnd As Date +Dim mstrN_LPD, mstrN_Desc, mstrN_LC, mstrN_RTL, mstrN_VND, mstrN_VS As String, mstrFStock As String +Dim mstrS_LPD, mstrS_Desc, mstrS_LC, mstrS_RTL, mstrS_VND, mstrS_VS As String ', mstrStore1 As String +Dim mstrT_LPD, mstrT_Desc, mstrT_LC, mstrT_RTL, mstrT_VND, mstrT_VS As String ', mstrStore2 As String +Dim mstrN_LM, mstrN_LY, mstrN_YA, mstrN_ICLM, mstrN_ICLY, mstrN_ICYA As String +Dim mstrS_LM, mstrS_LY, mstrS_YA, mstrS_ICLM, mstrS_ICLY, mstrS_ICYA As String +Dim mstrT_LM, mstrT_LY, mstrT_YA, mstrT_ICLM, mstrT_ICLY, mstrT_ICYA As String +Dim mstrT_TY, mstrN_TY, mstrS_TY As String + +'vbDefaultButton2 + +Private Sub InventoryLoad() +Dim oSTATUS As Long, oRSAV As Recordset, strSQLAV As String +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + mintCnt1 = mintCnt1 + 1 + +' mdteBegin = Now +' Label1 = mdteBegin + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If rc = r4success Then +' If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + lngSTDCST = d4field(db, "IN_STDCST") + strTYPE = f4str(lngType) + strName = f4str(lngNAME) + mstrSTOCK = UCase(Field2Str(strName)) + strCUST = f4str(lngCUST) + strVend = f4str(lngVEND) + mstrAVENDOR = Field2Str(strVend) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) +' If Mid$(strCUST, 1, 7) = "Dobbins" Then + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT +' End If + strCSQty = f4str(lngCSQty) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + + .AddItem RTrim$(strName) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVend) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + strWeight = "" + End With + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + MsgBox "No Inventory Items Were Found", vbInformation + vbOKOnly, "No Inventory" + End If + lstInventory.SortState = SortStateActiveReSort + +' mdteEnd = Now +' Label2 = mdteEnd +' If gstrLOGIN = "DWW" Then +' Label1.Visible = True +' Label2.Visible = True +' Else +' Label1.Visible = False +' Label2.Visible = False +' End If +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadInventory() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim intYN As Integer, strMSG As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngCUST = d4field(db, "IN_DES") + strCUST = f4str(lngCUST) + If IsNull(strCUST) Or IsNull(txtSearch) Or txtSearch = "" Then + intYN = 0 + Else + intYN = InStr(1, UCase(Trim(strCUST)), UCase(Trim(txtSearch))) ', vbTextCompare) + End If + If intYN > 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + ' lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngSTDCST = d4field(db, "IN_STDCST") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + strTYPE = f4str(lngType) + strName = f4str(lngNAME) + ' strCUST = f4str(lngCUST) + strVend = f4str(lngVEND) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT + strCSQty = f4str(lngCSQty) + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + .AddItem RTrim$(strName) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVend) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + End With + End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + strMSG = "No Inventory Items Were Found Matching The" + strMSG = strMSG & vbCrLf & " Information You Entered" + MsgBox strMSG, vbInformation + vbOKOnly, "Nothing Matches" + End If + lstInventory.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 +Dim lngPVENDOR As Long, strPVENDOR As String +Dim lngBUYCON As Long, dblBUYCON As Double, lngWEIGHT As Long, dblWEIGHT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrAVENDOR = Field2Str(oRS!VENDOR) +' Call GETALTVEND + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + mstrSTOCK = UCase(Field2Str(oRS!VStock)) + mstrVSTOCK = Field2Str(oRS!VStock) + + Call GetALIAS + If mboolALIASFOUND = False Then + mstrSTOCK = UCase(Field2Str(oRS!inv_no)) + Call GetALIAS2 + Else + oRS!inv_no = Field2Str(mstrALIAS) + oRS.Update + End If + + If Not mboolALIASFOUND Then + Call GETAVINFO2 + strFIND = RTrim(mstrSTOCK) + Else + strFIND = Field2Str(mstrALIAS) + End If + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN2") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngPVENDOR = d4field(db, "IN_VENDOR") + strTYPE = f4str(lngType) + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblWEIGHT = f4double(lngWEIGHT) + strPVENDOR = f4str(lngPVENDOR) + End If + If strName = strFIND Then + oRS!inv_no = strName + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + strSQL = gstrCOMPANY & "INAL" + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strName + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + + strSQL = gstrCOMPANY & "INAL" + + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strName + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + +'************** Need to make this look up a corrected description and fix it. If the record needs to be updated, then +'************** be sure to also pickup last cost + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM tblPODetail WHERE POID = " & poid & " and LineNo = " & xxxx + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = UCase(oRS!StockNo) + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + strTYPE = f4str(lngType) + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + End If + If strName = strFIND Then + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module UpdateStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectAllLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim strSELECT As String +Dim oRS As Recordset + +'TAG4 pointers +Dim lngCustTag As Long + +' On Error GoTo Error_EH + On Error Resume Next + + aTabs(0) = 100 + aTabs(1) = 120 + aTabs(2) = 200 + + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + lngRET = SendMessage(lstInventory.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) +' strSQLL = cboARCode.Text + rc = d4top(db) + +' lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then +' lngRECORD = d4field(db, "AR_CODE") +' strCode = f4str(lngRECORD) +' If strCode = strSQLL Then + With oRS + .AddNew + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") +' strTYPE = f4str(lngTYPE) +' strNAME = f4str(lngNAME) +' strCUST = f4str(lngCUST) + !inv_no = f4str(lngNAME) + !Description = f4str(lngCUST) + !VENDOR = f4str(lngVEND) + !Type = f4str(lngType) + !OnHand = f4double(lngONHAND) + !User = gstrLOGIN + .Update +' .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) + End With +' End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectAllLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVend As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then '1 + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then '2 + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVend = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) +' If dblMAX > 0 And Not chkZero Then +' If dblMAX > 0 And chkZero Then + If dblMAX > 0 Then '3 + If cboSort.ListIndex = 0 Then '4 + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then '5 + + If dblALLTOTAL <= dblMIN Then ' 6 + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Or mboolALL Then '7 + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If +' End If +' If dblMAX > 0 And Not chkZero Then + ElseIf cboSort.ListIndex = 1 Then '4 + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If THIS MAY NOT BE CORRECT +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 2 Then '4 +' If Not chkZero And dblOrder > 0 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVend) >= Trim$(strBEG2) And Trim$(strVend) <= Trim$(strEND2) Then '5 + +' If dblALLTOTAL <= dblMIN Then + If chkZero = vbUnchecked Then '6 +' If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + End If '7 + + If dblOrder < 0 Then + dblOrder = 0 + End If + + +' If Not chkZero Then '7 +' If Not chkZero And dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '6 +' If chkZero Then + + If chkZero = vbChecked And dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + + End If '6 +' End If + End If '5 +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 3 Then '4 + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 + End If '4 + End If '3 + End If '2 + + rc = d4skip(db, 1) + Loop While rc = r4success +' End If '2 + End If '1 + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoadHold() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVend As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVend = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + If dblOrder > 0 Or mboolALL Then + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 1 Then + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 2 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVend) >= Trim$(strBEG2) And Trim$(strVend) <= Trim$(strEND2) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then + intREM = dblOrder Mod dblBUYCON + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 3 Then + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + End If + + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSearch_Click() +'Multiple character search code. + lstInventory.SearchText = txtSearch.Text + + lstInventory.SearchMethod = 2 + lstInventory.SearchIndex = -1 + lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub cboSort_Click() +Dim intMIN As Integer + + On Error Resume Next + mintCnt2 = mintCnt2 + 1 + lblCount2 = mintCnt2 + mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex + cboSortOrder.ListIndex = 4 + + If cboSort.ListIndex = 0 Then +' If mbytSort <> cbolistindex Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 0 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 0 + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Stock # Search Information:" + + ElseIf cboSort.ListIndex = 1 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 1 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.Caption = "Enter Description Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 2 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 2 + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Vendor Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 3 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 3 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Product Type Search Information:" + ElseIf cboSort.ListIndex = 5 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 16 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.Caption = "Enter Vendor Stock Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 4 Then + Call LoadInventory +' txtSearch.SetFocus + End If + mbytSort = cboSort.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub cboSortOrder_Click() + + On Error Resume Next + + If cboSortOrder.ListIndex = 0 Then + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 8 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + ElseIf cboSortOrder.ListIndex = 1 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + ElseIf cboSortOrder.ListIndex = 2 Then + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + txtSearch = "" + lblSearch.Caption = "Enter Vendor Search Information:" + txtSearch.SetFocus + ElseIf cboSortOrder.ListIndex = 3 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + + ElseIf cboSortOrder.ListIndex = 4 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeInteger + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + End If + +End Sub + +'Private Sub cmdCalc_Click() +' Screen.MousePointer = vbHourglass +' If lblBegDate2.caption = "" Then +' MsgBox "No Dates Set, No Calculations Will Process", vbOKOnly, "No Calculation" +' Exit Sub +' End If +' lblMessage.Visible = True +' lblMessage.caption = "Calculating -- Be Patient" +' DoEvents +' Call InvProcess +' lblMessage.Visible = False +' MsgBox "Calculation Complete", vbOKOnly, "Done" +' Screen.MousePointer = vbDefault +'End Sub + +Private Sub cmdClear_Click() +Dim strSQL As String + +' strSQL = "UPDATE tblPOList SET User = 'XX'" ' WHERE User = '" & gstrLOGIN & "'" + strSQL = "Delete * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + goConn.Execute strSQL +' strSQL = "DELETE * FROM tblINVUsage" +' goConn.Execute strSQL + Call ClearMiddle + Call Inventory2Load + chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If +End Sub + +Private Sub ClearMiddle() + lblMessage = "" + lblMessage.Visible = False + lblTest = "" + lblStock = "" + lblShowDesc = "" + txtOrderQty = 0 + lstCompare.Clear +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPartial_Click() + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + Call SelectPartialLoad + lblMessage.Visible = False +End Sub + +Private Sub cmdReports_Click() + frmRepList.Show 1 +End Sub + +Private Sub cmdSetEnd_Click() +Dim oRS As Recordset +Dim strSQL As String, strSql2 As String +Dim strINVNO As String, strDESC As String, strVend As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVend = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtEndSelect = strVend + ElseIf cboSort.ListIndex = 3 Then + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetEnd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSetBeg_Click() +Dim oRS As Recordset +Dim strSQL As String, strSql2 As String +Dim strINVNO As String, strDESC As String, strVend As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVend = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtBegSelect = strINVNO + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtBegSelect = strDESC + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtBegSelect = strVend + txtEndSelect = strVend + ElseIf cboSort.ListIndex = 3 Then + txtBegSelect = strTYPE + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetBeg_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFixDesc_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFile As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + + +' cdPO.CancelError = True + mstrDESC = InputBox("Enter The Updated Description (45 Char Max)", "New Description", strDESC) + If mstrDESC = "" Then + MsgBox "Description Was Not Changed", vbInformation + vbOKOnly, "No Change" + Exit Sub + Else + mstrDESC = Mid(mstrDESC, 1, 45) + End If + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "IN_DES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) +'******** Update INMAT File + strFile = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "INMXDES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On + +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdFixDesc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboVendor_KeyPress(KeyAscii As Integer) +Dim strControl As String + strControl = Me.ActiveControl.Name + + If KeyAscii = 13 Then + KeyCode = vbTab + KeyAscii = 0 + + cboVendor.SetFocus + cboVendor.col = 1 + gstrVENDOR = cboVendor.ColText + Call mnuCreate_Click + + End If + + If strControl = "cboVendor" Then + If KeyAscii = 27 Then + KeyAscii = 0 + + lblSelectVend.Visible = False + cboVendor.Visible = False + + + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If +End Sub + +Private Sub cmdAlias_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Changing Alias Information - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmAlias.Show 1 + + +End Sub + +Private Sub cmdAltVend2_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + + gboolALTVEND = True + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + gstrSTOCK = strVSTOCK + frmVendAlt2.Show 1 + gstrSTOCK = "" + Call Inventory2Load + +End Sub + +Private Sub cmdAltVendor_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + strVENDOR = InputBox("Enter The Vendor NUMBER for the Vendor Stock Number", "Vendor Number") + strVENDOR = UCase(strVENDOR) + If Trim(strVENDOR) = "" Then + MsgBox "You Must Enter A Vendor Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVSTOCK") +' mstrAVENDOR = "LEX500 " + mstrSTOCK2 = strVSTOCK + strVENDOR +' mstrSTOCK2 = mstrSTOCK + "LEX500 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK2) + + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If Trim(strSTOCK) = Trim(strVSTOCK) Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVSTOCK") + strVend = f4str(lngVEND) + If Trim(strVend) = Trim(strVENDOR) Then + mstrNSTOCK = f4str(lngVSTOCK) + cboSort.ListIndex = 0 + txtSearch = Trim(mstrNSTOCK) + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdAltVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAPAR_Click() + frmAPAR.Show 1 +End Sub + +Private Sub cmdImpCMS_Click() + frmPOImp.Show +End Sub + +Private Sub cmdMinMax_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim strMIN As String, strMAX As String, strTType As String +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFile As String, strCATNBR As String, strUDF01 As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstInventory.col = 0 + strSTOCK = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblMIN = Field2Str2(lstInventory.ColText) + lstInventory.col = 5 + dblMAX = Field2Str2(lstInventory.ColText) + +' dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + strMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + If strMIN = "" Then + MsgBox "MIN Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMIN) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMIN = Field2Str2(strMIN) + End If +' dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + strMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + If strMAX = "" Then + MsgBox "MAX Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMAX) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMAX = Field2Str2(strMAX) + End If + strCATNBR = "M" + strUDF01 = "N" + strTType = InputBox("Enter The New Type if Desired", "Type", strTYPE) + If strTType = "" Then + MsgBox "TYPE Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + strTYPE = strTType + mintBOOKMARK = lstInventory.ListIndex + + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") + lngCATNBR = d4field(db4, "IN_CATNBR") + lngUDF01 = d4field(db4, "IN_FIELD01") + lngType = d4field(db4, "IN_TYPE") + lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) + Call f4assign(lngCATNBR, strCATNBR) + Call f4assign(lngUDF01, strUDF01) + Call f4assign(lngType, strTYPE) + Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + + strFile = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngType = d4field(db4, "INMXTYPE") + Call f4assign(lngType, strTYPE) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMinMax2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFile As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWait.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWait.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdType2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFile As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWait.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWait.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdType2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOnOrder_Click() + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + + frmOnOrder.Show 1 +End Sub + +Private Sub cmdOpenPO_Click() +' chkNoDisplay = vbUnchecked + frmPOOpen.Show 1 +' chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If + Call Inventory2Load +' chkNoDisplay = vbChecked + lstProcess.ListIndex = 0 + +End Sub + +Private Sub cmdTest_Click() + frmInvAdd2.Show 1 +End Sub + +Private Sub cmdSunburst_Click() +Dim xlInvoice As Excel.Application +Dim strSBFile As String + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strSBFile = cdPO.FileName + + Set xlInvoice = Excel.Workbooks.Item(strSBFile) + +End Sub + +Private Sub cmdPrint_Click() +Dim intYN As Integer, intYN2 As Integer, strFile As String +Dim intYN3 As Integer, strMSG As String, intYN4 As Integer, intYN5 As Integer +Dim intYN6 As Integer + + On Error GoTo Error_EH + + intYN3 = 0 + intYN = 0 + intYN2 = 0 + intYN4 = 0 + intYN5 = 0 +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 + + strMSG = "Answer YES to Print Checklist by Stock #" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN3 = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Stock #") +' intYN3 = MsgBox("Do You Want To Print A CheckList by Stock #", vbQuestion + vbYesNo, "Print Checklist") + If intYN3 = vbNo Then + strMSG = "Answer YES to Print Checklist by Description" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Description") +' intYN = MsgBox("Do You Want To Print A CheckList by Description", vbYesNo, "Print Checklist") + End If +' If intYN = vbNo Then + If intYN = vbNo And intYN3 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN4 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Stock #") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Description Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN5 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Description") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo And intYN5 = vbNo Then + strMSG = "Answer YES to Print A Checklist With Barcodes in Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO To Exit Without Printing Anything" + intYN6 = MsgBox(strMSG, vbQuestion + vbYesNo, "Barcodes by Stock No.") + End If +' End If +' If intYN5 = vbNo Then +' Exit Sub +' End If + + If intYN3 = vbYes Then + strFile = "\POCheckSTK.rpt" + End If + If intYN = vbYes Then + strFile = "\POCheckDESC.rpt" + End If + If intYN4 = vbYes Then + strFile = "\POCheckNoZero.rpt" + End If + If intYN5 = vbYes Then + strFile = "\POCheckNoZeroD.rpt" +' ElseIf intYN5 = vbNo Then +' Exit Sub + End If + If intYN6 = vbYes Then + strFile = "\POCheckCP.rpt" + ElseIf intYN6 = vbNo Then + Exit Sub + End If + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + crPO.ReportFileName = App.Path & strFile + crPO.GroupSelectionFormula = "{tblPOlist.User}= '" & gstrLOGIN & "'" +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPromo_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Promo Detail - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmPromo.Show 1 + +End Sub + +Private Sub cmdSales_Click() + frmInvUsed.Show 1 + Call Inventory2Load +End Sub + +Private Sub cmdTest2_Click() + frmInvAdd2.Show 1 + Call Inventory2Load + +End Sub + +Private Sub lstInventory_Click() + +'Dim intTEST As Integer + +' intTEST = lstInventory.ListIndex + +' lblCount1 = mintCnt1 +' lblCount2 = mintCnt2 + +' DoEvents +' lblTest = intTEST +' inttext = lstInventory.ListIndex +' mintBOOKMARK12 = lstInventory.ListIndex ' = mintbookmark12 +End Sub + +Private Sub mnuAddInvO_Click() + Call cmdTest_Click + Call Inventory2Load +End Sub + +Private Sub mnuAddS_Click() + + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmInvStore.Show 1 + Call Inventory2Load +End Sub + +Private Sub mnuAddV_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + Call mnuAddInvO_Click +End Sub + +Private Sub mnuCreate2_Click() + lblBegSelect.Visible = False + lblEndSelect.Visible = False + txtEndSelect.Visible = False + txtBegSelect.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + cboVendor.Action = 6 + Call VendLoad + lblSelectVend.Visible = True + cboVendor.Visible = True + cboVendor.SetFocus +End Sub + +Private Sub VendLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCITY As String, strVend As String, strPHONE As String, strFAX As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCITY As Long, lngVEND As Long, lngPHONE As Long, lngFAX As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "APMSD" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + cboVendor.Clear + cboVendor.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngRECORD = d4field(db, "AP_FIELD01") + strCode = Trim(f4str(lngRECORD)) + If strCode = "Y" Then + With cboVendor + lngNAME = d4field(db, "AP_NAME") + lngVEND = d4field(db, "AP_VENDOR") + strName = f4str(lngNAME) + strVend = f4str(lngVEND) + .AddItem "A" & vbTab & strVend & vbTab & strName '& vbTab & strCITY & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + End With + End If + End If + rc = d4skip(db, 1) + oSTATUS = rc + Loop While rc = r4success + End If + + rc = d4close(db) + + cboVendor.SortState = SortStateActiveReSort + If cboVendor.ListCount Then + cboVendor.ListIndex = 0 + Else + MsgBox "No Vendors Were Found", vbInformation + vbOKOnly, "No Vendors" + End If +' cboVendor.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module VendLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuHelp_Click() +Dim strMSG As String + +' strMSG = "Ctrl-O = Show A List Of All Purchases For The Highlited Item" & vbCrLf +' strMSG = strMSG & " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = strMSG & " F5 = Reload The Inventory List (Will Update Any Changes Made" & vbCrLf + strMSG = strMSG & "F11 = Move The Highlite Line To The Same Place As The Before The Last Action" & vbCrLf + strMSG = strMSG & "Ctrl-G = Show A List Of All Vendors For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-K = Set Order Qty To Zero For All Items In The PO List (Must ReEnter" & vbCrLf + strMSG = strMSG & "Ctrl-D = Display A List Of Every PO That The Highlited Item Was Deleted" & vbCrLf + strMSG = strMSG & "Ctrl-H = Update The Cost For The Highlighted Item In The Order List" & vbCrLf + strMSG = strMSG & "Ctrl-O = Display A List Of Every PO That Was Placed For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-U = ReCalc The OnOrder Amount For The Item That Is Higlighted In The CMS Inventory List" & vbCrLf + strMSG = strMSG + + MsgBox strMSG, vbOKOnly, "Information Screen" +End Sub + +Private Sub mnuRenumber_Click() + frmInvtry3.Show 1 +End Sub + +Private Sub mnuUpDesc_Click() + Call cmdFixDesc_Click +End Sub + +Private Sub F5On() + lblWait.Caption = "Press F5 To Show Updates" + lblWait.Visible = True + DoEvents +End Sub + +Private Sub F5Off() + lblWait.Visible = False + lblWait.Caption = "Please Wait" + DoEvents +End Sub + +Private Sub cmdUpVendor_Click() +Dim ARCode As Long, oSTATUS As Long, lngVENDOR As Long +Dim strSQL As String, strFile As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strVENDOR As String, dblALIAS As Double + + On Error GoTo Error_EH + + frmVendor.Show 1 +' DoEvents + mstrSTOCK = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "IN_VENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + strFile = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdUpVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + + +End Sub + +Private Sub mnuUpWgt_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFile As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Package Weight For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD07") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpWgt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuUpCase_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFile As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Units Per Case For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFile = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFile) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD08") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 +' On Error Resume Next +' DoEvents + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpCase" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +' mnuRenumber.Visible = False + If gstrLOGIN = "DWW" Then + frmPO.WindowState = 0 + frmPO.Left = 2 + frmPO.Top = 2 + frmPO.Height = 9600 + frmPO.Width = 12000 + cmdAPAR.Visible = True +' mnuRenumber.Visible = True + End If + If gstrLOGIN = "KLB" Then + chkByDesc = vbChecked + Else + chkByDesc = vbUnchecked + End If + If gstrLOGIN = "CCP" Then + cmdAPAR.Visible = True + End If +' If chkNoDisplay = vbUnchecked Then +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +' End If + If gboolInvList Then + chkHistory = vbChecked + Else + chkHistory = vbUnchecked + End If + frmPO.lblUser = "User: " & gstrLOGIN + +' txtBegSelect = "" +' frmPO.Width = 12000 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) +Dim strControl As String + + strControl = frmPO.ActiveControl.Name +' If Screen.ActiveControl <> "cboVendor" Then + If strControl <> "cboVendor" Then +' If frmPO.ActiveControl <> frmPO.cboVendor Then + If KeyAscii = 27 Then + KeyAscii = 0 + Unload Me + End If + End If + +End Sub + +Private Sub Form_Load() +Dim strSQL As String, strAV As String + mboolALIASFOUND = False +' frmPO.Height = 8760 + + strAV = "SELECT * FROM tblAV ORDER BY StockNo, Vendor" + Set moRSAV = New Recordset + moRSAV.Open strAV, goConn, adOpenDynamic, adLockOptimistic + + mintCnt1 = 0 + mintCnt2 = 0 + lblCount1 = mintCnt1 + lblCount2 = mintCnt2 + + Call InventoryLoad + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set moRSPOList = New Recordset + moRSPOList.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + cboSort.ListIndex = gbytPOSort +' cboSort.ListIndex = 0 + If moRSPOList.RecordCount > 0 Then + Call Inventory2Load + End If + frmPO.Caption = frmPO.Caption & " -- " & gstrCOMPANY & " -- " & gstrLOGIN + frmPO.Width = 12000 + frmPO.Height = 9600 + If gstrLOGIN = "DWW" Then +' cmdPromo.Visible = True +' mnuAddInv.Visible = True + Else +' mnuAddInv.Visible = False + End If + mbytSort = cboSort.ListIndex +' If gboolConn3Bad Then +' MsgBox "History Files From All Stores Are Not Available - Call Darv", vbOKOnly, "No History" +' End If +' mnuAddInv +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strSql2 As String +Dim strINVNO As String, strDESC As String, strVend As String +Dim strTYPE As String, dblONHAND As Double +Dim dblMIN As Double, dblMAX As Double, dblAVAILABLE As Double +Dim dblOrder As Double, intYN As Integer, strMSG As String, intWHOLE As Integer +Dim dblLASTCOST As Double, dblRETAIL1 As Double, dblBUYCON As Double, intREM As Integer +Dim dblONORDER As Double, dblALLTOTAL As Double, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim strWeight As String, strONHAND As String, dblSTDCST As Double + + + On Error Resume Next + intYN = vbYes + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVend = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblMIN = lstInventory.ColText + lstInventory.col = 5 + dblMAX = lstInventory.ColText + lstInventory.col = 6 + dblAVAILABLE = lstInventory.ColText + lstInventory.col = 10 + dblONORDER = lstInventory.ColText + lstInventory.col = 11 + dblWEIGHT = lstInventory.ColText + strWeight = lstInventory.ColText +' strWeight = dblWEIGHT + dblALLTOTAL = dblONORDER + dblAVAILABLE + If dblALLTOTAL < dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + Else + dblOrder = 0 + End If + + lstInventory.col = 7 + dblLASTCOST = lstInventory.ColText + lstInventory.col = 8 + dblRETAIL1 = lstInventory.ColText + lstInventory.col = 9 + dblBUYCON = lstInventory.ColText + intREM = dblOrder Mod dblBUYCON + lstInventory.col = 13 + strLOrder = lstInventory.ColText + lstInventory.col = 14 + strLPur = lstInventory.ColText + lstInventory.col = 15 + strLSALE = lstInventory.ColText + lstInventory.col = 18 + strONHAND = lstInventory.ColText + lstInventory.col = 19 + dblSTDCST = lstInventory.ColText + + If NoDups2("tblPOList", "Inv_No", strINVNO, gstrLOGIN) Then +' intWHOLE = 0 + + Else + MsgBox "You Already Have This Item in This PO", vbCritical + vbOKOnly, "Duplicate Item" + Exit Sub + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON 'THis makes the order be in full cases/bundles + End If + + If dblOrder <= 0 Then + strMSG = "The Hi-Lited Stock Item Has An Order Quantity Of Zero Or Less" + strMSG = strMSG & Chr(10) & "Do You Want To Order Anyway?" + + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Order Zero or Less") + End If + If intYN = vbYes Then + moRSPOList.AddNew + moRSPOList!inv_no = Field2Str(strINVNO) + moRSPOList!Description = Field2Str(strDESC) + moRSPOList!VENDOR = Field2Str(strVend) + moRSPOList!Type = Field2Str(strTYPE) + moRSPOList!Min = dblMIN + moRSPOList!Max = dblMAX + moRSPOList!OnOrder = dblONORDER + moRSPOList!Available = dblALLTOTAL +' moRSPOList!Available = dblAVAILABLE + moRSPOList!Order = dblOrder + moRSPOList!OnHand = strONHAND + moRSPOList!LastCost = dblLASTCOST + moRSPOList!Retail1 = dblRETAIL1 + moRSPOList!Weight = dblWEIGHT + moRSPOList!User = gstrLOGIN + moRSPOList!LastOrder = strLOrder + moRSPOList!LastPurchase = strLPur + moRSPOList!LastSale = strLSALE + moRSPOList!StdCost = dblSTDCST + moRSPOList.Update + End If + + Call Inventory2Load + lstProcess.ListIndex = lstProcess.ListCount - 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Inventory2Load() +Dim oSTATUS As Long +Dim oRS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long, dblTotalWgt As Double, dblPOTotal As Double +Dim intYN As Integer, strYN As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lstProcess.Clear + lstProcess.SortState = SortStateSuspend + Do Until oRS.EOF +' intYN = Field2CheckBox(oRS!FixAV) +' If intYN = vbChecked Then +' strYN = "UV" +' Else +' strYN = " " +' End If + lstProcess.AddItem Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!Description) & vbTab & Field2Str(oRS!VENDOR) & vbTab & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!Min) & vbTab & Field2Str(oRS!Max) & vbTab & Field2Str(oRS!Available) & vbTab & Field2Str(oRS!Order) & vbTab & Field2Str(oRS!LastCost) & vbTab & Field2Str(oRS!ListID) & vbTab & Field2Str2(oRS!Weight) & vbTab & Field2Str(oRS!LastOrder) & vbTab & Field2Str(oRS!LastPurchase) & vbTab & Field2Str(oRS!LastSale) & vbTab & Format(Field2Str(oRS!Retail1), "#,#0.00") & vbTab & Format(Field2Str(oRS!StdCost), "#,#0.00") + dblTotalWgt = dblTotalWgt + (Field2Str2(oRS!Weight) * Field2Str2(oRS!Order)) + dblPOTotal = dblPOTotal + (Field2Str2(oRS!Order) * Field2Str(oRS!LastCost)) + oRS.MoveNext + Loop +' End If + + oRS.Close + +' If lstProcess.ListCount Then +' lstProcess.ListIndex = 0 +' End If + lstProcess.SortState = SortStateActiveReSort + txtWeight = Format(dblTotalWgt, "#,#") + txtPOTotal = Format(dblPOTotal, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module Inventory2Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer, intBOOKMARK9 As Integer +Dim strSQL As String, oRS As Recordset, intORDER As Integer +Dim boolPOLIST As Boolean, boolPOOrder As Boolean, strNNCOST As String +Dim strNCOST As String, oRSF As Recordset, strSQLF As String, lngListID As Long +Dim strSTDCST As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyF11 Then ' Display key combinations. + lstInventory.ListIndex = mintBOOKMARK12 + lstProcess.ListIndex = mintBOOKMARK13 + End If + + If KeyCode = vbKeyF5 Then ' Display key combinations. + Call F5Off + mintBOOKMARK12 = lstInventory.ListIndex + lblWait.Caption = "Reloading Inventory" + lblWait.Visible = True + DoEvents + Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK12 + lblWait.Visible = False + lblWait.Caption = "Please Wait" + End If + + If KeyCode = vbKeyF12 Then ' Display key combinations. +' If CtrlDown Then +' If gbytSECURITY <> 2 Then +' If gstrLOGIN = "DWW" Then + lstInventory.col = 17 + gstrIMAGE = Trim$(lstInventory.ColText) + If Len(gstrIMAGE) > 0 Then + frmImage.Show 1 + Else + MsgBox "No Image File Is Available", vbOKOnly, "No Image" + Exit Sub + End If + +' Call cmdTest_Click +' Call Inventory2Load +' Call UpdatePRList +' End If +' End If + Exit Sub + End If + + If KeyCode = vbKeyQ Then ' Same as adding inventory from another store. + If CtrlDown Then +' If gbytSECURITY <> 2 Then + If gstrLOGIN = "DWW" Then +' Call cmdTest_Click + frmInvStore.Show 1 + Call Inventory2Load +' Call UpdatePRList + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyG Then ' And gbytSECURITY < 3 Then ' Display Alternate Vendors + If CtrlDown Then + txtOrderQty.SetFocus + DoEvents + mintBOOKMARK3 = lstInventory.ListIndex + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + lstInventory.col = 0 + gstrSTOCK = CStr(lstInventory.ColText) + lstInventory.col = 1 + gstrDESC = CStr(lstInventory.ColText) + lstInventory.SortState = SortStateSuspend + frmVendAlt.Show 1 +' Call InventoryLoad + lstInventory.SortState = SortStateActive + lstInventory.ListIndex = mintBOOKMARK3 + KeyCode = vbKeyF5 + DoEvents + KeyCode = vbKeyF11 + DoEvents + End If + Exit Sub + End If + + If KeyCode = vbKeyO Then ' And gbytSECURITY < 3 Then ' Show where the highlited items has been purchased + +' If chkNoDisplay = vbUnchecked Then +' chkNoDisplay = vbChecked +' End If + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + If CtrlDown Then + If chkHistory = vbChecked Then + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + lstInventory.col = 9 + gstrAVAIL = lstInventory.ColText + lstInventory.col = 10 + gstrOrderAmt = lstInventory.ColText + lstInventory.col = 19 + gdblSTDCST = lstInventory.ColText + intBOOKMARK9 = lstInventory.ListIndex + frmOnOrder2.Show 1 + lstInventory.ListIndex = intBOOKMARK9 + Else + lstProcess.col = 0 + gstrONORDER = lstProcess.ColText + lstProcess.col = 1 + gstrDESC = lstProcess.ColText + lstProcess.col = 2 + gstrVENDOR = lstProcess.ColText + intBOOKMARK9 = lstProcess.ListIndex + frmOnOrder2.Show 1 + lstProcess.ListIndex = intBOOKMARK9 + End If + End If +' lstInventory.ListIndex = mintBOOKMARK12 + KeyCode = vbKeyF11 + DoEvents + Exit Sub + End If + +' If KeyCode = vbKeyL Then ' And gbytSECURITY < 3 Then ' Display key combinations. + +' If CtrlDown Then +' lstProcess.Col = 0 +' gstrONORDER = lstProcess.ColText +' lstProcess.Col = 1 +' gstrDESC = lstProcess.ColText +' lstProcess.Col = 2 +' gstrVENDOR = lstProcess.ColText +' intBOOKMARK9 = lstProcess.ListIndex +' mintBOOKMARK5 = lstInventory.ListIndex +' frmOnOrder2.Show 1 +' lstProcess.ListIndex = intBOOKMARK9 +' lstInventory.ListIndex = mintBOOKMARK5 +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyD Then ' And gbytSECURITY < 3 Then ' Show items deleted + If CtrlDown Then + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK5 = lstInventory.ListIndex + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + mintBOOKMARK5 = lstInventory.ListIndex + frmOnOrder3.Show 1 + lstInventory.ListIndex = mintBOOKMARK5 + End If + KeyCode = vbKeyF11 + Exit Sub + End If + + If KeyCode = vbKeyK Then ' Changes the Order QTY to 0 - Must reEnter the Desired Qty + If CtrlDown Then +' strSQL = "UPDATE tblPOList SET Order = 0" 'WHERE User = '" & gstrLOGIN & "'" +' goConn.Execute strSQL + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF +' intORDER = Field2Str2(oRS!Order) + oRS!Order = 0 + oRS.Update + oRS.MoveNext + Loop + Call Inventory2Load + lstProcess.ListIndex = 0 + End If + Exit Sub + End If + + If KeyCode = vbKeyA Then + If CtrlDown Then + + End If + End If + + If KeyCode = vbKeyW Then + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.col = 8 + strNCOST = lstProcess.ColText + lstProcess.col = 9 + lngListID = Field2Str2(lstProcess.ColText) + lstProcess.col = 15 + strSTDCST = Field2Str2(lstProcess.ColText) + If strSTDCST = "0" Then + MsgBox "BuyIn Price Cannot Be Zero", vbOKOnly, "Price = 0" + Exit Sub + End If +' strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) +' If strNCOST = "" Then +' MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" +' Exit Sub +' End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strSTDCST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + + End If + End If + If KeyCode = vbKeyH Then '** UpDate the Last Cost for the highlighted item + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.col = 8 + strNCOST = lstProcess.ColText + lstProcess.col = 9 + lngListID = Field2Str2(lstProcess.ColText) + strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) + If strNCOST = "" Then + MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" + Exit Sub + End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strNCOST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + End If + End If + + If KeyCode = vbKeyU Then 'UPdates The On Order Amount for the highlited item + If CtrlDown Then + If lstInventory.ListIndex = -1 Then + MsgBox "Select An Item From The Inventry List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstInventory.ListIndex + lblWait.Visible = True + lblWait.Caption = "ReCalculate On Order" + DoEvents + Call ChgONOrder + Call FixONOrder + lstInventory.Refresh + lblWait.Visible = False + lblWait.Caption = "Please Wait" + lstInventory.ListIndex = mintBOOKMARK12 + End If + End If + End If + +End Sub + +Private Sub lstProcess_Click() +Dim oRS As Recordset, oRSU As Recordset, strSQLL As String, strTIP2 As String, strTIP As String +Dim strSQL As String, strSTOCK As String, strDESC As String, dblQTY As Double, strNA As String +Dim strLOrder As String, strLPur As String, strLSALE As String ' strNA As String +Dim sglSTDCST As Single + + lstCompare.Clear + lstHistory.Clear +' lstProcess.TextTipDelay = 50 + lstProcess.col = 0 + mstrFStock = lstProcess.ColText + lstProcess.col = 9 + strSTOCK = lstProcess.ColText + lblMessage = "" + lblMessage.Visible = False + lblTest = "" +' strSTOCK = lstProcess.ColText + strNA = "N/A" + + If strSTOCK <> "" Then + strSQL = "SELECT * FROM tblPOList WHERE ListID = " & strSTOCK ' & """" + + Set moRSUpdate = New Recordset + moRSUpdate.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lblStock = moRSUpdate!inv_no + lblShowDesc = moRSUpdate!Description + txtOrderQty = moRSUpdate!Order + lblOrderHold = moRSUpdate!Order + strLOrder = Field2Str(moRSUpdate!LastOrder) + strLOrder = Format(strLOrder, "####/##/##") + strLPur = Field2Str(moRSUpdate!LastPurchase) + strLPur = Format(strLPur, "####/##/##") + strLSALE = Field2Str(moRSUpdate!LastSale) + strLSALE = Format(strLSALE, "####/##/##") + sglSTDCST = Field2Str2(moRSUpdate!StdCost) + sglSTDCST = Format(sglSTDCST, "#,#0.00") + lblTest = "Last Order - " & Trim(strLOrder) & vbCrLf + lblTest = lblTest & "Last Purchase - " & Trim(strLPur) & vbCrLf + lblTest = lblTest & "Last Sale - " & Trim(strLSALE) & vbCrLf + If sglSTDCST > 0 Then + lblTest = lblTest & "Buyin Amt - " & Format(sglSTDCST, "#,#0.00") + End If +' lblTest = lblTest & "Std Cost - " & sglSTDCST + +' If Not gboolConn3Bad Then + Call GetTSSHist + Call GetAFNHist + Call GetAFSHist +' Else +' MsgBox "History Files From All Store Not Available - Call Darv", vbOKOnly, "No History" +' End If + + If gstrCOMPANY = "TSS" Then + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFN" Then + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFS" Then + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + End If + +' lblMessage.Visible = True +' lblMessage = strTIP + If lstProcess.ListCount <> 0 Then + If gstrCOMPANY = "TSS" Then +' If Not gboolConn3Bad Then + Call GetAFN + Call GetAFS +' Else + +' End If + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + End If + + If gstrCOMPANY = "AFN" Then + Call GetTSS + Call GetAFS + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + + End If + + If gstrCOMPANY = "AFS" Then + Call GetAFN + Call GetTSS + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + End If + End If + +' lstProcess.ToolTipText = strTIP2 + mintBOOKMARK2 = lstProcess.ListIndex + txtOrderQty.SetFocus + + End If +End Sub + +Private Sub lstProcess_DblClick() +Dim strSQL As String, strINVNO As String +Dim oRS As Recordset, intBookmark As Integer + lblMessage.Visible = False + lblTest = "" + txtOrderQty = "" + lstProcess.col = 0 + strINVNO = lstProcess.ColText + intBookmark = lstProcess.ListIndex + +' strSQL = "SELECT * FROM tblPOList WHERE Inv_No = '" & Trim(strINVNO) & "'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then + moRSUpdate.Delete +' End If + Call Inventory2Load + If intBookmark >= lstProcess.ListCount Then + intBookmark = lstProcess.ListCount - 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus +End Sub + +Private Sub cmdSetDate_Click() +Dim strMSG As String, intYN As Integer +Dim strBegDate As String +Dim strEndDate As String +Dim intMonth As Integer, intYear As Integer + + strMSG = "Enter the beginning date for Inventory Calculations (MM/DD/YYYY)" + lblBegDate.Visible = True + lblEndDate.Visible = True + lblBegDate2.Visible = True + lblEndDate2.Visible = True + lblBegDate2 = "" + lblEndDate2 = "" + intMonth = Month(Date) + intYear = Year(Date) + intYN = MsgBox("Do You Want To Set The Dates At The Last 30 Days?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBegDate = Date - 30 + strEndDate = Date + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Fiscal Year (Oct-Sep)?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + If intMonth >= 10 Then + strBegDate = "10/01/" & Trim(Str(intYear - 1)) & "" + strEndDate = "09/30/" & Trim(Str(intYear)) & "" + Else + strBegDate = "10/01/" & Trim(Str(intYear - 2)) & "" + strEndDate = "09/30/" & Trim(Str(intYear - 1)) & "" + End If + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Year?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBegDate = Date - 365 + strEndDate = Date + GoTo FixDate + End If + strBegDate = InputBox(strMSG, "Beginning Date") + If IsDate(strBegDate) Then + + Else + If Len(strBegDate) > 0 Then + strBegDate = Format(strBegDate, "00/00/####") + If Not IsDate(strBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Inventory Calculations (MM/DD/YYYY)" + strEndDate = InputBox(strMSG, "Ending Date") + + If IsDate(strEndDate) Then + + Else + If Len(strEndDate) > 0 Then + strEndDate = Format(strEndDate, "00/00/####") + If Not IsDate(strEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If +FixDate: + lblBegDate2 = strBegDate + lblEndDate2 = strEndDate + mstrBEGDATE = Year(strBegDate) & "/" & Format(Month(strBegDate), "00") & "/" & Format(Day(strBegDate), "00") + mstrENDDATE = Year(strEndDate) & "/" & Format(Month(strEndDate), "00") & "/" & Format(Day(strEndDate), "00") + strEndDate = "" +End Sub + +Private Sub mnuBegDate_Click() +Dim strMSG As String, intYN As Integer, intYN2 As Index, intYN3 As Integer + + intYN = MsgBox("Do You Want The Last Week", vbQuestion + vbYesNo) + + If intYN = vbYes Then + txtBegDate = Date - 8 + txtEndDate = Date - 1 + End If + strMSG = "Enter the beginning date for Purchase Order Calculations (MM/DD/YYYY)" + txtBegDate = InputBox(strMSG, "Beginning Date", txtBegDate) + + If IsDate(txtBegDate) Then + + Else + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Purchase Order Calculations (MM/DD/YYYY)" + + txtEndDate = InputBox(strMSG, "Ending Date", txtEndDate) + If IsDate(txtEndDate) Then + + Else + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +End Sub + +Private Sub mnuBegin_Click() + Call cmdSetBeg_Click +End Sub + +Private Sub mnuClear_Click() + Call cmdClear_Click +End Sub + +Private Sub mnuCPet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFile As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFile = cdPO.FileName + + mstrDATE = InputBox("Enter The Central Pet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CEN500" +' !VENDOR = "CENTPET" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CENTPET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then +' mstrVENDOR = "CENTPET" + mstrVENDOR = "CEN500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CENTPET" + End If + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuTVet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFile As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFile = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + If strCKStock = "" Then + strCKStock = strCKVStock + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "THOMVET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "THOMVET" + End If + Call GetStock + Call TVPO +' Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuTVet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuEagle_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFile As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strInv_No As String, strV_Stock As String +Dim intLength As Integer, boolINVOICE As Boolean, boolDATE As Boolean +Dim strINVOICE As String, strINVDATE As String +Dim strTEST1 As String, strTEST2 As String, strTEST3 As String, strTEST4 As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + + boolINVOICE = False + boolDATE = False + + strSQL = "DELETE * FROM tblEagle" + goConn.Execute strSQL + + cdPO.Action = 1 + strFile = cdPO.FileName + + mstrDATE = InputBox("Enter The Eagle Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 + strSQL = "SELECT * FROM tblEagle ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + intLength = Len(strINPUT) + If intLength = 73 Then 'And Not boolINVOICE Then + strTEST4 = Mid(strINPUT, 1, 7) + If strTEST4 = "Cargill" Then + strINVOICE = Field2Str(Trim$(Mid(strINPUT, 64, 10))) + boolINVOICE = True + End If + End If + If intLength = 77 And Not boolDATE Then + strINVDATE = Field2Str(Trim$(Mid(strINPUT, 70, 8))) + boolDATE = True + End If + If intLength = 79 Then + strTEST1 = Mid(strINPUT, 1, 8) + strTEST2 = Mid(strINPUT, 77, 3) + strTEST3 = Mid(strINPUT, 35, 5) + If Not (strTEST1 = "Customer" Or strTEST1 = " Please ") Then 'Or Not strTEST2 = "LBS" Then + If Not strTEST2 = "LBS" Then + If Not strTEST3 = "STORE" Then + ' If Not Mid(strINPUT, 1, 8) = "Customer" Or Not Mid(strINPUT, 77, 3) = "LBS" Then + intSTART = 18 + With moRSInv + intAUX = 0 + intTAB = 10 'InStr(intSTART, strINPUT, Chr(9)) + strV_Stock = Field2Str(Trim$(Mid(strINPUT, intSTART, intTAB))) + If Trim(strV_Stock) <> "FS" Then + .AddNew + !VStock = strV_Stock + !VDesc = Field2Str(Trim$(Mid(strINPUT, 28, 25))) + intSTART = 1 + intTAB = 11 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = 53 'intSTART + intTAB + 1 + intTAB = 12 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !invoice = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CAR400" + + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CARGANI" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = strINVDATE + .Update + + End If + End With + End If + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblEagle" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "CAR400" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CARGANI" + End If + Call GetStock + Call EAPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form PO - Module ImportEagle" + Call ErrorHandler2 + gstrMODULE = "" +End Sub + +Private Sub EAPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + +' On Error GoTo Error_EH + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblEagle" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!invoice + + + Do Until oRS.EOF + strINVOICE = oRS!invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = oRS!lineno + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = Trim(Field2Str(oRS!inv_no)) + moRSPODetail!vstockno = oRS!VStock + moRSPODetail!Desc = Trim(oRS!Description) + strTEST = Left(Trim(oRS!Description), 4) +' moRSPODetail!qty = dblQORDER + moRSPODetail!qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!Weight = Field2Str2(oRS!Weight) + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!nextpo + glngPO = lngNextPO + oRSS!nextpo = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "CAR400" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "CAR400" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CARGANI" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "CARGANI" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "ANDREW" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module EAPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuLabels_Click() + frmLabels.Show 1 +End Sub + +Private Sub mnuLextron_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFile As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblLextron" + goConn.Execute strSQL + + cdPO.Action = 1 + strFile = cdPO.FileName + + mstrDATE = InputBox("Enter The Lextron Invoice Date MM/DD/YYYY", "Invoice Date", Date) + strPONUM = InputBox("Enter the Orginal PO Number", "PO Number") + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblLextron ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT +' If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, 10))) + intSTART = 14 + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, 30))) + intSTART = 56 + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, 6))) + intSTART = 61 + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, 9))) + intSTART = 70 + !lineno = intLINENO + intLINENO = intLINENO + 1 + !VENDOR = "LEX500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblLextron" + Call GetStock + Call LEXPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + Close #1 +End Sub + +Private Sub mnuCreate_Click() +Dim intYN As Integer, intYN2 As Integer, strFile As String, intYN3 As Integer +Dim intOK As Integer, intOK2 As Integer, strMSG As String + + On Error GoTo Error_EH + + gstrMODULE = "Point 1 " +' lstInventory.SetFocus + Call POCreate + gstrMODULE = gstrMODULE & "Point 2 " + If mintYN = vbNo Then + Exit Sub + End If + gstrMODULE = gstrMODULE & "Point 3 " +' If gstrLOGIN = "DWW" Then + If gboolPOPrint Then + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton2, "Print PO") ', , vbDefaultButton2) + Else + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton1, "Print PO") ', , vbDefaultButton2) + End If +' intYN = MsgBox("Do You Want To Print A PO Now", vbYesNo, "Print PO", , vbDefaultButton2) + If intYN = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 ' &H40 + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + intYN3 = MsgBox("Do You Want To Use Vendor Stock #'s", vbYesNo, "Use Vendor Stock") + If intYN3 = vbYes Then +' If Not chkByDesc Then + If chkByDesc = vbUnchecked Then + strFile = "\POVend.rpt" + Else + strFile = "\POVDesc.rpt" + End If + Else + If chkByDesc = vbUnchecked Then + strFile = "\PO.rpt" + Else + strFile = "\PODesc.rpt" + End If + End If + crPO.ReportFileName = App.Path & strFile + crPO.GroupSelectionFormula = "{tblPOHeader.PONum}=" & glngPO +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 ' &H40 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 + End If + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form PO - Module mnuCreate" + Call ErrorHandler2 + gstrMODULE = "" +' Close #1 +End Sub + +Private Sub mnuEnding_Click() + Call cmdSetEnd_Click + +End Sub + +Private Sub mnuExit_Click() + Unload Me +End Sub + +Private Sub mnuMinMax_Click() + mboolALL = False + +' strMSG = "Do You Want To Update CMS OnOrder Amount Before Creating The New PO?" +' strMSG = strMSG & Chr(10) & "This May Take As Long As 2 Minutes To Run" +' intOK = MsgBox(strMSG, vbYesNo, "Update ONORDER") +' If intOK = vbYes Then +' Call cmdZeroOnOrd_Click +' Call cmdReCalc_Click +' ElseIf intOK = vbNo Then + +' End If + + Call cmdPartial_Click +End Sub + +Private Sub mnuPOSSales_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" + strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad2 + Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub mnuSelALL_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Then 'Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select ALL For 1 Vendor Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" +' strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad3 +' Call SelectPartialLoad2 +' Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub CalcSales2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVend As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strSTOCK As String, strDate As String +Dim strYEAR As String, strMONTH As String, strDAY As String, strBDATE As String +Dim strMSG As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + gboolVEND = True + + frmVendor.Show 1 + +' On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = Field2Str(oRS!inv_no) + strYEAR = Format(Year(txtBegDate), "0000") + strMONTH = Format(Month(txtBegDate), "00") + strDAY = Format(Day(txtBegDate), "00") + strBDATE = strYEAR + strMONTH + strDAY +' strDATE = txtBegDate + strSTOCK = mstrSTOCK + strBDATE + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strSTOCK) +' db = d4open(cb, fPath + strSQL) + +' rc = d4top(db) + +' lstInventory.SortState = SortStateSuspend +' If d4top(db) = r4success Then + +' Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVend = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + ' If dblAVAIL <= dblMIN Then + ' dblOrder = dblMAX - dblAVAIL '**************** + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + ' dblOrder = intWHOLE + End If + If dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !Available = dblALLTOTAL + ' !Available = dblAVAIL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + rc = d4skip(db, 1) + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(25), Chr(34), "") +''' test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) +''' dblQTY = Replace(strG(28), Chr(34), "") + dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If +''' strDESC = Replace(strG(26), Chr(34), "") + strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(37), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then +'' strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" +'' Set oRSS = New Recordset +'' oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock +'' If Not oRSS.EOF Then +'' strDiscCost = Replace(strF(3), Chr(34), "") +'' strNET = Mid$(strDiscCost, 1, 8) +'' If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) +'' bytLEN = Len(strDiscCost) +'' bytLEN2 = bytLEN - 8 +'' dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) +'' oRSS!Cost = Round(dblDCost, 4) +' oRS.Save +'' oRSS.Update +'' End If +'' End If +'' End If 'May Need To Comment Out + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina2_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") +'''' test0 = Replace(strF(25), Chr(34), "") + test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) + dblQTY = Replace(strG(28), Chr(34), "") +'''' dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strG(26), Chr(34), "") +'''' strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(36), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then + + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina1_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") + strSTOCK = Replace(strF(2), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" +' oRS!VENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) + bytLEN = Len(strDiscCost) + bytLEN2 = bytLEN - 8 + dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" +' mstrVENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina0126_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then + strCELL = Replace(strF(3), Chr(34), "") + strSTOCK = Mid$(strCELL, 1, 12) + strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then + dblDCost = Field2Str2(Right$(strDiscCost, 13)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub PurninaHold() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + If ExcelOpen() Then + ' Add New WorkBook + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) ' & "\JHDPrice.xls") + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If oRS.EOF Then + End If + ' Load data into Excel + intRow = 1 + Do Until boolCHECK +' Do Until strCHECK = "TLR10" +' Do Until boolSTOP + strTYPE = Trim$(.Cells(intRow, 1).Value) + If strTYPE = "HDR10" Then + strINVOICE = Trim$(.Cells(intRow, 6).Value) +' intRow = intRow + 1 + ElseIf strTYPE = "DTL10" Then + lngQTY = Round((.Cells(intRow, 5).Value), 0) + If lngQTY > 0 Then + strCELL = Trim$(.Cells(intRow, 4).Value) + strSTOCK = Mid$(strCELL, 1, 14) + strDESC = Mid$(strCELL, 16, 30) + dblCost = Round((.Cells(intRow, 6).Value), 4) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!invoice = strINVOICE + oRS.Update + + End If + End If + intRow = intRow + 1 + strCHECK = .Cells(intRow, 1).Value + If strCHECK = "TLR10" Then + intCHECK = 1 + End If + If strCHECK = "" And intCHECK = 1 Then + intCHECK = 2 + ElseIf strCHECK = "" And intCHECK = 2 Then + boolCHECK = True + ElseIf strCHECK = "HDR10" And intCHECK = 2 Then + intCHECK = 0 + End If + Loop + End With + oRS.Close + End If + goExcel.Quit + + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuReports_Click() + Call cmdReports_Click +End Sub + +Private Sub mnuThomp2_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFile As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFile = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFile For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !inv_no = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) +' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Order = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Cost = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Invoice = "" + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + Else + !VENDOR = "THOMVET" + End If + +' !VENDOR = "THO500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + Else + mstrVENDOR = "THOMVET" + End If +' mstrVENDOR = "THO500" + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuThomp" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuUpVendor_Click() + Call cmdUpVendor_Click +End Sub + +Private Sub txtBegSelect_GotFocus() + txtBegSelect.SelStart = 0 + txtBegSelect.SelLength = 1000 +End Sub + +Private Sub txtEndSelect_GotFocus() + txtEndSelect.SelStart = 0 + txtEndSelect.SelLength = 1000 +End Sub + +Private Sub txtOrderQty_Click() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + txtOrderQty.SetFocus +End Sub + +Private Sub txtOrderQty_GotFocus() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + +End Sub + +Private Sub txtOrderQty_KeyPress(KeyAscii As Integer) +Dim intBookmark As Integer + + If KeyAscii = vbKeyReturn Then +' MsgBox "THis is a test" + If txtOrderQty <> lblOrderHold Then + intBookmark = lstProcess.ListIndex + If IsNumeric(txtOrderQty) Then + moRSUpdate!Order = (txtOrderQty) + Else + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid Number" + moRSUpdate!Order = 0 + txtOrderQty.SetFocus + Exit Sub +' moRSUpdate!Order = 0 + End If + moRSUpdate.Update + txtOrderQty = "" + lblOrderHold = "" + Call Inventory2Load + If mintBOOKMARK2 >= lstProcess.ListCount - 1 Then + intBookmark = lstProcess.ListCount - 1 + Else + intBookmark = intBookmark + 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + Else + lstProcess.ListIndex = lstProcess.ListIndex + 1 +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + End If + End If +' txtOrderQty.SetFocus +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstInventory.SearchText = txtSearch.Text +lstInventory.SearchMethod = 2 +lstInventory.Action = ActionSearch +lstInventory.SearchIndex = -1 +lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_GotFocus() + txtSearch.SelStart = 0 + txtSearch.SelLength = 1000 +End Sub + +Private Sub POCreate() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Long +Dim lngPOID As Long, strORDERDATE As String, strDueDate As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngAdd1 As Long +Dim lngAdd2 As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long, lngSTOCK As Long, lngONORDER As Long +Dim lngTTLWEIGHT As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strAdd2 As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String, dblCALCONORDER As Double +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double, dblONORDER As Double +Dim lngONHAND As Long, dblONHAND As Double, strBUYER As String +Dim dblEXT As Double, dblQORDER As Double, dblQCost As Double, strONHAND As String +Dim lngDueCtl As Long, lngDueDay As Long, lngDisCtl As Long, lngDisDay As Long +Dim lngDUECTL2 As Long, lngDUEDAY2 As Long, lngDISCTL2 As Long, lngDISDAY2 As Long +Dim lngAPCODE As Long, strAPCODE As String, intYNNote As Integer +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long, lngPOS As Long +Dim strYEAR As String, strMONTH2 As String, strDAY As String, strDate As String +Dim lngODATE As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + intYNNote = vbNo + strYEAR = Year(Date) + strMONTH2 = Format(Month(Date), "00") + strDAY = Format(Day(Date), "00") + strDate = strYEAR & strMONTH2 & strDAY + + gstrMODULE = "Before frmVendor.Show" + lngTTLWEIGHT = 0 + mintYN = vbYes +' frmVendorLook.Show 1 +' frmVendor.Show 1 + If gstrVENDOR = "" Then + MsgBox "No Vendor Selected", vbCritical + vbOKOnly, "No PO Created" + mintYN = vbNo + Exit Sub + End If +' On Error GoTo Error_EH + strORDERDATE = InputBox("Enter The PO Order Date", "PO Order Date", Date) + + gstrMODULE = "Point 1 " + If IsDate(strORDERDATE) Then + + Else +' lngPOS = InStr(1, strOrderDate, "/", 1) +' If lngPOS = 0 Then + If Len(strORDERDATE) > 0 Then + strORDERDATE = Format(strORDERDATE, "00/00/####") + If Not IsDate(strORDERDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strDueDate = InputBox("Enter the Due Date for the PO", "PO Due Date", (Date + 1)) + + If IsDate(strDueDate) Then + + Else + If Len(strDueDate) > 0 Then + strDueDate = Format(strDueDate, "00/00/####") + If Not IsDate(strDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strBUYER = InputBox("Enter The Name Of The Person Creating The PO", "Buyer's Name", "This is Required") + If strBUYER = "This is Required" Or Trim$(strBUYER) = "" Then + MsgBox "You have entered an invalid Buyer -- NO PO WILL BE CREATED", vbCritical + vbOKOnly + mintYN = vbNo + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + Else + intYNNote = MsgBox("Do You Want To Add Notes To This PO?", vbYesNo + vbDefaultButton2, "Add Notes?") + + + End If + strBUYER = UCase(strBUYER) + gstrMODULE = "Point 2 " + + cb = code4init + lngPOLineNum = 1 + + strSQL = "Select * FROM tblProgInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = Field2Str2(oRS!nextpo) + glngPO = lngNextPO + oRS!nextpo = lngNextPO + 1 + oRS.Update + + strVENDOR = gstrVENDOR + + strSQL = "SELECT * FROM tblPOHeader" + + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + '******* + strSQL = gstrCOMPANY & "APMSD" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "AP_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR) + gstrMODULE = "Point 3 " + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngVEND = d4field(db, "AP_VENDOR") + lngNAME = d4field(db, "AP_NAME") + lngAdd1 = d4field(db, "AP_ADDR1") + lngAdd2 = d4field(db, "AP_ADDR2") + lngCITY = d4field(db, "AP_CITY") + lngState = d4field(db, "AP_STATE") + lngZIP = d4field(db, "AP_ZIP") + lngPHONE = d4field(db, "AP_PHONE") + lngFAX = d4field(db, "AP_FAX") + lngAPCODE = d4field(db, "AP_CODE") + lngDueCtl = d4field(db, "AP_DUECTL") + lngDisCtl = d4field(db, "AP_DISCTL") + lngDueDay = d4field(db, "AP_DUEDAY") + lngDisDay = d4field(db, "AP_DISDAY") + + strVend = Field2Str(f4str(lngVEND)) + strName = f4str(lngNAME) + strAdd1 = f4str(lngAdd1) + strAdd2 = f4str(lngAdd2) + strCITY = f4str(lngCITY) + strState = f4str(lngState) + strZIP = f4str(lngZIP) + strPHONE = f4str(lngPHONE) + strFAX = f4str(lngFAX) + strAPCODE = f4str(lngAPCODE) + lngDUECTL2 = f4long(lngDueCtl) + lngDISCTL2 = f4long(lngDisCtl) + lngDUEDAY2 = f4long(lngDueDay) + lngDISDAY2 = f4long(lngDisDay) + + moRSPOHeader.AddNew + moRSPOHeader!ponum = lngNextPO +' moRSPOHeader!VendorID = Trim(gstrVENDOR) + moRSPOHeader!vendorid = Trim(strVend) + moRSPOHeader!vendorname = Trim(strName) + moRSPOHeader!vaddress1 = Trim(strAdd1) + moRSPOHeader!vaddress2 = Trim(strAdd2) + moRSPOHeader!vcity = Trim(strCITY) + moRSPOHeader!vstate = Trim(strState) + moRSPOHeader!vzip = Trim(strZIP) + moRSPOHeader!VPhone = Trim(strPHONE) + moRSPOHeader!VFAX = Trim(strFAX) + moRSPOHeader!OrderDate = strORDERDATE + moRSPOHeader!duedate = strDueDate + moRSPOHeader!Buyer = strBUYER + moRSPOHeader!duectl = lngDUECTL2 + moRSPOHeader!disctl = lngDISCTL2 + moRSPOHeader!dueday = lngDUEDAY2 + moRSPOHeader!disday = lngDISDAY2 + moRSPOHeader!CreateID = gstrLOGIN + If Trim(strAPCODE) = "ACC" Then + moRSPOHeader!CCard = vbChecked + Else + moRSPOHeader!CCard = vbUnchecked + End If + moRSPOHeader.Update + End If +'' End If + rc = d4close(db) + + strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & lngNextPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + mstrAVENDOR = moRSPOHeader!vendorid + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + gstrMODULE = "Point 4 " + Do Until oRS.EOF +'************** + mstrSTOCK = Trim(oRS!inv_no) + strSQL = gstrCOMPANY & "INMAS" + gstrMODULE = "Point 5 " + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngODATE = d4field(db, "IN_LSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDate) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDate) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + '************** + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + If Field2Str2(oRS!Order) > 0 Then + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + ' mstrSTOCK = Trim(oRS!Inv_No) + ' If oRS!new = 1 Then + If oRS!New = True Then + moRSPODetail!vstockno = Field2Str(oRS!VStock) + ElseIf Len(Field2Str(oRS!VStock)) > 0 Then '***** This may need to be removed if it causes PO to not have a vendor stock number + moRSPODetail!vstockno = Field2Str(oRS!VStock) + Else + Call GETAVINFO + mstrADDVStock = Trim(mstrVSTOCK) + If Len(mstrADDVStock) = 20 Then + mstrADDVStock = "" + End If + moRSPODetail!vstockno = mstrADDVStock + End If + ' If Len(mstrADDVStock) = 20 Then + ' mstrADDVStock = "" + ' End If + ' moRSPODetail!vstockno = mstrADDVStock + moRSPODetail!Desc = Trim(oRS!Description) + moRSPODetail!BalQty = Field2Str2(oRS!Order) + moRSPODetail!qty = Field2Str2(oRS!Order) + moRSPODetail!Cost = Field2Str2(oRS!LastCost) + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!Min = Field2Str2(oRS!Min) + moRSPODetail!Max = Field2Str2(oRS!Max) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!Add = oRS!New + ' moRSPODetail!Available = dblONORDER + moRSPODetail!CreateID = gstrLOGIN + moRSPODetail!PVendor = Field2Str(oRS!VENDOR) + moRSPODetail!StdCost = Field2Str2(oRS!StdCost) + moRSPODetail.Update + lngTTLWEIGHT = lngTTLWEIGHT + (Field2Str2(oRS!Order) * Field2Str2(oRS!Weight)) + End If + oRS.MoveNext + gstrMODULE = "Point 7 " + + Loop + + If intYNNote = vbYes Then + gboolNoteADD = True + frmPONotes.Show 1 + End If + + If glngPONID > 0 Then + moRSPOHeader!PONoteFlag = vbChecked + moRSPOHeader!PONID = glngPONID + moRSPOHeader.Update + End If + gstrMODULE = "Point 8 " + moRSPOHeader!TTLWEIGHT = lngTTLWEIGHT + moRSPOHeader!DetailLines = lngPOLineNum - 1 + + moRSPOHeader.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module POCreate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CPPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!invoice + + Do Until oRS.EOF + + strINVOICE = oRS!invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!nextpo + glngPO = lngNextPO + oRSS!nextpo = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CEN500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "CEN500" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "JOE" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CENTPET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "CENTPET" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "ERIC" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub TVPO() +Dim strSQL As String, oRS As Recordset, strTEST As String +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String + + On Error GoTo Error_EH + + +' GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + strTEST = Field2Str(oRS!VENDOR) + mstrCP_PO = oRS!invoice + GoSub Set_Header + + Do Until oRS.EOF + + strINVOICE = oRS!invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!nextpo + glngPO = lngNextPO + oRSS!nextpo = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module TVPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub GETAVINFO() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVENDOR") + Call d4tagSelect(db, lngCustTag) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc = d4seek(db, strVEND_STOCK) + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVVSTOCK") + strVend = f4str(lngVEND) + If Trim(strVend) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO3() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim oRSAV As Recordset, strSQLAV As String +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO, strTEST As String + + On Error GoTo Error_EH + +' cb = code4init + + strSQLAV = "SELECT * FROM tblAV WHERE STOCKNO = '" & Trim(mstrSTOCK) & "' AND VENDOR = '" & Trim(mstrAVENDOR) & "'" + Set oRSAV = New Recordset + oRSAV.Open strSQLAV, goConn, adOpenDynamic, adLockOptimistic + + + If Not oRSAV.EOF Then + mstrVSTOCK = Trim(Field2Str(oRSAV!VStock)) + Else + mstrVSTOCK = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO4() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db6 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db6, "INAVVENDOR") + Call d4tagSelect(db6, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc6 = d4seek(db6, strVEND_STOCK) + + oSTATUS = d4deleted(db6) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db6, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db6, "INAVVENDOR") + lngVSTOCK = d4field(db6, "INAVVSTOCK") + strVend = f4str(lngVEND) + If Trim(strVend) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc6 = d4close(db6) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuSunburst_Click() + Dim intRow As Integer, boolSTOP As Boolean + Dim strLOCATE As String, strVDESC As String, strVSTOCK As String + Dim sglActQTY As Single, dblCost As Double + Dim oRS As Recordset + Dim strSQL As String, strPATH As String, dblPRICE5 As Double + Dim lngLINENO As Long + + Screen.MousePointer = vbHourglass + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + lngLINENO = 1 +' Call ExcelOpen +' Call ButtonReset + mnuSunburst.Enabled = False +' cmdGroup.Enabled = False +' lblMessage.caption = "Importing Excel Price List -- Please Wait" +' lblMessage.Visible = True + On Error GoTo Error_EH + + boolSTOP = False + If ExcelOpen() Then + ' Add New WorkBook + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblSUNBURST" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblSUNBURST" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' If oRS.EOF Then +' End If + ' Load data into Excel + intRow = 3 + Do Until boolSTOP + strVDESC = Trim$(.Cells(intRow, 7).Value) + strVSTOCK = Trim$(.Cells(intRow, 8).Value) + sglActQTY = (.Cells(intRow, 9).Value) +' sglActQTY = Trim$(.Cells(intRow, 9).value) + dblCost = (.Cells(intRow, 10).Value) + oRS.AddNew + oRS!VStock = strVSTOCK + oRS!VDesc = strVDESC + oRS!Order = sglActQTY + oRS!Cost = dblCost + oRS!VENDOR = "SUN750" + oRS!lineno = lngLINENO + oRS.Update +' End If + intRow = intRow + 1 + If .Cells(intRow, 7).Value = "" Then + boolSTOP = True + End If + lngLINENO = lngLINENO + 1 + Loop + End With + oRS.Close + End If + goExcel.Quit + +' Call ButtonReset + mnuSunburst.Enabled = True +' cmdGroup.Enabled = True +' lblMessage.Visible = False + mstrTABLE = "tblSunburst" + + Call GetStock +' Call CPPO + + Screen.MousePointer = vbDefault + MsgBox "Sunburst Pet Import is Complete", vbInformation + vbOKOnly, "Import Complete" + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuSunburst" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LEXPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblLextron" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + Do Until oRS.EOF + + strINVOICE = Field2Str(oRS!invoice) + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) +' mstrSTOCK = Trim(oRS!inv_no) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!qty = oRS!Order + moRSPODetail!Cost = oRS!Cost + moRSPODetail!ActCost = oRS!Cost + moRSPODetail!ActCostO = oRS!Cost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = oRS!Order + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail.Update + oRS.MoveNext + + Loop + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!nextpo + glngPO = lngNextPO + oRSS!nextpo = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO +' moRSPOHeader!InvoiceNo = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "LEX500" + moRSPOHeader!vendorname = "Lextron Animal Health" + moRSPOHeader!vaddress1 = "C/O Lextron-TEXAN LLP" + moRSPOHeader!vaddress2 = "Department 1305" + moRSPOHeader!vcity = "Denver" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80256" + moRSPOHeader!VPhone = "800 292-5692" + moRSPOHeader!VFAX = "800 411-4412" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "BILL" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 10 + moRSPOHeader.Update + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETALTVEND() +Dim strSQL As String, oRS As Recordset + + strSQL = "SELECT * FROM tblAltVend WHERE Primary = '" & RTrim$(mstrAVENDOR) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrOldVendor = Field2Str(oRS!Secondary) + End If +End Sub + +Private Sub GETAVINFO2() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVend As String, strName As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db3 = d4open(cb, fPath + strSQL) +' lngCustTag = d4tag(db3, "INAVVSTOCK") + lngCustTag = d4tag(db3, "INAVVSTOCK") + + mstrSTOCK2 = mstrVSTOCK ' + mstrAVENDOR +' mstrSTOCK2 = mstrVSTOCK + mstrAVENDOR + + Call d4tagSelect(db3, lngCustTag) + + rc3 = d4seek(db3, mstrSTOCK2) + + + oSTATUS = d4deleted(db3) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db3, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrVSTOCK Then + lngVEND = d4field(db3, "INAVVENDOR") + lngVSTOCK = d4field(db3, "INAVSTOCK") + strVend = f4str(lngVEND) + If Trim(strVend) = Trim(mstrAVENDOR) Or Trim(strVend) = Trim(mstrOldVendor) Then + mstrSTOCK = f4str(lngVSTOCK) + mboolALIASFOUND = True + Else + mstrSTOCK = " " + mboolALIASFOUND = False + End If + End If + End If + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Recieve - Module GETAVINFO2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLabel_Click() +Dim oRS As Recordset +Dim strSQL As String, intCount As Integer +Dim intQTY As Integer, strQTY As String +Dim strINVNO As String, strDESC As String, txtPRICE1 As String + + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 8 + txtPRICE1 = lstInventory.ColText + intCount = 0 + + strQTY = InputBox("How Many Labels Do You Want?", "Label Quantity", 1) + If strQTY = "" Then + MsgBox "Cancel Pressed", vbOKOnly + Exit Sub + End If + intQTY = Field2Str2(strQTY) + If intQTY <= 0 Then + intQTY = 1 + End If + strSQL = "SELECT * FROM tblLABELS2" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until intCount = intQTY + oRS.AddNew + oRS!IN_STOCK = strINVNO + oRS!IN_DESC1 = Field2Str(strDESC) + oRS!IN_USER = gstrLOGIN + oRS!IN_PRICE1 = Format(Field2Str(txtPRICE1), "$#,#.00") + oRS!lbl_qty = 1 + intCount = intCount + 1 + oRS.Update + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form PO - Module cmdLabel" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PURPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, dblBUYCON As Double +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER BY CPID" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + oRS.MoveFirst + + mstrCP_PO = oRS!invoice + + Do Until oRS.EOF + + strINVOICE = oRS!invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = lngPOLineNum + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(Field2Str(oRS!inv_no)) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) + moRSPODetail!vstockno = Field2Str(oRS!VStock) + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(Field2Str(oRS!Description)) + moRSPODetail!qty = Field2Str2(oRS!Order) + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + + Loop + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!nextpo + glngPO = lngNextPO + oRSS!nextpo = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + If mstrVENDOR = "PUR500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!vendorid = "PUR500" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "PURIMIL" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!InvoiceDate = mstrDATE + moRSPOHeader!invoiceno = "" + moRSPOHeader!vendorid = "PURIMIL" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!duedate = mstrDATE + moRSPOHeader!Buyer = "MANAGER" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module PURPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If +' dblONORDER = f4str(lngONORDER) +' strONORDER = Field2Str2(strONORDER) +' dblONORDER = CDbl(strONORDER) + +' dblQORDER = Field2Str2(oRS!Order) + +' dblCALCONORDER = dblONORDER + dblQORDER + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) +' Call f4assign(lngODATE, strDATE) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub UpONOrderHold() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + +' mstrSTOCK = Trim(oRS!Inv_No) + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then +' If strDESC = "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + ' mdblQORDER = Field2Str2(oRS!Order) + ' dblCALCONORDER = dblONORDER - mdblQORDER + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + End If + +End Sub + +Private Sub CalcSales() +Dim strSQL As String, oSTATUS As Long, strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAMOUNT As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngQTY As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strName As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNewDate As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + strSQLL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + gboolVEND = False + + mstrBEGDATE = Year(txtBegDate) & Format(Month(txtBegDate), "00") & Format(Day(txtBegDate), "00") + mstrENDDATE = Year(txtEndDate) & Format(Month(txtEndDate), "00") & Format(Day(txtEndDate), "00") + + Do Until oRS.EOF + mstrCUSTOMER = Field2Str(oRS!inv_no) + + cb = code4init + + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrCUSTOMER) + Do Until rc <> r4success + oSTATUS = d4deleted(db) + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngNAME = d4field(db, "INHICV") + lngDOC = d4field(db, "INHIDOC") + lngINVDATE = d4field(db, "INHIDATE") + lngINVNO = d4field(db, "INHISOURCE") + lngRECORD = d4field(db, "INHIUNIQ") + lngType = d4field(db, "INHITYPE") + lngPRICE = d4field(db, "INHIPRICE") + lngQTY = d4field(db, "INHIQTY") + lngCOST = d4field(db, "INHICOST") + + strDOC = f4str(lngDOC) + strName = f4str(lngNAME) + If strName <> "" Then + If strName <> mstrCUSTNO Then + mstrCUSTNO = "" + mstrCUSTNAME = "" + mstrCUSTOMER2 = strName +' Call CustomerFind + End If + Else + mstrCUSTNO = "" + mstrCUSTNAME = "" + End If + strINVDATE = f4str(lngINVDATE) + strMONTH = date4month(strINVDATE) + Call date4format(strINVDATE, strNewDate, "CCYY/MM/DD") + dblPRICE = f4double(lngPRICE) + RSet strAMOUNT = FormatCurrency(dblPRICE, 2) + strINVNO = f4str(lngINVNO) + lngPSHIREC = f4long(lngRECORD) + dblTYPE = f4double(lngType) + dblQTY = f4double(lngQTY) + dblCost = f4double(lngCOST) + dblTCOST = dblCost + If dblQTY > 0 Then + dblCost = dblCost / dblQTY + End If + RSet strCOST = FormatCurrency(dblCost, 2) + + If dblTYPE = 1 Then + strTYPE = "SUB" + If strINVDATE >= mstrBEGDATE And strINVDATE <= mstrENDDATE Then + If strINVNO = "PS" Or strINVNO = "OE" Or strINVNO = "AG" Then + dblSOLD = dblSOLD + dblQTY + End If + End If +' Else + ' strTYPE = "TRANS" + End If + End If + rc = d4seekNext(db, mstrCUSTOMER) + + Loop + rc = d4close(db) + oRS!Order = dblSOLD + oRS!usage = dblSOLD + If dblSOLD = 0 And chkZero Then + oRS.Delete + Else + oRS.Update + End If + oRS.MoveNext + dblQTY = 0 + dblSOLD = 0 + dblCost = 0 + dblTCOST = 0 + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdImportInv_Click() +Dim ARCode As Long, oSTATUS As Long +Dim lngSTOCKNO As Long, lngQTY As Long, lngDESC As Long +Dim strSTOCKNO As String, dblQTY As Double, strDESC As String +Dim strREGISTER As String, strFIND As String, strVENDOR As String, strVENDOR2 As String * 20 +Dim strSQL As String, strFile As String, strMSG As String +Dim lngLCOST As Long, lngPRICE1 As Long, dblLCOST As Double, dblPRICE1 As Double +Dim lngVEND As Long +Dim lngWEIGHT As Long, dblWEIGHT As Double + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strName As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNewDate As String +Dim dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +Dim strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAMOUNT As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long + + strSQL = "DELETE * FROM tblINMAS" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblINMAS" + Set moRSHAND = New Recordset + moRSHAND.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strVENDOR2 = Trim(txtBegSelect) + strFile = gstrCOMPANY & "INMAS.DBF" + '"IN_VENDOR" + db = d4open(cb, fPath + strFile) + + lngCustTag = d4tag(db, "IN_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR2) +' rc = d4seek(db, strINVSTOCK) + + If rc = r4success Then + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + lngSTOCKNO = d4field(db, "IN_STOCK") + lngQTY = d4field(db, "IN_ONHAND") + lngDESC = d4field(db, "IN_DES") + lngLCOST = d4field(db, "IN_LSCOST") + lngPRICE1 = d4field(db, "IN_PRICE1") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strSTOCKNO = f4str(lngSTOCKNO) + strSTOCKNO = Trim$(strSTOCKNO) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblQTY = f4double(lngQTY) + dblLCOST = f4double(lngLCOST) + dblPRICE1 = f4double(lngPRICE1) + strDESC = f4str(lngDESC) + strVENDOR = f4str(lngVEND) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If Trim$(strVENDOR) = Trim$(txtBegSelect) Then + ' strFIND = "STOCKNO = '" & strSTOCKNO & "'" + moRSHAND.AddNew + moRSHAND!StockNo = Field2Str(strSTOCKNO) + ' If Not moRSHAND.EOF Then + ' moRSHAND!Count = Field2Str2(moRSHAND!Count) + Field2Str2(dblQTY) + moRSHAND!Description = Field2Str(strDESC) + moRSHAND!OnHand = dblQTY + moRSHAND!LCost = dblLCOST + moRSHAND!Price1 = dblPRICE1 + moRSHAND!VENDOR = strVENDOR + moRSHAND!Type = strTYPE + moRSHAND!Min = dblMIN + moRSHAND!Max = dblMAX + moRSHAND!Available = dblAVAIL + moRSHAND!Weight = dblWEIGHT + moRSHAND!User = gstrLOGIN + moRSHAND!LastOrder = strLOrder + moRSHAND!LastPurchase = strLPur + moRSHAND!LastSale = strLSALE + moRSHAND.Update + End If +' End If + End If + rc = d4seekNext(db, strVENDOR2) +' rc = d4skip(db, 1) + Loop While rc = r4success + End If + + '******* Need to look at the logic to see why this is not caclulating correctly + + rc = d4close(db) + moRSHAND.Close + +End Sub + +Private Sub SelectPartialLoad2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVend As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVend = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL +'' !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad3() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVend As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVend = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVend) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL + !Order = 1 + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer + + If cboSort.ListIndex = 4 Then + If KeyCode = vbKeyReturn Then + Call LoadInventory + End If + End If +End Sub + +Private Sub cmdZeroOnOrd_Click() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db7 = d4open(cb, fPath + strSQL) + + rc7 = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "IN_STOCK") + lngCUST = d4field(db7, "IN_DES") + lngONHAND = d4field(db7, "IN_ORDERTE") + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + strSQL = gstrCOMPANY & "INMAT" + db7 = d4open(cb, fPath + strSQL) + + rc = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "INMXSTOCK") + lngONHAND = d4field(db7, "INMXONORDR") + strName = f4str(lngNAME) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdZeroOnHand" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixONOrder() +Dim oSTATUS As Long, intBOOKMARK99 As Integer +Dim strSQL As String, strSQLL As String, dblONHAND As Double, oRS As Recordset +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME2 As String, lngNAME2 As Long, lngONHANDX As Long, dblONHANDX As Double +Dim strName As String, strCUST As String, strVend As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double +Dim strSTOCK As String, dblQTY As Double, intCoun As Integer +Dim intCNT As Integer, intCNT2 As Integer +Dim lngCustTag2 As Long, intTEST As Integer +Dim lngMXSTOCK As Long, strMXSTOCK As String, lngMXONHAND As Long, dblMXONHAND As Double +Dim strMXLOC As String * 20, strMXSTK As String * 20, strMXSEARCH As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH +' intBOOKMARK99 = lstInventory.ListIndex + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + intCNT = 0 + intCNT2 = 0 + 'lstinventory.col=10 + 'lstinventory.ColText= + strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag and StockNo = '" & mstrSTOCK & "'" +' strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag " + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + intCoun = oRS.RecordCount +'********************************** + strSQL = gstrCOMPANY & "INMAS" + strSQLL = gstrCOMPANY & "INMAT" + db = d4open(cb, fPath + strSQL) + db6 = d4open(cb, fPath + strSQLL) + + lngCustTag = d4tag(db, "IN_STOCK2") + Call d4tagSelect(db, lngCustTag) + + lngCustTag2 = d4tag(db6, "INMXSTOCK3") +' lngCustTag2 = d4tag(db6, "INMXSTOCK") + Call d4tagSelect(db6, lngCustTag2) + + Do Until oRS.EOF + strSTOCK = Field2Str(oRS!StockNo) + strMXSTK = Field2Str(oRS!StockNo) + strMXSEARCH = strMXSTK & strMXLOC + dblQTY = oRS!qty + If IsNull(strSTOCK) Or strSTOCK = "" Then + + Else + + + rc = d4seek(db, strSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngONHAND = d4field(db, "IN_ORDERTE") + strName = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If Trim(strSTOCK) = Trim(strName) Then + dblONHAND = dblONHAND + dblQTY + Call f4assignDouble(lngONHAND, dblONHAND) + End If + intCNT2 = intCNT2 + 1 + End If + intCNT = intCNT + 1 + + rc6 = d4seek(db6, strSTOCK) + oSTATUS = d4deleted(db6) + If oSTATUS = 0 Then + lngNAME2 = d4field(db6, "INMXSTOCK") + lngONHANDX = d4field(db6, "INMXONORDR") + strNAME2 = f4str(lngNAME2) + dblONHANDX = f4double(lngONHANDX) + If Trim(strMXSTK) = Trim(strName) Then + dblONHANDX = dblONHANDX + dblQTY + Call f4assignDouble(lngONHANDX, dblONHANDX) + End If + End If + End If + + oRS.MoveNext + Loop + rc = d4close(db) + rc6 = d4close(db6) + lstInventory.col = 10 + lstInventory.ColText = dblONHANDX +' lstInventory.Refresh + inttext = lstInventory.ListIndex +' lstInventory.ListIndex = mintbookmark99 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module FixOnOrder" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ChgONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + +' dblONORDER = f4str(lngONORDER) +' dblCALCONORDER = dblONORDER + mdblQORDER +' If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 +' End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + + dblCALCONORDER = 0 + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub GetAFN() +Dim strSQL As String, oRS As Recordset + + mstrN_LC = "" + mstrN_RTL = "" + mstrN_VS = "" + mstrN_VND = "" + mstrN_LPD = "" + mstrN_Desc = "" + mstrN_TY = "" + + strSQL = "SELECT AFN_LCost, AFN_Retail, AFN_VSTOCK, AFN_VEND, AFN_DESC, AFN_PDATE, AFN_TYPE FROM tblPriceCompare WHERE AFN_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrN_LC = Format(Field2Str(oRS!AFN_LCost), "##,##0.00") + mstrN_RTL = Format(Field2Str(oRS!AFN_Retail), "##,##0.00") + mstrN_VS = Field2Str(oRS!AFN_VStock) + mstrN_VND = Field2Str(oRS!AFN_VEND) + mstrN_Desc = Field2Str(oRS!AFN_Desc) + mstrN_LPD = Field2Str(oRS!AFN_PDATE) + mstrN_TY = Field2Str(oRS!AFN_TYPE) + Else + mstrN_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetAFS() +Dim strSQL As String, oRS As Recordset + + On Error GoTo Error_EH + + mstrS_LC = "" + mstrS_RTL = "" + mstrS_VS = "" + mstrS_VND = "" + mstrS_LPD = "" + mstrS_Desc = "" + mstrS_TY = "" + +' strSQL = "SELECT * FROM tblPriceCompare WHERE AFSSKU = '" & mstrFStock & "'" +' If Not gboolConn3Bad Then + strSQL = "SELECT AFS_LCost, AFS_Retail, AFS_VSTOCK, AFS_VEND, AFS_DESC, AFS_PDATE, AFS_TYPE FROM tblPriceCompare WHERE AFS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn3, adOpenForwardOnly, adLockReadOnly +' Else +' MsgBox "Cannot Process AFS History", vbOKOnly, "No History" +' Exit Sub +' End If + + If Not oRS.EOF Then + mstrS_LC = Format(Field2Str(oRS!AFS_LCost), "##,##0.00") + mstrS_RTL = Format(Field2Str(oRS!AFS_Retail), "##,##0.00") + mstrS_VS = Field2Str(oRS!AFS_VStock) + mstrS_VND = Field2Str(oRS!AFS_VEND) + mstrS_Desc = Field2Str(oRS!AFS_Desc) + mstrS_LPD = Field2Str(oRS!AFS_PDATE) + mstrS_TY = Field2Str(oRS!AFS_TYPE) + Else + mstrS_LC = "NO INFORMATION FOUND" + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form PO - Module GetAFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetTSS() + +Dim strSQL As String, oRS As Recordset + + mstrT_LC = "" + mstrT_RTL = "" + mstrT_VS = "" + mstrT_VND = "" + mstrT_LPD = "" + mstrT_Desc = "" + mstrT_TY = "" + + strSQL = "SELECT TSS_LCost, TSS_Retail, TSS_VSTOCK, TSS_VEND, TSS_DESC, TSS_PDATE, TSS_TYPE FROM tblPriceCompare WHERE TSS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrT_LC = Format(Field2Str(oRS!TSS_LCost), "##,##0.00") + mstrT_RTL = Format(Field2Str(oRS!TSS_Retail), "##,##0.00") + mstrT_VS = Field2Str(oRS!TSS_VStock) + mstrT_VND = Field2Str(oRS!TSS_VEND) + mstrT_Desc = Field2Str(oRS!TSS_Desc) + mstrT_LPD = Field2Str(oRS!TSS_PDATE) + mstrT_TY = Field2Str(oRS!TSS_TYPE) + Else + mstrT_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetTSSHist() +Dim strSQL As String, oRS As Recordset + + mstrT_LM = "" + mstrT_LY = "" + mstrT_YA = "" + mstrT_ICLM = "" + mstrT_ICLY = "" + mstrT_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGET WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrT_LM = Field2Str2(oRS!LastMo) + mstrT_LY = Field2Str2(oRS!LastYr) + mstrT_YA = Field2Str2(oRS!YearAgo) + mstrT_ICLM = Field2Str2(oRS!ICLastMo) + mstrT_ICLY = Field2Str2(oRS!ICLastYr) + mstrT_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrT_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFNHist() + +Dim strSQL As String, oRS As Recordset + + mstrN_LM = "" + mstrN_LY = "" + mstrN_YA = "" + mstrN_ICLM = "" + mstrN_ICLY = "" + mstrN_ICYA = "" + + + strSQL = "SELECT * FROM tblUSAGEN WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrN_LM = Field2Str2(oRS!LastMo) + mstrN_LY = Field2Str2(oRS!LastYr) + mstrN_YA = Field2Str2(oRS!YearAgo) + mstrN_ICLM = Field2Str2(oRS!ICLastMo) + mstrN_ICLY = Field2Str2(oRS!ICLastYr) + mstrN_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrN_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFSHist() + +Dim strSQL As String, oRS As Recordset + + mstrS_LM = "" + mstrS_LY = "" + mstrS_YA = "" + mstrS_ICLM = "" + mstrS_ICLY = "" + mstrS_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGES WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrS_LM = Field2Str2(oRS!LastMo) + mstrS_LY = Field2Str2(oRS!LastYr) + mstrS_YA = Field2Str2(oRS!YearAgo) + mstrS_ICLM = Field2Str2(oRS!ICLastMo) + mstrS_ICLY = Field2Str2(oRS!ICLastYr) + mstrS_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrS_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frx new file mode 100644 index 0000000..3bef0d5 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frm new file mode 100644 index 0000000..3769d6a --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frm @@ -0,0 +1,9647 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPO + Caption = "Purchase Order Selection " + ClientHeight = 8670 + ClientLeft = 165 + ClientTop = 735 + ClientWidth = 12045 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8670 + ScaleWidth = 12045 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + WindowState = 2 'Maximized + Begin VB.CommandButton cmdPONotes + Caption = "PO Notes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 10935 + TabIndex = 55 + Top = 5145 + Visible = 0 'False + Width = 1080 + End + Begin LpLib.fpList lstHistory + Height = 840 + Left = 3735 + TabIndex = 53 + Top = 4290 + Width = 8010 + _Version = 196608 + _ExtentX = 14129 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 16578720 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 195 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":0000 + End + Begin VB.CheckBox chkHistory + Caption = "Check to Use CMS Inventory List for CTRL-O" + Height = 240 + Left = 105 + TabIndex = 51 + Top = 7530 + Width = 3600 + End + Begin VB.CommandButton cmdAlias + Caption = "Alias" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6555 + TabIndex = 49 + Top = 900 + Visible = 0 'False + Width = 735 + End + Begin VB.CheckBox chkNoDisplay + Caption = "Skip Display" + Height = 240 + Left = 2115 + TabIndex = 48 + Top = 7320 + Visible = 0 'False + Width = 585 + End + Begin VB.CheckBox chkOKPO + Caption = "Do Not Create" + Height = 240 + Left = 1365 + TabIndex = 47 + Top = 7335 + Visible = 0 'False + Width = 510 + End + Begin VB.CheckBox chkByDesc + Caption = "PO By Description" + Height = 210 + Left = 4845 + TabIndex = 46 + Top = 1245 + Width = 1620 + End + Begin VB.CommandButton cmdAPAR + Caption = "AP/AR Check" + Height = 300 + Left = 3915 + TabIndex = 45 + Top = 7530 + Visible = 0 'False + Width = 1245 + End + Begin VB.CommandButton cmdPromo + Caption = "Promo" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 44 + Top = 495 + Width = 1035 + End + Begin VB.CommandButton cmdOnOrder + Caption = "OnOrder List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9990 + TabIndex = 43 + ToolTipText = "This Will Display The Outstanding PO's For The Hi-Lited Inventory Item" + Top = 900 + Width = 840 + End + Begin VB.CommandButton cmdAltVend2 + Caption = "Vendor Stock List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 10830 + TabIndex = 40 + Top = 15 + Width = 1035 + End + Begin VB.CheckBox chkKEEP + Caption = "Keep Search Info" + Height = 210 + Left = 1770 + TabIndex = 38 + Top = 1245 + Value = 1 'Checked + Width = 1680 + End + Begin VB.Timer tmrAltVend + Left = 3375 + Top = 7215 + End + Begin VB.CommandButton cmdAltVendor + Caption = "Vendor Stock #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8355 + TabIndex = 37 + Top = 600 + Visible = 0 'False + Width = 1650 + End + Begin VB.CheckBox chkZero + Caption = "No Zero Qty" + Height = 210 + Left = 3510 + TabIndex = 36 + Top = 1245 + Value = 1 'Checked + Width = 1260 + End + Begin VB.CommandButton cmdMinMax2 + Caption = "Update Order List Min/Max" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 675 + Left = 2535 + TabIndex = 30 + Top = 4305 + Width = 1215 + End + Begin VB.CommandButton cmdSales + Caption = "Calc Sales" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 7260 + TabIndex = 29 + Top = 585 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtBegDate + Height = 285 + Left = 5580 + TabIndex = 26 + Top = 660 + Width = 975 + End + Begin VB.TextBox txtEndDate + Height = 285 + Left = 5580 + TabIndex = 25 + Top = 960 + Width = 975 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Order Checklist" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7305 + TabIndex = 24 + Top = 900 + Width = 1050 + End + Begin VB.CommandButton cmdMINMAX + Caption = "Update Inv List - MIN/MAX && Type" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8370 + TabIndex = 23 + Top = 900 + Width = 1620 + End + Begin VB.CommandButton cmdLabel + Caption = "Setup BC Labels" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 480 + Left = 10830 + TabIndex = 21 + Top = 975 + Width = 1035 + End + Begin VB.ComboBox cboSortOrder + Height = 315 + ItemData = "frmPO.frx":06F9 + Left = 1920 + List = "frmPO.frx":070C + Style = 2 'Dropdown List + TabIndex = 20 + Top = 240 + Width = 1755 + End + Begin MSComDlg.CommonDialog cdPO + Left = 3855 + Top = 7185 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin Crystal.CrystalReport crPO + Left = 2865 + Top = 7185 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtOrderQty + Alignment = 1 'Right Justify + Height = 285 + Left = 9975 + TabIndex = 16 + Tag = """OrderQty""" + Top = 5130 + Width = 795 + End + Begin VB.TextBox txtEndSelect + Height = 285 + Left = 5580 + TabIndex = 8 + Top = 360 + Width = 4845 + End + Begin VB.TextBox txtBegSelect + Height = 285 + Left = 5580 + TabIndex = 7 + Top = 60 + Width = 4845 + End + Begin VB.ComboBox cboSort + Height = 315 + ItemData = "frmPO.frx":0749 + Left = 45 + List = "frmPO.frx":075F + Style = 2 'Dropdown List + TabIndex = 3 + Top = 240 + Width = 1755 + End + Begin LpLib.fpList lstInventory + Height = 2535 + Left = 90 + TabIndex = 0 + Top = 1470 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 4471 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 21 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 2 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 450 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":07A9 + End + Begin LpLib.fpList lstProcess + Height = 2040 + Left = 90 + TabIndex = 50 + Top = 5445 + Width = 11655 + _Version = 196608 + _ExtentX = 20558 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 16 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 0 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":11B2 + End + Begin LpLib.fpCombo cboVendor + Height = 315 + Left = 3750 + TabIndex = 41 + Top = 240 + Visible = 0 'False + Width = 5730 + _Version = 196608 + _ExtentX = 10107 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPO.frx":1A84 + End + Begin LpLib.fpList lstCompare + Height = 780 + Left = 90 + TabIndex = 52 + Top = 7800 + Width = 11715 + _Version = 196608 + _ExtentX = 20664 + _ExtentY = 1376 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Courier New" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = 8454143 + ForeColor = -2147483640 + Columns = 8 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPO.frx":20DB + End + Begin VB.TextBox txtSearch + Height = 285 + Left = 60 + TabIndex = 5 + Top = 840 + Width = 2520 + End + Begin VB.Label lblMessage + BackColor = &H0000FFFF& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 270 + Left = 75 + TabIndex = 54 + Top = 4005 + Visible = 0 'False + Width = 11670 + End + Begin VB.Label lblWait + Alignment = 2 'Center + BackColor = &H00FF0000& + Caption = "Please Wait" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H0000FFFF& + Height = 645 + Left = 2580 + TabIndex = 31 + Top = 615 + Visible = 0 'False + Width = 1800 + End + Begin VB.Label lblSelectVend + Caption = "Select Vendor and Press ENTER to Complete PO" + Height = 240 + Left = 3720 + TabIndex = 42 + Top = 0 + Visible = 0 'False + Width = 6045 + End + Begin VB.Label lblTest + BeginProperty Font + Name = "Arial" + Size = 6.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 720 + Left = 90 + TabIndex = 39 + Top = 4350 + Width = 2250 + End + Begin VB.Label txtPOTotal + Height = 195 + Left = 10665 + TabIndex = 35 + Top = 7545 + Width = 1065 + End + Begin VB.Label lblPOTotalAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated PO Total:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8895 + TabIndex = 34 + Top = 7545 + Width = 1710 + End + Begin VB.Label lblWeight + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "TTL Weight" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6780 + TabIndex = 33 + Top = 7545 + Width = 1020 + End + Begin VB.Label txtWeight + Alignment = 2 'Center + Height = 195 + Left = 7890 + TabIndex = 32 + Top = 7545 + Width = 975 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Date:" + Height = 195 + Left = 4560 + TabIndex = 28 + Top = 1020 + Width = 930 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Date:" + Height = 195 + Left = 4380 + TabIndex = 27 + Top = 720 + Width = 1140 + End + Begin VB.Label lblUser + Caption = "User: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3150 + TabIndex = 22 + Top = 885 + Width = 1185 + End + Begin VB.Label lblSort2 + Caption = "Sort Field - Order List" + Height = 255 + Left = 1920 + TabIndex = 19 + Top = 0 + Width = 1635 + End + Begin VB.Label lblSort1 + Caption = "Sort Field - Inventory" + Height = 240 + Left = 0 + TabIndex = 18 + Top = 0 + Width = 1635 + End + Begin VB.Label lblOrderHold + Height = 315 + Left = 11490 + TabIndex = 17 + Top = 3945 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblOrder + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Qty:" + Height = 195 + Left = 9180 + TabIndex = 15 + Top = 5145 + Width = 720 + End + Begin VB.Label lblShowDesc + BorderStyle = 1 'Fixed Single + Height = 255 + Left = 4560 + TabIndex = 14 + Top = 5115 + Width = 4515 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 3660 + TabIndex = 13 + Top = 5145 + Width = 840 + End + Begin VB.Label lblStock + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 255 + Left = 1860 + TabIndex = 12 + Top = 5115 + Width = 1755 + End + Begin VB.Label lblStockNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stock #:" + Height = 195 + Left = 1170 + TabIndex = 11 + Top = 5115 + Width = 615 + End + Begin VB.Label lblEndSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Ending Selection: " + Height = 195 + Left = 4245 + TabIndex = 10 + Top = 420 + Width = 1290 + End + Begin VB.Label lblBegSelect + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Beginning Selection: " + Height = 195 + Left = 4035 + TabIndex = 9 + Top = 120 + Width = 1500 + End + Begin VB.Label lblSearch + Caption = "Enter Stock Number to Find" + Height = 255 + Left = 60 + TabIndex = 6 + Top = 600 + Width = 3075 + End + Begin VB.Label lblSort + Caption = "Sort Field - Inventory" + Height = 255 + Left = 60 + TabIndex = 4 + Top = 0 + Width = 1635 + End + Begin VB.Label lblProcess + AutoSize = -1 'True + Caption = "Order List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 15 + TabIndex = 2 + Top = 5130 + Width = 840 + End + Begin VB.Label lblCMS + AutoSize = -1 'True + Caption = "CMS Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 1 + Top = 1260 + Width = 1620 + End + Begin VB.Menu mnuSelect + Caption = "Set Selection" + Begin VB.Menu mnuBegin + Caption = "Beginning Selection" + End + Begin VB.Menu mnuEnding + Caption = "Ending Selection" + End + Begin VB.Menu mnuBegDate + Caption = "Beginning Date" + End + Begin VB.Menu mnuEndDate + Caption = "Ending Date" + End + End + Begin VB.Menu mnuPartial + Caption = "Select By Criteria" + Begin VB.Menu mnuMinMax + Caption = "Select by Min/Max" + End + Begin VB.Menu mnuPOSSales + Caption = "Select by POS Sales" + End + Begin VB.Menu mnuSelAll + Caption = "Select ALL For 1 Vendor" + End + End + Begin VB.Menu mnuCreate2 + Caption = "Create PO" + End + Begin VB.Menu mnuClear + Caption = "c&Lear" + End + Begin VB.Menu mnuReports + Caption = "&Reports" + End + Begin VB.Menu cmdOpenPO + Caption = "Open PO List" + End + Begin VB.Menu mnuImport + Caption = "Import Electronic Invoices" + Begin VB.Menu mnuCPet + Caption = "Central Pet" + End + Begin VB.Menu mnuSunburst + Caption = "Sunburst Pet" + Visible = 0 'False + End + Begin VB.Menu mnuTVet + Caption = "Thompson Vet" + End + Begin VB.Menu mnuLextron + Caption = "Lextron" + Visible = 0 'False + End + Begin VB.Menu mnuPurina1 + Caption = "Purina (Land O Lakes)" + End + Begin VB.Menu mnuPurina2 + Caption = "Purina (CSV Detail Old)" + End + Begin VB.Menu mnuPurina + Caption = "Purina (CSV Detail 2016)" + End + Begin VB.Menu mnuEagle + Caption = "Eagle - Create PO" + Visible = 0 'False + End + End + Begin VB.Menu cmdImpCMS + Caption = "Import CMS PO's" + Visible = 0 'False + End + Begin VB.Menu mnuLabels + Caption = "Labels" + End + Begin VB.Menu mnuUpdate + Caption = "Update" + Begin VB.Menu mnuUpVendor + Caption = "Primary Vendor" + End + Begin VB.Menu mnuUpDesc + Caption = "Description" + End + Begin VB.Menu mnuUpWgt + Caption = "Weight" + End + Begin VB.Menu mnuUpCase + Caption = "Units in a Case" + End + End + Begin VB.Menu mnuAddInv + Caption = "Add Inventory" + Begin VB.Menu mnuAddV + Caption = "Add From Vendor" + End + Begin VB.Menu mnuAddS + Caption = "Add From Another Store" + End + End + Begin VB.Menu mnuExit + Caption = "E&Xit" + End + Begin VB.Menu mnuHelp + Caption = "&Help" + End +End +Attribute VB_Name = "frmPO" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim moRSPOList As Recordset, moRSUpdate As Recordset, moRSAV As Recordset +Dim moRSPOHeader As Recordset, moRSPODetail As Recordset +Dim mstrBEGDATE As String, mstrENDDATE As String, mboolCTRLO As Boolean +Dim mstrCUSTOMER As String * 20, mintYN As String +'Dim mstrVSTOCK As String, mstrAVENDOR As String, mstrSTOCK As String +Dim mstrVSTOCK As String * 20, mstrAVENDOR As String * 20, mstrSTOCK As String * 20 +Dim mstrADDVStock As String, mintBOOKMARK3 As Integer, mstrNSTOCK As String * 20 +Dim mstrLine As String, strCode As String, strCompany As String +Dim mstrName As String, strCUST As String, strVEND As String, strTYPE As String +Dim mstrCP_PO As String, mstrDATE As String, mstrTABLE As String +Dim mstrALIAS As String, mboolALIASFOUND As Boolean, mstrOldVendor As String +Dim mstrVENDOR As String, mboolNOVSTOCK As Boolean, mintBOOKMARK2 As Integer +Dim mstrDESC As String, mintBOOKMARK As Integer, mlngCOUNT As Long, mintBOOKMARK5 As Integer +Dim mdblQORDER As Double, mboolALL As Boolean, mstrVFIND As String * 20 +Dim mbytSort As Byte, mintBOOKMARK12 As Integer, mintBOOKMARK13 As Integer +Dim mintCnt1 As Integer, mintCnt2 As Integer +Dim mdteBegin As Date, mdteEnd As Date +Dim mstrN_LPD, mstrN_Desc, mstrN_LC, mstrN_RTL, mstrN_VND, mstrN_VS As String, mstrFStock As String +Dim mstrS_LPD, mstrS_Desc, mstrS_LC, mstrS_RTL, mstrS_VND, mstrS_VS As String ', mstrStore1 As String +Dim mstrT_LPD, mstrT_Desc, mstrT_LC, mstrT_RTL, mstrT_VND, mstrT_VS As String ', mstrStore2 As String +Dim mstrN_LM, mstrN_LY, mstrN_YA, mstrN_ICLM, mstrN_ICLY, mstrN_ICYA As String +Dim mstrS_LM, mstrS_LY, mstrS_YA, mstrS_ICLM, mstrS_ICLY, mstrS_ICYA As String +Dim mstrT_LM, mstrT_LY, mstrT_YA, mstrT_ICLM, mstrT_ICLY, mstrT_ICYA As String +Dim mstrT_TY, mstrN_TY, mstrS_TY As String + +'vbDefaultButton2 + +Private Sub InventoryLoad() +Dim oSTATUS As Long, oRSAV As Recordset, strSQLAV As String +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + mintCnt1 = mintCnt1 + 1 + +' mdteBegin = Now +' Label1 = mdteBegin + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If rc = r4success Then +' If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + lngSTDCST = d4field(db, "IN_STDCST") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + mstrSTOCK = UCase(Field2Str(strNAME)) + strCUST = f4str(lngCUST) + strVEND = f4str(lngVEND) + mstrAVENDOR = Field2Str(strVEND) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) +' If Mid$(strCUST, 1, 7) = "Dobbins" Then + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT +' End If + strCSQty = f4str(lngCSQty) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + + .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVEND) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + strWeight = "" + End With + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + MsgBox "No Inventory Items Were Found", vbInformation + vbOKOnly, "No Inventory" + End If + lstInventory.SortState = SortStateActiveReSort + +' mdteEnd = Now +' Label2 = mdteEnd +' If gstrLOGIN = "DWW" Then +' Label1.Visible = True +' Label2.Visible = True +' Else +' Label1.Visible = False +' Label2.Visible = False +' End If +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadInventory() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim lngBUYCON As Long, dblBUYCON As Double, lngSTDCST As Long, dblSTDCST As Double +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim lngONORDER As Long, dblONORDER As Double +Dim lngCSQty As Long, strCSQty As String +Dim intYN As Integer, strMSG As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strLOrder As String, strLPur As String, strLSALE As String, strTStock As String +Dim strWeight As String, intMIN As Integer, strFIND As String, strTVend As String +Dim strVSTOCK As String, lngVSTOCK As Long, lngIMAGE As Long, strIMAGE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngCUST = d4field(db, "IN_DES") + strCUST = f4str(lngCUST) + If IsNull(strCUST) Or IsNull(txtSearch) Or txtSearch = "" Then + intYN = 0 + Else + intYN = InStr(1, UCase(Trim(strCUST)), UCase(Trim(txtSearch))) ', vbTextCompare) + End If + If intYN > 0 Then + With lstInventory + lngNAME = d4field(db, "IN_STOCK") + ' lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngCSQty = d4field(db, "IN_FIELD08") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + lngSTDCST = d4field(db, "IN_STDCST") + lngVSTOCK = d4field(db, "IN_FIELD10") + lngIMAGE = d4field(db, "IN_GRAPHIC") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + ' strCUST = f4str(lngCUST) + strVEND = f4str(lngVEND) + strVSTOCK = Trim(f4str(lngVSTOCK)) + dblONHAND = f4double(lngONHAND) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblONORDER = f4double(lngONORDER) + dblWEIGHT = f4double(lngWEIGHT) + strWeight = dblWEIGHT + strCSQty = f4str(lngCSQty) + If Trim(strCSQty) = "0.00" Then + strCSQty = "" + End If + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + strIMAGE = f4str(lngIMAGE) + dblSTDCST = f4double(lngSTDCST) + dblSTDCST = Format((dblSTDCST + 0.0049), "#,#.00") + If Trim(strWeight) = "0.00" Or Trim(strWeight) = "0" Then + strWeight = "" + End If + .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) & vbTab & Trim$(strVEND) & vbTab & Trim$(strTYPE) & vbTab & (dblMIN) & vbTab & (dblMAX) & vbTab & (dblAVAIL) & vbTab & (dblLSTCOST) & vbTab & (dblRETAIL1) & vbTab & dblBUYCON & vbTab & dblONORDER & vbTab & strWeight & vbTab & strCSQty & vbTab & strLOrder & vbTab & strLPur & vbTab & strLSALE & vbTab & (strVSTOCK) & vbTab & (strIMAGE) & vbTab & (strONHAND) & vbTab & (dblSTDCST) + End With + End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + + rc = d4close(db) + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + Else + strMSG = "No Inventory Items Were Found Matching The" + strMSG = strMSG & vbCrLf & " Information You Entered" + MsgBox strMSG, vbInformation + vbOKOnly, "Nothing Matches" + End If + lstInventory.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module LoadInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 +Dim lngPVENDOR As Long, strPVENDOR As String +Dim lngBUYCON As Long, dblBUYCON As Double, lngWEIGHT As Long, dblWEIGHT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrAVENDOR = Field2Str(oRS!VENDOR) +' Call GETALTVEND + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + mstrSTOCK = UCase(Field2Str(oRS!VStock)) + mstrVSTOCK = Field2Str(oRS!VStock) + + Call GetALIAS + If mboolALIASFOUND = False Then + mstrSTOCK = UCase(Field2Str(oRS!inv_no)) + Call GetALIAS2 + Else + oRS!inv_no = Field2Str(mstrALIAS) + oRS.Update + End If + + If Not mboolALIASFOUND Then + Call GETAVINFO2 + strFIND = RTrim(mstrSTOCK) + Else + strFIND = Field2Str(mstrALIAS) + End If + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN2") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngPVENDOR = d4field(db, "IN_VENDOR") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblBUYCON = f4double(lngBUYCON) + dblWEIGHT = f4double(lngWEIGHT) + strPVENDOR = f4str(lngPVENDOR) + End If + If strNAME = strFIND Then + oRS!inv_no = strNAME + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!buycon = Field2Str2(dblBUYCON) + oRS!Weight = Field2Str2(dblWEIGHT) + oRS!PVendor = Field2Str(strPVENDOR) + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + strSQL = gstrCOMPANY & "INAL" + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strNAME + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetALIAS2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + + + strSQL = gstrCOMPANY & "INAL" + + db3 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db3, "INAL_ALIAS") + + Call d4tagSelect(db3, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc3 = d4seek(db3, mstrSTOCK) + + oSTATUS = d4deleted(db3) + If oSTATUS = 0 Then + lngNAME = d4field(db3, "INAL_STOCK") + lngCUST = d4field(db3, "INAL_ALIAS") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + End If + If mstrSTOCK = strCUST Then + mstrALIAS = strNAME + If mstrALIAS = " " Then + mboolALIASFOUND = False + Else + mboolALIASFOUND = True + End If + Else + mstrALIAS = " " + mboolALIASFOUND = False + End If + + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GetALIAS2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpdateStock() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim lngLSTCOST As Long, lngRETAIL1 As Long, dblLSTCOST As Double, dblRETAIL1 As Double +Dim oRS As Recordset, strFIND As String * 20 + +'TAG4 pointers +Dim lngCustTag As Long + +'************** Need to make this look up a corrected description and fix it. If the record needs to be updated, then +'************** be sure to also pickup last cost + + On Error GoTo Error_EH + + strSQLL = "SELECT * FROM tblPODetail WHERE POID = " & poid & " and LineNo = " & xxxx + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = UCase(oRS!StockNo) + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + + Do Until oRS.EOF + strFIND = Field2Str(oRS!inv_no) + rc = d4seek(db, strFIND) + + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngType = d4field(db, "IN_TYPE") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + strTYPE = f4str(lngType) + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + End If + If strNAME = strFIND Then + oRS!Description = Field2Str(strCUST) + oRS!Type = Field2Str(strTYPE) + oRS!LastCost = Field2Str2(dblLSTCOST) + oRS!Retail1 = Field2Str2(dblRETAIL1) + oRS.Update + Else + oRS!Description = "**** - " & Left(Field2Str(oRS!VDesc), 36) + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!Add = vbChecked + oRS.Update + End If + oRS.MoveNext + Loop 'While rc = r4success +' End If + + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module UpdateStock" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectAllLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim strSELECT As String +Dim oRS As Recordset + +'TAG4 pointers +Dim lngCustTag As Long + +' On Error GoTo Error_EH + On Error Resume Next + + aTabs(0) = 100 + aTabs(1) = 120 + aTabs(2) = 200 + + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + lngRET = SendMessage(lstInventory.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) +' strSQLL = cboARCode.Text + rc = d4top(db) + +' lstInventory.Clear + lstInventory.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then +' lngRECORD = d4field(db, "AR_CODE") +' strCode = f4str(lngRECORD) +' If strCode = strSQLL Then + With oRS + .AddNew + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") +' strTYPE = f4str(lngTYPE) +' strNAME = f4str(lngNAME) +' strCUST = f4str(lngCUST) + !inv_no = f4str(lngNAME) + !Description = f4str(lngCUST) + !VENDOR = f4str(lngVEND) + !Type = f4str(lngType) + !OnHand = f4double(lngONHAND) + !User = gstrLOGIN + .Update +' .AddItem RTrim$(strNAME) & vbTab & Trim$(strCUST) + End With +' End If + End If + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectAllLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then '1 + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then '2 + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) +' If dblMAX > 0 And Not chkZero Then +' If dblMAX > 0 And chkZero Then + If dblMAX > 0 Then '3 + If cboSort.ListIndex = 0 Then '4 + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then '5 + + If dblALLTOTAL <= dblMIN Then ' 6 + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Or mboolALL Then '7 + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If +' End If +' If dblMAX > 0 And Not chkZero Then + ElseIf cboSort.ListIndex = 1 Then '4 + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 +' End If THIS MAY NOT BE CORRECT +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 2 Then '4 +' If Not chkZero And dblOrder > 0 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVEND) >= Trim$(strBEG2) And Trim$(strVEND) <= Trim$(strEND2) Then '5 + +' If dblALLTOTAL <= dblMIN Then + If chkZero = vbUnchecked Then '6 +' If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + End If '7 + + If dblOrder < 0 Then + dblOrder = 0 + End If + + +' If Not chkZero Then '7 +' If Not chkZero And dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '6 +' If chkZero Then + + If chkZero = vbChecked And dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then '7 + intREM = dblOrder Mod dblBUYCON + End If '7 + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + + If dblOrder > 0 Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If '7 + + End If '6 +' End If + End If '5 +' End If +' If dblMAX > 0 And Not chkZero Then + + + ElseIf cboSort.ListIndex = 3 Then '4 + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then '5 + If dblALLTOTAL <= dblMIN Then '6 + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then '7 + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If '7 + If dblOrder > 0 Or mboolALL Then '7 + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If '7 + End If '6 + End If '5 + End If '4 + End If '3 + End If '2 + + rc = d4skip(db, 1) + Loop While rc = r4success +' End If '2 + End If '1 + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoadHold() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim lngWEIGHT As Long, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long +Dim strONHAND As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQL = gstrCOMPANY & "INMAS" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + lstInventory.SortState = SortStateSuspend + + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblALLTOTAL = 0 + dblONORDER = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + strONHAND = dblONHAND + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + If dblOrder > 0 Or mboolALL Then + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 1 Then + If UCase(strDESC) >= UCase(strBEG) And UCase(strDESC) <= UCase(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 2 Then + strBEG2 = Trim$(strBEG) + strEND2 = Trim$(strEND) + + If Trim$(strVEND) >= Trim$(strBEG2) And Trim$(strVEND) <= Trim$(strEND2) Then + + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + If dblBUYCON <> 0 Then + intREM = dblOrder Mod dblBUYCON + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + + !OnOrder = dblONORDER + !Available = dblALLTOTAL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + + End If + End If + End If + End If + If dblMAX > 0 And Not chkZero Then + If cboSort.ListIndex = 3 Then + + If Trim$(strTYPE) >= Trim$(strBEG) And Trim$(strTYPE) <= Trim$(strEND) Then + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + + End If + If dblOrder > 0 Or mboolALL Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !OnOrder = dblONORDER + !Available = dblALLTOTAL + + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !Weight = dblWEIGHT + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + End If + End If + + rc = d4skip(db, 1) + Loop While rc = r4success + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSearch_Click() +'Multiple character search code. + lstInventory.SearchText = txtSearch.Text + + lstInventory.SearchMethod = 2 + lstInventory.SearchIndex = -1 + lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub cboSort_Click() +Dim intMIN As Integer + + On Error Resume Next + mintCnt2 = mintCnt2 + 1 + lblCount2 = mintCnt2 + mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex + cboSortOrder.ListIndex = 4 + + If cboSort.ListIndex = 0 Then +' If mbytSort <> cbolistindex Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 0 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 0 + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Stock # Search Information:" + + ElseIf cboSort.ListIndex = 1 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 1 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.Caption = "Enter Description Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 2 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 2 + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Vendor Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 3 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = 1 +' lstInventory.ColSortSeq = -1 +' lstInventory.ColSorted = SortedNone + lstInventory.ColSorted = SortedAscending + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 3 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If + lblSearch.Caption = "Enter Product Type Search Information:" + ElseIf cboSort.ListIndex = 5 Then + If mbytSort = 4 Then + Call InventoryLoad + End If + lstInventory.col = 0 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 2 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 3 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 1 + lstInventory.ColSortSeq = -1 + lstInventory.ColSorted = SortedNone + lstInventory.col = 16 + lstInventory.ColSortSeq = 0 + lstInventory.ColSorted = SortedAscending + lstInventory.Redraw = True + + lstInventory.ColSortDataType = ColSortDataTypeTextNoCase + lstInventory.SearchIgnoreCase = True + lstInventory.ColumnSearch = 16 + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + If chkKEEP Then + Call cmdSearch_Click + txtSearch.SetFocus + Else + txtSearch = "" + txtSearch.SetFocus + End If +' txtSearch = "" + lblSearch.Caption = "Enter Vendor Stock Search Information:" +' txtSearch.SetFocus + ElseIf cboSort.ListIndex = 4 Then + Call LoadInventory +' txtSearch.SetFocus + End If + mbytSort = cboSort.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub cboSortOrder_Click() + + On Error Resume Next + + If cboSortOrder.ListIndex = 0 Then + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 8 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 0 + ElseIf cboSortOrder.ListIndex = 1 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 1 + ElseIf cboSortOrder.ListIndex = 2 Then + + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 2 + txtSearch = "" + lblSearch.Caption = "Enter Vendor Search Information:" + txtSearch.SetFocus + ElseIf cboSortOrder.ListIndex = 3 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeTextNoCase + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + + ElseIf cboSortOrder.ListIndex = 4 Then + + lstProcess.col = 0 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 1 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 2 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 3 + lstProcess.ColSortSeq = -1 + lstProcess.ColSorted = SortedNone + lstProcess.col = 9 + lstProcess.ColSortSeq = 0 + lstProcess.ColSorted = SortedAscending + lstProcess.Redraw = True + + lstProcess.ColSortDataType = ColSortDataTypeInteger + lstProcess.SearchIgnoreCase = True + lstProcess.ColumnSearch = 3 + End If + +End Sub + +'Private Sub cmdCalc_Click() +' Screen.MousePointer = vbHourglass +' If lblBegDate2.caption = "" Then +' MsgBox "No Dates Set, No Calculations Will Process", vbOKOnly, "No Calculation" +' Exit Sub +' End If +' lblMessage.Visible = True +' lblMessage.caption = "Calculating -- Be Patient" +' DoEvents +' Call InvProcess +' lblMessage.Visible = False +' MsgBox "Calculation Complete", vbOKOnly, "Done" +' Screen.MousePointer = vbDefault +'End Sub + +Private Sub cmdClear_Click() +Dim strSQL As String + +' strSQL = "UPDATE tblPOList SET User = 'XX'" ' WHERE User = '" & gstrLOGIN & "'" + strSQL = "Delete * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + goConn.Execute strSQL +' strSQL = "DELETE * FROM tblINVUsage" +' goConn.Execute strSQL + Call ClearMiddle + Call Inventory2Load + chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If +End Sub + +Private Sub ClearMiddle() + lblMessage = "" + lblMessage.Visible = False + lblTest = "" + lblStock = "" + lblShowDesc = "" + txtOrderQty = 0 + lstCompare.Clear +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPartial_Click() + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + Call SelectPartialLoad + lblMessage.Visible = False +End Sub + +Private Sub cmdReports_Click() + frmRepList.Show 1 +End Sub + +Private Sub cmdSetEnd_Click() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVEND = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtEndSelect = strVEND + ElseIf cboSort.ListIndex = 3 Then + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetEnd_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSetBeg_Click() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double + + On Error Resume Next + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVEND = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblONHAND = lstInventory.ColText + + If cboSort.ListIndex = 0 Then + txtBegSelect = strINVNO + txtEndSelect = strINVNO + ElseIf cboSort.ListIndex = 1 Then + txtBegSelect = strDESC + txtEndSelect = strDESC + ElseIf cboSort.ListIndex = 2 Then + txtBegSelect = strVEND + txtEndSelect = strVEND + ElseIf cboSort.ListIndex = 3 Then + txtBegSelect = strTYPE + txtEndSelect = strTYPE + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdSetBeg_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdFixDesc_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + + +' cdPO.CancelError = True + mstrDESC = InputBox("Enter The Updated Description (45 Char Max)", "New Description", strDESC) + If mstrDESC = "" Then + MsgBox "Description Was Not Changed", vbInformation + vbOKOnly, "No Change" + Exit Sub + Else + mstrDESC = Mid(mstrDESC, 1, 45) + End If + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "IN_DES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) +'******** Update INMAT File + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + +' cboAlias.Clear + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngDESC = d4field(db4, "INMXDES") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngDESC, mstrDESC) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On + +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdFixDesc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboVendor_KeyPress(KeyAscii As Integer) +Dim strControl As String + strControl = Me.ActiveControl.Name + + If KeyAscii = 13 Then + KeyCode = vbTab + KeyAscii = 0 + + cboVendor.SetFocus + cboVendor.col = 1 + gstrVENDOR = cboVendor.ColText + Call mnuCreate_Click + + End If + + If strControl = "cboVendor" Then + If KeyAscii = 27 Then + KeyAscii = 0 + + lblSelectVend.Visible = False + cboVendor.Visible = False + + + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If +End Sub + +Private Sub cmdAlias_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Changing Alias Information - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmAlias.Show 1 + + +End Sub + +Private Sub cmdAltVend2_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + + gboolALTVEND = True + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + gstrSTOCK = strVSTOCK + frmVendAlt2.Show 1 + gstrSTOCK = "" + Call Inventory2Load + +End Sub + +Private Sub cmdAltVendor_Click() +Dim strVENDOR As String * 20, strVSTOCK As String * 20, strAVKEY As String * 80 + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + strVENDOR = InputBox("Enter The Vendor NUMBER for the Vendor Stock Number", "Vendor Number") + strVENDOR = UCase(strVENDOR) + If Trim(strVENDOR) = "" Then + MsgBox "You Must Enter A Vendor Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + strVSTOCK = InputBox("Enter the Vendor STOCK NUMBER to Find", "Vendor Stock #") + strVSTOCK = UCase(strVSTOCK) + If Trim(strVSTOCK) = "" Then + MsgBox "You Must Enter A Vendor Stock Number", vbCritical + vbOKOnly, "Error" + Exit Sub + End If + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVSTOCK") +' mstrAVENDOR = "LEX500 " + mstrSTOCK2 = strVSTOCK + strVENDOR +' mstrSTOCK2 = mstrSTOCK + "LEX500 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK2) + + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If Trim(strSTOCK) = Trim(strVSTOCK) Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(strVENDOR) Then + mstrNSTOCK = f4str(lngVSTOCK) + cboSort.ListIndex = 0 + txtSearch = Trim(mstrNSTOCK) + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + Else + MsgBox "No Vendor Stock Number " & Trim(strVSTOCK) & " Found", vbCritical + vbOKOnly, "No Vendor Stock #" + Exit Sub + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdAltVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAPAR_Click() + frmAPAR.Show 1 +End Sub + +Private Sub cmdImpCMS_Click() + frmPOImp.Show +End Sub + +Private Sub cmdMinMax_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim strMIN As String, strMAX As String, strTType As String +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstInventory.col = 0 + strSTOCK = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblMIN = Field2Str2(lstInventory.ColText) + lstInventory.col = 5 + dblMAX = Field2Str2(lstInventory.ColText) + +' dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + strMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + If strMIN = "" Then + MsgBox "MIN Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMIN) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMIN = Field2Str2(strMIN) + End If +' dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + strMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) + If strMAX = "" Then + MsgBox "MAX Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + If Not IsNumeric(strMAX) Then + MsgBox "Must Be A Number - ReEnter", vbOKOnly, "ReEnter a Number" + Exit Sub + Else + dblMAX = Field2Str2(strMAX) + End If + strCATNBR = "M" + strUDF01 = "N" + strTType = InputBox("Enter The New Type if Desired", "Type", strTYPE) + If strTType = "" Then + MsgBox "TYPE Not Updated", vbOKOnly, "Not Updated" + Exit Sub + End If + strTYPE = strTType + mintBOOKMARK = lstInventory.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") + lngCATNBR = d4field(db4, "IN_CATNBR") + lngUDF01 = d4field(db4, "IN_FIELD01") + lngType = d4field(db4, "IN_TYPE") + lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) + Call f4assign(lngCATNBR, strCATNBR) + Call f4assign(lngUDF01, strUDF01) + Call f4assign(lngType, strTYPE) + Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngType = d4field(db4, "INMXTYPE") + Call f4assign(lngType, strTYPE) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMinMax2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWait.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWait.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdMinMax2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdType2_Click() +Dim dblMIN As Double, dblMAX As Double, strTYPE As String +Dim strSTOCK As String, lngType As Long, lngGLKEY As Long +Dim ARCode As Long, oSTATUS As Long +Dim lngMIN As Long, lngMAX As Long, lngCATNBR As Long, lngUDF01 As Long +Dim strSQL As String, strFILE As String, strCATNBR As String, strUDF01 As String +Dim intBookmark As Integer +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + + lstProcess.col = 0 + strSTOCK = lstProcess.ColText +' lstProcess.Col = 3 +' strTYPE = lstProcess.ColText + lstProcess.col = 4 + dblMIN = Field2Str2(lstProcess.ColText) + lstProcess.col = 5 + dblMAX = Field2Str2(lstProcess.ColText) + + dblMIN = InputBox("Enter the Corrected MIN Amount", "Correct MIN", dblMIN) + dblMAX = InputBox("Enter the Corrected MAX Amount", "Correct MAX", dblMAX) +' strCATNBR = InputBox("Enter The Order Frequency (WMBS)", "Order Frequency", "M") +' strUDF01 = InputBox("Enter Y to Calculate MIN/MAX", "Calc MIN/MAX", "Y") +' strCATNBR = "M" +' strUDF01 = "N" +' strTYPE = InputBox("Enter The New Type if Desired", "Type", strTYPE) + + mintBOOKMARK = lstInventory.ListIndex + intBookmark = lstProcess.ListIndex + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + rc4 = d4seek(db4, strSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngMIN = d4field(db4, "IN_MINQTY") + lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +' lngTYPE = d4field(db4, "IN_TYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") + Call f4assignDouble(lngMIN, dblMIN) + Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) + rc4 = d4flush(db4) + End If + End If + rc4 = d4close(db4) + +' strFILE = gstrCOMPANY & "INMAT.DBF" + +' db4 = d4open(cb, fPath + strFILE) +' lngInvTag = d4tag(db4, "INMXSTOCK") +' Call d4tagSelect(db4, lngInvTag) + +' rc4 = d4seek(db4, strSTOCK) + +' If rc4 = r4success Then +' oSTATUS = d4deleted(db4) +' If oSTATUS = 0 Then +' lngMIN = d4field(db4, "IN_MINQTY") +' lngMAX = d4field(db4, "IN_MAXQTY") +' lngCATNBR = d4field(db4, "IN_CATNBR") +' lngUDF01 = d4field(db4, "IN_FIELD01") +'' lngTYPE = d4field(db4, "INMXTYPE") +' lngGLKEY = d4field(db4, "IN_GLKEY") +' Call f4assignDouble(lngMIN, dblMIN) +' Call f4assignDouble(lngMAX, dblMAX) +' Call f4assign(lngCATNBR, strCATNBR) +' Call f4assign(lngUDF01, strUDF01) +'' Call f4assign(lngTYPE, strTYPE) +' Call f4assign(lngGLKEY, strTYPE) +'' rc4 = d4flush(db4) +' lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) +' Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) +' rc4 = d4flush(db4) + +' End If +' rc = d4seekNext(db, mstrCUSTOMER2) +' End If +' Loop +' rc4 = d4close(db4) + + moRSUpdate!Min = dblMIN + moRSUpdate!Max = dblMAX + moRSUpdate.Update + + lblWait.Visible = True + DoEvents +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Call Inventory2Load + lstProcess.ListIndex = intBookmark + lblWait.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdType2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdOnOrder_Click() + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + + frmOnOrder.Show 1 +End Sub + +Private Sub cmdOpenPO_Click() +' chkNoDisplay = vbUnchecked + frmPOOpen.Show 1 +' chkOKPO = vbUnchecked + If chkOKPO Then + mnuCreate2.Enabled = False + Else + mnuCreate2.Enabled = True + End If + Call Inventory2Load +' chkNoDisplay = vbChecked + lstProcess.ListIndex = 0 + +End Sub + +Private Sub cmdTest_Click() + frmInvAdd2.Show 1 +End Sub + +Private Sub cmdSunburst_Click() +Dim xlInvoice As Excel.Application +Dim strSBFile As String + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strSBFile = cdPO.FileName + + Set xlInvoice = Excel.Workbooks.Item(strSBFile) + +End Sub + +Private Sub cmdPrint_Click() +Dim intYN As Integer, intYN2 As Integer, strFILE As String +Dim intYN3 As Integer, strMSG As String, intYN4 As Integer, intYN5 As Integer +Dim intYN6 As Integer + + On Error GoTo Error_EH + + intYN3 = 0 + intYN = 0 + intYN2 = 0 + intYN4 = 0 + intYN5 = 0 +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 + + strMSG = "Answer YES to Print Checklist by Stock #" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN3 = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Stock #") +' intYN3 = MsgBox("Do You Want To Print A CheckList by Stock #", vbQuestion + vbYesNo, "Print Checklist") + If intYN3 = vbNo Then + strMSG = "Answer YES to Print Checklist by Description" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Sort By Description") +' intYN = MsgBox("Do You Want To Print A CheckList by Description", vbYesNo, "Print Checklist") + End If +' If intYN = vbNo Then + If intYN = vbNo And intYN3 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN4 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Stock #") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo Then + strMSG = "Answer YES to Print A Checklist With No Zeros In Description Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO For More Selections" + intYN5 = MsgBox(strMSG, vbQuestion + vbYesNo, "No Zeros by Description") + End If + If intYN = vbNo And intYN3 = vbNo And intYN4 = vbNo And intYN5 = vbNo Then + strMSG = "Answer YES to Print A Checklist With Barcodes in Stock # Order" + strMSG = strMSG & vbCrLf & vbCrLf & " Click NO To Exit Without Printing Anything" + intYN6 = MsgBox(strMSG, vbQuestion + vbYesNo, "Barcodes by Stock No.") + End If +' End If +' If intYN5 = vbNo Then +' Exit Sub +' End If + + If intYN3 = vbYes Then + strFILE = "\POCheckSTK.rpt" + End If + If intYN = vbYes Then + strFILE = "\POCheckDESC.rpt" + End If + If intYN4 = vbYes Then + strFILE = "\POCheckNoZero.rpt" + End If + If intYN5 = vbYes Then + strFILE = "\POCheckNoZeroD.rpt" +' ElseIf intYN5 = vbNo Then +' Exit Sub + End If + If intYN6 = vbYes Then + strFILE = "\POCheckCP.rpt" + ElseIf intYN6 = vbNo Then + Exit Sub + End If + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + crPO.ReportFileName = App.Path & strFILE + crPO.GroupSelectionFormula = "{tblPOlist.User}= '" & gstrLOGIN & "'" +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPromo_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Promo Detail - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmPromo.Show 1 + +End Sub + +Private Sub cmdSales_Click() + frmInvUsed.Show 1 + Call Inventory2Load +End Sub + +Private Sub cmdTEST2_Click() + frmInvAdd2.Show 1 + Call Inventory2Load + +End Sub + +Private Sub lstInventory_Click() + +'Dim intTEST As Integer + +' intTEST = lstInventory.ListIndex + +' lblCount1 = mintCnt1 +' lblCount2 = mintCnt2 + +' DoEvents +' lblTest = intTEST +' inttext = lstInventory.ListIndex +' mintBOOKMARK12 = lstInventory.ListIndex ' = mintbookmark12 +End Sub + +Private Sub mnuAddInvO_Click() + Call cmdTest_Click + Call Inventory2Load +End Sub + +Private Sub mnuAddS_Click() + + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + frmInvStore.Show 1 + Call Inventory2Load +End Sub + +Private Sub mnuAddV_Click() + If gbytSECURITY = 2 Then + MsgBox "You Should Not Be Adding Inventory - Get A Manager Or See Darv", vbOKOnly, "UnAuthorized" + Exit Sub + End If + Call mnuAddInvO_Click +End Sub + +Private Sub mnuCreate2_Click() + lblBegSelect.Visible = False + lblEndSelect.Visible = False + txtEndSelect.Visible = False + txtBegSelect.Visible = False + txtBegDate.Visible = False + txtEndDate.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + cboVendor.Action = 6 + Call VendLoad + lblSelectVend.Visible = True + cboVendor.Visible = True + cboVendor.SetFocus +End Sub + +Private Sub VendLoad() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCITY As String, strVEND As String, strPHONE As String, strFAX As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCITY As Long, lngVEND As Long, lngPHONE As Long, lngFAX As Long +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "APMSD" + db = d4open(cb, fPath + strSQL) + + rc = d4top(db) + + cboVendor.Clear + cboVendor.SortState = SortStateSuspend + If d4top(db) = r4success Then + + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngRECORD = d4field(db, "AP_FIELD01") + strCode = Trim(f4str(lngRECORD)) + If strCode = "Y" Then + With cboVendor + lngNAME = d4field(db, "AP_NAME") + lngVEND = d4field(db, "AP_VENDOR") + strNAME = f4str(lngNAME) + strVEND = f4str(lngVEND) + .AddItem "A" & vbTab & strVEND & vbTab & strNAME '& vbTab & strCITY & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + End With + End If + End If + rc = d4skip(db, 1) + oSTATUS = rc + Loop While rc = r4success + End If + + rc = d4close(db) + + cboVendor.SortState = SortStateActiveReSort + If cboVendor.ListCount Then + cboVendor.ListIndex = 0 + Else + MsgBox "No Vendors Were Found", vbInformation + vbOKOnly, "No Vendors" + End If +' cboVendor.SortState = SortStateActiveReSort + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module VendLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuHelp_Click() +Dim strMSG As String + +' strMSG = "Ctrl-O = Show A List Of All Purchases For The Highlited Item" & vbCrLf +' strMSG = strMSG & " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = " The Check Box At The Bottom Determines Inventory List or PO List" & vbCrLf + strMSG = strMSG & " F5 = Reload The Inventory List (Will Update Any Changes Made" & vbCrLf + strMSG = strMSG & "F11 = Move The Highlite Line To The Same Place As The Before The Last Action" & vbCrLf + strMSG = strMSG & "Ctrl-G = Show A List Of All Vendors For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-K = Set Order Qty To Zero For All Items In The PO List (Must ReEnter" & vbCrLf + strMSG = strMSG & "Ctrl-D = Display A List Of Every PO That The Highlited Item Was Deleted" & vbCrLf + strMSG = strMSG & "Ctrl-H = Update The Cost For The Highlighted Item In The Order List" & vbCrLf + strMSG = strMSG & "Ctrl-O = Display A List Of Every PO That Was Placed For The Highlited Item" & vbCrLf + strMSG = strMSG & "Ctrl-U = ReCalc The OnOrder Amount For The Item That Is Higlighted In The CMS Inventory List" & vbCrLf + strMSG = strMSG + + MsgBox strMSG, vbOKOnly, "Information Screen" +End Sub + +Private Sub mnuRenumber_Click() + frmInvtry3.Show 1 +End Sub + +Private Sub mnuUpDesc_Click() + Call cmdFixDesc_Click +End Sub + +Private Sub F5On() + lblWait.Caption = "Press F5 To Show Updates" + lblWait.Visible = True + DoEvents +End Sub + +Private Sub F5Off() + lblWait.Visible = False + lblWait.Caption = "Please Wait" + DoEvents +End Sub + +Private Sub cmdUpVendor_Click() +Dim ARCode As Long, oSTATUS As Long, lngVENDOR As Long +Dim strSQL As String, strFILE As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strVENDOR As String, dblALIAS As Double + + On Error GoTo Error_EH + + frmVendor.Show 1 +' DoEvents + mstrSTOCK = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "IN_VENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + strFILE = gstrCOMPANY & "INMAT.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "INMXSTOCK3") +' lngInvTag = d4tag(db4, "INMXSTOCK") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngVENDOR = d4field(db4, "INMXVENDOR") +' strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngVENDOR, gstrVENDOR) +' rc = d4append(db) + rc4 = d4flush(db4) + + End If +' rc = d4seekNext(db, mstrCUSTOMER2) + End If +' Loop + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdUpVendor_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + + +End Sub + +Private Sub mnuUpWgt_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Package Weight For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD07") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpWgt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuUpCase_Click() +Dim ARCode As Long, oSTATUS As Long, lngDESC As Long +Dim strSQL As String, strFILE As String +Dim lngWEIGHT As Long, strWeight As String +'TAG4 pointers +Dim lngInvTag As Long + +'INDEX4 pointers +Dim ind1 As Long +Dim intYN As Integer, strDESC As String, dblALIAS As Double + + On Error GoTo Error_EH + mstrSTOCK = "" + mstrDESC = "" + + mintBOOKMARK = lstInventory.ListIndex + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + lstInventory.col = 10 + strDESC = lstInventory.ColText + + mstrDESC = InputBox("Enter The Units Per Case For The Highlighted Item", "New Weight", strDESC) + strWeight = Mid(mstrDESC, 1, 3) + strFILE = gstrCOMPANY & "INMAS.DBF" + + db4 = d4open(cb, fPath + strFILE) + lngInvTag = d4tag(db4, "IN_STOCK2") + Call d4tagSelect(db4, lngInvTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc4 = d4seek(db4, mstrSTOCK) + + + If rc4 = r4success Then + oSTATUS = d4deleted(db4) + If oSTATUS = 0 Then + lngWEIGHT = d4field(db4, "IN_FIELD08") + strDESC = Trim$(Field2Str(txtDescription)) + Call f4assign(lngWEIGHT, strWeight) + rc4 = d4flush(db4) + + End If + End If + rc4 = d4close(db4) + + + Call F5On +' Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK + 1 +' On Error Resume Next +' DoEvents + lstInventory.SetFocus + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuUpCase" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +' mnuRenumber.Visible = False + If gstrLOGIN = "DWW" Then + frmPO.WindowState = 0 + frmPO.Left = 2 + frmPO.Top = 2 + frmPO.Height = 9600 + frmPO.Width = 12000 + cmdAPAR.Visible = True +' mnuRenumber.Visible = True + End If + If gstrLOGIN = "KLB" Then + chkByDesc = vbChecked + Else + chkByDesc = vbUnchecked + End If + If gstrLOGIN = "CCP" Then + cmdAPAR.Visible = True + End If +' If chkNoDisplay = vbUnchecked Then +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +' End If + If gboolInvList Then + chkHistory = vbChecked + Else + chkHistory = vbUnchecked + End If + frmPO.lblUser = "User: " & gstrLOGIN + +' txtBegSelect = "" +' frmPO.Width = 12000 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) +Dim strControl As String + + strControl = frmPO.ActiveControl.Name +' If Screen.ActiveControl <> "cboVendor" Then + If strControl <> "cboVendor" Then +' If frmPO.ActiveControl <> frmPO.cboVendor Then + If KeyAscii = 27 Then + KeyAscii = 0 + Unload Me + End If + End If + +End Sub + +Private Sub Form_Load() +Dim strSQL As String, strAV As String + mboolALIASFOUND = False +' frmPO.Height = 8760 + + strAV = "SELECT * FROM tblAV ORDER BY StockNo, Vendor" + Set moRSAV = New Recordset + moRSAV.Open strAV, goConn, adOpenDynamic, adLockOptimistic + + mintCnt1 = 0 + mintCnt2 = 0 + lblCount1 = mintCnt1 + lblCount2 = mintCnt2 + + Call InventoryLoad + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set moRSPOList = New Recordset + moRSPOList.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + cboSort.ListIndex = gbytPOSort +' cboSort.ListIndex = 0 + If moRSPOList.RecordCount > 0 Then + Call Inventory2Load + End If + frmPO.Caption = frmPO.Caption & " -- " & gstrCOMPANY & " -- " & gstrLOGIN + frmPO.Width = 12000 + frmPO.Height = 9600 + If gstrLOGIN = "DWW" Then +' cmdPromo.Visible = True +' mnuAddInv.Visible = True + Else +' mnuAddInv.Visible = False + End If + mbytSort = cboSort.ListIndex +' If gboolConn3Bad Then +' MsgBox "History Files From All Stores Are Not Available - Call Darv", vbOKOnly, "No History" +' End If +' mnuAddInv +' If lstProcess.ListCount > 0 Then +' lstProcess.ListIndex = 0 +' End If +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strSQL2 As String +Dim strINVNO As String, strDESC As String, strVEND As String +Dim strTYPE As String, dblONHAND As Double +Dim dblMIN As Double, dblMAX As Double, dblAVAILABLE As Double +Dim dblOrder As Double, intYN As Integer, strMSG As String, intWHOLE As Integer +Dim dblLASTCOST As Double, dblRETAIL1 As Double, dblBUYCON As Double, intREM As Integer +Dim dblONORDER As Double, dblALLTOTAL As Double, dblWEIGHT As Double +Dim strLOrder As String, strLPur As String, strLSALE As String +Dim strWeight As String, strONHAND As String, dblSTDCST As Double + + + On Error Resume Next + intYN = vbYes + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 2 + strVEND = lstInventory.ColText + lstInventory.col = 3 + strTYPE = lstInventory.ColText + lstInventory.col = 4 + dblMIN = lstInventory.ColText + lstInventory.col = 5 + dblMAX = lstInventory.ColText + lstInventory.col = 6 + dblAVAILABLE = lstInventory.ColText + lstInventory.col = 10 + dblONORDER = lstInventory.ColText + lstInventory.col = 11 + dblWEIGHT = lstInventory.ColText + strWeight = lstInventory.ColText +' strWeight = dblWEIGHT + dblALLTOTAL = dblONORDER + dblAVAILABLE + If dblALLTOTAL < dblMIN Then + dblOrder = dblMAX - dblALLTOTAL + Else + dblOrder = 0 + End If + + lstInventory.col = 7 + dblLASTCOST = lstInventory.ColText + lstInventory.col = 8 + dblRETAIL1 = lstInventory.ColText + lstInventory.col = 9 + dblBUYCON = lstInventory.ColText + intREM = dblOrder Mod dblBUYCON + lstInventory.col = 13 + strLOrder = lstInventory.ColText + lstInventory.col = 14 + strLPur = lstInventory.ColText + lstInventory.col = 15 + strLSALE = lstInventory.ColText + lstInventory.col = 18 + strONHAND = lstInventory.ColText + lstInventory.col = 19 + dblSTDCST = lstInventory.ColText + + If NoDups2("tblPOList", "Inv_No", strINVNO, gstrLOGIN) Then +' intWHOLE = 0 + + Else + MsgBox "You Already Have This Item in This PO", vbCritical + vbOKOnly, "Duplicate Item" + Exit Sub + End If + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON 'THis makes the order be in full cases/bundles + End If + + If dblOrder <= 0 Then + strMSG = "The Hi-Lited Stock Item Has An Order Quantity Of Zero Or Less" + strMSG = strMSG & Chr(10) & "Do You Want To Order Anyway?" + + intYN = MsgBox(strMSG, vbQuestion + vbYesNo, "Order Zero or Less") + End If + If intYN = vbYes Then + moRSPOList.AddNew + moRSPOList!inv_no = Field2Str(strINVNO) + moRSPOList!Description = Field2Str(strDESC) + moRSPOList!VENDOR = Field2Str(strVEND) + moRSPOList!Type = Field2Str(strTYPE) + moRSPOList!Min = dblMIN + moRSPOList!Max = dblMAX + moRSPOList!OnOrder = dblONORDER + moRSPOList!Available = dblALLTOTAL +' moRSPOList!Available = dblAVAILABLE + moRSPOList!Order = dblOrder + moRSPOList!OnHand = strONHAND + moRSPOList!LastCost = dblLASTCOST + moRSPOList!Retail1 = dblRETAIL1 + moRSPOList!Weight = dblWEIGHT + moRSPOList!User = gstrLOGIN + moRSPOList!LastOrder = strLOrder + moRSPOList!LastPurchase = strLPur + moRSPOList!LastSale = strLSALE + moRSPOList!StdCost = dblSTDCST + moRSPOList.Update + End If + + Call Inventory2Load + lstProcess.ListIndex = lstProcess.ListCount - 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Inventory2Load() +Dim oSTATUS As Long +Dim oRS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long, dblTotalWgt As Double, dblPOTotal As Double +Dim intYN As Integer, strYN As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lstProcess.Clear + lstProcess.SortState = SortStateSuspend + Do Until oRS.EOF +' intYN = Field2CheckBox(oRS!FixAV) +' If intYN = vbChecked Then +' strYN = "UV" +' Else +' strYN = " " +' End If + lstProcess.AddItem Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!Description) & vbTab & Field2Str(oRS!VENDOR) & vbTab & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!Min) & vbTab & Field2Str(oRS!Max) & vbTab & Field2Str(oRS!Available) & vbTab & Field2Str(oRS!Order) & vbTab & Field2Str(oRS!LastCost) & vbTab & Field2Str(oRS!ListID) & vbTab & Field2Str2(oRS!Weight) & vbTab & Field2Str(oRS!LastOrder) & vbTab & Field2Str(oRS!LastPurchase) & vbTab & Field2Str(oRS!LastSale) & vbTab & Format(Field2Str(oRS!Retail1), "#,#0.00") & vbTab & Format(Field2Str(oRS!StdCost), "#,#0.00") + dblTotalWgt = dblTotalWgt + (Field2Str2(oRS!Weight) * Field2Str2(oRS!Order)) + dblPOTotal = dblPOTotal + (Field2Str2(oRS!Order) * Field2Str(oRS!LastCost)) + oRS.MoveNext + Loop +' End If + + oRS.Close + +' If lstProcess.ListCount Then +' lstProcess.ListIndex = 0 +' End If + lstProcess.SortState = SortStateActiveReSort + txtWeight = Format(dblTotalWgt, "#,#") + txtPOTotal = Format(dblPOTotal, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module Inventory2Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer, intBOOKMARK9 As Integer +Dim strSQL As String, oRS As Recordset, intORDER As Integer +Dim boolPOLIST As Boolean, boolPOOrder As Boolean, strNNCOST As String +Dim strNCOST As String, oRSF As Recordset, strSQLF As String, lngListID As Long +Dim strSTDCST As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyF11 Then ' Display key combinations. + lstInventory.ListIndex = mintBOOKMARK12 + lstProcess.ListIndex = mintBOOKMARK13 + End If + + If KeyCode = vbKeyF5 Then ' Display key combinations. + Call F5Off + mintBOOKMARK12 = lstInventory.ListIndex + lblWait.Caption = "Reloading Inventory" + lblWait.Visible = True + DoEvents + Call InventoryLoad + lstInventory.ListIndex = mintBOOKMARK12 + lblWait.Visible = False + lblWait.Caption = "Please Wait" + End If + + If KeyCode = vbKeyF12 Then ' Display key combinations. +' If CtrlDown Then +' If gbytSECURITY <> 2 Then +' If gstrLOGIN = "DWW" Then + lstInventory.col = 17 + gstrIMAGE = Trim$(lstInventory.ColText) + If Len(gstrIMAGE) > 0 Then + frmImage.Show 1 + Else + MsgBox "No Image File Is Available", vbOKOnly, "No Image" + Exit Sub + End If + +' Call cmdTest_Click +' Call Inventory2Load +' Call UpdatePRList +' End If +' End If + Exit Sub + End If + + If KeyCode = vbKeyQ Then ' Same as adding inventory from another store. + If CtrlDown Then +' If gbytSECURITY <> 2 Then + If gstrLOGIN = "DWW" Then +' Call cmdTest_Click + frmInvStore.Show 1 + Call Inventory2Load +' Call UpdatePRList + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyG Then ' And gbytSECURITY < 3 Then ' Display Alternate Vendors + If CtrlDown Then + txtOrderQty.SetFocus + DoEvents + mintBOOKMARK3 = lstInventory.ListIndex + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + lstInventory.col = 0 + gstrSTOCK = CStr(lstInventory.ColText) + lstInventory.col = 1 + gstrDESC = CStr(lstInventory.ColText) + lstInventory.SortState = SortStateSuspend + frmVendAlt.Show 1 +' Call InventoryLoad + lstInventory.SortState = SortStateActive + lstInventory.ListIndex = mintBOOKMARK3 + KeyCode = vbKeyF5 + DoEvents + KeyCode = vbKeyF11 + DoEvents + End If + Exit Sub + End If + + If KeyCode = vbKeyO Then ' And gbytSECURITY < 3 Then ' Show where the highlited items has been purchased + +' If chkNoDisplay = vbUnchecked Then +' chkNoDisplay = vbChecked +' End If + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK13 = lstProcess.ListIndex + If CtrlDown Then + If chkHistory = vbChecked Then + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + lstInventory.col = 9 + gstrAVAIL = lstInventory.ColText + lstInventory.col = 10 + gstrOrderAmt = lstInventory.ColText + lstInventory.col = 19 + gdblSTDCST = lstInventory.ColText + intBOOKMARK9 = lstInventory.ListIndex + frmOnOrder2.Show 1 + lstInventory.ListIndex = intBOOKMARK9 + Else + lstProcess.col = 0 + gstrONORDER = lstProcess.ColText + lstProcess.col = 1 + gstrDESC = lstProcess.ColText + lstProcess.col = 2 + gstrVENDOR = lstProcess.ColText + intBOOKMARK9 = lstProcess.ListIndex + frmOnOrder2.Show 1 + lstProcess.ListIndex = intBOOKMARK9 + End If + End If +' lstInventory.ListIndex = mintBOOKMARK12 + KeyCode = vbKeyF11 + DoEvents + Exit Sub + End If + +' If KeyCode = vbKeyL Then ' And gbytSECURITY < 3 Then ' Display key combinations. + +' If CtrlDown Then +' lstProcess.Col = 0 +' gstrONORDER = lstProcess.ColText +' lstProcess.Col = 1 +' gstrDESC = lstProcess.ColText +' lstProcess.Col = 2 +' gstrVENDOR = lstProcess.ColText +' intBOOKMARK9 = lstProcess.ListIndex +' mintBOOKMARK5 = lstInventory.ListIndex +' frmOnOrder2.Show 1 +' lstProcess.ListIndex = intBOOKMARK9 +' lstInventory.ListIndex = mintBOOKMARK5 +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyD Then ' And gbytSECURITY < 3 Then ' Show items deleted + If CtrlDown Then + mintBOOKMARK12 = lstInventory.ListIndex + mintBOOKMARK5 = lstInventory.ListIndex + lstInventory.col = 0 + gstrONORDER = lstInventory.ColText + lstInventory.col = 1 + gstrDESC = lstInventory.ColText + lstInventory.col = 2 + gstrVENDOR = lstInventory.ColText + mintBOOKMARK5 = lstInventory.ListIndex + frmOnOrder3.Show 1 + lstInventory.ListIndex = mintBOOKMARK5 + End If + KeyCode = vbKeyF11 + Exit Sub + End If + + If KeyCode = vbKeyK Then ' Changes the Order QTY to 0 - Must reEnter the Desired Qty + If CtrlDown Then +' strSQL = "UPDATE tblPOList SET Order = 0" 'WHERE User = '" & gstrLOGIN & "'" +' goConn.Execute strSQL + strSQL = "SELECT * FROM tblPOList WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF +' intORDER = Field2Str2(oRS!Order) + oRS!Order = 0 + oRS.Update + oRS.MoveNext + Loop + Call Inventory2Load + lstProcess.ListIndex = 0 + End If + Exit Sub + End If + + If KeyCode = vbKeyA Then + If CtrlDown Then + + End If + End If + + If KeyCode = vbKeyW Then + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.col = 8 + strNCOST = lstProcess.ColText + lstProcess.col = 9 + lngListID = Field2Str2(lstProcess.ColText) + lstProcess.col = 15 + strSTDCST = Field2Str2(lstProcess.ColText) + If strSTDCST = "0" Then + MsgBox "BuyIn Price Cannot Be Zero", vbOKOnly, "Price = 0" + Exit Sub + End If +' strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) +' If strNCOST = "" Then +' MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" +' Exit Sub +' End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strSTDCST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + + End If + End If + If KeyCode = vbKeyH Then '** UpDate the Last Cost for the highlighted item + If CtrlDown Then + If lstProcess.ListIndex = -1 Then + MsgBox "Select An Item From The Order List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstProcess.ListIndex + DoEvents + lstProcess.col = 8 + strNCOST = lstProcess.ColText + lstProcess.col = 9 + lngListID = Field2Str2(lstProcess.ColText) + strNCOST = InputBox("Enter The Last Cost You Want To Use", "New Last Cost", strNCOST) + If strNCOST = "" Then + MsgBox "Cancel or ESC Was Pressed", vbOKOnly, "Cancel/ESC" + Exit Sub + End If + strSQLF = "SELECT * FROM tblPOList WHERE ListID = " & lngListID + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenDynamic, adLockOptimistic + If Not oRSF.EOF Then + oRSF!LastCost = Field2Str2(strNCOST) + oRSF.Update + End If + Call Inventory2Load + lstProcess.ListIndex = mintBOOKMARK12 + End If + End If + End If + + If KeyCode = vbKeyU Then 'UPdates The On Order Amount for the highlited item + If CtrlDown Then + If lstInventory.ListIndex = -1 Then + MsgBox "Select An Item From The Inventry List and Try Again", vbOKOnly, "Wrong Item" + Exit Sub + Else + mintBOOKMARK12 = lstInventory.ListIndex + lblWait.Visible = True + lblWait.Caption = "ReCalculate On Order" + DoEvents + Call ChgONOrder + Call FixONOrder + lstInventory.Refresh + lblWait.Visible = False + lblWait.Caption = "Please Wait" + lstInventory.ListIndex = mintBOOKMARK12 + End If + End If + End If + +End Sub + +Private Sub lstProcess_Click() +Dim oRS As Recordset, oRSU As Recordset, strSQLL As String, strTIP2 As String, strTIP As String +Dim strSQL As String, strSTOCK As String, strDESC As String, dblQTY As Double, strNA As String +Dim strLOrder As String, strLPur As String, strLSALE As String ' strNA As String +Dim sglSTDCST As Single + + lstCompare.Clear + lstHistory.Clear +' lstProcess.TextTipDelay = 50 + lstProcess.col = 0 + mstrFStock = lstProcess.ColText + lstProcess.col = 9 + strSTOCK = lstProcess.ColText + lblMessage = "" + lblMessage.Visible = False + lblTest = "" +' strSTOCK = lstProcess.ColText + strNA = "N/A" + + If strSTOCK <> "" Then + strSQL = "SELECT * FROM tblPOList WHERE ListID = " & strSTOCK ' & """" + + Set moRSUpdate = New Recordset + moRSUpdate.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + + lblStock = moRSUpdate!inv_no + lblShowDesc = moRSUpdate!Description + txtOrderQty = moRSUpdate!Order + lblOrderHold = moRSUpdate!Order + strLOrder = Field2Str(moRSUpdate!LastOrder) + strLOrder = Format(strLOrder, "####/##/##") + strLPur = Field2Str(moRSUpdate!LastPurchase) + strLPur = Format(strLPur, "####/##/##") + strLSALE = Field2Str(moRSUpdate!LastSale) + strLSALE = Format(strLSALE, "####/##/##") + sglSTDCST = Field2Str2(moRSUpdate!StdCost) + sglSTDCST = Format(sglSTDCST, "#,#0.00") + lblTest = "Last Order - " & Trim(strLOrder) & vbCrLf + lblTest = lblTest & "Last Purchase - " & Trim(strLPur) & vbCrLf + lblTest = lblTest & "Last Sale - " & Trim(strLSALE) & vbCrLf + If sglSTDCST > 0 Then + lblTest = lblTest & "Buyin Amt - " & Format(sglSTDCST, "#,#0.00") + End If +' lblTest = lblTest & "Std Cost - " & sglSTDCST + +' If Not gboolConn3Bad Then + Call GetTSSHist + Call GetAFNHist + Call GetAFSHist +' Else +' MsgBox "History Files From All Store Not Available - Call Darv", vbOKOnly, "No History" +' End If + + If gstrCOMPANY = "TSS" Then + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFN" Then + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFS" & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + End If + + If gstrCOMPANY = "AFS" Then + If mstrS_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & mstrS_LM & vbTab & mstrS_LY & vbTab & mstrS_YA & vbTab & mstrS_ICLM & vbTab & mstrS_ICLY & vbTab & mstrS_ICYA) + Else + lstHistory.AddItem (Trim(moRSUpdate!inv_no) & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrT_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("TSS" & vbTab & mstrT_LM & vbTab & mstrT_LY & vbTab & mstrT_YA & vbTab & mstrT_ICLM & vbTab & mstrT_ICLY & vbTab & mstrT_ICYA) + Else + lstHistory.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + If mstrN_LM <> " NO SALES INFORMATION FOUND " Then + lstHistory.AddItem ("AFN" & vbTab & mstrN_LM & vbTab & mstrN_LY & vbTab & mstrN_YA & vbTab & mstrN_ICLM & vbTab & mstrN_ICLY & vbTab & mstrN_ICYA) + Else + lstHistory.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + End If + + End If + +' lblMessage.Visible = True +' lblMessage = strTIP + If lstProcess.ListCount <> 0 Then + If gstrCOMPANY = "TSS" Then +' If Not gboolConn3Bad Then + Call GetAFN + Call GetAFS +' Else + +' End If + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + End If + + If gstrCOMPANY = "AFN" Then + Call GetTSS + Call GetAFS + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + If mstrS_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFS" & vbTab & mstrS_LC & vbTab & mstrS_RTL & vbTab & mstrS_VND & vbTab & mstrS_VS & vbTab & mstrS_LPD & vbTab & mstrS_Desc & vbTab & mstrS_TY) + End If + + End If + + If gstrCOMPANY = "AFS" Then + Call GetAFN + Call GetTSS + + If mstrN_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("AFN" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("AFN" & vbTab & mstrN_LC & vbTab & mstrN_RTL & vbTab & mstrN_VND & vbTab & mstrN_VS & vbTab & mstrN_LPD & vbTab & mstrN_Desc & vbTab & mstrN_TY) + End If + + If mstrT_LC = "NO INFORMATION FOUND" Then + lstCompare.AddItem ("TSS" & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA & vbTab & strNA) + Else + lstCompare.AddItem ("TSS" & vbTab & mstrT_LC & vbTab & mstrT_RTL & vbTab & mstrT_VND & vbTab & mstrT_VS & vbTab & mstrT_LPD & vbTab & mstrT_Desc & vbTab & mstrT_TY) + End If + + End If + End If + +' lstProcess.ToolTipText = strTIP2 + mintBOOKMARK2 = lstProcess.ListIndex + txtOrderQty.SetFocus + + End If +End Sub + +Private Sub lstProcess_DblClick() +Dim strSQL As String, strINVNO As String +Dim oRS As Recordset, intBookmark As Integer + lblMessage.Visible = False + lblTest = "" + txtOrderQty = "" + lstProcess.col = 0 + strINVNO = lstProcess.ColText + intBookmark = lstProcess.ListIndex + +' strSQL = "SELECT * FROM tblPOList WHERE Inv_No = '" & Trim(strINVNO) & "'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then + moRSUpdate.Delete +' End If + Call Inventory2Load + If intBookmark >= lstProcess.ListCount Then + intBookmark = lstProcess.ListCount - 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus +End Sub + +Private Sub cmdSetDate_Click() +Dim strMSG As String, intYN As Integer +Dim strBEGDATE As String +Dim strENDDATE As String +Dim intMONTH As Integer, intYEAR As Integer + + strMSG = "Enter the beginning date for Inventory Calculations (MM/DD/YYYY)" + lblBegDate.Visible = True + lblEndDate.Visible = True + lblBegDate2.Visible = True + lblEndDate2.Visible = True + lblBegDate2 = "" + lblEndDate2 = "" + intMONTH = Month(Date) + intYEAR = Year(Date) + intYN = MsgBox("Do You Want To Set The Dates At The Last 30 Days?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBEGDATE = Date - 30 + strENDDATE = Date + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Fiscal Year (Oct-Sep)?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + If intMONTH >= 10 Then + strBEGDATE = "10/01/" & Trim(Str(intYEAR - 1)) & "" + strENDDATE = "09/30/" & Trim(Str(intYEAR)) & "" + Else + strBEGDATE = "10/01/" & Trim(Str(intYEAR - 2)) & "" + strENDDATE = "09/30/" & Trim(Str(intYEAR - 1)) & "" + End If + GoTo FixDate + End If + intYN = MsgBox("Do You Want To Set The Dates At The Last Year?", vbQuestion + vbYesNo, "Set Date") + If intYN = vbYes Then + strBEGDATE = Date - 365 + strENDDATE = Date + GoTo FixDate + End If + strBEGDATE = InputBox(strMSG, "Beginning Date") + If IsDate(strBEGDATE) Then + + Else + If Len(strBEGDATE) > 0 Then + strBEGDATE = Format(strBEGDATE, "00/00/####") + If Not IsDate(strBEGDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Inventory Calculations (MM/DD/YYYY)" + strENDDATE = InputBox(strMSG, "Ending Date") + + If IsDate(strENDDATE) Then + + Else + If Len(strENDDATE) > 0 Then + strENDDATE = Format(strENDDATE, "00/00/####") + If Not IsDate(strENDDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If +FixDate: + lblBegDate2 = strBEGDATE + lblEndDate2 = strENDDATE + mstrBEGDATE = Year(strBEGDATE) & "/" & Format(Month(strBEGDATE), "00") & "/" & Format(Day(strBEGDATE), "00") + mstrENDDATE = Year(strENDDATE) & "/" & Format(Month(strENDDATE), "00") & "/" & Format(Day(strENDDATE), "00") + strENDDATE = "" +End Sub + +Private Sub mnuBegDate_Click() +Dim strMSG As String, intYN As Integer, intYN2 As Index, intYN3 As Integer + + intYN = MsgBox("Do You Want The Last Week", vbQuestion + vbYesNo) + + If intYN = vbYes Then + txtBegDate = Date - 8 + txtEndDate = Date - 1 + End If + strMSG = "Enter the beginning date for Purchase Order Calculations (MM/DD/YYYY)" + txtBegDate = InputBox(strMSG, "Beginning Date", txtBegDate) + + If IsDate(txtBegDate) Then + + Else + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strMSG = "Enter the ending date for Purchase Order Calculations (MM/DD/YYYY)" + + txtEndDate = InputBox(strMSG, "Ending Date", txtEndDate) + If IsDate(txtEndDate) Then + + Else + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +End Sub + +Private Sub mnuBegin_Click() + Call cmdSetBeg_Click +End Sub + +Private Sub mnuClear_Click() + Call cmdClear_Click +End Sub + +Private Sub mnuCPet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Central Pet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CEN500" +' !VENDOR = "CENTPET" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CENTPET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then +' mstrVENDOR = "CENTPET" + mstrVENDOR = "CEN500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CENTPET" + End If + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuTVet_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strTEST1 As String +Dim strCKStock As String, strCKVStock As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" +' strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + strSQL = "SELECT * FROM tblCPImport" ' ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + strTEST1 = Mid(strINPUT, 1, 6) + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + If Not Mid(strINPUT, 1, 1) = vbTab Then + If Not Mid(strINPUT, 1, 2) = "" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + strCKVStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + !VStock = strCKVStock + ' !vstock = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + strCKStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + If strCKStock = "NONE" Then + strCKStock = strCKStock & CStr(intLINENO) + End If + If strCKStock = "" Then + strCKStock = strCKVStock + End If + !inv_no = strCKStock + ' !Inv_No = Field2Str(Trim$(Mid(strINPUT, intStart, (intTAB)))) + ' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + ' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "THOMVET" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update +' Call UpONOrder + End With +' Call UpONOrder + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "THOMVET" + End If + Call GetStock + Call TVPO +' Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuTVet" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuEagle_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer, strInv_No As String, strV_Stock As String +Dim intLength As Integer, boolINVOICE As Boolean, boolDATE As Boolean +Dim strINVOICE As String, strINVDATE As String +Dim strTEST1 As String, strTEST2 As String, strTEST3 As String, strTEST4 As String + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + + boolINVOICE = False + boolDATE = False + + strSQL = "DELETE * FROM tblEagle" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Eagle Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 + strSQL = "SELECT * FROM tblEagle ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + intLength = Len(strINPUT) + If intLength = 73 Then 'And Not boolINVOICE Then + strTEST4 = Mid(strINPUT, 1, 7) + If strTEST4 = "Cargill" Then + strINVOICE = Field2Str(Trim$(Mid(strINPUT, 64, 10))) + boolINVOICE = True + End If + End If + If intLength = 77 And Not boolDATE Then + strINVDATE = Field2Str(Trim$(Mid(strINPUT, 70, 8))) + boolDATE = True + End If + If intLength = 79 Then + strTEST1 = Mid(strINPUT, 1, 8) + strTEST2 = Mid(strINPUT, 77, 3) + strTEST3 = Mid(strINPUT, 35, 5) + If Not (strTEST1 = "Customer" Or strTEST1 = " Please ") Then 'Or Not strTEST2 = "LBS" Then + If Not strTEST2 = "LBS" Then + If Not strTEST3 = "STORE" Then + ' If Not Mid(strINPUT, 1, 8) = "Customer" Or Not Mid(strINPUT, 77, 3) = "LBS" Then + intSTART = 18 + With moRSInv + intAUX = 0 + intTAB = 10 'InStr(intSTART, strINPUT, Chr(9)) + strV_Stock = Field2Str(Trim$(Mid(strINPUT, intSTART, intTAB))) + If Trim(strV_Stock) <> "FS" Then + .AddNew + !VStock = strV_Stock + !VDesc = Field2Str(Trim$(Mid(strINPUT, 28, 25))) + intSTART = 1 + intTAB = 11 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + intSTART = 53 'intSTART + intTAB + 1 + intTAB = 12 '(InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !Invoice = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = strINVOICE 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "CAR400" + + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + !VENDOR = "CARGANI" + End If + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = strINVDATE + .Update + + End If + End With + End If + End If + End If + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblEagle" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "CAR400" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "CARGANI" + End If + Call GetStock + Call EAPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form PO - Module ImportEagle" + Call ErrorHandler2 + gstrMODULE = "" +End Sub + +Private Sub EAPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + +' On Error GoTo Error_EH + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblEagle" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!Invoice + + + Do Until oRS.EOF + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = oRS!lineno + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = Trim(Field2Str(oRS!inv_no)) + moRSPODetail!vstockno = oRS!VStock + moRSPODetail!Desc = Trim(oRS!Description) + strTEST = Left(Trim(oRS!Description), 4) +' moRSPODetail!qty = dblQORDER + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!Weight = Field2Str2(oRS!Weight) + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "CAR400" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CAR400" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CARGANI" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CARGANI" + moRSPOHeader!vendorname = "Cargill Animal Nutrition" + moRSPOHeader!vaddress1 = "P.O. Box 15007" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Casa Grande" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85230-5007" + moRSPOHeader!VPhone = "(888) 220-6455" + moRSPOHeader!VFAX = "(800) 962-3344" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "ANDREW" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 3 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module EAPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuLabels_Click() + frmLabels.Show 1 +End Sub + +Private Sub mnuLextron_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblLextron" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Lextron Invoice Date MM/DD/YYYY", "Invoice Date", Date) + strPONUM = InputBox("Enter the Orginal PO Number", "PO Number") + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblLextron ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT +' If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, 10))) + intSTART = 14 + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, 30))) + intSTART = 56 + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, 6))) + intSTART = 61 + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, 9))) + intSTART = 70 + !lineno = intLINENO + intLINENO = intLINENO + 1 + !VENDOR = "LEX500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblLextron" + Call GetStock + Call LEXPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuCPet" + Call ErrorHandler2 + gstrMODULE = "" + Close #1 +End Sub + +Private Sub mnuCreate_Click() +Dim intYN As Integer, intYN2 As Integer, strFILE As String, intYN3 As Integer +Dim intOK As Integer, intOK2 As Integer, strMSG As String + + On Error GoTo Error_EH + + gstrMODULE = "Point 1 " +' lstInventory.SetFocus + Call POCreate + gstrMODULE = gstrMODULE & "Point 2 " + If mintYN = vbNo Then + Exit Sub + End If + gstrMODULE = gstrMODULE & "Point 3 " +' If gstrLOGIN = "DWW" Then + If gboolPOPrint Then + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton2, "Print PO") ', , vbDefaultButton2) + Else + intYN = MsgBox("Do You Want To Print A PO Now", vbQuestion + vbYesNo + vbDefaultButton1, "Print PO") ', , vbDefaultButton2) + End If +' intYN = MsgBox("Do You Want To Print A PO Now", vbYesNo, "Print PO", , vbDefaultButton2) + If intYN = vbYes Then + cdPO.CancelError = True + cdPO.Flags = 64 + cdPO.Action = 5 ' &H40 + intYN2 = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Print to Printer") + intYN3 = MsgBox("Do You Want To Use Vendor Stock #'s", vbYesNo, "Use Vendor Stock") + If intYN3 = vbYes Then +' If Not chkByDesc Then + If chkByDesc = vbUnchecked Then + strFILE = "\POVend.rpt" + Else + strFILE = "\POVDesc.rpt" + End If + Else + If chkByDesc = vbUnchecked Then + strFILE = "\PO.rpt" + Else + strFILE = "\PODesc.rpt" + End If + End If + crPO.ReportFileName = App.Path & strFILE + crPO.GroupSelectionFormula = "{tblPOHeader.PONum}=" & glngPO +' crPO.ReportFileName = PO.rpt + If intYN2 = vbYes Then +' cdPO.CancelError = True +' cdPO.Flags = 64 +' cdPO.Action = 5 ' &H40 + gintDEST = crptToPrinter + Else + gintDEST = crptToWindow + End If + crPO.PrinterCopies = 1 + crPO.Destination = gintDEST + crPO.Action = 1 + End If + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form PO - Module mnuCreate" + Call ErrorHandler2 + gstrMODULE = "" +' Close #1 +End Sub + +Private Sub mnuEnding_Click() + Call cmdSetEnd_Click + +End Sub + +Private Sub mnuExit_Click() + Unload Me +End Sub + +Private Sub mnuMinMax_Click() + mboolALL = False + +' strMSG = "Do You Want To Update CMS OnOrder Amount Before Creating The New PO?" +' strMSG = strMSG & Chr(10) & "This May Take As Long As 2 Minutes To Run" +' intOK = MsgBox(strMSG, vbYesNo, "Update ONORDER") +' If intOK = vbYes Then +' Call cmdZeroOnOrd_Click +' Call cmdReCalc_Click +' ElseIf intOK = vbNo Then + +' End If + + Call cmdPartial_Click +End Sub + +Private Sub mnuPOSSales_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" + strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad2 + Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub mnuSelALL_Click() +Dim strMSG As String + If cboSort.ListIndex <> 2 Or txtBegSelect = "" Then 'Or Not IsDate(txtBegDate) Or (txtBegSelect <> txtEndSelect) Then + strMSG = "The Select ALL For 1 Vendor Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected" + strMSG = strMSG & Chr(10) & "Only 1 Vendor Can Be Selected" +' strMSG = strMSG & Chr(10) & "A Beginning and Ending Date is also Required -- ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "Vendor Required" +' MsgBox "The Select by POS Sales Must have Vendor as the Sort Field and a Beginning & Ending Vendor Selected", vbOKOnly, "Vendor Required" + Exit Sub + End If + lblMessage.Caption = "Selecting Items Using Seletion Criteria - Be PATIENT" + lblMessage.Visible = True + DoEvents + mboolALL = True + Call cmdImportInv_Click + Call SelectPartialLoad3 +' Call SelectPartialLoad2 +' Call CalcSales + Call Inventory2Load + lblMessage.Visible = False + mboolALL = False + +End Sub + +Private Sub CalcSales2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strSTOCK As String, strDATE As String +Dim strYEAR As String, strMONTH As String, strDAY As String, strBDATE As String +Dim strMSG As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + gboolVEND = True + + frmVendor.Show 1 + +' On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + mstrSTOCK = Field2Str(oRS!inv_no) + strYEAR = Format(Year(txtBegDate), "0000") + strMONTH = Format(Month(txtBegDate), "00") + strDAY = Format(Day(txtBegDate), "00") + strBDATE = strYEAR + strMONTH + strDAY +' strDATE = txtBegDate + strSTOCK = mstrSTOCK + strBDATE + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strSTOCK) +' db = d4open(cb, fPath + strSQL) + +' rc = d4top(db) + +' lstInventory.SortState = SortStateSuspend +' If d4top(db) = r4success Then + +' Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + mlngCOUNT = mlngCOUNT + 1 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngLSTCOST = d4field(db, "IN_LSCOST") + lngRETAIL1 = d4field(db, "IN_PRICE1") + lngBUYCON = d4field(db, "IN_ALTRN1") + lngONORDER = d4field(db, "IN_ORDERTE") + strINVNO = Trim(f4str(lngNAME)) + strDESC = Trim(f4str(lngCUST)) + strVEND = Trim(f4str(lngVEND)) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblALLTOTAL = dblONORDER + dblAVAIL + dblLSTCOST = f4double(lngLSTCOST) + dblRETAIL1 = f4double(lngRETAIL1) + dblCost = f4double(lngLSTCOST) + dblBUYCON = f4double(lngBUYCON) + If cboSort.ListIndex = 0 Then + If Trim$(strINVNO) >= Trim$(strBEG) And Trim$(strINVNO) <= Trim$(strEND) Then + ' If dblAVAIL <= dblMIN Then + ' dblOrder = dblMAX - dblAVAIL '**************** + If dblALLTOTAL <= dblMIN Then + dblOrder = dblMAX - dblALLTOTAL '**************** + intREM = dblOrder Mod dblBUYCON + If dblBUYCON > 1 And intREM > 0 Then + intWHOLE = Int((dblOrder / dblBUYCON) + 0.99) + dblOrder = intWHOLE * dblBUYCON + ' dblOrder = intWHOLE + End If + If dblOrder > 0 Then + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX + !Available = dblALLTOTAL + ' !Available = dblAVAIL + !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !User = gstrLOGIN + .Update + End With + End If + End If + End If + End If + rc = d4skip(db, 1) + End If + + rc = d4close(db) + oRS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(25), Chr(34), "") +''' test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) +''' dblQTY = Replace(strG(28), Chr(34), "") + dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If +''' strDESC = Replace(strG(26), Chr(34), "") + strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(37), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then +'' strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" +'' Set oRSS = New Recordset +'' oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock +'' If Not oRSS.EOF Then +'' strDiscCost = Replace(strF(3), Chr(34), "") +'' strNET = Mid$(strDiscCost, 1, 8) +'' If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) +'' bytLEN = Len(strDiscCost) +'' bytLEN2 = bytLEN - 8 +'' dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) +'' oRSS!Cost = Round(dblDCost, 4) +' oRS.Save +'' oRSS.Update +'' End If +'' End If +'' End If 'May Need To Comment Out + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina2_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, dblQTY As Double, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strLINE2 As String, strG() As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + Line Input #1, strLine + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") +'''' test0 = Replace(strF(25), Chr(34), "") + test0 = Replace(strF(24), Chr(34), "") +' test0 = Replace(strF(23), Chr(34), "") + + If test0 <> "" And test0 <> "0.00" Then +' If test0 = "HDR10" Then +' strINVOICE = Replace(strF(5), Chr(34), "") + Line Input #1, strLINE2 + strG = Split(strLINE2, ",") +' ElseIf test0 = "DTL10" Then +' dblQTY = Field2Str2(strG(28)) + dblQTY = Replace(strG(28), Chr(34), "") +'''' dblQTY = Replace(strG(29), Chr(34), "") +'' If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strSTOCK = Replace(strG(24), Chr(34), "") + strSTOCK = test0 'Replace(strG(24), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strG(26), Chr(34), "") +'''' strDESC = Replace(strG(27), Chr(34), "") + strINVOICE = Replace(strG(9), Chr(34), "") + dblCost = Replace(strG(36), Chr(34), "") +' dblCost = CDbl(Field2Str2(strG(36))) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = dblQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(dblQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf dblQTY = 0 Then + + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina1_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset, strNetCost As String +Dim bytLEN As Byte, bytLEN2 As Byte, bytLEN3 As Byte, strASTRICK As String + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then +' strCELL = Replace(strF(3), Chr(34), "") +' strSTOCK = Mid$(strCELL, 1, 12) +' strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") + strSTOCK = Replace(strF(2), Chr(34), "") + strASTRICK = Right(strSTOCK, 2) + If strASTRICK = "**" Then + bytLEN3 = Len(strSTOCK) + strSTOCK = Left(strSTOCK, (bytLEN3 - 2)) + strSTOCK = RTrim(strSTOCK) + End If + strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" +' oRS!VENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then +' strNetCost = Mid$(strDiscCost, 1, 8) + bytLEN = Len(strDiscCost) + bytLEN2 = bytLEN - 8 + dblDCost = Field2Str2(Right$(strDiscCost, bytLEN2)) +' dblDCost = Field2Str2(Right$(strDiscCost, 10)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" +' mstrVENDOR = "PURIMIL" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module mnuPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuPurina0126_Click() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer +'Dim strF1 As String, strF2 As String, strF3 As String, strF4 As String, strF5 As String +'Dim strF6 As String, strF7 As String, strF8 As String, strF9 As String, strF10 As String +'Dim strF11 As String, strF12 As String, strF13 As String, strF14 As String, strF15 As String +Dim strF() As String, strDiscCost As String, dblDCost As Double +Dim strLine As String, strNET As String, strFIND As String +Dim strSQLL As String, oRSS As Recordset + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intRow = 1 + Open strLOCATE For Input As #1 + + Do Until EOF(1) + Line Input #1, strLine + If Trim$(strLine) <> "" Then + strF = Split(strLine, ",") + test0 = Replace(strF(0), Chr(34), "") + + If test0 = "HDR10" Then + strINVOICE = Replace(strF(5), Chr(34), "") + ElseIf test0 = "DTL10" Then + lngQTY = Field2Str2(strF(4)) + If lngQTY > 0 Then + strCELL = Replace(strF(3), Chr(34), "") + strSTOCK = Mid$(strCELL, 1, 12) + strDESC = Mid$(strCELL, 16, 30) +' strSTOCK = Replace(strF(2), Chr(34), "") +' strDESC = Replace(strF(3), Chr(34), "") + dblCost = Field2Str2(strF(5)) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mdblQORDER = Field2Str2(lngQTY) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + ElseIf lngQTY = 0 Then + strSQLL = "SELECT * FROM tblCPImport WHERE VStock = '" & strSTOCK & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + +' strFIND = "VStock = '" & strSTOCK & "'" +' oRS.MoveFirst +' oRS.Find strFIND +' oRS.MoveLast +' strSTOCK = oRS!vstock + If Not oRSS.EOF Then + strDiscCost = Replace(strF(3), Chr(34), "") + strNET = Mid$(strDiscCost, 1, 8) + If strNET = "Net Cost" Then + dblDCost = Field2Str2(Right$(strDiscCost, 13)) + oRSS!Cost = Round(dblDCost, 4) +' oRS.Save + oRSS.Update + End If + End If + End If + End If + End If + Loop + + oRS.Close + Close (1) + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + Screen.MousePointer = 0 + + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub PurninaHold() +Dim intRow As Integer, boolSTOP As Boolean, intLINENO As Integer +Dim strLOCATE As String, strCHECK As String +'Dim strSTONE As String, strDESC As String, dblPRICE As Double +Dim dblCost As Double, lngQTY As Long, strSTOCK As String, strDESC As String +Dim oRS As Recordset, strSTK_DESC As String +Dim strSQL As String, strPATH As String, dblPRICE5 As Double +Dim strTYPE As String, strINVOICE As String, strCELL As String +Dim boolCHECK As Boolean, intCHECK As Integer + + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + intLINENO = 1 + boolSTOP = False + boolCHECK = False + intCHECK = 0 + If ExcelOpen() Then + ' Add New WorkBook + + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + mstrDATE = InputBox("Enter The Purina Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) ' & "\JHDPrice.xls") + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If oRS.EOF Then + End If + ' Load data into Excel + intRow = 1 + Do Until boolCHECK +' Do Until strCHECK = "TLR10" +' Do Until boolSTOP + strTYPE = Trim$(.Cells(intRow, 1).Value) + If strTYPE = "HDR10" Then + strINVOICE = Trim$(.Cells(intRow, 6).Value) +' intRow = intRow + 1 + ElseIf strTYPE = "DTL10" Then + lngQTY = Round((.Cells(intRow, 5).Value), 0) + If lngQTY > 0 Then + strCELL = Trim$(.Cells(intRow, 4).Value) + strSTOCK = Mid$(strCELL, 1, 14) + strDESC = Mid$(strCELL, 16, 30) + dblCost = Round((.Cells(intRow, 6).Value), 4) + oRS.AddNew + oRS!VStock = strSTOCK + oRS!VDesc = strDESC 'Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + oRS!Order = lngQTY 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!Cost = dblCost 'Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + oRS!lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + oRS!VENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + oRS!VENDOR = "PURIMIL" + End If + oRS!Description = " " + oRS!Type = "" + oRS!LastCost = 0 + oRS!Retail1 = 0 + oRS!InvDate = mstrDATE + oRS!Invoice = strINVOICE + oRS.Update + + End If + End If + intRow = intRow + 1 + strCHECK = .Cells(intRow, 1).Value + If strCHECK = "TLR10" Then + intCHECK = 1 + End If + If strCHECK = "" And intCHECK = 1 Then + intCHECK = 2 + ElseIf strCHECK = "" And intCHECK = 2 Then + boolCHECK = True + ElseIf strCHECK = "HDR10" And intCHECK = 2 Then + intCHECK = 0 + End If + Loop + End With + oRS.Close + End If + goExcel.Quit + + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "PUR500" + ElseIf gstrCOMPANY = "AFN" Or gstrCOMPANY = "AFS" Then + mstrVENDOR = "PURIMIL" + End If + Call GetStock + Call PURPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub + Exit Sub + +Error_EH: + gstrMODULE = "Form POOpen - Module ImportPurina" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub mnuReports_Click() + Call cmdReports_Click +End Sub + +Private Sub mnuThomp2_Click() +Dim strVSTOCK As String, strSTOCK As String, strVDESC As String +Dim strQTY As String, strCOST As String, strINVNO As String +Dim strINPUT As String, strSQL As String, strFILE As String +Dim strFLAG As String, intAUX As Integer, strTEST As String +Dim strSQLL As String, intTAB As Integer, intSTART As Integer, intOLD As Integer +Dim intLINENO As Integer + +'Import data from e-mailed file into table for subsiquent import into PO table +'Need pricing report for this to be useful + + On Error GoTo Error_EH + +' strSQL = "DELETE * FROM " & mstrTABLE 'tblCPImport" + strSQL = "DELETE * FROM tblCPImport" + goConn.Execute strSQL + + cdPO.Action = 1 + strFILE = cdPO.FileName + + mstrDATE = InputBox("Enter The Thompson Vet Invoice Date MM/DD/YYYY", "Invoice Date", Date) + + If IsDate(mstrDATE) Then + + Else + If Len(mstrDATE) > 0 Then + mstrDATE = Format(mstrDATE, "00/00/####") + If Not IsDate(mstrDATE) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + MousePointer = 11 +' strSQL = "SELECT * FROM " & mstrTABLE 'tblCPImport" + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" + Set moRSInv = New Recordset + moRSInv.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + intLINENO = 1 + + Open strFILE For Input As #1 + + Do Until EOF(1) + Line Input #1, strINPUT + If Not Mid(strINPUT, 1, 6) = "VENDOR" Then + intSTART = 1 + With moRSInv + intAUX = 0 + .AddNew + intTAB = InStr(intSTART, strINPUT, Chr(9)) + !VStock = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) + intSTART = intSTART + intTAB + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !inv_no = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Inv_No = Field2Str(Mid(strINPUT, 11, 7)) + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !VDesc = Field2Str(Trim$(Mid(strINPUT, intSTART, (intTAB - 1)))) +' !VDesc = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Order = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Order = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Cost = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Cost = "" + intSTART = intSTART + intTAB + 1 + intOLD = intTAB + intTAB = (InStr(intSTART, strINPUT, Chr(9))) - intSTART + !Invoice = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) + mstrCP_PO = Field2Str2(Trim$(Mid(strINPUT, intSTART, (intTAB)))) +' !Invoice = "" + !lineno = intLINENO + intLINENO = intLINENO + 1 + If gstrCOMPANY = "TSS" Then + !VENDOR = "THO500" + Else + !VENDOR = "THOMVET" + End If + +' !VENDOR = "THO500" + !Description = " " + !Type = "" + !LastCost = 0 + !Retail1 = 0 + !InvDate = mstrDATE + .Update + End With + End If + Loop + moRSInv.Close + Close #1 + mstrTABLE = "tblCPImport" + If gstrCOMPANY = "TSS" Then + mstrVENDOR = "THO500" + Else + mstrVENDOR = "THOMVET" + End If +' mstrVENDOR = "THO500" + Call GetStock + Call CPPO + MsgBox "Import of Invoice Information Complete", vbInformation + vbOKOnly, "Import Done" + MousePointer = 0 + Exit Sub +Error_EH: + If Err = cdlCancel Then + MsgBox "The Import Was Canceled", vbCritical + vbOKOnly, "Cancel" + Exit Sub + End If + gstrMODULE = "Form Main - Module mnuThomp" + Call ErrorHandler2 + gstrMODULE = "" + +End Sub + +Private Sub mnuUpVendor_Click() + Call cmdUpVendor_Click +End Sub + +Private Sub txtBegSelect_GotFocus() + txtBegSelect.SelStart = 0 + txtBegSelect.SelLength = 1000 +End Sub + +Private Sub txtEndSelect_GotFocus() + txtEndSelect.SelStart = 0 + txtEndSelect.SelLength = 1000 +End Sub + +Private Sub txtOrderQty_Click() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + txtOrderQty.SetFocus +End Sub + +Private Sub txtOrderQty_GotFocus() + txtOrderQty.SelStart = 0 + txtOrderQty.SelLength = 100 + +End Sub + +Private Sub txtOrderQty_KeyPress(KeyAscii As Integer) +Dim intBookmark As Integer + + If KeyAscii = vbKeyReturn Then +' MsgBox "THis is a test" + If txtOrderQty <> lblOrderHold Then + intBookmark = lstProcess.ListIndex + If IsNumeric(txtOrderQty) Then + moRSUpdate!Order = (txtOrderQty) + Else + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid Number" + moRSUpdate!Order = 0 + txtOrderQty.SetFocus + Exit Sub +' moRSUpdate!Order = 0 + End If + moRSUpdate.Update + txtOrderQty = "" + lblOrderHold = "" + Call Inventory2Load + If mintBOOKMARK2 >= lstProcess.ListCount - 1 Then + intBookmark = lstProcess.ListCount - 1 + Else + intBookmark = intBookmark + 1 + End If + lstProcess.ListIndex = intBookmark +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + Else + lstProcess.ListIndex = lstProcess.ListIndex + 1 +' txtOrderQty.SetFocus + Call txtOrderQty_Click + Exit Sub + End If + End If +' txtOrderQty.SetFocus +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstInventory.SearchText = txtSearch.Text +lstInventory.SearchMethod = 2 +lstInventory.Action = ActionSearch +lstInventory.SearchIndex = -1 +lstInventory.Action = 0 + + If lstInventory.SearchIndex <> -1 Then + lstInventory.TopIndex = lstInventory.SearchIndex + lstInventory.ListIndex = lstInventory.SearchIndex + Else + lstInventory.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_GotFocus() + txtSearch.SelStart = 0 + txtSearch.SelLength = 1000 +End Sub + +Private Sub POCreate() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Long +Dim lngPOID As Long, strOrderDate As String, strDueDate As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngAdd1 As Long +Dim lngAdd2 As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long, lngSTOCK As Long, lngONORDER As Long +Dim lngTTLWEIGHT As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strAdd2 As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String, dblCALCONORDER As Double +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double, dblONORDER As Double +Dim lngONHAND As Long, dblONHAND As Double, strBUYER As String +Dim dblEXT As Double, dblQORDER As Double, dblQCost As Double, strONHAND As String +Dim lngDueCtl As Long, lngDueDay As Long, lngDisCtl As Long, lngDisDay As Long +Dim lngDUECTL2 As Long, lngDUEDAY2 As Long, lngDISCTL2 As Long, lngDISDAY2 As Long +Dim lngAPCODE As Long, strAPCODE As String, intYNNote As Integer +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long, lngPOS As Long +Dim strYEAR As String, strMONTH2 As String, strDAY As String, strDATE As String +Dim lngODATE As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + intYNNote = vbNo + strYEAR = Year(Date) + strMONTH2 = Format(Month(Date), "00") + strDAY = Format(Day(Date), "00") + strDATE = strYEAR & strMONTH2 & strDAY + + gstrMODULE = "Before frmVendor.Show" + lngTTLWEIGHT = 0 + mintYN = vbYes +' frmVendorLook.Show 1 +' frmVendor.Show 1 + If gstrVENDOR = "" Then + MsgBox "No Vendor Selected", vbCritical + vbOKOnly, "No PO Created" + mintYN = vbNo + Exit Sub + End If +' On Error GoTo Error_EH + strOrderDate = InputBox("Enter The PO Order Date", "PO Order Date", Date) + + gstrMODULE = "Point 1 " + If IsDate(strOrderDate) Then + + Else +' lngPOS = InStr(1, strOrderDate, "/", 1) +' If lngPOS = 0 Then + If Len(strOrderDate) > 0 Then + strOrderDate = Format(strOrderDate, "00/00/####") + If Not IsDate(strOrderDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strDueDate = InputBox("Enter the Due Date for the PO", "PO Due Date", (Date + 1)) + + If IsDate(strDueDate) Then + + Else + If Len(strDueDate) > 0 Then + strDueDate = Format(strDueDate, "00/00/####") + If Not IsDate(strDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + End If + End If + End If + strBUYER = InputBox("Enter The Name Of The Person Creating The PO", "Buyer's Name", "This is Required") + If strBUYER = "This is Required" Or Trim$(strBUYER) = "" Then + MsgBox "You have entered an invalid Buyer -- NO PO WILL BE CREATED", vbCritical + vbOKOnly + mintYN = vbNo + lblSelectVend.Visible = False + cboVendor.Visible = False + lblBegSelect.Visible = True + lblEndSelect.Visible = True + txtEndSelect.Visible = True + txtBegSelect.Visible = True + txtBegDate.Visible = True + txtEndDate.Visible = True + lblBegDate.Visible = True + lblEndDate.Visible = True + Exit Sub + Else + intYNNote = MsgBox("Do You Want To Add Notes To This PO?", vbYesNo + vbDefaultButton2, "Add Notes?") + + + End If + strBUYER = UCase(strBUYER) + gstrMODULE = "Point 2 " + + cb = code4init + lngPOLineNum = 1 + + strSQL = "Select * FROM tblProgInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = Field2Str2(oRS!NextPO) + glngPO = lngNextPO + oRS!NextPO = lngNextPO + 1 + oRS.Update + + strVENDOR = gstrVENDOR + + strSQL = "SELECT * FROM tblPOHeader" + + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + '******* + strSQL = gstrCOMPANY & "APMSD" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "AP_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR) + gstrMODULE = "Point 3 " + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngVEND = d4field(db, "AP_VENDOR") + lngNAME = d4field(db, "AP_NAME") + lngAdd1 = d4field(db, "AP_ADDR1") + lngAdd2 = d4field(db, "AP_ADDR2") + lngCITY = d4field(db, "AP_CITY") + lngState = d4field(db, "AP_STATE") + lngZIP = d4field(db, "AP_ZIP") + lngPHONE = d4field(db, "AP_PHONE") + lngFAX = d4field(db, "AP_FAX") + lngAPCODE = d4field(db, "AP_CODE") + lngDueCtl = d4field(db, "AP_DUECTL") + lngDisCtl = d4field(db, "AP_DISCTL") + lngDueDay = d4field(db, "AP_DUEDAY") + lngDisDay = d4field(db, "AP_DISDAY") + + strVEND = Field2Str(f4str(lngVEND)) + strNAME = f4str(lngNAME) + strAdd1 = f4str(lngAdd1) + strAdd2 = f4str(lngAdd2) + strCITY = f4str(lngCITY) + strState = f4str(lngState) + strZIP = f4str(lngZIP) + strPHONE = f4str(lngPHONE) + strFAX = f4str(lngFAX) + strAPCODE = f4str(lngAPCODE) + lngDUECTL2 = f4long(lngDueCtl) + lngDISCTL2 = f4long(lngDisCtl) + lngDUEDAY2 = f4long(lngDueDay) + lngDISDAY2 = f4long(lngDisDay) + + moRSPOHeader.AddNew + moRSPOHeader!ponum = lngNextPO +' moRSPOHeader!VendorID = Trim(gstrVENDOR) + moRSPOHeader!vendorid = Trim(strVEND) + moRSPOHeader!vendorname = Trim(strNAME) + moRSPOHeader!vaddress1 = Trim(strAdd1) + moRSPOHeader!vaddress2 = Trim(strAdd2) + moRSPOHeader!vcity = Trim(strCITY) + moRSPOHeader!vstate = Trim(strState) + moRSPOHeader!vzip = Trim(strZIP) + moRSPOHeader!VPhone = Trim(strPHONE) + moRSPOHeader!VFAX = Trim(strFAX) + moRSPOHeader!OrderDate = strOrderDate + moRSPOHeader!DueDate = strDueDate + moRSPOHeader!Buyer = strBUYER + moRSPOHeader!duectl = lngDUECTL2 + moRSPOHeader!disctl = lngDISCTL2 + moRSPOHeader!dueday = lngDUEDAY2 + moRSPOHeader!disday = lngDISDAY2 + moRSPOHeader!CreateID = gstrLOGIN + If Trim(strAPCODE) = "ACC" Then + moRSPOHeader!CCard = vbChecked + Else + moRSPOHeader!CCard = vbUnchecked + End If + moRSPOHeader.Update + End If +'' End If + rc = d4close(db) + + strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & lngNextPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + mstrAVENDOR = moRSPOHeader!vendorid + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + gstrMODULE = "Point 4 " + Do Until oRS.EOF +'************** + mstrSTOCK = Trim(oRS!inv_no) + strSQL = gstrCOMPANY & "INMAS" + gstrMODULE = "Point 5 " + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngODATE = d4field(db, "IN_LSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDATE) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + gstrMODULE = "Point 5.1 " + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + gstrMODULE = "Point 5.2 " + '*************** This may be good logic to keep the on order amounts correct + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + gstrMODULE = "Point 5.3 " + gstrMODULE = "mstrSTOCK = " & mstrSTOCK + gstrMODULE = gstrMODULE & " Make Sure On Order is Zero" + + strONORDER = f4str(lngONORDER) + strONORDER = Field2Str2(strONORDER) + dblONORDER = CDbl(strONORDER) + ' dblONORDER = f4str(lngONORDER) + gstrMODULE = "dblONORDER = " & dblONORDER + dblQORDER = Field2Str2(oRS!Order) + gstrMODULE = "dblQORDER = " & dblQORDER + dblCALCONORDER = dblONORDER + dblQORDER + gstrMODULE = "dblCALCONORDER = " & dblCALCONORDER + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) + Call f4assign(lngODATE, strDATE) + gstrMODULE = "Point 5.4 " + + End If + gstrMODULE = "Point 6 " + + rc = d4close(db) + + '************** + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + If Field2Str2(oRS!Order) > 0 Then + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + ' mstrSTOCK = Trim(oRS!Inv_No) + ' If oRS!new = 1 Then + If oRS!New = True Then + moRSPODetail!vstockno = Field2Str(oRS!VStock) + ElseIf Len(Field2Str(oRS!VStock)) > 0 Then '***** This may need to be removed if it causes PO to not have a vendor stock number + moRSPODetail!vstockno = Field2Str(oRS!VStock) + Else + Call GETAVINFO + mstrADDVStock = Trim(mstrVSTOCK) + If Len(mstrADDVStock) = 20 Then + mstrADDVStock = "" + End If + moRSPODetail!vstockno = mstrADDVStock + End If + ' If Len(mstrADDVStock) = 20 Then + ' mstrADDVStock = "" + ' End If + ' moRSPODetail!vstockno = mstrADDVStock + moRSPODetail!Desc = Trim(oRS!Description) + moRSPODetail!BalQty = Field2Str2(oRS!Order) + moRSPODetail!Qty = Field2Str2(oRS!Order) + moRSPODetail!Cost = Field2Str2(oRS!LastCost) + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!Min = Field2Str2(oRS!Min) + moRSPODetail!Max = Field2Str2(oRS!Max) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!Add = oRS!New + ' moRSPODetail!Available = dblONORDER + moRSPODetail!CreateID = gstrLOGIN + moRSPODetail!PVendor = Field2Str(oRS!VENDOR) + moRSPODetail!StdCost = Field2Str2(oRS!StdCost) + moRSPODetail.Update + lngTTLWEIGHT = lngTTLWEIGHT + (Field2Str2(oRS!Order) * Field2Str2(oRS!Weight)) + End If + oRS.MoveNext + gstrMODULE = "Point 7 " + + Loop + + If intYNNote = vbYes Then + gboolNoteADD = True + frmPONotes.Show 1 + End If + + If glngPONID > 0 Then + moRSPOHeader!PONoteFlag = vbChecked + moRSPOHeader!PONID = glngPONID + moRSPOHeader.Update + End If + gstrMODULE = "Point 8 " + moRSPOHeader!TTLWEIGHT = lngTTLWEIGHT + moRSPOHeader!DetailLines = lngPOLineNum - 1 + + moRSPOHeader.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module POCreate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CPPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + mstrCP_PO = oRS!Invoice + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CEN500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CEN500" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "JOE" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "CENTPET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "CENTPET" + moRSPOHeader!vendorname = "Central Pet West" + moRSPOHeader!vaddress1 = "13227 Orden Drive" + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "Santa Fe Springs" + moRSPOHeader!vstate = "CA" + moRSPOHeader!vzip = "90670" + moRSPOHeader!VPhone = "800 283-4738" + moRSPOHeader!VFAX = "480 785-1243" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "ERIC" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub TVPO() +Dim strSQL As String, oRS As Recordset, strTEST As String +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, lngPOID As Long +Dim strINVOICE As String + + On Error GoTo Error_EH + + +' GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER By LineNo" +' strSQL = "SELECT * FROM tblCPImport" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + strTEST = Field2Str(oRS!VENDOR) + mstrCP_PO = oRS!Invoice + GoSub Set_Header + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + moRSPODetail!InvLine = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost +' moRSPODetail!Cost = oRS!Cost +' moRSPODetail!actcost = oRS!Cost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT +' moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = oRS!Retail1 +' moRSPODetail!ACTQty = oRS!Order + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty +' moRSPODetail!BalQty = oRS!Order - moRSPODetail!qty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If mstrVENDOR = "THO500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THO500" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + ElseIf mstrVENDOR = "THOMVET" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "THOMVET" + moRSPOHeader!vendorname = "Thompson Veterinary Supply" + moRSPOHeader!vaddress1 = "1340 N. 29TH AVE." + moRSPOHeader!vaddress2 = "" + moRSPOHeader!vcity = "PHOENIX" + moRSPOHeader!vstate = "AZ" + moRSPOHeader!vzip = "85009" + moRSPOHeader!VPhone = "(602) 258-8187" + moRSPOHeader!VFAX = "(602) 278-1512" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "KEVIN" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 30 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module TVPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub GETAVINFO() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + + cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "INAVVENDOR") + Call d4tagSelect(db, lngCustTag) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc = d4seek(db, strVEND_STOCK) + + oSTATUS = d4deleted(db) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db, "INAVVENDOR") + lngVSTOCK = d4field(db, "INAVVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc = d4close(db) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO3() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim oRSAV As Recordset, strSQLAV As String +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO, strTEST As String + + On Error GoTo Error_EH + +' cb = code4init + + strSQLAV = "SELECT * FROM tblAV WHERE STOCKNO = '" & Trim(mstrSTOCK) & "' AND VENDOR = '" & Trim(mstrAVENDOR) & "'" + Set oRSAV = New Recordset + oRSAV.Open strSQLAV, goConn, adOpenDynamic, adLockOptimistic + + + If Not oRSAV.EOF Then + mstrVSTOCK = Trim(Field2Str(oRSAV!VStock)) + Else + mstrVSTOCK = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETAVINFO4() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long, strVEND_STOCK As String + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db6 = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db6, "INAVVENDOR") + Call d4tagSelect(db6, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + + strVEND_STOCK = mstrAVENDOR & mstrSTOCK + rc6 = d4seek(db6, strVEND_STOCK) + + oSTATUS = d4deleted(db6) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db6, "INAVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrSTOCK Then + lngVEND = d4field(db6, "INAVVENDOR") + lngVSTOCK = d4field(db6, "INAVVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Then + mstrVSTOCK = f4str(lngVSTOCK) + Else + mstrVSTOCK = "" + End If + Else + mstrVSTOCK = " " + End If + End If + rc6 = d4close(db6) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module GETAVINFO4" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub mnuSunburst_Click() + Dim intRow As Integer, boolSTOP As Boolean + Dim strLOCATE As String, strVDESC As String, strVSTOCK As String + Dim sglActQTY As Single, dblCost As Double + Dim oRS As Recordset + Dim strSQL As String, strPATH As String, dblPRICE5 As Double + Dim lngLINENO As Long + + Screen.MousePointer = vbHourglass + +' cdPO.InitDir = "e:\Invoices" + cdPO.DefaultExt = ".xls" + cdPO.InitDir = "c:\projects\historysum" + cdPO.Action = 1 + strLOCATE = cdPO.FileName + + lngLINENO = 1 +' Call ExcelOpen +' Call ButtonReset + mnuSunburst.Enabled = False +' cmdGroup.Enabled = False +' lblMessage.caption = "Importing Excel Price List -- Please Wait" +' lblMessage.Visible = True + On Error GoTo Error_EH + + boolSTOP = False + If ExcelOpen() Then + ' Add New WorkBook + +' strLOCATE = App.Path + goExcel.Workbooks.Open (strLOCATE) + ' Get currently active sheet object + With goExcel.ActiveSheet + + ' Open Database + + ' Build SQL Statement + strSQL = "DELETE * FROM tblSUNBURST" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblSUNBURST" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' If oRS.EOF Then +' End If + ' Load data into Excel + intRow = 3 + Do Until boolSTOP + strVDESC = Trim$(.Cells(intRow, 7).Value) + strVSTOCK = Trim$(.Cells(intRow, 8).Value) + sglActQTY = (.Cells(intRow, 9).Value) +' sglActQTY = Trim$(.Cells(intRow, 9).value) + dblCost = (.Cells(intRow, 10).Value) + oRS.AddNew + oRS!VStock = strVSTOCK + oRS!VDesc = strVDESC + oRS!Order = sglActQTY + oRS!Cost = dblCost + oRS!VENDOR = "SUN750" + oRS!lineno = lngLINENO + oRS.Update +' End If + intRow = intRow + 1 + If .Cells(intRow, 7).Value = "" Then + boolSTOP = True + End If + lngLINENO = lngLINENO + 1 + Loop + End With + oRS.Close + End If + goExcel.Quit + +' Call ButtonReset + mnuSunburst.Enabled = True +' cmdGroup.Enabled = True +' lblMessage.Visible = False + mstrTABLE = "tblSunburst" + + Call GetStock +' Call CPPO + + Screen.MousePointer = vbDefault + MsgBox "Sunburst Pet Import is Complete", vbInformation + vbOKOnly, "Import Complete" + Exit Sub + +Error_EH: + gstrMODULE = "Form Main - Module mnuSunburst" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LEXPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblLextron" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + oRS.MoveFirst + + Do Until oRS.EOF + + strINVOICE = Field2Str(oRS!Invoice) + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(oRS!inv_no) +' mstrSTOCK = Trim(oRS!inv_no) +' Call GETAVINFO + moRSPODetail!vstockno = oRS!VStock + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(oRS!Description) +' moRSPODetail!balqty = oRS!Order + moRSPODetail!Qty = oRS!Order + moRSPODetail!Cost = oRS!Cost + moRSPODetail!ActCost = oRS!Cost + moRSPODetail!ActCostO = oRS!Cost + moRSPODetail!LastCost = oRS!LastCost + moRSPODetail!Retail1 = oRS!Retail1 + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!Type = 5 + moRSPODetail!NRetail = oRS!Retail1 + moRSPODetail!ACTQty = oRS!Order + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail.Update + oRS.MoveNext + + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO +' moRSPOHeader!InvoiceNo = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "LEX500" + moRSPOHeader!vendorname = "Lextron Animal Health" + moRSPOHeader!vaddress1 = "C/O Lextron-TEXAN LLP" + moRSPOHeader!vaddress2 = "Department 1305" + moRSPOHeader!vcity = "Denver" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80256" + moRSPOHeader!VPhone = "800 292-5692" + moRSPOHeader!VFAX = "800 411-4412" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "BILL" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 30 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 10 + moRSPOHeader.Update + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO +' strSQL = "SELECT * FROM tblPOHeader WHERE PONUM = " & mstrCP_PO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module CPPO_Create" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GETALTVEND() +Dim strSQL As String, oRS As Recordset + + strSQL = "SELECT * FROM tblAltVend WHERE Primary = '" & RTrim$(mstrAVENDOR) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrOldVendor = Field2Str(oRS!secondary) + End If +End Sub + +Private Sub GETAVINFO2() +Dim strVENDOR As String, strSQL As String +Dim oRS As Recordset, lngNextPO As Long, lngPOLineNum As Byte +Dim lngPOID As Long + +'FIELD4 pointers +Dim lngNAME As Long, lngVEND As Long, lngVSTOCK As Long +Dim lngSTOCK As Long, lngCITY As Long, lngState As Long +Dim lngZIP As Long, lngPHONE As Long, lngFAX As Long +Dim lngDOC As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim strVEND As String, strNAME As String, strAdd1 As String +Dim strSTOCK As String, strCITY As String, strState As String +Dim strZIP As String, strPHONE As String, strFAX As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double +Dim lngONHAND As Long, dblONHAND As Double +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + +' cb = code4init + + strSQL = gstrCOMPANY & "INAV" + + db3 = d4open(cb, fPath + strSQL) +' lngCustTag = d4tag(db3, "INAVVSTOCK") + lngCustTag = d4tag(db3, "INAVVSTOCK") + + mstrSTOCK2 = mstrVSTOCK ' + mstrAVENDOR +' mstrSTOCK2 = mstrVSTOCK + mstrAVENDOR + + Call d4tagSelect(db3, lngCustTag) + + rc3 = d4seek(db3, mstrSTOCK2) + + + oSTATUS = d4deleted(db3) + + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngSTOCK = d4field(db3, "INAVVSTOCK") + strSTOCK = f4str(lngSTOCK) + If strSTOCK = mstrVSTOCK Then + lngVEND = d4field(db3, "INAVVENDOR") + lngVSTOCK = d4field(db3, "INAVSTOCK") + strVEND = f4str(lngVEND) + If Trim(strVEND) = Trim(mstrAVENDOR) Or Trim(strVEND) = Trim(mstrOldVendor) Then + mstrSTOCK = f4str(lngVSTOCK) + mboolALIASFOUND = True + Else + mstrSTOCK = " " + mboolALIASFOUND = False + End If + End If + End If + rc3 = d4close(db3) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Recieve - Module GETAVINFO2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLabel_Click() +Dim oRS As Recordset +Dim strSQL As String, intCOUNT As Integer +Dim intQTY As Integer, strQTY As String +Dim strINVNO As String, strDESC As String, txtPRICE1 As String + + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + lstInventory.col = 1 + strDESC = lstInventory.ColText + lstInventory.col = 8 + txtPRICE1 = lstInventory.ColText + intCOUNT = 0 + + strQTY = InputBox("How Many Labels Do You Want?", "Label Quantity", 1) + If strQTY = "" Then + MsgBox "Cancel Pressed", vbOKOnly + Exit Sub + End If + intQTY = Field2Str2(strQTY) + If intQTY <= 0 Then + intQTY = 1 + End If + strSQL = "SELECT * FROM tblLABELS2" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until intCOUNT = intQTY + oRS.AddNew + oRS!IN_STOCK = strINVNO + oRS!IN_DESC1 = Field2Str(strDESC) + oRS!IN_USER = gstrLOGIN + oRS!IN_PRICE1 = Format(Field2Str(txtPRICE1), "$#,#.00") + oRS!lbl_qty = 1 + intCOUNT = intCOUNT + 1 + oRS.Update + Loop + Exit Sub +Error_EH: + gstrMODULE = "Form PO - Module cmdLabel" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PURPO() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset +Dim dblQORDER As Double, dblQCost As Double, dblEXT As Double +Dim lngPOLineNum As Long, dblBUYCON As Double +Dim strINVOICE As String, strTEST As String + + On Error GoTo Error_EH + + + GoSub Set_Header + + strSQL = "SELECT * FROM tblPODetail" ' WHERE poid = " & glngPOID + Set moRSPODetail = New Recordset + moRSPODetail.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strSQL = "SELECT * FROM tblCPImport ORDER BY CPID" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + oRS.MoveFirst + + mstrCP_PO = oRS!Invoice + + Do Until oRS.EOF + + strINVOICE = oRS!Invoice + If strINVOICE <> mstrCP_PO Then + mstrCP_PO = strINVOICE + If lngPOLineNum <> 0 Then + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + End If + GoSub Set_Header + End If + dblBUYCON = Field2Str(oRS!buycon) + If dblBUYCON > 0 Then + dblQORDER = Field2Str2(oRS!Order) + dblQORDER = dblQORDER * dblBUYCON + dblQCost = Field2Str2(oRS!Cost) + dblQCost = dblQCost / dblBUYCON + dblQCost = Format(dblQCost, "#,#.0000") + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + Else + dblQORDER = Field2Str2(oRS!Order) + dblQCost = Field2Str2(oRS!Cost) + dblEXT = dblQORDER * dblQCost + dblEXT = Round(dblEXT, 2) + End If + moRSPODetail.AddNew + moRSPODetail!poid = lngPOID + moRSPODetail!InvLine = lngPOLineNum + moRSPODetail!lineno = lngPOLineNum + lngPOLineNum = lngPOLineNum + 1 + moRSPODetail!StockNo = Trim(Field2Str(oRS!inv_no)) + mstrSTOCK = UCase(Trim(Field2Str(oRS!inv_no))) + moRSPODetail!vstockno = Field2Str(oRS!VStock) + strTEST = Left(Trim(oRS!Description), 4) + moRSPODetail!Desc = Trim(Field2Str(oRS!Description)) + moRSPODetail!Qty = Field2Str2(oRS!Order) + mdblQORDER = dblQORDER +' mdblQORDER = Field2Str2(oRS!Order) + moRSPODetail!Cost = dblQCost + moRSPODetail!ActCost = dblQCost + moRSPODetail!ActCostO = dblQCost + moRSPODetail!LastCost = Field2Str2(oRS!LastCost) + moRSPODetail!Retail1 = Field2Str2(oRS!Retail1) + moRSPODetail!ExtCost = dblEXT + moRSPODetail!AExtCost = dblEXT + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!BalQty = oRS!Order - moRSPODetail!ACTQty + moRSPODetail!Type = 5 + moRSPODetail!NRetail = Field2Str2(oRS!Retail1) + moRSPODetail!ACTQty = dblQORDER + If strTEST = "****" Then + moRSPODetail!Add = vbChecked + Else + moRSPODetail!Add = oRS!Add + End If +' moRSPODetail!Add = oRS!Add + moRSPODetail!Weight = Field2Str2(oRS!Weight) + moRSPODetail!PVendor = Field2Str(oRS!PVendor) + moRSPODetail.Update + oRS.MoveNext + Call UpONOrder + + Loop + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!DetailLines = lngPOLineNum - 1 + moRSPOHeader.Update + lngPOLineNum = 0 + + Exit Sub + +Set_Header: + + lngPOLineNum = 1 + + strSQLL = "Select * FROM tblProgInfo" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic + lngNextPO = oRSS!NextPO + glngPO = lngNextPO + oRSS!NextPO = lngNextPO + 1 + oRSS.Update + + strSQLL = "SELECT * FROM tblPOHeader" + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + + If mstrVENDOR = "PUR500" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoiceno = mstrCP_PO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!vendorid = "PUR500" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MARK" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + ElseIf mstrVENDOR = "PURIMIL" Then + moRSPOHeader.AddNew + moRSPOHeader!ponum = glngPO + moRSPOHeader!invoicedate = mstrDATE + moRSPOHeader!invoiceno = "" + moRSPOHeader!vendorid = "PURIMIL" + moRSPOHeader!vendorname = "Purina Mills Inc." + moRSPOHeader!vaddress1 = "P.O. Box 248" + moRSPOHeader!vaddress2 = "Attn: Financial Services" + moRSPOHeader!vcity = "Commerce City" + moRSPOHeader!vstate = "CO" + moRSPOHeader!vzip = "80037-00248" + moRSPOHeader!VPhone = "800 747-2469" + moRSPOHeader!VFAX = "888 590-2463" + moRSPOHeader!OrderDate = mstrDATE + moRSPOHeader!DueDate = mstrDATE + moRSPOHeader!Buyer = "MANAGER" + moRSPOHeader!duectl = 0 + moRSPOHeader!dueday = 0 + moRSPOHeader!disctl = 0 + moRSPOHeader!disday = 0 + moRSPOHeader.Update + End If + + strSQLL = "SELECT * FROM tblPOHeader WHERE PONUM = " & glngPO + Set moRSPOHeader = New Recordset + moRSPOHeader.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + lngPOID = moRSPOHeader!poid + + Return + +Error_EH: + gstrMODULE = "Form PO - Module PURPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + lngODATE = d4field(db, "INMXLSORDR") + + dblONORDER = f4str(lngONORDER) + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If +' dblONORDER = f4str(lngONORDER) +' strONORDER = Field2Str2(strONORDER) +' dblONORDER = CDbl(strONORDER) + +' dblQORDER = Field2Str2(oRS!Order) + +' dblCALCONORDER = dblONORDER + dblQORDER + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + ' Call f4assignDateTime(lngODATE, strDATE) +' Call f4assign(lngODATE, strDATE) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub UpONOrderHold() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + +' mstrSTOCK = Trim(oRS!Inv_No) + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then +' If strDESC = "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + ' mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + + dblONORDER = f4str(lngONORDER) + ' mdblQORDER = Field2Str2(oRS!Order) + ' dblCALCONORDER = dblONORDER - mdblQORDER + dblCALCONORDER = dblONORDER + mdblQORDER + If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 + End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + End If + +End Sub + +Private Sub CalcSales() +Dim strSQL As String, oSTATUS As Long, strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAmount As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngQTY As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long + +'TAG4 pointers +Dim lngCustTag As Long + +'INDEX4 pointers +Dim ind1 As Long + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strNAME As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNEWDATE As String +Dim dblQTY As Double, dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +'Others +Dim fldArray As Long, tagArray As Long +Dim FileName As String, db2 As Long + +Dim save1 As Integer, save2 As Integer, save3 As Integer, save4 As Integer, save5 As Integer +Dim rc1 As Integer, rc2 As Integer +Dim indexInfo() As TAG4INFO + + On Error GoTo Error_EH + If Not IsDate(txtBegDate) Then + strMSG = "You Must Have Beginning and Ending Date Entered - ReEnter" + MsgBox strMSG, vbCritical + vbOKOnly, "InValid Dates" + Exit Sub + End If + + strSQLL = "SELECT * FROM tblPOLIST WHERE User = '" & gstrLOGIN & "' " & " ORDER BY ListID" +' strSQL = "SELECT * FROM tblPOLIST SORTedBY ListID WHERE User = '" & gstrLOGIN & "'" + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + gboolVEND = False + + mstrBEGDATE = Year(txtBegDate) & Format(Month(txtBegDate), "00") & Format(Day(txtBegDate), "00") + mstrENDDATE = Year(txtEndDate) & Format(Month(txtEndDate), "00") & Format(Day(txtEndDate), "00") + + Do Until oRS.EOF + mstrCUSTOMER = Field2Str(oRS!inv_no) + + cb = code4init + + strSQL = gstrCOMPANY & "INHIS" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INHISTOCK") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrCUSTOMER) + Do Until rc <> r4success + oSTATUS = d4deleted(db) + mstrCUSTOMER2 = "" + If oSTATUS = 0 Then + lngNAME = d4field(db, "INHICV") + lngDOC = d4field(db, "INHIDOC") + lngINVDATE = d4field(db, "INHIDATE") + lngINVNO = d4field(db, "INHISOURCE") + lngRECORD = d4field(db, "INHIUNIQ") + lngType = d4field(db, "INHITYPE") + lngPRICE = d4field(db, "INHIPRICE") + lngQTY = d4field(db, "INHIQTY") + lngCOST = d4field(db, "INHICOST") + + strDOC = f4str(lngDOC) + strNAME = f4str(lngNAME) + If strNAME <> "" Then + If strNAME <> mstrCUSTNO Then + mstrCUSTNO = "" + mstrCUSTNAME = "" + mstrCUSTOMER2 = strNAME +' Call CustomerFind + End If + Else + mstrCUSTNO = "" + mstrCUSTNAME = "" + End If + strINVDATE = f4str(lngINVDATE) + strMONTH = date4month(strINVDATE) + Call date4format(strINVDATE, strNEWDATE, "CCYY/MM/DD") + dblPRICE = f4double(lngPRICE) + RSet strAmount = FormatCurrency(dblPRICE, 2) + strINVNO = f4str(lngINVNO) + lngPSHIREC = f4long(lngRECORD) + dblTYPE = f4double(lngType) + dblQTY = f4double(lngQTY) + dblCost = f4double(lngCOST) + dblTCOST = dblCost + If dblQTY > 0 Then + dblCost = dblCost / dblQTY + End If + RSet strCOST = FormatCurrency(dblCost, 2) + + If dblTYPE = 1 Then + strTYPE = "SUB" + If strINVDATE >= mstrBEGDATE And strINVDATE <= mstrENDDATE Then + If strINVNO = "PS" Or strINVNO = "OE" Or strINVNO = "AG" Then + dblSOLD = dblSOLD + dblQTY + End If + End If +' Else + ' strTYPE = "TRANS" + End If + End If + rc = d4seekNext(db, mstrCUSTOMER) + + Loop + rc = d4close(db) + oRS!Order = dblSOLD + oRS!usage = dblSOLD + If dblSOLD = 0 And chkZero Then + oRS.Delete + Else + oRS.Update + End If + oRS.MoveNext + dblQTY = 0 + dblSOLD = 0 + dblCost = 0 + dblTCOST = 0 + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module CalcSales" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdImportInv_Click() +Dim ARCode As Long, oSTATUS As Long +Dim lngSTOCKNO As Long, lngQTY As Long, lngDESC As Long +Dim strSTOCKNO As String, dblQTY As Double, strDESC As String +Dim strREGISTER As String, strFIND As String, strVENDOR As String, strVENDOR2 As String * 20 +Dim strSQL As String, strFILE As String, strMSG As String +Dim lngLCOST As Long, lngPRICE1 As Long, dblLCOST As Double, dblPRICE1 As Double +Dim lngVEND As Long +Dim lngWEIGHT As Long, dblWEIGHT As Double + +'Field value holders +Dim dblINVTOT As Double, dblTYPE As Double, dblAMOUNT As Double +Dim strNAME As String, strCUST As String, lngPSHIREC As Long +Dim strINVNO As String, strINVDATE As String, strNEWDATE As String +Dim dblPRICE As Double, strDOC As String, strSTOCK As String +Dim strTYPE As String, lngCOST As Long, dblCost As Double, strCOST As String * 12 +Dim strMONTH As String, dblTCOST As Double + +Dim strINDEX As String +Dim strLine As String, strLINE2 As String +Dim lngRET As Long, aTabs(7) As Long, strAmount As String * 12 +Dim dblSOLD As Double, dblBUY As Double, dblNET As Double +Dim strSQLL As String, oRS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'FIELD4 pointers +Dim lngNAME As Long, lngCUST As Long, lngINVTOT As Long +Dim lngINVNO As Long, lngINVDATE As Long, lngType As Long +Dim lngRECORD As Long, lngPRICE As Long +Dim lngDOC As Long, lngSTOCK As Long +Dim lngLOrder As Long, lngLPur As Long, lngLSALE As Long + + strSQL = "DELETE * FROM tblINMAS" + goConn.Execute strSQL + + strSQL = "SELECT * FROM tblINMAS" + Set moRSHAND = New Recordset + moRSHAND.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + strVENDOR2 = Trim(txtBegSelect) + strFILE = gstrCOMPANY & "INMAS.DBF" + '"IN_VENDOR" + db = d4open(cb, fPath + strFILE) + + lngCustTag = d4tag(db, "IN_VENDOR") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, strVENDOR2) +' rc = d4seek(db, strINVSTOCK) + + If rc = r4success Then + Do + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + lngSTOCKNO = d4field(db, "IN_STOCK") + lngQTY = d4field(db, "IN_ONHAND") + lngDESC = d4field(db, "IN_DES") + lngLCOST = d4field(db, "IN_LSCOST") + lngPRICE1 = d4field(db, "IN_PRICE1") + lngVEND = d4field(db, "IN_VENDOR") + lngType = d4field(db, "IN_TYPE") + lngONHAND = d4field(db, "IN_ONHAND") + lngMIN = d4field(db, "IN_MINQTY") + lngMAX = d4field(db, "IN_MAXQTY") + lngCOMMIT = d4field(db, "IN_COMMIT") + lngONORDER = d4field(db, "IN_ORDERTE") + lngWEIGHT = d4field(db, "IN_FIELD07") + lngLOrder = d4field(db, "IN_LSORDR") + lngLPur = d4field(db, "IN_LSPRCH") + lngLSALE = d4field(db, "IN_LSSALE") + dblWEIGHT = f4double(lngWEIGHT) + strSTOCKNO = f4str(lngSTOCKNO) + strSTOCKNO = Trim$(strSTOCKNO) + strTYPE = Trim(f4str(lngType)) + dblMIN = f4double(lngMIN) + dblMAX = f4double(lngMAX) + dblONHAND = f4double(lngONHAND) + dblONORDER = f4double(lngONORDER) + dblCOMMIT = f4double(lngCOMMIT) + dblAVAIL = dblONHAND - dblCOMMIT + dblQTY = f4double(lngQTY) + dblLCOST = f4double(lngLCOST) + dblPRICE1 = f4double(lngPRICE1) + strDESC = f4str(lngDESC) + strVENDOR = f4str(lngVEND) + strLOrder = f4str(lngLOrder) + strLPur = f4str(lngLPur) + strLSALE = f4str(lngLSALE) + If Trim$(strVENDOR) = Trim$(txtBegSelect) Then + ' strFIND = "STOCKNO = '" & strSTOCKNO & "'" + moRSHAND.AddNew + moRSHAND!StockNo = Field2Str(strSTOCKNO) + ' If Not moRSHAND.EOF Then + ' moRSHAND!Count = Field2Str2(moRSHAND!Count) + Field2Str2(dblQTY) + moRSHAND!Description = Field2Str(strDESC) + moRSHAND!OnHand = dblQTY + moRSHAND!LCost = dblLCOST + moRSHAND!Price1 = dblPRICE1 + moRSHAND!VENDOR = strVENDOR + moRSHAND!Type = strTYPE + moRSHAND!Min = dblMIN + moRSHAND!Max = dblMAX + moRSHAND!Available = dblAVAIL + moRSHAND!Weight = dblWEIGHT + moRSHAND!User = gstrLOGIN + moRSHAND!LastOrder = strLOrder + moRSHAND!LastPurchase = strLPur + moRSHAND!LastSale = strLSALE + moRSHAND.Update + End If +' End If + End If + rc = d4seekNext(db, strVENDOR2) +' rc = d4skip(db, 1) + Loop While rc = r4success + End If + + '******* Need to look at the logic to see why this is not caclulating correctly + + rc = d4close(db) + moRSHAND.Close + +End Sub + +Private Sub SelectPartialLoad2() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVEND = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL +'' !Order = dblOrder + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectPartialLoad3() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String +Dim lngVEND As Long, lngType As Long, lngONHAND As Long +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long +Dim lngNAME As Long, lngCUST As Long +Dim lngLSTCOST As Long, lngRETAIL1 As Long +Dim dblLSTCOST As String, dblRETAIL1 As String +Dim strVEND As String, strTYPE As String, strINVNO As String, strDESC As String * 45 +Dim strSELECT As String, strBEG As String * 45, strEND As String * 45 +Dim oRS As Recordset +Dim lngMIN As Long, lngMAX As Long, lngCOMMIT As Long +Dim dblMIN As Double, dblMAX As Double, dblCOMMIT As Double, dblAVAIL As Double +Dim dblOrder As Double, dblCost As Double, dblALLTOTAL As Double +Dim lngBUYCON As Long, dblBUYCON As Double, intREM As Integer, intWHOLE As Integer +Dim lngONORDER As Long, dblONORDER As Double +Dim strBEG2 As String, strEND2 As String +Dim oRSS As Recordset +Dim strLOrder As String, strLPur As String, strLSALE As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + On Error Resume Next + mlngCOUNT = 0 + strBEG = txtBegSelect + strEND = txtEndSelect + strSELECT = "SELECT * FROM tblPOList" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + strSQLL = "SELECT * FROM tblINMAS WHERE User = '" & gstrLOGIN & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + lstInventory.SortState = SortStateSuspend + Do Until oRSS.EOF + + mlngCOUNT = mlngCOUNT + 1 + dblMIN = 0 + dblMAX = 0 + dblCOMMIT = 0 + dblAVAIL = 0 + dblLSTCOST = 0 + dblRETAIL1 = 0 + dblCost = 0 + strINVNO = Field2Str(oRSS!StockNo) + strDESC = Field2Str(oRSS!Description) + strVEND = Field2Str(oRSS!VENDOR) + strTYPE = Field2Str(oRSS!Type) + dblMIN = Field2Str(oRSS!Min) + dblMAX = Field2Str(oRSS!Max) + dblONHAND = Field2Str(oRSS!OnHand) + dblAVAIL = Field2Str(oRSS!Available) + dblLSTCOST = Field2Str(oRSS!LCost) + dblRETAIL1 = Field2Str(oRSS!Price1) + dblWEIGHT = Field2Str2(oRSS!Weight) + dblCost = Field2Str(oRSS!LCost) + strLOrder = Field2Str(oRSS!LastOrder) + strLPur = Field2Str(oRSS!LastPurchase) + strLSALE = Field2Str(oRSS!LastSale) + With oRS + .AddNew + !inv_no = Field2Str(strINVNO) + !Description = Field2Str2(strDESC) + !VENDOR = Field2Str(strVEND) + !Type = Field2Str(strTYPE) + !OnHand = dblONHAND + !Min = dblMIN + !Max = dblMAX +' !Available = dblALLTOTAL + !OnOrder = dblONORDER + !Available = dblAVAIL + !Order = 1 + !LastCost = dblLSTCOST + !Retail1 = dblRETAIL1 + !Cost = dblLSTCOST + !Weight = dblWEIGHT + !LastOrder = strLOrder + !LastPurchase = strLPur + !LastSale = strLSALE + !User = gstrLOGIN + .Update + End With + oRSS.MoveNext + Loop + oRS.Close + oRSS.Close + lstInventory.SortState = SortStateActiveReSort + Call Inventory2Load + mlngCOUNT = mlngCOUNT + On Error GoTo 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module SelectPartialLoad3" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intBookmark As Integer, intTEST As Integer + + If cboSort.ListIndex = 4 Then + If KeyCode = vbKeyReturn Then + Call LoadInventory + End If + End If +End Sub + +Private Sub cmdZeroOnOrd_Click() +Dim oSTATUS As Long +Dim strSQL As String, strSQLL As String, dblONHAND As Double +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH + + strSQL = gstrCOMPANY & "INMAS" + db7 = d4open(cb, fPath + strSQL) + + rc7 = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "IN_STOCK") + lngCUST = d4field(db7, "IN_DES") + lngONHAND = d4field(db7, "IN_ORDERTE") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + strSQL = gstrCOMPANY & "INMAT" + db7 = d4open(cb, fPath + strSQL) + + rc = d4top(db7) + + If d4top(db7) = r4success Then + + Do + oSTATUS = d4deleted(db7) + If oSTATUS = 0 Then + With lstInventory + lngNAME = d4field(db7, "INMXSTOCK") + lngONHAND = d4field(db7, "INMXONORDR") + strNAME = f4str(lngNAME) + dblONHAND = f4double(lngONHAND) + If dblONHAND > 0 Then + Call f4assignDouble(lngONHAND, 0) + End If + End With + End If + rc7 = d4skip(db7, 1) + Loop While rc7 = r4success + rc7 = d4flush(db7) + rc7 = d4unlock(db7) + End If + + rc7 = d4close(db7) + + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module cmdZeroOnHand" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FixONOrder() +Dim oSTATUS As Long, intBOOKMARK99 As Integer +Dim strSQL As String, strSQLL As String, dblONHAND As Double, oRS As Recordset +Dim strLine As String, strCode As String, strCompany As String +Dim strNAME2 As String, lngNAME2 As Long, lngONHANDX As Long, dblONHANDX As Double +Dim strNAME As String, strCUST As String, strVEND As String, strTYPE As String +Dim lngRET As Long, aTabs(2) As Long, lngRECORD As Long, lngONHAND As Long +Dim lngNAME As Long, lngCUST As Long, lngVEND As Long, lngType As Long +Dim lngCOMMIT As Long, dblCOMMIT As Double +Dim strSTOCK As String, dblQTY As Double, intCoun As Integer +Dim intCNT As Integer, intCNT2 As Integer +Dim lngCustTag2 As Long, intTEST As Integer +Dim lngMXSTOCK As Long, strMXSTOCK As String, lngMXONHAND As Long, dblMXONHAND As Double +Dim strMXLOC As String * 20, strMXSTK As String * 20, strMXSEARCH As String + +'TAG4 pointers +Dim lngCustTag As Long + + On Error GoTo Error_EH +' intBOOKMARK99 = lstInventory.ListIndex + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + intCNT = 0 + intCNT2 = 0 + 'lstinventory.col=10 + 'lstinventory.ColText= + strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag and StockNo = '" & mstrSTOCK & "'" +' strSQLL = "SELECT * FROM tblPODetail WHERE not Complete and not DelFlag " + Set oRS = New Recordset + oRS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + intCoun = oRS.RecordCount +'********************************** + strSQL = gstrCOMPANY & "INMAS" + strSQLL = gstrCOMPANY & "INMAT" + db = d4open(cb, fPath + strSQL) + db6 = d4open(cb, fPath + strSQLL) + + lngCustTag = d4tag(db, "IN_STOCK2") + Call d4tagSelect(db, lngCustTag) + + lngCustTag2 = d4tag(db6, "INMXSTOCK3") +' lngCustTag2 = d4tag(db6, "INMXSTOCK") + Call d4tagSelect(db6, lngCustTag2) + + Do Until oRS.EOF + strSTOCK = Field2Str(oRS!StockNo) + strMXSTK = Field2Str(oRS!StockNo) + strMXSEARCH = strMXSTK & strMXLOC + dblQTY = oRS!Qty + If IsNull(strSTOCK) Or strSTOCK = "" Then + + Else + + + rc = d4seek(db, strSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngNAME = d4field(db, "IN_STOCK") + lngCUST = d4field(db, "IN_DES") + lngONHAND = d4field(db, "IN_ORDERTE") + strNAME = f4str(lngNAME) + strCUST = f4str(lngCUST) + dblONHAND = f4double(lngONHAND) + If Trim(strSTOCK) = Trim(strNAME) Then + dblONHAND = dblONHAND + dblQTY + Call f4assignDouble(lngONHAND, dblONHAND) + End If + intCNT2 = intCNT2 + 1 + End If + intCNT = intCNT + 1 + + rc6 = d4seek(db6, strSTOCK) + oSTATUS = d4deleted(db6) + If oSTATUS = 0 Then + lngNAME2 = d4field(db6, "INMXSTOCK") + lngONHANDX = d4field(db6, "INMXONORDR") + strNAME2 = f4str(lngNAME2) + dblONHANDX = f4double(lngONHANDX) + If Trim(strMXSTK) = Trim(strNAME) Then + dblONHANDX = dblONHANDX + dblQTY + Call f4assignDouble(lngONHANDX, dblONHANDX) + End If + End If + End If + + oRS.MoveNext + Loop + rc = d4close(db) + rc6 = d4close(db6) + lstInventory.col = 10 + lstInventory.ColText = dblONHANDX +' lstInventory.Refresh + inttext = lstInventory.ListIndex +' lstInventory.ListIndex = mintbookmark99 + Exit Sub + +Error_EH: + gstrMODULE = "Form PO - Module FixOnOrder" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ChgONOrder() +Dim lngCustTag As Long, strSQL As String +Dim dblONORDER As Double, dblCALCONORDER As Double +Dim lngONORDER As Long, lngDESC As Long, strDESC As String + + lstInventory.col = 0 + mstrSTOCK = lstInventory.ColText + strDESC = Trim(mstrSTOCK) + If Trim(mstrSTOCK) <> "" Then + + strSQL = gstrCOMPANY & "INMAS" + + db = d4open(cb, fPath + strSQL) + lngCustTag = d4tag(db, "IN_STOCK2") + + Call d4tagSelect(db, lngCustTag) + mstrSTOCK = UCase(mstrSTOCK) + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + + If oSTATUS = 0 Then + lngONORDER = d4field(db, "IN_ORDERTE") + lngDESC = d4field(db, "IN_DES") + strDESC = f4str(lngDESC) + +' dblONORDER = f4str(lngONORDER) +' dblCALCONORDER = dblONORDER + mdblQORDER +' If dblCALCONORDER < 0 Then + dblCALCONORDER = 0 +' End If + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + strSQL = gstrCOMPANY & "INMAT" + + db = d4open(cb, fPath + strSQL) + + lngCustTag = d4tag(db, "INMXSTOCK3") + + Call d4tagSelect(db, lngCustTag) + + rc = d4seek(db, mstrSTOCK) + oSTATUS = d4deleted(db) + If oSTATUS = 0 Then + lngONORDER = d4field(db, "INMXONORDR") + + dblCALCONORDER = 0 + + Call f4assignDouble(lngONORDER, dblCALCONORDER) + + End If + + rc = d4close(db) + + End If + +End Sub + +Private Sub GetAFN() +Dim strSQL As String, oRS As Recordset + + mstrN_LC = "" + mstrN_RTL = "" + mstrN_VS = "" + mstrN_VND = "" + mstrN_LPD = "" + mstrN_Desc = "" + mstrN_TY = "" + + strSQL = "SELECT AFN_LCost, AFN_Retail, AFN_VSTOCK, AFN_VEND, AFN_DESC, AFN_PDATE, AFN_TYPE FROM tblPriceCompare WHERE AFN_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrN_LC = Format(Field2Str(oRS!AFN_LCost), "##,##0.00") + mstrN_RTL = Format(Field2Str(oRS!AFN_Retail), "##,##0.00") + mstrN_VS = Field2Str(oRS!AFN_VStock) + mstrN_VND = Field2Str(oRS!AFN_VEND) + mstrN_Desc = Field2Str(oRS!AFN_Desc) + mstrN_LPD = Field2Str(oRS!AFN_PDATE) + mstrN_TY = Field2Str(oRS!AFN_TYPE) + Else + mstrN_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetAFS() +Dim strSQL As String, oRS As Recordset + + On Error GoTo Error_EH + + mstrS_LC = "" + mstrS_RTL = "" + mstrS_VS = "" + mstrS_VND = "" + mstrS_LPD = "" + mstrS_Desc = "" + mstrS_TY = "" + +' strSQL = "SELECT * FROM tblPriceCompare WHERE AFSSKU = '" & mstrFStock & "'" +' If Not gboolConn3Bad Then + strSQL = "SELECT AFS_LCost, AFS_Retail, AFS_VSTOCK, AFS_VEND, AFS_DESC, AFS_PDATE, AFS_TYPE FROM tblPriceCompare WHERE AFS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' oRS.Open strSQL, goConn3, adOpenForwardOnly, adLockReadOnly +' Else +' MsgBox "Cannot Process AFS History", vbOKOnly, "No History" +' Exit Sub +' End If + + If Not oRS.EOF Then + mstrS_LC = Format(Field2Str(oRS!AFS_LCost), "##,##0.00") + mstrS_RTL = Format(Field2Str(oRS!AFS_Retail), "##,##0.00") + mstrS_VS = Field2Str(oRS!AFS_VStock) + mstrS_VND = Field2Str(oRS!AFS_VEND) + mstrS_Desc = Field2Str(oRS!AFS_Desc) + mstrS_LPD = Field2Str(oRS!AFS_PDATE) + mstrS_TY = Field2Str(oRS!AFS_TYPE) + Else + mstrS_LC = "NO INFORMATION FOUND" + End If + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & "Form PO - Module GetAFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetTSS() + +Dim strSQL As String, oRS As Recordset + + mstrT_LC = "" + mstrT_RTL = "" + mstrT_VS = "" + mstrT_VND = "" + mstrT_LPD = "" + mstrT_Desc = "" + mstrT_TY = "" + + strSQL = "SELECT TSS_LCost, TSS_Retail, TSS_VSTOCK, TSS_VEND, TSS_DESC, TSS_PDATE, TSS_TYPE FROM tblPriceCompare WHERE TSS_SKU = '" & mstrFStock & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrT_LC = Format(Field2Str(oRS!TSS_LCost), "##,##0.00") + mstrT_RTL = Format(Field2Str(oRS!TSS_Retail), "##,##0.00") + mstrT_VS = Field2Str(oRS!TSS_VStock) + mstrT_VND = Field2Str(oRS!TSS_VEND) + mstrT_Desc = Field2Str(oRS!TSS_Desc) + mstrT_LPD = Field2Str(oRS!TSS_PDATE) + mstrT_TY = Field2Str(oRS!TSS_TYPE) + Else + mstrT_LC = "NO INFORMATION FOUND" + End If +End Sub + +Private Sub GetTSSHist() +Dim strSQL As String, oRS As Recordset + + mstrT_LM = "" + mstrT_LY = "" + mstrT_YA = "" + mstrT_ICLM = "" + mstrT_ICLY = "" + mstrT_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGET WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrT_LM = Field2Str2(oRS!LastMo) + mstrT_LY = Field2Str2(oRS!LastYr) + mstrT_YA = Field2Str2(oRS!YearAgo) + mstrT_ICLM = Field2Str2(oRS!ICLastMo) + mstrT_ICLY = Field2Str2(oRS!ICLastYr) + mstrT_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrT_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFNHist() + +Dim strSQL As String, oRS As Recordset + + mstrN_LM = "" + mstrN_LY = "" + mstrN_YA = "" + mstrN_ICLM = "" + mstrN_ICLY = "" + mstrN_ICYA = "" + + + strSQL = "SELECT * FROM tblUSAGEN WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrN_LM = Field2Str2(oRS!LastMo) + mstrN_LY = Field2Str2(oRS!LastYr) + mstrN_YA = Field2Str2(oRS!YearAgo) + mstrN_ICLM = Field2Str2(oRS!ICLastMo) + mstrN_ICLY = Field2Str2(oRS!ICLastYr) + mstrN_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrN_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + +Private Sub GetAFSHist() + +Dim strSQL As String, oRS As Recordset + + mstrS_LM = "" + mstrS_LY = "" + mstrS_YA = "" + mstrS_ICLM = "" + mstrS_ICLY = "" + mstrS_ICYA = "" + + strSQL = "SELECT * FROM tblUSAGES WHERE StockNo = '" & Trim(moRSUpdate!inv_no) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrS_LM = Field2Str2(oRS!LastMo) + mstrS_LY = Field2Str2(oRS!LastYr) + mstrS_YA = Field2Str2(oRS!YearAgo) + mstrS_ICLM = Field2Str2(oRS!ICLastMo) + mstrS_ICLY = Field2Str2(oRS!ICLastYr) + mstrS_ICYA = Field2Str2(oRS!ICYearAgo) + Else + mstrS_LM = " NO SALES INFORMATION FOUND " + End If +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frx new file mode 100644 index 0000000..b5402b5 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPO99.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frm new file mode 100644 index 0000000..3d5a0e8 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frm @@ -0,0 +1,789 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPOInfo + Caption = "Special PO Information" + ClientHeight = 4875 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10380 + LinkTopic = "Form1" + ScaleHeight = 4875 + ScaleWidth = 10380 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstPOMaterial + Height = 2610 + Left = 45 + TabIndex = 27 + Top = 2190 + Width = 4695 + _Version = 196608 + _ExtentX = 8281 + _ExtentY = 4604 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPOInfo.frx":0000 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 915 + Left = 8610 + TabIndex = 25 + Top = 3540 + Width = 1395 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 120 + TabIndex = 26 + Top = 0 + Width = 9675 + End + Begin VB.Label lblD_MatPrice + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 24 + Top = 4335 + Width = 1155 + End + Begin VB.Label lblD_MType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 23 + Top = 3915 + Width = 1575 + End + Begin VB.Label lblD_DType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 22 + Top = 3495 + Width = 1575 + End + Begin VB.Label lblD_Qty + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 21 + Top = 3075 + Width = 1155 + End + Begin VB.Label lblD_Desc + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 20 + Top = 2655 + Width = 4515 + End + Begin VB.Label lblD_InvNo + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 5850 + TabIndex = 19 + Top = 2235 + Width = 2625 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Mat. Price:" + Height = 195 + Left = 5025 + TabIndex = 18 + Top = 4395 + Width = 765 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 4785 + TabIndex = 17 + Top = 3975 + Width = 1005 + End + Begin VB.Label lblDType + Caption = "Delivery Type:" + Height = 195 + Left = 4755 + TabIndex = 16 + Top = 3555 + Width = 1035 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = 5160 + TabIndex = 15 + Top = 3135 + Width = 630 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 4950 + TabIndex = 14 + Top = 2715 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv No:" + Height = 195 + Left = 5265 + TabIndex = 13 + Top = 2295 + Width = 525 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 60 + TabIndex = 12 + Top = 1980 + Width = 750 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 0 + X2 = 9840 + Y1 = 1920 + Y2 = 1920 + End + Begin VB.Label lblD_Notes + BorderStyle = 1 'Fixed Single + Height = 1035 + Left = 6120 + TabIndex = 11 + Top = 780 + Width = 3735 + End + Begin VB.Label lblD_PayYds + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 10 + Top = 1500 + Width = 1395 + End + Begin VB.Label lblD_PayDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 9 + Top = 1140 + Width = 3735 + End + Begin VB.Label lblD_InvDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 8 + Top = 780 + Width = 3735 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Yards:" + Height = 195 + Left = 870 + TabIndex = 7 + Top = 1560 + Width = 765 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6120 + TabIndex = 6 + Top = 480 + Width = 570 + End + Begin VB.Label lblPayDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Description:" + Height = 195 + Left = 480 + TabIndex = 5 + Top = 1200 + Width = 1155 + End + Begin VB.Label lblInvDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Description:" + Height = 195 + Left = 225 + TabIndex = 4 + Top = 840 + Width = 1410 + End + Begin VB.Label lblPOType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3600 + TabIndex = 3 + Top = 420 + Width = 2475 + End + Begin VB.Label lblPODate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 2220 + TabIndex = 2 + Top = 420 + Width = 1320 + End + Begin VB.Label lblPONum + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1260 + TabIndex = 1 + Top = 420 + Width = 915 + End + Begin VB.Label lblPOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Information:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 480 + Width = 1095 + End +End +Attribute VB_Name = "frmPOInfo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolSHOW As Boolean +Dim moRSPO As Recordset, moRSPOMAT As Recordset + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & gintPONUM + + Set moRSPO = New Recordset + + moRSPO.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPO.EOF Then + FormFindPO = False + Else + FormFindPO = True + + End If + Exit Function + +Error_EH: + gstrMODULE = "Form POInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPOMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstPOMaterial.col = 3 + strINVNO = lstPOMaterial.ColText + strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM & " and Inv_No = '" & strINVNO & "'" + + Set moRSPOMAT = New Recordset + + moRSPOMAT.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPOMAT.EOF Then + FormFindPOMat = False + Else + FormFindPOMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form POInfo - Module FormFindPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowPO() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPO + lblPONum = Field2Long(!ponum) + lblD_InvDesc = Field2Str(!towhom) + lblD_PayDesc = Field2Str(!Desc) + lblD_Notes = Field2Str(!notes) + lblPODate = Field2Str(!Date) + lblD_PayYds = Field2Str2(!yards) + gstrPO = Field2Str(!potype) + End With + + Select Case gstrPO + Case "L" + lblInvDesc = "Invoice Description:" + lblD_InvDesc.Visible = True + lblInvDesc.Visible = True + lblPayDesc = "Pay Description:" + lblD_PayDesc.Visible = True + lblPayDesc.Visible = True + lblPayYds = "Pay Yards:" + lblD_PayYds.Visible = True + lblPayYds.Visible = True + lblPOType = "Lot Material" + + Case "Y" + lblInvDesc.Visible = False + lblD_InvDesc.Visible = False + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Yard Stock" + + Case "V" + lblInvDesc = "Mileage:" + lblD_InvDesc.Visible = True + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Vehicle/Equip." + + Case "M" + lblInvDesc = "Person Requesting:" + lblD_InvDesc.Visible = True + lblPayDesc = "Supplier:" + lblD_PayDesc.Visible = True + lblPayYds.Visible = False + lblD_PayYds.Visible = False + lblPOType = "Misc. Items" + + End Select + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowPOMat() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSPOMAT + lblD_InvNo = Field2Str(!inv_no) +' lblD_InvNo = Field2Long(!inv_no) + lblD_Desc = Field2Str(!Desc) + lblD_Qty = Field2Str(!qty) + + If !d_flag = "S" Then + lblD_DType = "Supplier" + Else + lblD_DType = "Yard" + End If + + If !m_type = "L" Then + lblD_MType = "Lath" + ElseIf !m_type = "B" Then + lblD_MType = "Brown" + ElseIf !m_type = "S" Then + lblD_MType = "Scratch" + ElseIf !m_type = "T" Then + lblD_MType = "Texture" + ElseIf !m_type = "C" Then + lblD_MType = "CMU" + ElseIf !m_type = "P" Then + lblD_MType = "PreOrder" + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FormShowPOMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String, intINVNO As Integer +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & gintPONUM & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = Field2Long(oRS("inv_no")) + + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPOMaterial.ListCount Then + lstPOMaterial.ListIndex = 0 + Else + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + + Unload Me +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + If FormFindPO() Then + Call FormShowPO + Call POMatLoad + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + End If + Else + MsgBox "No PO Information Was Found -- Call Darv", vbOKOnly, "No PO Info" + Unload Me + End If + + Call FindProjLot + + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPOMaterial_Click() + On Error GoTo Error_EH + + If lstPOMaterial.ListIndex <> -1 Then + If FormFindPOMat() Then + Call FormShowPOMat + Else + lstPOMaterial.Clear + lblD_InvNo = "" + lblD_Desc = "" + lblD_Qty = "" + lblD_DType = "" + lblD_MType = "" + lblD_MatPrice = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module lstPOMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FindProjLot() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblProject " + strSQL = strSQL & "WHERE Proj_id = " & Field2Long(moRSPO!PROJ_ID) +' strSQL = strSQL & "WHERE Proj_id = " & Field2Integer(moRSPO!proj_id) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + Else + lblProjLot = Trim$(Field2Str(oRS!Proj_Code)) & " " & Trim$(Field2Str(oRS!Proj_Desc)) + End If + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_id = " & Field2Long(moRSPO!Lot_ID) +' strSQL = strSQL & "WHERE Lot_id = " & Field2Integer(moRSPO!Lot_id) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + + Else + lblProjLot = lblProjLot & " -- " & Trim$(Field2Str(oRS!lot_no)) + End If + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOrders " + strSQL = strSQL & "WHERE ponum = " & gintPONUM + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If oRS.EOF Then + lblProjLot = lblProjLot & " -- NO PO PRINTED" + Else + lblProjLot = lblProjLot & " -- " & Trim$(Field2Str(oRS!po_num)) + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form POInfo - Module FindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frx new file mode 100644 index 0000000..2106299 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOInfo.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOList.frm new file mode 100644 index 0000000..3d73314 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOList.frm @@ -0,0 +1,387 @@ +VERSION 5.00 +Begin VB.Form frmPOList + Caption = "Purchase Order List" + ClientHeight = 4305 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9885 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4305 + ScaleWidth = 9885 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 6840 + TabIndex = 11 + TabStop = 0 'False + Top = 3660 + Width = 1395 + End + Begin VB.ListBox lstCrew + Height = 4155 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 60 + Width = 5055 + End + Begin VB.Label lblOType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 13 + Top = 1920 + Width = 2955 + End + Begin VB.Label lblODate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 12 + Top = 1560 + Width = 2955 + End + Begin VB.Label lblOrderType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Type" + Height = 195 + Left = 5235 + TabIndex = 10 + Top = 1980 + Width = 795 + End + Begin VB.Label lblOrderDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Order Date:" + Height = 195 + Left = 5205 + TabIndex = 9 + Top = 1620 + Width = 825 + End + Begin VB.Label lblSupplyName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 8 + Top = 1200 + Width = 2955 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supplier:" + Height = 195 + Left = 5415 + TabIndex = 7 + Top = 1275 + Width = 615 + End + Begin VB.Label lblPONum + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 6 + Top = 840 + Width = 2955 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Num:" + Height = 195 + Left = 5385 + TabIndex = 5 + Top = 900 + Width = 645 + End + Begin VB.Label lblProjDesc + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 4 + Top = 480 + Width = 3645 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7140 + TabIndex = 3 + Top = 120 + Width = 810 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6120 + TabIndex = 2 + Top = 120 + Width = 1005 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot:" + Height = 195 + Left = 5760 + TabIndex = 1 + Top = 180 + Width = 270 + End +End +Attribute VB_Name = "frmPOList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSORDER As Recordset + +Dim mboolAdding As Boolean + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "FormPOList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "FormPOList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PO_Num, Order_Date, Supplier, Order_id from tblOrders" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + strLine = Field2Str(oRS!po_Num) & vbTab & Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!supplier) + .AddItem strLine + .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormPOList - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblorders " + strSQL = strSQL & "WHERE order_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSORDER = New Recordset + + moRSORDER.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSORDER.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormPOList - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String, strSQL2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + With moRSORDER + If Field2Str(!m_type) = "L" Then + lblOType.Caption = "LATH" + ElseIf Field2Str(!m_type) = "T" Then + lblOType.Caption = "TEXTURE" + ElseIf Field2Str(!m_type) = "B" Then + lblOType.Caption = "BROWN" + ElseIf Field2Str(!m_type) = "S" Then + lblOType.Caption = "SCRATCH" + ElseIf Field2Str(!m_type) = "A" Then + lblOType.Caption = "SAND" + ElseIf Field2Str(!m_type) = "P" Then + lblOType.Caption = "PREORDER" + ElseIf Field2Str(!m_type) = "R" Then + lblOType.Caption = "PURCHASE ORDER" + End If + lblODate.Caption = Field2Str(!order_date) + lblSupplyName = Field2Str(!supplier) + lblPONum.Caption = Field2Str(!po_Num) + strSQL = "SELECT proj_id,Lot_no FROM tblLotInfo WHERE lot_id = " & Field2Str(!lot_id) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + strSQL2 = "SELECT proj_code, proj_desc FROM tblProject WHERE proj_id = " & Field2Str(oRS!proj_id) + Set oRSS = New Recordset + oRSS.Open strSQL2, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + lblLotNo.Caption = Field2Str(oRS!lot_no) + lblProjCode.Caption = Field2Str(oRSS!proj_code) + lblProjDesc.Caption = Field2Str(oRSS!proj_desc) + End If + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormPOList - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblLotNo.Caption = "" + lblProjDesc.Caption = "" + lblProjCode.Caption = "" + lblOType.Caption = "" + lblODate.Caption = "" + lblPONum.Caption = "" + lblSupplyName.Caption = "" +End Sub + + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH +' If cmdSave.Enabled Then + +' strMSG = "Crew Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call FormSave + +' Case vbNo + +' Case vbCancel +' Cancel = True +' Exit Sub +' End Select +' End If + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frm new file mode 100644 index 0000000..83b80ae --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frm @@ -0,0 +1,520 @@ +VERSION 5.00 +Begin VB.Form frmPOMatrl + BorderStyle = 3 'Fixed Dialog + Caption = "POMATRL" + ClientHeight = 2985 + ClientLeft = 1095 + ClientTop = 330 + ClientWidth = 5775 + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 2985 + ScaleWidth = 5775 + Begin VB.PictureBox picButtons + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5775 + TabIndex = 20 + Top = 2385 + Width = 5775 + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 300 + Left = 1675 + TabIndex = 26 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update" + Height = 300 + Left = 290 + TabIndex = 25 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdClose + Caption = "&Close" + Height = 300 + Left = 4445 + TabIndex = 24 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Height = 300 + Left = 3060 + TabIndex = 23 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdEdit + Caption = "&Edit" + Height = 300 + Left = 1675 + TabIndex = 22 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 300 + Left = 290 + TabIndex = 21 + Top = 0 + Width = 1095 + End + End + Begin VB.PictureBox picStatBox + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 5775 + TabIndex = 14 + Top = 2685 + Width = 5775 + Begin VB.CommandButton cmdLast + Height = 300 + Left = 4545 + Picture = "frmPOMatrl.frx":0000 + Style = 1 'Graphical + TabIndex = 18 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4200 + Picture = "frmPOMatrl.frx":0342 + Style = 1 'Graphical + TabIndex = 17 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 345 + Picture = "frmPOMatrl.frx":0684 + Style = 1 'Graphical + TabIndex = 16 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 0 + Picture = "frmPOMatrl.frx":09C6 + Style = 1 'Graphical + TabIndex = 15 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.Label lblStatus + BackColor = &H00FFFFFF& + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 690 + TabIndex = 19 + Top = 0 + Width = 3360 + End + End + Begin VB.TextBox txtFields + DataField = "CALC_FLAG" + Height = 285 + Index = 6 + Left = 2040 + TabIndex = 13 + Top = 1980 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "CALC_AMT" + Height = 285 + Index = 5 + Left = 2040 + TabIndex = 11 + Top = 1660 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "M_TYPE" + Height = 285 + Index = 4 + Left = 2040 + TabIndex = 9 + Top = 1340 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "D_FLAG" + Height = 285 + Index = 3 + Left = 2040 + TabIndex = 7 + Top = 1020 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "QTY" + Height = 285 + Index = 2 + Left = 2040 + TabIndex = 5 + Top = 700 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "DESC" + Height = 285 + Index = 1 + Left = 2040 + TabIndex = 3 + Top = 380 + Width = 3375 + End + Begin VB.TextBox txtFields + DataField = "INV_NO" + Height = 285 + Index = 0 + Left = 2040 + TabIndex = 1 + Top = 60 + Width = 3375 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Metal Calc Flag:" + Height = 255 + Index = 6 + Left = 120 + TabIndex = 12 + Top = 1980 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Metal Calc Amount:" + Height = 255 + Index = 5 + Left = 120 + TabIndex = 10 + Top = 1660 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Material Type:" + Height = 255 + Index = 4 + Left = 120 + TabIndex = 8 + Top = 1340 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Delivery Flag:" + Height = 255 + Index = 3 + Left = 120 + TabIndex = 6 + Top = 1020 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Quantity:" + Height = 255 + Index = 2 + Left = 120 + TabIndex = 4 + Top = 700 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Description:" + Height = 255 + Index = 1 + Left = 120 + TabIndex = 2 + Top = 380 + Width = 1815 + End + Begin VB.Label lblLabels + Alignment = 1 'Right Justify + Caption = "Inventory Number:" + Height = 255 + Index = 0 + Left = 120 + TabIndex = 0 + Top = 60 + Width = 1815 + End +End +Attribute VB_Name = "frmPOMatrl" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim WithEvents adoPrimaryRS As Recordset +Attribute adoPrimaryRS.VB_VarHelpID = -1 +Dim mbChangedByCode As Boolean +Dim mvBookMark As Variant +Dim mbEditFlag As Boolean +Dim mbAddNewFlag As Boolean +Dim mbDataChanged As Boolean + +Private Sub Form_Load() + Dim db As Connection + Set db = New Connection + db.CursorLocation = adUseClient + db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\VWP\VWP.mdb;" + + Set adoPrimaryRS = New Recordset + adoPrimaryRS.Open "select INV_NO,DESC,QTY,D_FLAG,M_TYPE,CALC_AMT,CALC_FLAG from POMATRL Order by INV_NO", db, adOpenStatic, adLockOptimistic + + Dim oText As TextBox + 'Bind the text boxes to the data provider + For Each oText In Me.txtFields + Set oText.DataSource = adoPrimaryRS + Next + + mbDataChanged = False +End Sub + +Private Sub Form_Resize() + On Error Resume Next + lblStatus.Width = Me.Width - 1500 + cmdNext.Left = lblStatus.Width + 700 + cmdLast.Left = cmdNext.Left + 340 +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + If mbEditFlag Or mbAddNewFlag Then Exit Sub + + Select Case KeyCode + Case vbKeyEscape + cmdClose_Click + Case vbKeyEnd + cmdLast_Click + Case vbKeyHome + cmdFirst_Click + Case vbKeyUp, vbKeyPageUp + If Shift = vbCtrlMask Then + cmdFirst_Click + Else + cmdPrevious_Click + End If + Case vbKeyDown, vbKeyPageDown + If Shift = vbCtrlMask Then + cmdLast_Click + Else + cmdNext_Click + End If + End Select +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Screen.MousePointer = vbDefault +End Sub + +Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This will display the current record position for this recordset + lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition) +End Sub + +Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This is where you put validation code + 'This event gets called when the following actions occur + Dim bCancel As Boolean + + Select Case adReason + Case adRsnAddNew + Case adRsnClose + Case adRsnDelete + Case adRsnFirstChange + Case adRsnMove + Case adRsnRequery + Case adRsnResynch + Case adRsnUndoAddNew + Case adRsnUndoDelete + Case adRsnUndoUpdate + Case adRsnUpdate + End Select + + If bCancel Then adStatus = adStatusCancel +End Sub + +Private Sub cmdAdd_Click() + On Error GoTo AddErr + With adoPrimaryRS + If Not (.BOF And .EOF) Then + mvBookMark = .Bookmark + End If + .AddNew + lblStatus.Caption = "Add record" + mbAddNewFlag = True + SetButtons False + End With + + Exit Sub +AddErr: + MsgBox Err.Description +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo DeleteErr + With adoPrimaryRS + .Delete + .MoveNext + If .EOF Then .MoveLast + End With + Exit Sub +DeleteErr: + MsgBox Err.Description +End Sub + +Private Sub cmdEdit_Click() + On Error GoTo EditErr + + lblStatus.Caption = "Edit record" + mbEditFlag = True + SetButtons False + Exit Sub + +EditErr: + MsgBox Err.Description +End Sub +Private Sub cmdCancel_Click() + On Error Resume Next + + SetButtons True + mbEditFlag = False + mbAddNewFlag = False + adoPrimaryRS.CancelUpdate + If mvBookMark > 0 Then + adoPrimaryRS.Bookmark = mvBookMark + Else + adoPrimaryRS.MoveFirst + End If + mbDataChanged = False + +End Sub + +Private Sub cmdUpdate_Click() + On Error GoTo UpdateErr + + adoPrimaryRS.UpdateBatch adAffectAll + + If mbAddNewFlag Then + adoPrimaryRS.MoveLast 'move to the new record + End If + + mbEditFlag = False + mbAddNewFlag = False + SetButtons True + mbDataChanged = False + + Exit Sub +UpdateErr: + MsgBox Err.Description +End Sub + +Private Sub cmdClose_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + On Error GoTo GoFirstError + + adoPrimaryRS.MoveFirst + mbDataChanged = False + + Exit Sub + +GoFirstError: + MsgBox Err.Description +End Sub + +Private Sub cmdLast_Click() + On Error GoTo GoLastError + + adoPrimaryRS.MoveLast + mbDataChanged = False + + Exit Sub + +GoLastError: + MsgBox Err.Description +End Sub + +Private Sub cmdNext_Click() + On Error GoTo GoNextError + + If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext + If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveLast + End If + 'show the current record + mbDataChanged = False + + Exit Sub +GoNextError: + MsgBox Err.Description +End Sub + +Private Sub cmdPrevious_Click() + On Error GoTo GoPrevError + + If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious + If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveFirst + End If + 'show the current record + mbDataChanged = False + + Exit Sub + +GoPrevError: + MsgBox Err.Description +End Sub + +Private Sub SetButtons(bVal As Boolean) + cmdAdd.Visible = bVal + cmdEdit.Visible = bVal + cmdUpdate.Visible = Not bVal + cmdCancel.Visible = Not bVal + cmdDelete.Visible = bVal + cmdClose.Visible = bVal + cmdNext.Enabled = bVal + cmdFirst.Enabled = bVal + cmdLast.Enabled = bVal + cmdPrevious.Enabled = bVal +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frx new file mode 100644 index 0000000..cd06a6e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOMatrl.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frm new file mode 100644 index 0000000..e6db047 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frm @@ -0,0 +1,1759 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPOWOLot + Caption = "WorkOrders & PO For Billing" + ClientHeight = 4845 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11850 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4845 + ScaleWidth = 11850 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtZIP + Height = 315 + Left = 4965 + MaxLength = 5 + TabIndex = 13 + Top = 1755 + Width = 930 + End + Begin VB.TextBox txtSTATE + Height = 315 + Left = 3690 + MaxLength = 2 + TabIndex = 12 + Top = 1755 + Width = 585 + End + Begin VB.CheckBox chkLOOK + Caption = "LOOK" + Height = 375 + Left = 2400 + TabIndex = 60 + Top = 90 + Visible = 0 'False + Width = 825 + End + Begin VB.TextBox txtSC_DESC + Height = 300 + Left = 5025 + TabIndex = 59 + TabStop = 0 'False + Top = 3240 + Visible = 0 'False + Width = 1050 + End + Begin VB.TextBox txtSalesCode + Height = 315 + Left = 3480 + TabIndex = 14 + Top = 3225 + Width = 1485 + End + Begin LpLib.fpCombo cboSalesCode + Height = 315 + Left = 2220 + TabIndex = 22 + TabStop = 0 'False + Top = 2925 + Visible = 0 'False + Width = 3945 + _Version = 196608 + _ExtentX = 6959 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 2 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 0 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 2 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = -1 'True + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPOWOLot.frx":0000 + End + Begin Crystal.CrystalReport crREPAIR + Left = 8550 + Top = 165 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Invoice" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10590 + TabIndex = 54 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin VB.TextBox txtJC + Height = 315 + Left = 3480 + TabIndex = 15 + Top = 3555 + Width = 1485 + End + Begin VB.TextBox txtRepID + Alignment = 2 'Center + Appearance = 0 'Flat + BackColor = &H80000000& + BorderStyle = 0 'None + Height = 270 + Left = 1515 + TabIndex = 52 + TabStop = 0 'False + Top = 105 + Width = 780 + End + Begin VB.CheckBox chkADD + Caption = "ADD" + Height = 315 + Left = 615 + TabIndex = 51 + Top = 120 + Visible = 0 'False + Width = 870 + End + Begin VB.TextBox txtCMSCust + Height = 315 + Left = 3480 + TabIndex = 17 + Top = 4200 + Width = 1485 + End + Begin VB.TextBox txtInvNo + Height = 315 + Left = 3480 + TabIndex = 16 + Top = 3885 + Width = 1485 + End + Begin VB.TextBox txtHOName + Height = 315 + Left = 3675 + TabIndex = 9 + Top = 825 + Width = 3000 + End + Begin VB.TextBox txtTAX + Height = 315 + Left = 960 + TabIndex = 8 + Top = 4470 + Width = 735 + End + Begin VB.CommandButton cmdProforma + Caption = "Proforma Invoice" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9325 + TabIndex = 45 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin MSComCtl2.DTPicker dtpRepair + Height = 315 + Left = 960 + TabIndex = 0 + Top = 840 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + DateIsNull = -1 'True + Format = 43646977 + CurrentDate = 43132 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 8060 + TabIndex = 27 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6795 + TabIndex = 26 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 6165 + MultiLine = -1 'True + TabIndex = 21 + Top = 3450 + Width = 5595 + End + Begin VB.TextBox txtDesc + Height = 1035 + Left = 6165 + MaxLength = 150 + MultiLine = -1 'True + TabIndex = 20 + Top = 2415 + Width = 5595 + End + Begin VB.TextBox txtBPhone + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 14 + TabIndex = 2 + Top = 2280 + Width = 1215 + End + Begin VB.TextBox txtBCWho + Height = 315 + Left = 8265 + MaxLength = 20 + TabIndex = 19 + Top = 2070 + Width = 3495 + End + Begin VB.Frame frmRepair + Caption = "Work Type" + Height = 1125 + Left = 9930 + TabIndex = 30 + Top = 105 + Width = 1875 + Begin VB.CheckBox chkBC + Caption = "Back Charge:" + Height = 255 + Left = 225 + TabIndex = 23 + Top = 795 + Width = 1400 + End + Begin VB.CheckBox chkWarrenty + Caption = "Purchase Order" + Height = 255 + Left = 225 + TabIndex = 24 + Top = 540 + Width = 1455 + End + Begin VB.CheckBox chkWO + Caption = "WorkOrder:" + Height = 255 + Left = 225 + TabIndex = 25 + Top = 285 + Width = 1400 + End + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 8400 + MaxLength = 14 + TabIndex = 18 + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtHAddress + Height = 315 + Left = 3675 + MaxLength = 30 + TabIndex = 10 + Top = 1125 + Width = 3000 + End + Begin VB.TextBox txtHName + Height = 315 + Left = 3675 + MaxLength = 20 + TabIndex = 11 + Top = 1440 + Width = 3000 + End + Begin VB.TextBox txtBillAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 7 + Top = 4080 + Width = 1215 + End + Begin VB.TextBox txtBillDate + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 6 + Top = 3720 + Width = 1215 + End + Begin VB.CheckBox chkBilled + Alignment = 1 'Right Justify + Caption = "Billed:" + Height = 195 + Left = 420 + TabIndex = 5 + Top = 3420 + Width = 1035 + End + Begin VB.TextBox txtBPOAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 4 + Top = 3000 + Width = 1215 + End + Begin VB.TextBox txtBPO + Height = 315 + Left = 960 + MaxLength = 15 + TabIndex = 3 + Top = 2655 + Width = 1215 + End + Begin VB.TextBox txtBContact + Height = 315 + Left = 960 + MaxLength = 20 + TabIndex = 1 + Top = 1920 + Width = 2175 + End + Begin VB.Label lblADD + Caption = "ADD" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1710 + TabIndex = 63 + Top = 390 + Width = 540 + End + Begin VB.Label lblZIP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ZIP:" + Height = 195 + Left = 4635 + TabIndex = 62 + Top = 1815 + Width = 300 + End + Begin VB.Label lblState + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "State:" + Height = 195 + Left = 3180 + TabIndex = 61 + Top = 1815 + Width = 420 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sales Code:" + Height = 195 + Left = 2595 + TabIndex = 58 + Top = 3300 + Width = 855 + End + Begin VB.Label lblLetters + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Max Characters - 120" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4290 + TabIndex = 57 + Top = 2655 + Width = 1830 + End + Begin VB.Label txtINV + Height = 255 + Left = 780 + TabIndex = 56 + Top = 1320 + Visible = 0 'False + Width = 825 + End + Begin VB.Label txtRepairID + Height = 315 + Left = 2445 + TabIndex = 55 + Top = 435 + Visible = 0 'False + Width = 525 + End + Begin VB.Label lblJC + AutoSize = -1 'True + Caption = "Job Cost:" + Height = 195 + Left = 2790 + TabIndex = 53 + Top = 3615 + Width = 660 + End + Begin VB.Label lblBuilder + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 315 + Left = 2205 + TabIndex = 50 + Top = 4530 + Width = 3345 + End + Begin VB.Label lblCMSCust + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Cust. #:" + Height = 195 + Left = 2460 + TabIndex = 49 + Top = 4260 + Width = 945 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv. No: " + Height = 195 + Left = 2835 + TabIndex = 48 + Top = 3945 + Width = 615 + End + Begin VB.Label lblHO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "HomeOwner:" + Height = 195 + Left = 2670 + TabIndex = 47 + Top = 885 + Width = 930 + End + Begin VB.Label lblTaxCode + AutoSize = -1 'True + Caption = "Tax Code: " + Height = 195 + Left = 75 + TabIndex = 46 + Top = 4530 + Width = 780 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 5430 + TabIndex = 44 + Top = 3555 + Width = 690 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description of Work:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4350 + TabIndex = 43 + Top = 2445 + Width = 1770 + End + Begin VB.Label lblBPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Telephone:" + Height = 195 + Left = 30 + TabIndex = 42 + Top = 2340 + Width = 810 + End + Begin VB.Label lblBCWho + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Back Charge Whom:" + Height = 195 + Left = 6705 + TabIndex = 41 + Top = 2130 + Width = 1485 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Superintendent:" + Height = 195 + Left = 6840 + TabIndex = 40 + Top = 960 + Width = 1545 + End + Begin VB.Label lblHAddress + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address:" + Height = 195 + Left = 2985 + TabIndex = 39 + Top = 1170 + Width = 615 + End + Begin VB.Label lblHName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "City:" + Height = 195 + Left = 3300 + TabIndex = 38 + Top = 1485 + Width = 300 + End + Begin VB.Label lblBillDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Date:" + Height = 195 + Left = 30 + TabIndex = 37 + Top = 3840 + Width = 810 + End + Begin VB.Label lblBillAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Amt:" + Height = 195 + Left = 105 + TabIndex = 36 + Top = 4200 + Width = 735 + End + Begin VB.Label lblHOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot Information:" + Height = 195 + Left = 3300 + TabIndex = 35 + Top = 600 + Width = 1095 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amount:" + Height = 195 + Left = 255 + TabIndex = 34 + Top = 3120 + Width = 585 + End + Begin VB.Label lblBPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O. #:" + Height = 195 + Left = 330 + TabIndex = 33 + Top = 2760 + Width = 510 + End + Begin VB.Label lblBContact + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contact:" + Height = 195 + Left = 240 + TabIndex = 32 + Top = 2040 + Width = 600 + End + Begin VB.Label lblBuilderInfo + AutoSize = -1 'True + Caption = "Builder Information:" + Height = 195 + Left = 960 + TabIndex = 31 + Top = 1650 + Width = 1350 + End + Begin VB.Label lblScheduled + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Height = 195 + Left = 270 + TabIndex = 29 + Top = 960 + Width = 660 + End + Begin VB.Label lblProjectLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3300 + TabIndex = 28 + Top = 120 + Width = 5055 + End +End +Attribute VB_Name = "frmPOWOLot" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSRepair As Recordset, moRSC As Recordset +Dim moRS As Recordset, moRSProj As Recordset +Dim moRSInvINFO As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean, mboolEDIT As Boolean +Dim mintREPAIRID As Integer, mlngINVID As Long, mboolNOSAVE As Boolean +Dim mstrPROJLOT As String, mboolLOOK As Boolean + +Private Sub cboSalesCode_DblClick() + + cboSalesCode.col = 0 + + cboSalesCode.ColText = txtSalesCode + + cboSalesCode.col = 1 + txtSC_DESC = cboSalesCode.ColText +End Sub + +Private Sub chkBilled_LostFocus() + If chkBilled = vbChecked Then +' cmdPrint.Enabled = False + Else +' cmdPrint.Enabled = True + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() + + On Error GoTo Error_EH + + Call FormSave + Call InvPrint + gboolPRINT = False + + Exit Sub + +Error_EH: + gstrMODULE = gstrMODULE & " Form POWOLot - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdProforma_Click() + + + On Error GoTo Error_EH + + Call FormSave + Call ProformaPrint + gboolPRINT = False + + Exit Sub +Error_EH: + gstrMODULE = gstrMODULE & " Form POWOLot - Module cmdProforma" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ProformaPrint() +Dim strSQL As String, mdblORDAMT As Double, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset +Dim strPRICE As String, lngRepID As String +Dim strYARD As String, intYN As Integer + + On Error GoTo Error_EH: + + + strSELECT = "SELECT * FROM tblPOWO WHERE Repair_ID = " & txtRepairID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + + oRS.Close + + If gintCOCODE = 0 Then + crREPAIR.ReportFileName = App.Path & "\InvoicePRep.rpt" + End If + strSQL = "{tblPOWO.Repair_ID} = " & CLng(txtRepairID) + crREPAIR.ReplaceSelectionFormula (strSQL) + crREPAIR.CopiesToPrinter = 1 + intYN = MsgBox("Do You Want To Print To A Printer?", vbYesNo, "Use Printer") + If intYN = vbNo Then + crREPAIR.Destination = crptToWindow + Else + crREPAIR.Destination = crptToPrinter + End If + crREPAIR.Action = 1 + + crREPAIR.Reset + + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOLot - Module ProformaPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub InvPrintXXX() +Dim strSQL As String, mdblORDAMT As Double, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset +Dim strPRICE As String, lngRepID As String +Dim strYARD As String + + On Error GoTo Error_EH: + + strSELECT = "SELECT * FROM tblPOWO WHERE Repair_ID = " & txtRepairID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + oRS.Close + + If gintCOCODE = 0 Then + crREPAIR.ReportFileName = App.Path & "\InvoiceRep.rpt" + End If + strSQL = "{tblPOWO.Repair_ID} = " & CLng(txtRepairID) + crREPAIR.ReplaceSelectionFormula (strSQL) + crREPAIR.CopiesToPrinter = 1 + crREPAIR.Destination = crptToWindow +' crREPAIR.Destination = crptToPrinter + crREPAIR.Action = 1 + + crREPAIR.Reset + + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOLot - Module InvPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + Call FormSave + Unload Me +End Sub + +Private Function FormFindPO() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOWO WHERE REPAIR_Id = " & gintREPAIRID + Set moRSRepair = New Recordset + moRSRepair.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSRepair.EOF Then + FormFindPO = False + Else + FormFindPO = True +' Call FormShowPO + End If + Exit Function + +Error_EH: + gstrMODULE = "formPOWOLot - Module FormFindPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowPO() + On Error GoTo Error_EH + +' mboolSHOW = True + + With moRSRepair + txtRepairID = Field2Str(!repair_id) + txtHOName = Field2Str(!HOName) + txtHAddress = Field2Str(!Owner_address) + txtHName = Field2Str(!Owner_Name) + txtVWPSuper = Field2Str(!VWP_Super) + txtBCWho = Field2Str(!bc_who) + txtDesc = Field2Str(!Desc) + txtNotes = Field2Str(!notes) + txtCMSCust = Field2Str(!Builder_NO) + If Len(txtCMSCust) = 0 Then + txtCMSCust = Field2Str(moRSProj!ar) + End If + lblBuilder = Field2Str(moRSC!Name) + txtZIP = Field2Str2(!zip) + txtSTATE = Field2Str(!State) +' cboSalesCode.col = 1 + txtSalesCode = Field2Str(!sales_code) + If Len(txtSalesCode) = 0 Then + cboSalesCode.Enabled = True + Else + cboSalesCode.Enabled = False + End If + cboSalesCode.ColumnSearch = 0 + cboSalesCode.SearchText = txtSalesCode + cboSalesCode.Action = ActionSearch + If Len(txtCMSCust) <> 0 Then + lblBuilder = Field2Str(moRSC!Name) + End If + txtSC_DESC = Field2Str(!SC_Description) + txtInvNo = Field2Str(!invoice_no) + txtTAX = Field2Str(!tax_code) + If IsNull(txtTAX) Or txtTAX = "" Then + txtTAX = Field2Str(moRSProj!taxcode) + End If + txtBillAmt = Format(Field2Str(!bill_amt), "#,#.00") + txtBillDate = Field2Str2(!bill_date) + txtBPOAmt = Format(Field2Str(!PO_Amt), "#,#.00") + txtBPO = Field2Str(!builder_PO) + txtBPhone = Field2Str(!builder_phone) + txtBContact = Field2Str(!builder_contact) + dtpRepair = Field2Str(!scheduled) + chkWO = Field2CheckBox(!wo) + chkBilled = Field2CheckBox(!billed) + If chkBilled = vbChecked Then + chkBilled.Enabled = False + cmdPrint.Enabled = False + Else + chkBilled.Enabled = True + cmdPrint.Enabled = True + End If + chkWarrenty = Field2CheckBox(!repair) + If Len(!job_number) > 0 Then + txtJC = Field2Str(!job_number) + Else + txtJC = Field2Str(moRS!jobcost) + End If + chkBC = Field2CheckBox(!backcharge) + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOInfo - Module FormShowPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim strTEST As String, intYN As Integer +' Call CrewLoad + dtpRepair.Value = Date + + Call GetLotInfo +' If moRSRepair!Save_Accpt Then '***** Still need to complete this logic +' mboolNOSAVE = True +' End If + If chkADD = vbChecked Then + mboolAdding = True + lblADD.Visible = True + txtCMSCust = Field2Str(moRSProj!ar) + lblBuilder = Field2Str(moRSC!Name) +' Call GetLotInfo + Else + mboolAdding = False + lblADD.Visible = False + If FormFindPO() Then + Call FormShowPO + End If + End If +' Call GetLotInfo + txtRepID = gintREPAIRID + + If chkLOOK = vbChecked Then + mboolLOOK = True + End If + + If mboolLOOK Or chkBilled = vbChecked Then + cmdSave.Enabled = False + cmdPrint.Enabled = False + cmdProforma.Enabled = False + chkWO.Enabled = False + chkWarrenty.Enabled = False + chkBC.Enabled = False + txtVWPSuper.Enabled = False + txtDesc.Enabled = False + txtNotes.Enabled = False + txtCMSCust.Enabled = False + txtInvNo.Enabled = False + txtJC.Enabled = False + cboSalesCode.Enabled = False + txtSalesCode.Enabled = False + txtBCWho.Enabled = False + txtHName.Enabled = False + txtHAddress.Enabled = False + txtHOName.Enabled = False + txtTAX.Enabled = False + txtZIP.Enabled = False + txtSTATE.Enabled = False + txtBillAmt.Enabled = False + txtBillDate.Enabled = False + chkBilled.Enabled = False + txtBPOAmt.Enabled = False + txtBPO.Enabled = False + dtpRepair.Enabled = False + txtBContact.Enabled = False + txtBPhone.Enabled = False + Else + cmdSave.Enabled = True +' If Not chkBilled = vbChecked Then +' cmdPrint.Enabled = True +' Else +' cmdPrint.Enabled = False +' End If + cmdPrint.Enabled = True + cmdProforma.Enabled = True + chkWO.Enabled = True + chkWarrenty.Enabled = True + chkBC.Enabled = True + txtVWPSuper.Enabled = True + txtDesc.Enabled = True + txtNotes.Enabled = True + txtCMSCust.Enabled = True + txtInvNo.Enabled = True + txtJC.Enabled = True + cboSalesCode.Enabled = True + txtSalesCode.Enabled = True + txtBCWho.Enabled = True + txtHName.Enabled = True + txtHAddress.Enabled = True + txtHOName.Enabled = True + txtTAX.Enabled = True + txtBillAmt.Enabled = True + txtBillDate.Enabled = True +' If Not chkBilled = vbChecked Then +' chkBilled.Enabled = True +' Else +' chkBilled.Enabled = False +' End If + chkBilled.Enabled = True + txtBPOAmt.Enabled = True + txtBPO.Enabled = True + dtpRepair.Enabled = True + txtBContact.Enabled = True + txtBPhone.Enabled = True + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRSSS As Recordset, strSQL As String + + If Shift = 4 Then + Exit Sub + End If + + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyB And gbytSECURITY < 3 Then ' Allow Print of Stone + If CtrlDown Then + strSQL = "SELECT * FROM tblPOWO WHERE Repair_ID = " & CInt(txtRepID) + Set oRSSS = New Recordset + oRSSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + cmdPrint.Enabled = True + oRSSS!billed = vbUnchecked + chkBilled = vbUnchecked + chkBilled.Enabled = True + oRSSS.Update + Exit Sub + End If + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() +Dim strTEST As String ', mboolLOOK As Boolean + On Error GoTo Error_EH + + txtRepID = 0 + mboolLOOK = False + Call FormClear + Call SCLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOLot - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSRepair.AddNew + End If + If moRSRepair.EOF Then + + End If + + With moRSRepair + !scheduled = dtpRepair.Value + !builder_contact = Str2Field(txtBContact) + !builder_phone = Str2Field(txtBPhone) + !builder_PO = Str2Field(txtBPO) + !PO_Amt = Str2Field(txtBPOAmt) + !bill_date = Date2Field(txtBillDate) +' !bill_date = Str2Field(txtBillDate) + !bill_amt = Str2Field(txtBillAmt) + !zip = Field2Str2(txtZIP) + !State = Field2Str(txtSTATE) + !Owner_Name = Str2Field(txtHName) + !Owner_address = Str2Field(txtHAddress) + !VWP_Super = Str2Field(txtVWPSuper) + !bc_who = Str2Field(txtBCWho) + !Desc = Str2Field(txtDesc) + !notes = Str2Field(txtNotes) + !billed = Field2CheckBox(chkBilled) + !wo = Field2CheckBox(chkWO) + !repair = Field2CheckBox(chkWarrenty) + !backcharge = Field2CheckBox(chkBC) + !job_number = Field2Str(txtJC) + !UpdateUser = gstrLOGIN + !Updated = Date + !proj_lot = lblProjectLot.Caption + !createuser = gstrLOGIN + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !project = Field2Str(moRSProj!Proj_Desc) + !lot_no = moRS!lot_no + !projcode = Field2Str(moRSProj!Proj_Code) + !CodeDesc = Field2Str(moRSProj!Proj_Code) & " " & Field2Str(moRSProj!Proj_Desc) + !sales_code = txtSalesCode + !SC_Description = txtSC_DESC + If Len(txtSalesCode) > 0 Then + !qty = 1 + Else + !qty = 0 + End If + !Builder_NO = Field2Str(txtCMSCust) + + If Len(txtInvNo) = 0 Then + !invoice_no = Trim(txtINV) & Trim(Field2Str(moRS!lot_no)) + Else + !invoice_no = Field2Str(txtInvNo) + End If + + !tax_code = Str2Field(txtTAX) + + If Not moRSC.EOF Then + !c_add1 = Field2Str(moRSC!Name) + !c_add2 = Field2Str(moRSC!Address1) + If Field2Str(moRSC!Address2) = "" Then + !c_add3 = Trim(Field2Str(moRSC!City)) & ", " & Field2Str(moRSC!State) & " " & Field2Str(moRSC!ZipCode) + Else + !c_add3 = Field2Str(moRSC!Address2) + End If + If Field2Str(moRSC!Address2) = "" Then + !c_add4 = "" + Else + !c_add4 = Trim(Field2Str(moRSC!City)) & ", " & Field2Str(moRSC!State) & " " & Field2Str(moRSC!ZipCode) + End If + Else + !c_add1 = "" + !c_add2 = "" + !c_add3 = "" + !c_add4 = "" + End If + !HOName = Field2Str(txtHOName) + + End With + + moRSRepair.Update + If mboolAdding Then + Call GetRepID + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + Resume Next + End If + gstrMODULE = "Form RepairLot - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtBContact = "" + txtBPhone = "" + txtBPO = "" + txtBPOAmt = 0 + txtBillDate = "00/00/0000" + txtBillAmt = 0 + txtHName = "" + txtZIP = "" + txtSTATE = "" + txtHAddress = "" + txtVWPSuper = "" + txtBCWho = "" + txtDesc = "" + txtNotes = "" +' cboDArea.ListIndex = -1 + chkBilled = vbUnchecked + chkWO = vbUnchecked + chkWarrenty = vbUnchecked + chkBC = vbUnchecked +' cboRCrew.ListIndex = -1 + lblProjectLot = "" + +End Sub + + +Private Sub FormSave() + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSRepair.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + On Error GoTo Error_EH + If moRSRepair.State = adStateOpen Then + moRSRepair.Close + End If + + frmWOList.chkQUIT = vbChecked + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If + +End Sub + +Private Sub txtBContact_GotFocus() + Call FieldSelect(txtBContact) +End Sub + +Private Sub txtBContact_LostFocus() + txtBContact = UCase(txtBContact) +End Sub + +Private Sub txtBCWho_GotFocus() + Call FieldSelect(txtBCWho) +End Sub + +Private Sub txtBCWho_LostFocus() + txtBCWho = UCase(txtBCWho) +End Sub + +Private Sub txtBillAmt_GotFocus() + Call FieldSelect(txtBillAmt) +End Sub + +Private Sub txtBillAmt_LostFocus() + txtBillAmt = Format(txtBillAmt, "#,#.00") +End Sub + +Private Sub txtBillDate_GotFocus() + Call FieldSelect(txtBillDate) +End Sub + +Private Sub txtBillDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBillDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBillDate) > 0 Then + txtBillDate = Format(txtBillDate, "00/00/####") + If Not IsDate(txtBillDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBillDate.SetFocus + ElseIf CDate(txtBillDate) < (Date - 90) Then + MsgBox "The Date Cannot Be Earlier Than 90 Days Before Today - ReEnter" + txtBillDate.SetFocus + ElseIf CDate(txtBillDate) > (Date + 366) Then + MsgBox "The Date Cannot Be More Than 1 Year From Today - ReEnter" + txtBillDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBillDate.SetFocus + End If + +End Sub + +Private Sub txtBPhone_GotFocus() + Call FieldSelect(txtBPhone) +End Sub + +Private Sub txtBPO_GotFocus() + Call FieldSelect(txtBPO) +End Sub + +Private Sub txtBPO_LostFocus() + txtBPO = UCase(txtBPO) +End Sub + +Private Sub txtBPOAmt_GotFocus() + Call FieldSelect(txtBPOAmt) +End Sub + +Private Sub txtBPOAmt_LostFocus() + txtBPOAmt = Format(txtBPOAmt, "#,#.00") +End Sub + +Private Sub txtCMSCust_GotFocus() + Call FieldSelect(txtCMSCust) +End Sub + +Private Sub txtCMSCust_LostFocus() + txtCMSCust = UCase(txtCMSCust) + lblBuilder = Field2Str(moRSC!Name) +End Sub + +Private Sub txtDesc_GotFocus() + +' cboSalesCode.col = 1 + If mboolAdding Then +' txtDesc = " REPAIR - " & txtDesc + txtDesc = txtDesc + End If + txtDesc.SelStart = 120 +' If Len(txtDesc) = 0 And Len(cboSalesCode.ColText) > 0 Then +' txtDesc = cboSalesCode.ColText +' End If +' Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +' If mboolAdding Then +' txtDesc = "REPAIR - " & txtDesc +' End If + If Len(txtDesc) > 120 Then + MsgBox "The Text In This Box Is Too Long. Move Anything Over 120 Characters To Notes", vbOKOnly, "Over 30 Characters" + Exit Sub + End If +End Sub + +Private Sub txtHAddress_GotFocus() + Call FieldSelect(txtHAddress) +End Sub + +Private Sub txtHAddress_LostFocus() + txtHAddress = UCase(txtHAddress) +End Sub + +Private Sub txtHName_GotFocus() + Call FieldSelect(txtHName) +End Sub + +Private Sub txtHName_LostFocus() + txtHName = UCase(txtHName) +End Sub + + +Private Sub txtHOName_GotFocus() + Call FieldSelect(txtHOName) +End Sub + +Private Sub txtHOName_LostFocus() + txtHOName = UCase(txtHOName) +End Sub + +Private Sub txtInvNo_GotFocus() + If Len(txtInvNo) = 0 Then + txtInvNo = Trim(txtINV) & Trim(Field2Str(moRS!lot_no)) + End If + + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtInvNo_LostFocus() + txtInvNo = UCase(txtInvNo) +End Sub + +Private Sub txtNotes_GotFocus() +' txtNotes.MaxLength = Len(txtNotes) +' Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() + txtSalesCode = UCase(txtSalesCode) +' Call cboSalesCode_DblClick +' txtSC_DESC = CBFindString(cboSalesCode, txtSalesCode) + End Sub + +Private Sub txtState_GotFocus() + Call FieldSelect(txtSTATE) +End Sub + +Private Sub txtState_LostFocus() + txtSTATE = UCase(txtSTATE) +End Sub + +Private Sub txtTax_GotFocus() + Call FieldSelect(txtTAX) +End Sub + +Private Sub txtTax_LostFocus() + If IsNull(txtTAX) Or txtTAX = "" Then + txtTAX = Field2Str(moRSProj!taxcode) + End If + txtTAX = UCase(txtTAX) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub + +Private Sub GetRepID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(Repair_ID) as MAXRepID from tblPOWO" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtRepID = oRSMAX!MAXRepID + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOLot - Module GetRepID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String, strREPAIR As String, strSQL4 As String + + If chkADD = vbChecked Then + strREPAIR = "SELECT * FROM tblPOWO WHERE Repair_id = 1" + Set moRSRepair = New Recordset + moRSRepair.Open strREPAIR, goConn, adOpenKeyset, adLockOptimistic + End If + +' If moRSRepair.EOF Then + +' End If + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!PROJ_ID) + Set moRSProj = New Recordset + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + If moRSProj!cocode = 0 Then + strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + ElseIf moRSProj!cocode = 1 Then + strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" + End If + Set moRSC = New Recordset + moRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly + + End If + + mstrPROJLOT = Trim(Field2Str(moRSProj!Proj_Desc)) & " - " & Trim(Field2Str(moRS!lot_no)) + lblProjectLot = mstrPROJLOT + txtHName = Field2Str(moRS!Owner) + txtHAddress = Field2Str(moRS!address) + txtINV = moRSProj!inv + + If chkADD = vbChecked Then + txtJC = Field2Str(moRS!jobcost) + End If + +End Sub + +Private Sub InvPrint() +Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset, oRSPO As Recordset +Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String +Dim strSQLE As String, oRSE As Recordset +Dim strSQL1 As String, strSQL3 As String, intDay As Integer +Dim intYear As Integer, intMonth As Integer, strDate As String +Dim dblINVTOTAL As Double, dblRETENTION As Double +Dim strADD3 As String, strADD4 As String, strSQLINFO As String +Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer +Dim strTEST2 As String, strMSG As String, strLEN As String +Dim dblBillAmt As Double, dblWAmt As Double, intYN As Integer + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + strSELECT = "SELECT * FROM tblPOWO WHERE Repair_ID = " & Field2Str2(txtRepID) + Set oRSPO = New Recordset + oRSPO.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + dblBillAmt = 0 + dblINVTOTAL = 0 + dblRETENTION = 0 + + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + mlngINVID = moRSInvINFO!ARINVOICE_TRANS_ID + + With oRS + .AddNew + !Trans_ID = mlngINVID + !Lot_ID = gintLOTID + !PROJ_ID = gintPROJID + !project = Field2Str(oRSPO!project) + !lot_no = Field2Str(oRSPO!lot_no) + !address = Field2Str(oRSPO!Owner_address) + !inv_type = "R" + !customer_no = Field2Str(oRSPO!Builder_NO) + !ship_date = Field2Str(oRSPO!bill_date) + !projcode = Field2Str(oRSPO!projcode) + !CodeDesc = Field2Str(oRSPO!projcode) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) + !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " LOT " & Field2Str(moRS!lot_no) + !invoice_no = oRSPO!invoice_no + !zip = Field2Str2(oRSPO!zip) + !State = Field2Str(oRSPO!State) + !City = Field2Str(oRSPO!Owner_Name) + !invoice_date = Field2Str(oRSPO!bill_date) + !job_number = Field2Str(oRSPO!job_number) + + !inv_due_date = DateAdd("d", 33, oRSPO!bill_date) + !disc_due_date = DateAdd("d", 3, oRSPO!bill_date) + + !sales_code = Field2Str(oRSPO!sales_code) + + + If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then + !taxcode = "AZ" + Else + !taxcode = Field2Str(oRSPO!tax_code) + End If + !Description = Field2Str(oRSPO!Desc) + !price = Field2Str2(oRSPO!bill_amt) + !amount = Field2Str2(oRSPO!bill_amt) + !header = vbChecked + !c_add1 = Field2Str(oRSPO!c_add1) + !c_add2 = Field2Str(oRSPO!c_add2) + !c_add3 = Field2Str(oRSPO!c_add3) + !c_add4 = Field2Str(oRSPO!c_add4) + !po_num = Field2Str(oRSPO!builder_PO) + oRS!non_tax_amt = Field2Str2(oRSPO!bill_amt) + oRS!retention_amt = 0 + .Update + + gstrMODULE = "Before mlngINVID update" + mlngINVID = mlngINVID + 1 + strSQLINFO = "SELECT * FROM tblTABLE_INFO" + Set moRSInvINFO = New Recordset + moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic + moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID + moRSInvINFO.Update + + End With + + + strSELECT = "SELECT * FROM tblPOWO WHERE Repair_ID = " & txtRepID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If gintCOCODE = 0 Then + crREPAIR.ReportFileName = App.Path & "\InvoiceRep.rpt" + End If + strSQL = "{tblPOWO.Repair_ID} = " & Field2Integer(txtRepID) +' strSQL = "{tblPOWO.Repair_ID} = " & CLng(txtRepID) + crREPAIR.ReplaceSelectionFormula (strSQL) + crREPAIR.CopiesToPrinter = 1 + intYN = MsgBox("Do You Want To Print To A Printer?", vbYesNo, "Use Printer") + If intYN = vbNo Then + crREPAIR.Destination = crptToWindow + Else + crREPAIR.Destination = crptToPrinter + End If + crREPAIR.Action = 1 + + crREPAIR.Reset + cmdPrint.Enabled = False + chkBilled = vbChecked + cboSalesCode.Enabled = False + chkBilled.Enabled = False + oRSPO!billed = Field2CheckBox(chkBilled) ' If moRSProj!cocode = 0 Then + oRSPO.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module InvPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SCLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + cboSalesCode.Clear + + strSQL = "SELECT * FROM tblCBOSalesCode" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str(oRS!SalesCode) & vbTab & Field2Str(oRS!SC_DESC) ' & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) +' strLine = Field2Str2(oRS!SC_ID) & vbTab & Field2Str(oRS!SalesCode) & vbTab & Field2Str(oRS!SC_DESC) ' & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) + cboSalesCode.AddItem strLine +' cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!bill_id) + oRS.MoveNext + Loop + oRS.Close +' cboAPCode.ListIndex = 0 +' cboSalesCode.ListIndex = -1 + Exit Sub + +Error_EH: + gstrMODULE = "Form POWOLot - Module SCLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub txtZip_GotFocus() + Call FieldSelect(txtZIP) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frx new file mode 100644 index 0000000..16826b0 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPOWOLot.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frm new file mode 100644 index 0000000..2e39f3e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frm @@ -0,0 +1,2399 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmPaintPrtJobs + Caption = "Paint Print Jobs" + ClientHeight = 5805 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6075 + LinkTopic = "Form1" + ScaleHeight = 5805 + ScaleWidth = 6075 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkPREP + Alignment = 1 'Right Justify + Caption = "Print Paint Prep" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 570 + TabIndex = 47 + Top = 930 + Width = 1695 + End + Begin VB.CheckBox chkBT1 + Alignment = 1 'Right Justify + Caption = "Print Blue Tape 1" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3585 + TabIndex = 46 + Top = 930 + Width = 1845 + End + Begin VB.CheckBox chkST + Alignment = 1 'Right Justify + Caption = "Print Stairs/Escalera" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 90 + TabIndex = 40 + Top = 4005 + Width = 2175 + End + Begin VB.CheckBox chkAS2 + Alignment = 1 'Right Justify + Caption = "Print Accent Siding 2" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3165 + TabIndex = 39 + Top = 4005 + Width = 2265 + End + Begin VB.CheckBox chkAS1 + Alignment = 1 'Right Justify + Caption = "Print Accent Siding 1" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3225 + TabIndex = 38 + Top = 3693 + Width = 2205 + End + Begin VB.CheckBox chkRF2 + Alignment = 1 'Right Justify + Caption = "Print Recortar Fascia 2" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3075 + TabIndex = 37 + Top = 3386 + Width = 2355 + End + Begin VB.CheckBox chkRF1 + Alignment = 1 'Right Justify + Caption = "Print Recortar Fascia 1 " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3000 + TabIndex = 36 + Top = 3079 + Width = 2430 + End + Begin VB.CommandButton cmdMarkALL + Caption = "Mark All CK Boxes" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 80 + TabIndex = 35 + Top = 5025 + Width = 1500 + End + Begin VB.CheckBox chkSP + Alignment = 1 'Right Justify + Caption = "Print Stucco Primer" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3405 + TabIndex = 32 + Top = 2465 + Width = 2025 + End + Begin VB.CheckBox chkFO + Alignment = 1 'Right Justify + Caption = "Print Fence Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3480 + TabIndex = 31 + Top = 2772 + Width = 1950 + End + Begin VB.CommandButton cmdPrint + Caption = "Print Sheets" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 1580 + TabIndex = 30 + Top = 5025 + Width = 1500 + End + Begin Crystal.CrystalReport crOrder + Left = 75 + Top = 1845 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CheckBox chkWH + Alignment = 1 'Right Justify + Caption = "Print Water House" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3510 + TabIndex = 27 + Top = 2158 + Width = 1920 + End + Begin VB.CheckBox chkCS + Alignment = 1 'Right Justify + Caption = "Print Customer Service" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3075 + TabIndex = 26 + Top = 1851 + Width = 2355 + End + Begin VB.CheckBox chkES + Alignment = 1 'Right Justify + Caption = "Print Exterior Spray" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 240 + TabIndex = 24 + Top = 1544 + Width = 2025 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 4580 + TabIndex = 21 + Top = 5025 + Width = 1500 + End + Begin VB.CheckBox chkCC + Alignment = 1 'Right Justify + Caption = "Print Ceiling Cut" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 540 + TabIndex = 19 + Top = 3693 + Width = 1725 + End + Begin VB.CheckBox chkIS + Alignment = 1 'Right Justify + Caption = "Print Interior Spray" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 315 + TabIndex = 17 + Top = 1237 + Width = 1950 + End + Begin VB.CheckBox chkPO + Alignment = 1 'Right Justify + Caption = "Print Purchase Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3315 + TabIndex = 8 + Top = 1544 + Width = 2115 + End + Begin VB.CheckBox chkBT2 + Alignment = 1 'Right Justify + Caption = "Print Blue Tape 2" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 3585 + TabIndex = 7 + Top = 1237 + Width = 1845 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 3080 + TabIndex = 6 + Top = 5025 + Width = 1500 + End + Begin VB.CheckBox chkFG2 + Alignment = 1 'Right Justify + Caption = "Print Fog In 2 Stories" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 120 + TabIndex = 5 + Top = 3386 + Width = 2145 + End + Begin VB.CheckBox chkFG1 + Alignment = 1 'Right Justify + Caption = "Print Fog In - 1 Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 135 + TabIndex = 4 + Top = 3079 + Width = 2130 + End + Begin VB.CheckBox chkF2 + Alignment = 1 'Right Justify + Caption = "Print Final 2 Tone" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 390 + TabIndex = 3 + Top = 2772 + Width = 1875 + End + Begin VB.CheckBox chkFS + Alignment = 1 'Right Justify + Caption = "Print Final Standard" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 225 + TabIndex = 2 + Top = 2465 + Width = 2040 + End + Begin VB.CheckBox chkOH + Alignment = 1 'Right Justify + Caption = "Print OverHang" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 600 + TabIndex = 1 + Top = 2158 + Width = 1665 + End + Begin VB.CheckBox chk2T + Alignment = 1 'Right Justify + Caption = "Print 2 Tone" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 840 + TabIndex = 0 + Top = 1851 + Width = 1425 + End + Begin VB.Label lblBT1 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 49 + Top = 930 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblPrep + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 48 + Top = 930 + Visible = 0 'False + Width = 465 + End + Begin VB.Line Line2 + X1 = 30 + X2 = 6060 + Y1 = 4320 + Y2 = 4320 + End + Begin VB.Line Line1 + X1 = 30 + X2 = 6060 + Y1 = 840 + Y2 = 840 + End + Begin VB.Label lblAS2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 45 + Top = 4005 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblAS1 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 44 + Top = 3693 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblRF2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 43 + Top = 3386 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblRF1 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 42 + Top = 3079 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblST + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 41 + Top = 4005 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblSP + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 34 + Top = 2445 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblFO + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 33 + Top = 2772 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblWH + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 29 + Top = 2158 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblCS + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 28 + Top = 1851 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblES + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 25 + Top = 1544 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblProjLot + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 750 + Left = 60 + TabIndex = 23 + Top = 0 + Width = 6015 + End + Begin VB.Label lblDirections + Caption = $"frmPaintPrtJobs.frx":0000 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 60 + TabIndex = 22 + Top = 4350 + Width = 5955 + End + Begin VB.Label lblFG2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 20 + Top = 3386 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblIS + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 18 + Top = 1237 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblPO + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 16 + Top = 1544 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblBT2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 5550 + TabIndex = 15 + Top = 1237 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblCC + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 14 + Top = 3693 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblFG1 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 13 + Top = 3079 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblF2 + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 12 + Top = 2772 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblFS + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 11 + Top = 2465 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lblOH + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 10 + Top = 2158 + Visible = 0 'False + Width = 465 + End + Begin VB.Label lbl2T + AutoSize = -1 'True + Caption = "Done" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 2415 + TabIndex = 9 + Top = 1851 + Visible = 0 'False + Width = 465 + End +End +Attribute VB_Name = "frmPaintPrtJobs" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim moRS As Recordset, moRSProj As Recordset, moRSPay As Recordset +Dim intCOUNT As Integer, mstrPROJLOT As String ', mboolBADD As Boolean +Dim mboolPrepD, mboolISD, mboolESD, mbool2TD, mboolOHD As Boolean +Dim mboolBT1D, mboolCCD, mboolFG1D, mboolFG2D, mboolF2D, mboolFSD As Boolean +Dim mboolBT2D, mboolPOD, mboolCSD, mboolWHD, mboolAS2D As Boolean +Dim mboolRF2D, mboolFOD, mboolSPD, mboolSTD, mboolRF1D, mboolAS1D As Boolean + +Private Sub cmdExit_Click() + Unload Me + +End Sub + +Private Sub cmdMarkALL_Click() + If chkPREP.Enabled = True Then + chkPREP = vbChecked + End If + If chkFO.Enabled = True Then + chkFO = vbChecked + End If + If chkSP.Enabled = True Then + chkSP = vbChecked + End If + If chkIS.Enabled = True Then + chkIS = vbChecked + End If + If chkES.Enabled = True Then + chkES = vbChecked + End If + If chk2T.Enabled = True Then + chk2T = vbChecked + End If + If chkOH.Enabled = True Then + chkOH = vbChecked + End If + If chkFS.Enabled = True Then + chkFS = vbChecked + End If + If chkF2.Enabled = True Then + chkF2 = vbChecked + End If + If chkFG1.Enabled = True Then + chkFG1 = vbChecked + End If + If chkFG2.Enabled = True Then + chkFG2 = vbChecked + End If + If chkCC.Enabled = True Then + chkCC = vbChecked + End If + If chkBT1.Enabled = True Then + chkBT1 = vbChecked + End If + If chkBT2.Enabled = True Then + chkBT2 = vbChecked + End If + If chkRF1.Enabled = True Then + chkRF1 = vbChecked + End If + If chkRF2.Enabled = True Then + chkRF2 = vbChecked + End If + If chkAS1.Enabled = True Then + chkAS1 = vbChecked + End If + If chkAS2.Enabled = True Then + chkAS2 = vbChecked + End If + If chkPO.Enabled = True Then + chkPO = vbChecked + End If + If chkST.Enabled = True Then + chkST = vbChecked + End If + If chkCS.Enabled = True Then + chkCS = vbChecked + End If + If chkWH.Enabled = True Then + chkWH = vbChecked + End If + +End Sub + +Private Sub cmdPrint_Click() + + If chkPREP = vbChecked Then + Call PrintPPPrep + ElseIf chkSP = vbChecked Then + Call PrintPPSP + ElseIf chkFO = vbChecked Then + Call PrintPPFO + ElseIf chkIS = vbChecked Then + Call PrintPPIS + ElseIf chkES = vbChecked Then + Call PrintPPES + ElseIf chk2T = vbChecked Then + Call PrintPP2T + ElseIf chkOH = vbChecked Then + Call PrintPPOH + ElseIf chkFS = vbChecked Then + Call PrintPPFS + ElseIf chkF2 = vbChecked Then + Call PrintPPF2 + ElseIf chkFG1 = vbChecked Then + Call PrintPPFG1 + ElseIf chkFG2 = vbChecked Then + Call PrintPPFG2 + ElseIf chkCC = vbChecked Then + Call PrintPPCC + ElseIf chkBT1 = vbChecked Then + Call PrintPPBT1 + ElseIf chkBT2 = vbChecked Then + Call PrintPPBT2 + ElseIf chkPO = vbChecked Then + Call PrintPPPO + ElseIf chkRF1 = vbChecked Then + Call PrintPPRF1 + ElseIf chkRF2 = vbChecked Then + Call PrintPPRF2 + ElseIf chkAS1 = vbChecked Then + Call PrintPPAS1 + ElseIf chkAS2 = vbChecked Then + Call PrintPPAS2 + ElseIf chkST = vbChecked Then + Call PrintPPST + ElseIf chkCS = vbChecked Then + Call PrintPPCS + ElseIf chkWH = vbChecked Then + Call PrintPPWH + Else + MsgBox "No Boxes Are Checked", vbOKOnly, "Print Paint Pay" + Call cmdExit_Click + End If + +End Sub + +Private Sub cmdSave_Click() + + With moRS + !PREPP = Field2CheckBox(chkPREP) + !SPP = Field2CheckBox(chkSP) + !FOP = Field2CheckBox(chkFO) + !ISP = Field2CheckBox(chkIS) + !ESP = Field2CheckBox(chkES) + !TwoTP = Field2CheckBox(chk2T) + !ohp = Field2CheckBox(chkOH) + !FSP = Field2CheckBox(chkFS) + !F2P = Field2CheckBox(chkF2) + !FG1P = Field2CheckBox(chkFG1) + !FG2P = Field2CheckBox(chkFG2) + !CCP = Field2CheckBox(chkCC) + !BT1P = Field2CheckBox(chkBT1) + !BT2P = Field2CheckBox(chkBT2) + !AS1P = Field2CheckBox(chkAS1) + !AS2P = Field2CheckBox(chkAS2) + !RF1P = Field2CheckBox(chkRF1) + !RF2P = Field2CheckBox(chkRF2) + !STP = Field2CheckBox(chkST) + !POP = Field2CheckBox(chkPO) + !CSP = Field2CheckBox(chkCS) + !WHP = Field2CheckBox(chkWH) + .Update + End With + +End Sub + +Private Sub PrintPPPrep() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PREP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!PREPL = vbTrue + moRS!PREPP = vbUnchecked + moRS.Update + chkPREP = vbUnchecked + chkPREP.Enabled = False + lblPrep.Visible = True +'*** End Prep Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPPrep" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPSP() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + +' On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpaySP.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "SP" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!SPL = vbTrue + moRS!SPP = vbUnchecked + moRS.Update + chkSP = vbUnchecked + chkSP.Enabled = False + lblSP.Visible = True +'*** End SP Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPSP" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFO() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FOL = vbTrue + moRS!FOP = vbUnchecked + moRS.Update + chkFO = vbUnchecked + chkFO.Enabled = False + lblFO.Visible = True +'*** End FO Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPFO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPIS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "IS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ISL = vbTrue + moRS!ISP = vbUnchecked + moRS.Update + chkIS = vbUnchecked + chkIS.Enabled = False + lblIS.Visible = True +'*** End IS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPIS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPES() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer +'Need To Complete the ability to print one + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayES.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ES" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!ESL = vbTrue + moRS!ESP = vbUnchecked + moRS.Update + chkES = vbUnchecked + chkES.Enabled = False + lblES.Visible = True +'*** End ES Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPES" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPP2T() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "2T" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!TwoTL = vbTrue + moRS!TwoTP = vbUnchecked + moRS.Update + chk2T = vbUnchecked + chk2T.Enabled = False + lbl2T.Visible = True +'*** End 2T Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPP2T" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPOH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "OH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!OHL = vbTrue + moRS!ohp = vbUnchecked + moRS.Update + chkOH = vbUnchecked + chkOH.Enabled = False + lblOH.Visible = True +'*** End OH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPOH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FSL = vbTrue + moRS!FSP = vbUnchecked + moRS.Update + chkFS = vbUnchecked + chkFS.Enabled = False + lblFS.Visible = True +'*** End FS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPFS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPF2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "F2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!F2L = vbTrue + moRS!F2P = vbUnchecked + moRS.Update + chkF2 = vbUnchecked + chkF2.Enabled = False + lblF2.Visible = True +'*** End F2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPF2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG1L = vbTrue + moRS!FG1P = vbUnchecked + moRS.Update + chkFG1 = vbUnchecked + chkFG1.Enabled = False + lblFG1.Visible = True +'*** End FG1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPFG1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPFG2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "FG2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!FG2L = vbTrue + moRS!FG2P = vbUnchecked + moRS.Update + chkFG2 = vbUnchecked + chkFG2.Enabled = False + lblFG2.Visible = True +'*** End FG2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPFG2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT1L = vbTrue + moRS!BT1P = vbUnchecked + moRS.Update + chkBT1 = vbUnchecked + chkBT1.Enabled = False + lblBT1.Visible = True +'*** End BT1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPBT1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPBT2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "BT2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!BT2L = vbTrue + moRS!BT2P = vbUnchecked + moRS.Update + chkBT2 = vbUnchecked + chkBT2.Enabled = False + lblBT2.Visible = True +'*** End BT2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPBT2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPRF1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayRF1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "RF1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!RF1L = vbTrue + moRS!RF1P = vbUnchecked + moRS.Update + chkRF1 = vbUnchecked + chkRF1.Enabled = False + lblRF1.Visible = True +'*** End RF1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPRF1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPRF2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayRF2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "RF2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!RF2L = vbTrue + moRS!RF2P = vbUnchecked + moRS.Update + chkRF2 = vbUnchecked + chkRF2.Enabled = False + lblRF2.Visible = True +'*** End RF2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPRF2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPAS1() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayAS1.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "AS1" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!AS1L = vbTrue + moRS!AS1P = vbUnchecked + moRS.Update + chkAS1 = vbUnchecked + chkAS1.Enabled = False + lblAS1.Visible = True +'*** End AS1 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPAS1" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPAS2() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayAS2.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "AS2" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!AS2L = vbTrue + moRS!AS2P = vbUnchecked + moRS.Update + chkAS2 = vbUnchecked + chkAS2.Enabled = False + lblAS2.Visible = True +'*** End AS2 Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPAS2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPPO() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "PO" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!POL = vbTrue + moRS!POP = vbUnchecked + moRS.Update + chkPO = vbUnchecked + chkPO.Enabled = False + lblPO.Visible = True +'*** End PO Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPPO" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPST() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayST.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "ST" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!STL = vbTrue + moRS!STP = vbUnchecked + moRS.Update + chkST = vbUnchecked + chkST.Enabled = False + lblST.Visible = True +'*** End ST Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPST" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCS() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CS" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CSL = vbTrue + moRS!CSP = vbUnchecked + moRS.Update + chkCS = vbUnchecked + chkCS.Enabled = False + lblCS.Visible = True +'*** End CS Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPCS" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPWH() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "WH" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!WHL = vbTrue + moRS!WHP = vbUnchecked + moRS.Update + chkWH = vbUnchecked + chkWH.Enabled = False + lblWH.Visible = True +'*** End WH Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPWH" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintPPCC() +Dim strSQL As String, i As Integer +Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer + + On Error GoTo Error_EH + gintCOPY = 1 + + strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID + crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" + crOrder.ReplaceSelectionFormula (strSQL) + crOrder.CopiesToPrinter = gintCOPY + crOrder.Destination = crptToPrinter + intTOTAL = Int((gintCOPY / 2) + 0.99) + intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) + i = 1 + crOrder.CopiesToPrinter = gintCOPY + crOrder.Action = 1 + crOrder.Reset + + moRSPay.AddNew + moRSPay!lotid = gintLOTID + moRSPay!Type = "X" + moRSPay!worktype = "CC" + moRSPay!pay_ydge = intYDS + moRSPay!sheet = i + moRSPay!Create = gstrLOGIN + moRSPay!printed = vbChecked + moRSPay!totalsheet = intTOTAL + moRSPay!cocode = 0 + moRSPay.Update + moRS!CCL = vbTrue + moRS!CCP = vbUnchecked + moRS.Update + chkCC = vbUnchecked + chkCC.Enabled = False + lblCC.Visible = True +'*** End CC Pay Sheet + + Exit Sub + +Error_EH: + gstrMODULE = "Form PrintPntPay - Module PrintPPCC" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + + + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + lblProjLot = mstrPROJLOT +' If moRS!Split Then +' mboolSPLIT = True +' Else +' mboolSPLIT = False +' End If + End If + + Exit Function + +End Function + +Private Sub Form_Load() +Dim strSQL As String + + Call ProjLoad + If FormFind() Then + Call FormShow + End If + + strSQL = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' If moRSProj!stone Then +' mboolStone = True +' End If +' mstrWIRE = Field2Str(moRSProj!wire) + +' gintCOCODE = Field2Str2(moRSProj!cocode) + Exit Sub +Error_EH: + gstrMODULE = "Form PaintPrtJobs - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + + On Error GoTo Error_EH + + mboolSHOW = True + gintLOTID = moRS!Lot_id + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + + With moRS + chkPREP = Field2CheckBox(!PREPP) + chkFO = Field2CheckBox(!FOP) + chkSP = Field2CheckBox(!SPP) + chkIS = Field2CheckBox(!ISP) + chkES = Field2CheckBox(!ESP) + chk2T = Field2CheckBox(!TwoTP) + chkOH = Field2CheckBox(!ohp) + chkFS = Field2CheckBox(!FSP) + chkF2 = Field2CheckBox(!F2P) + chkFG1 = Field2CheckBox(!FG1P) + chkFG2 = Field2CheckBox(!FG2P) + chkCC = Field2CheckBox(!CCP) + chkBT1 = Field2CheckBox(!BT1P) + chkBT2 = Field2CheckBox(!BT2P) + chkRF1 = Field2CheckBox(!RF1P) + chkRF2 = Field2CheckBox(!RF2P) + chkAS1 = Field2CheckBox(!AS1P) + chkAS2 = Field2CheckBox(!AS2P) + chkST = Field2CheckBox(!STP) + chkPO = Field2CheckBox(!POP) + chkCS = Field2CheckBox(!CSP) + chkWH = Field2CheckBox(!WHP) + + mboolSPD = (!SPL) + mboolFOD = (!FOL) + mboolISD = (!ISL) + mboolPrepD = (!PREPL) + mboolESD = (!ESL) + mbool2TD = (!TwoTL) + mboolOHD = (!OHL) + mboolFSD = (!FSL) + mboolF2D = (!F2L) + mboolFG1D = (!FG1L) + mboolFG2D = (!FG2L) + mboolCCD = (!CCL) + mboolBT1D = (!BT1L) + mboolBT2D = (!BT2L) + mboolRF1D = (!RF1L) + mboolRF2D = (!RF2L) + mboolAS1D = (!AS1L) + mboolAS2D = (!AS2L) + mboolSTD = (!STL) + mboolPOD = (!POL) + mboolCSD = (!CSL) + mboolWHD = (!WHL) + +' mboolPEXTD = Field2TrueFalse(!PEXTL) +' mboolPINTD = Field2TrueFalse(!PINTL) +' mboolISD = Field2TrueFalse(!ISL) +' mboolPrepD = Field2TrueFalse(!PREPL) +' mboolESD = Field2TrueFalse(!ESL) +' mbool2TD = Field2TrueFalse(!TwoTL) +' mboolOHD = Field2TrueFalse(!OHL) +' mboolFSD = Field2TrueFalse(!FSL) +' mboolF2D = Field2TrueFalse(!F2L) +' mboolFG1D = Field2TrueFalse(!FG1L) +' mboolFG2D = Field2TrueFalse(!FG2L) +' mboolCCD = Field2TrueFalse(!CCL) +' mboolBT1D = Field2TrueFalse(!BT1L) +' mboolBT2D = Field2TrueFalse(!BT2L) +' mboolPOD = Field2TrueFalse(!POL) +' mboolCSD = Field2TrueFalse(!CSL) +' mboolWHD = Field2TrueFalse(!WHL) + End With +' If mboolSupD Then +' chkSuperP.Enabled = False +' lblSuperD.Visible = True +' End If + If mboolPrepD Then + chkPREP.Enabled = False + lblPrep.Visible = True + End If + If mboolPINTD Then + chkPINT.Enabled = False + lblPINT.Visible = True + End If + If mboolPEXTD Then + chkPEXT.Enabled = False + lblPEXT.Visible = True + End If + If mboolISD Then + chkIS.Enabled = False + lblIS.Visible = True + End If + If mboolESD Then + chkES.Enabled = False + lblES.Visible = True + End If 'Need to make reports print from this screen + If mbool2TD Then + chk2T.Enabled = False + lbl2T.Visible = True + End If + If mboolOHD Then + chkOH.Enabled = False + lblOH.Visible = True + End If + If mboolFSD Then + chkFS.Enabled = False + lblFS.Visible = True + End If + If mboolF2D Then + chkF2.Enabled = False + lblF2.Visible = True + End If + If mboolFG1D Then + chkFG1.Enabled = False + lblFG1.Visible = True + End If + If mboolFG2D Then + chkFG2.Enabled = False + lblFG2.Visible = True + End If + If mboolCCD Then + chkCC.Enabled = False + lblCC.Visible = True + End If + If mboolBT1D Then + chkBT1.Enabled = False + lblBT1.Visible = True + End If + If mboolBT2D Then + chkBT2.Enabled = False + lblBT2.Visible = True + End If + If mboolPOD Then + chkPO.Enabled = False + lblPO.Visible = True + End If + If mboolCSD Then + chkCS.Enabled = False + lblCS.Visible = True + End If + If mboolWHD Then + chkWH.Enabled = False + lblWH.Visible = True + End If + If mboolRF1D Then + chkRF1.Enabled = False + lblRF1.Visible = True + End If + If mboolRF2D Then + chkRF2.Enabled = False + lblRF2.Visible = True + End If + If mboolAS1D Then + chkAS1.Enabled = False + lblAS1.Visible = True + End If + If mboolAS2D Then + chkAS2.Enabled = False + lblAS2.Visible = True + End If + If mboolSTD Then + chkST.Enabled = False + lblST.Visible = True + End If + If mboolSPD Then + chkSP.Enabled = False + lblSP.Visible = True + End If + If mboolFOD Then + chkFO.Enabled = False + lblFO.Visible = True + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PaintPrtJobs - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frx new file mode 100644 index 0000000..115cae1 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaintPrtJobs.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frm new file mode 100644 index 0000000..3b917a2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frm @@ -0,0 +1,3601 @@ +VERSION 5.00 +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayHead + Caption = "Payroll Summary Information" + ClientHeight = 5850 + ClientLeft = 165 + ClientTop = 450 + ClientWidth = 12390 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5850 + ScaleWidth = 12390 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdMoveHouse + Caption = "Move Amt To House" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2475 + TabIndex = 86 + Top = 5265 + Width = 1155 + End + Begin VB.CommandButton cmdAllCrew + Caption = "Get Crew Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5400 + TabIndex = 85 + Top = 5265 + Width = 1155 + End + Begin VB.CommandButton cmd1Emp + Caption = "Get 1 Emp Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3855 + TabIndex = 84 + Top = 5265 + Width = 1155 + End + Begin LpLib.fpList lstPaySheets + Height = 1080 + Left = 3780 + TabIndex = 77 + Top = 1785 + Visible = 0 'False + Width = 4335 + _Version = 196608 + _ExtentX = 7646 + _ExtentY = 1905 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 8 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 240 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayHead.frx":0000 + End + Begin VB.CommandButton cmdCalc + Caption = "Calc" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 330 + Left = 11775 + TabIndex = 75 + TabStop = 0 'False + Top = 3765 + Width = 615 + End + Begin VB.TextBox txtTTLPay + Alignment = 1 'Right Justify + Height = 315 + Left = 11355 + TabIndex = 72 + Top = 5370 + Width = 990 + End + Begin VB.TextBox txtTTLHrs + Alignment = 1 'Right Justify + Height = 315 + Left = 11370 + TabIndex = 71 + Top = 4575 + Width = 990 + End + Begin VB.CommandButton cmdCertPR + Caption = "Cert. Pay Rates" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 8220 + TabIndex = 70 + Top = 4095 + Visible = 0 'False + Width = 1035 + End + Begin VB.TextBox txtOTAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 10365 + TabIndex = 14 + Top = 5025 + Width = 990 + End + Begin VB.TextBox txtGross + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 13 + Top = 5025 + Width = 990 + End + Begin VB.TextBox txtTTLAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 9300 + TabIndex = 15 + Top = 5385 + Width = 990 + End + Begin VB.TextBox txtOTRate + Alignment = 1 'Right Justify + Height = 315 + Left = 10365 + TabIndex = 12 + Top = 4725 + Width = 990 + End + Begin VB.TextBox txtOTHrs + Alignment = 1 'Right Justify + Height = 315 + Left = 10365 + TabIndex = 10 + Top = 4425 + Width = 990 + End + Begin LpLib.fpList lstHouses + Height = 2400 + Left = 60 + TabIndex = 62 + Top = 1185 + Width = 3615 + _Version = 196608 + _ExtentX = 6376 + _ExtentY = 4233 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayHead.frx":0622 + End + Begin VB.TextBox txtPaint + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 11025 + TabIndex = 60 + Top = 420 + Width = 690 + End + Begin VB.CheckBox chkBiWeekly + BackColor = &H00C0FFFF& + Caption = "BiWeekly PR" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 285 + Left = 1935 + TabIndex = 58 + Top = 840 + Visible = 0 'False + Width = 1575 + End + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 54 + TabStop = 0 'False + Top = 420 + Width = 690 + End + Begin VB.CheckBox chkReady + Caption = "Ready to Process" + Height = 255 + Left = 3825 + TabIndex = 42 + Top = 3585 + Width = 1995 + End + Begin VB.CheckBox chkDeduct + Caption = "Deductions" + Height = 255 + Left = 150 + TabIndex = 39 + TabStop = 0 'False + Top = 5550 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdDivide + Caption = "Divide Equally" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5400 + TabIndex = 38 + TabStop = 0 'False + Top = 4080 + Width = 1155 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Emp. Pay" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5400 + TabIndex = 16 + Top = 4665 + Width = 1155 + End + Begin VB.CommandButton cmdTotal + Caption = "Update &Totals" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6930 + TabIndex = 27 + TabStop = 0 'False + Top = 4665 + Width = 1155 + End + Begin VB.CommandButton cmdGetCrew + Caption = "Get &Crew List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6930 + TabIndex = 26 + TabStop = 0 'False + Top = 4080 + Width = 1155 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3855 + TabIndex = 25 + TabStop = 0 'False + Top = 4665 + Width = 1155 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add &House/PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3855 + TabIndex = 17 + TabStop = 0 'False + Top = 4065 + Width = 1155 + End + Begin VB.TextBox txtHRate + Alignment = 1 'Right Justify + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 11 + Top = 4725 + Width = 990 + End + Begin VB.TextBox txtHours + Alignment = 1 'Right Justify + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 9 + Top = 4425 + Width = 990 + End + Begin VB.TextBox txtPayDate + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 1200 + TabIndex = 8 + TabStop = 0 'False + Top = 60 + Width = 1275 + End + Begin VB.TextBox txtSumCrew + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9600 + TabIndex = 2 + TabStop = 0 'False + Top = 60 + Width = 975 + End + Begin VB.TextBox txtSumHouse + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7500 + TabIndex = 1 + TabStop = 0 'False + Top = 60 + Width = 975 + End + Begin VB.TextBox txtCrewID + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 3180 + TabIndex = 0 + TabStop = 0 'False + Top = 60 + Width = 615 + End + Begin VB.ListBox lstLots + Height = 1620 + Left = 3780 + Sorted = -1 'True + TabIndex = 28 + TabStop = 0 'False + Top = 1200 + Visible = 0 'False + Width = 4335 + End + Begin LpLib.fpList lstCrew + Height = 2415 + Left = 8220 + TabIndex = 61 + Top = 1170 + Width = 3900 + _Version = 196608 + _ExtentX = 6879 + _ExtentY = 4260 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 210 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayHead.frx":0B50 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 315 + Left = 6900 + TabIndex = 83 + Top = 5265 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 94765057 + CurrentDate = 43678 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblTEST + Height = 285 + Left = 6915 + TabIndex = 87 + Top = 5580 + Width = 1170 + End + Begin VB.Label lblTYPE3 + Caption = "TYPE FROM PayList" + Height = 435 + Left = 30 + TabIndex = 82 + Top = 4950 + Visible = 0 'False + Width = 555 + End + Begin VB.Label lblWorkDone + Caption = "WORKDONE" + Height = 195 + Left = 3915 + TabIndex = 81 + Top = 2925 + Visible = 0 'False + Width = 255 + End + Begin VB.Label lblTYPE2 + Caption = "CrewTYpe" + Height = 225 + Left = 3015 + TabIndex = 80 + Top = 3705 + Visible = 0 'False + Width = 435 + End + Begin VB.Label lblLOTID + Caption = "0" + Height = 195 + Left = 7500 + TabIndex = 79 + Top = 3240 + Visible = 0 'False + Width = 615 + End + Begin VB.Label lblPROJID + Caption = "PRJ" + Height = 225 + Left = 7470 + TabIndex = 78 + Top = 2940 + Visible = 0 'False + Width = 585 + End + Begin VB.Label lblCalcHrs + Height = 270 + Left = 11400 + TabIndex = 76 + Top = 4200 + Visible = 0 'False + Width = 225 + End + Begin VB.Label lblTTLDlrs + Alignment = 2 'Center + Caption = "Total Pay" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 450 + Left = 11715 + TabIndex = 74 + Top = 4905 + Width = 555 + End + Begin VB.Label lblTTLHrs + Alignment = 2 'Center + Caption = "Total Hours" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 11580 + TabIndex = 73 + Top = 4185 + Width = 690 + End + Begin VB.Label lblCertPR + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "CERTIFIED" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 300 + Left = 9615 + TabIndex = 69 + Top = 825 + Visible = 0 'False + Width = 2505 + End + Begin VB.Label lblNoCalc + BackColor = &H0080FFFF& + Caption = "NO CALC" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00800080& + Height = 180 + Left = 8280 + TabIndex = 68 + Top = 3600 + Visible = 0 'False + Width = 855 + End + Begin VB.Label lblTIE + Caption = "TIEBREAKER" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 180 + Left = 9255 + TabIndex = 67 + Top = 3600 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblTTLWage + AutoSize = -1 'True + Caption = "Total Wages:" + Height = 195 + Left = 8235 + TabIndex = 66 + Top = 5490 + Width = 960 + End + Begin VB.Label lblRegTime + Alignment = 2 'Center + Caption = "Reg Time" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 9330 + TabIndex = 65 + Top = 4170 + Width = 945 + End + Begin VB.Label lblOTTime + Alignment = 2 'Center + Caption = "OT Time" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 10365 + TabIndex = 64 + Top = 4185 + Width = 945 + End + Begin VB.Label lblCtrl + Alignment = 2 'Center + Caption = "CTRL-K to LOOK" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00000000& + Height = 255 + Left = 45 + TabIndex = 63 + Top = 3600 + Visible = 0 'False + Width = 2610 + End + Begin VB.Label lblPaint + AutoSize = -1 'True + Caption = "Paint SqFt:" + Height = 195 + Left = 10110 + TabIndex = 59 + Top = 480 + Width = 780 + End + Begin VB.Label lblFrameCnt + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1740 + TabIndex = 57 + Top = 5310 + Width = 675 + End + Begin VB.Label lblFrames + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames:" + Height = 195 + Left = 1125 + TabIndex = 56 + Top = 5310 + Width = 555 + End + Begin VB.Label lblWCCode + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 10365 + TabIndex = 55 + Top = 5370 + Width = 990 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 8355 + TabIndex = 53 + Top = 480 + Width = 840 + End + Begin VB.Label lblMRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 6705 + TabIndex = 52 + Top = 480 + Width = 825 + End + Begin VB.Label lblDMRate + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7605 + TabIndex = 51 + Top = 420 + Width = 690 + End + Begin VB.Label lblDRate2 + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5925 + TabIndex = 50 + Top = 420 + Width = 690 + End + Begin VB.Label lblDRate + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5220 + TabIndex = 49 + Top = 420 + Width = 690 + End + Begin VB.Label lblRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Rates:" + Height = 195 + Left = 4320 + TabIndex = 48 + Top = 480 + Width = 780 + End + Begin VB.Label lblDMetal + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3180 + TabIndex = 47 + Top = 420 + Width = 1035 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal:" + Height = 195 + Left = 2670 + TabIndex = 46 + Top = 480 + Width = 435 + End + Begin VB.Label lblDFin2 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 45 + Top = 420 + Width = 795 + End + Begin VB.Label lblDYds + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 600 + TabIndex = 44 + Top = 420 + Width = 1035 + End + Begin VB.Label lblYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yds:" + Height = 195 + Left = 240 + TabIndex = 43 + Top = 480 + Width = 315 + End + Begin VB.Label lblSelect + Alignment = 2 'Center + Caption = "CTRL-S to Select Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00000000& + Height = 195 + Left = 6240 + TabIndex = 41 + Top = 3720 + Visible = 0 'False + Width = 1935 + End + Begin VB.Label lblTerm + Caption = "TERMINATED" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 180 + Left = 10590 + TabIndex = 40 + Top = 3600 + Visible = 0 'False + Width = 1320 + End + Begin VB.Label lblBalance + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3780 + TabIndex = 37 + Top = 840 + Width = 4335 + End + Begin VB.Label lblDelete + Caption = "CTRL R to Delete Crews CTRL H to Delete Houses" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 480 + Left = 4950 + TabIndex = 36 + Top = 2985 + Width = 2295 + End + Begin VB.Label lblDifference + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00000000& + Height = 315 + Left = 10680 + TabIndex = 35 + Top = 60 + Width = 1155 + End + Begin VB.Label lblBC + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 2700 + TabIndex = 34 + Top = 4110 + Width = 915 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Amount:" + Height = 195 + Left = 780 + TabIndex = 33 + Top = 4950 + Width = 900 + End + Begin VB.Label lblType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 960 + TabIndex = 32 + Top = 4080 + Width = 1695 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 120 + TabIndex = 31 + Top = 4155 + Width = 810 + End + Begin VB.Label lblPay + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1740 + TabIndex = 30 + Top = 4950 + Width = 1875 + End + Begin VB.Label lblAddress + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 0 + TabIndex = 29 + Top = 4470 + Width = 3615 + End + Begin VB.Label lblGross + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Amount:" + Height = 195 + Left = 8295 + TabIndex = 24 + Top = 5145 + Width = 900 + End + Begin VB.Label lblHRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Hourly Rate:" + Height = 195 + Left = 8310 + TabIndex = 23 + Top = 4845 + Width = 885 + End + Begin VB.Label lblHours + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Hours:" + Height = 195 + Left = 8400 + TabIndex = 22 + Top = 4545 + Width = 795 + End + Begin VB.Label lblEmpName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9165 + TabIndex = 21 + Top = 3780 + Width = 2505 + End + Begin VB.Label lblEmpId + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8220 + TabIndex = 20 + Top = 3780 + Width = 915 + End + Begin VB.Label lblCrewMember + AutoSize = -1 'True + Caption = "Crew Workers" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8280 + TabIndex = 19 + Top = 900 + Width = 1200 + End + Begin VB.Label lblHouse + AutoSize = -1 'True + Caption = "Houses && POs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 18 + Top = 900 + Width = 1215 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 0 + X2 = 11880 + Y1 = 780 + Y2 = 780 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 225 + TabIndex = 7 + Top = 120 + Width = 900 + End + Begin VB.Label lblCrewName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3840 + TabIndex = 6 + Top = 60 + Width = 2595 + End + Begin VB.Label lblSumCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Workers Sum:" + Height = 195 + Left = 8520 + TabIndex = 5 + Top = 120 + Width = 1005 + End + Begin VB.Label lblSumHouse + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Houses Sum:" + Height = 195 + Left = 6480 + TabIndex = 4 + Top = 120 + Width = 945 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 2700 + TabIndex = 3 + Top = 120 + Width = 405 + End +End +Attribute VB_Name = "frmPayHead" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolDelete As Boolean, mboolCERTIFIED As Boolean, mboolAdding As Boolean +Dim moRSPay As Recordset, moRSTIME As Recordset, mboolNOYDS As Boolean +Dim moRSCREW As Recordset, moRS As Recordset, moRSSPS As Recordset +Dim moRSHEAD As Recordset, moRSPS As Recordset, mintYDS As Integer +Dim mdblHours As Double, mdblRate As Double, mdblGROSS As Double +Dim mdblOTHours As Double, mdblOTRate As Double, mdblOTGROSS As Double +Dim mbytCOUNT As Byte, mlngPSPAYID As Long, mstrTexture As String +Dim mstrWTYPE As String, mstrWDone As String + +Private Sub cmdAddLot2_Click() +Dim strProj As String, strSQL As String, intPROJ As Integer +Dim strLine As String, intYN As Integer +Dim oRS As Recordset, oRSS As Recordset, oRS2 As Recordset +Dim strPSheet As String, oRSPS As Recordset, lngLOTID As Long +Dim strPCODE As String, strLOTNO As String, strPRJLOT As String, lngPROJID As Long +Dim sglMETAL As Single, sglPAMT As Single, strPROJCODE As String + + intYN = MsgBox("Do You Want To See A List Of Pay Sheets For This Crew?", vbYesNo, "Pay Sheet List?") + If intYN = vbYes Then + strPSheet = "SELECT * FROM tblPAYSHEET WHERE Not PAID and CrewID = " & gintCREWID + Set oRSPS = New Recordset + oRSPS.Open strPSheet, goConn, adOpenDynamic, adLockOptimistic + + If oRSPS.EOF Then + MsgBox "No Pay Sheets Were Found For This Crew.", vbOKOnly, "No Paysheets" + Exit Sub + Else + Do Until oRSPS.EOF + lstPaySheets.Clear + lstPaySheets.Top = 1200 + lstPaySheets.Left = 3780 + lstPaySheets.Height = 2400 + lstPaySheets.Width = 4335 + lstPaySheets.Visible = True + + lngLOTID = Field2Str2(oRSPS!lotid) + strSQL = "SELECT PROJ_ID, LOT_NO FROM tblLOTINFO WHERE Lot_ID = " & lngLOTID + Set oRS2 = New Recordset + oRS2.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS2.EOF Then + lngPROJID = Field2Str(oRS2!PROJ_ID) + strLOTNO = Field2Str(oRS2!lot_no) + oRS2.Close + Else + MsgBox "No Lot Information Found", vbOKOnly, "No Lot" + End If + strSQL = "SELECT Proj_Code FROM tblPROJECT WHERE Proj_ID = " & lngPROJID + Set oRS2 = New Recordset + oRS2.Open strSQL, goConn, adOpenDynamic, adLockBatchOptimistic + + If Not oRS2.EOF Then + strPROJCODE = Field2Str(oRS2!Proj_Code) + oRS.Close + Else + MsgBox "No Project Found", vbOKOnly, "No Project" + Exit Sub + End If + strPRJLOT = Trim(strPROJCODE) & " - " & Trim(strLOTNO) + strLine = Field2Str2(oRSPS!pay_id) & vbTab & strPRJLOT & vbTab & Field2Str(oRSPS!Type) + strLine = strLine & vbTab & Field2Str(oRSPS!WorkDone) & vbTab & Field2Str2(oRSPS!pay_ydge) & vbTab & Field2Str2(oRSPS!GROSSPAY) + lstPaySheets.AddItem strLine + Loop + End If + ElseIf intYN = vbNo Then + strProj = InputBox("Enter the Project Code 'JPAR' for the Lot Your Want To Add", "Enter Project Code") + If Len(strProj) > 0 Then + strProj = UCase(strProj) + strSQL = "SELECT proj_id FROM tblProject WHERE proj_code = '" & Field2Str(strProj) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + frmProjList.txtSearch = strProj + frmProjList.Show 1 + + Else + gintPROJID = Field2Long(oRS!PROJ_ID) + End If + strSQL = "SELECT Lot_No, Lot_id, Address FROM tblLotInfo where proj_id = " & gintPROJID + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lstLots.Clear + lstLots.Top = 1200 + lstLots.Left = 3780 + lstLots.Height = 2400 + lstLots.Width = 4335 + lstLots.Visible = True + Do Until oRSS.EOF + With lstLots + strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRSS!address) + .AddItem strLine + .ItemData(.NewIndex) = oRSS!Lot_ID + End With + + oRSS.MoveNext + Loop + If lstLots.ListCount Then + lblSelect.Visible = True + lblCtrl.Visible = True + lstLots.ListIndex = 0 + End If + + lstLots.SetFocus + + Else + MsgBox "You Must Enter A Project Code", vbOKOnly, "No Project Code" + cmdAddLot.SetFocus + Exit Sub + End If + End If +End Sub + +Private Sub cmd1Emp_Click() +Dim strSQL As String, strEMPID As String, dtPAYDT As String +Dim oRS As Recordset +Dim sglRTWages, sglOTWages As Single, strCODES As String + + On Error GoTo Error_EH + + lstCrew.col = 1 + strEMPID = lstCrew.ColText + +' strSQL = "SELECT * FROM tblHOURLIST WHERE PAY_DATE = #" & dtpPayDate.Value & "#" + strSQL = "SELECT * FROM tblHOURLIST WHERE EMP_ID = '" & strEMPID & "' AND PAY_DATE = #" & dtpPayDate.Value & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + strCODES = Field2Str(oRS!CODES) + If strCODES = "1" Then + txtHours = CSng(Field2Str(oRS!RTHours)) '+ CSng(Field2Str(oRS!Reg_HRS2)) + txtOTHrs = CSng(Field2Str(oRS!OTHours)) ' + CSng(Field2Str(oRS!OT_HRS2)) + txtHRate = Format(CSng(Field2Str(oRS!Rate)), "#,#.00") '+ CSng(Field2Str(oRS!Reg_RT2))) / 2 + txtOTRate = Format(CSng(Field2Str(oRS!OT_Rate)), "#,#.00") ' + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) +' sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_Hrs2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) +' sglOTWages = sglOTWages + ((CSng(Field2Str(oRS!OT_Hrs2)) * (CSng(Field2Str(oRS!OT_RT2))))) + txtGross = Format(sglRTWages, "#,#.00") + txtOTAmt = Format(sglOTWages, "#,#.00") + txtTTLAmt = sglOTWages + sglRTWages + txtTTLAmt = Format(txtTTLAmt, "#,#.00") + ElseIf strCODES = "2" Then + txtHours = CSng(Field2Str(oRS!RTHours)) '+ CSng(Field2Str(oRS!Reg_HRS2)) + txtOTHrs = CSng(Field2Str(oRS!OTHours)) ' + CSng(Field2Str(oRS!OT_HRS2)) + If Field2Str2(oRS!Reg_RT2) > 0 Then + txtHRate = (CSng(Field2Str(oRS!Rate)) + CSng(Field2Str(oRS!Reg_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) + sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_HRS2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + Else + txtHRate = CSng(Field2Str(oRS!Rate)) ' + CSng(Field2Str(oRS!Reg_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) + End If + If Field2Str2(oRS!OT_RT2) > 0 Then + txtOTRate = (CSng(Field2Str(oRS!OT_Rate)) + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) + sglOTWages = sglOTWages + ((CSng(Field2Str(oRS!OT_Hrs2)) * (CSng(Field2Str(oRS!OT_RT2))))) + Else + txtOTRate = CSng(Field2Str(oRS!OT_Rate)) ' + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) + End If +' txtOTRate = (CSng(Field2Str(oRS!OT_Rate)) + CSng(Field2Str(oRS!OT_RT2))) / 2 +' sglRTWages = (CSng(Field2Str(oRS!Reg_Hrs)) * (CSng(Field2Str(oRS!Rate)))) +' sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_Hrs2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + txtGross = Format(sglRTWages, "#,#.00") + txtOTAmt = Format(sglOTWages, "#,#.00") + txtTTLAmt = sglOTWages + sglRTWages + txtTTLAmt = Format(txtTTLAmt, "#,#.00") + End If + Else + MsgBox "No Employee Time Information Found", vbOKOnly, "No Time" + End If + Call CrewSave + cmdSavePay.Enabled = False + Call cmdTotal_Click + Exit Sub +Error_EH: + gstrMODULE = "Form PayHead - Module cmd1Emp_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddLot_Click() +Dim strProj As String, strSQL As String, intPROJ As Integer +Dim strLine As String, intYN As Integer +Dim oRS As Recordset, oRSS As Recordset, oRS2 As Recordset +Dim strPSheet As String, oRSPS As Recordset, lngLOTID As Long, dblGPAY As Double +Dim strPCODE As String, strLOTNO As String, strPRJLOT As String, lngPROJID As Long + + intYN = MsgBox("Do You Want To See A List Of Pay Sheets For This Crew?", vbYesNo, "Pay Sheet List?") + +' intYN = vbNo + If intYN = vbYes Then + strPSheet = "SELECT * FROM tblPAYSHEET WHERE Not PAID and not MOVEPAY and CrewID = " & gintCREWID + Set oRSPS = New Recordset + oRSPS.Open strPSheet, goConn, adOpenDynamic, adLockOptimistic + + + If oRSPS.EOF Then + MsgBox "No Pay Sheets Were Found For This Crew.", vbOKOnly, "No Paysheets" + Exit Sub + Else +' Do Until oRSPS.EOF '*** This when testing + lstPaySheets.Clear + lstPaySheets.Top = 1200 + lstPaySheets.Left = 3780 + lstPaySheets.Height = 2400 + lstPaySheets.Width = 4335 + lstPaySheets.Visible = True + + Do Until oRSPS.EOF + lngLOTID = Field2Str2(oRSPS!lotid) + strSQL = "SELECT PROJ_ID, LOT_NO FROM tblLOTINFO WHERE Lot_ID = " & lngLOTID + Set oRS2 = New Recordset + oRS2.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS2.EOF Then + lngPROJID = Field2Str(oRS2!PROJ_ID) + strLOTNO = Field2Str(oRS2!lot_no) + oRS2.Close + Else + MsgBox "No Lot Information Found", vbOKOnly, "No Lot" + End If + strSQL = "SELECT Proj_Code FROM tblPROJECT WHERE Proj_ID = " & lngPROJID + Set oRS2 = New Recordset + oRS2.Open strSQL, goConn, adOpenDynamic, adLockBatchOptimistic + + If Not oRS2.EOF Then + strPCODE = Field2Str(oRS2!Proj_Code) '************ Check this to make sure it works + oRS2.Close + Else + MsgBox "No Project Found", vbOKOnly, "No Project" + Exit Sub + End If + If oRSPS!Amt = 0 Then + dblGPAY = (oRSPS!pay_ydge * oRSPS!Y_Rate) + (oRSPS!METAL * oRSPS!M_Rate) + If dblGPAY > 0 Then + oRSPS!Amt = dblGPAY + oRSPS!GROSSPAY = dblGPAY + oRSPS.Update + End If + End If + strPRJLOT = Trim(strPCODE) & " - " & Trim(strLOTNO) + strLine = Field2Str2(oRSPS!payid) & vbTab & strPRJLOT & vbTab & Field2Str(oRSPS!Type) + strLine = strLine & vbTab & Field2Str(oRSPS!worktype) & vbTab & Field2Str(oRSPS!pay_ydge) + strLine = strLine & vbTab & Format(Field2Str2(oRSPS!GROSSPAY), "#,#.00") 'Change to GrossPay when for Final + strLine = strLine & vbTab & Field2Str(lngPROJID) & vbTab & Field2Str(lngLOTID) +' strLine = strLine & vbTab & Field2Str(oRSPS!worktype) & vbTab & Field2Str(oRSPS!pay_ydge) & vbTab & Field2Str2(oRSPS!Amt) 'Change to GrossPay when for Final + lstPaySheets.AddItem strLine + oRSPS.MoveNext + Loop + End If + ElseIf intYN = vbNo Then + strProj = InputBox("Enter the Project Code 'JPAR' for the Lot Your Want To Add", "Enter Project Code") + If Len(strProj) > 0 Then + strProj = UCase(strProj) + strSQL = "SELECT proj_id FROM tblProject WHERE proj_code = '" & Field2Str(strProj) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + frmProjList.txtSearch = strProj + frmProjList.Show 1 + + Else + gintPROJID = Field2Long(oRS!PROJ_ID) + End If + strSQL = "SELECT Lot_No, Lot_id, Address FROM tblLotInfo where proj_id = " & gintPROJID + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lstLots.Clear + lstLots.Top = 1200 + lstLots.Left = 3780 + lstLots.Height = 2400 + lstLots.Width = 4335 + lstLots.Visible = True + Do Until oRSS.EOF + With lstLots + strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRSS!address) + .AddItem strLine + .ItemData(.NewIndex) = oRSS!Lot_ID + End With + + oRSS.MoveNext + Loop + If lstLots.ListCount Then + lblSelect.Visible = True + lblCtrl.Visible = True + lstLots.ListIndex = 0 + End If + + lstLots.SetFocus + + Else + MsgBox "You Must Enter A Project Code", vbOKOnly, "No Project Code" + cmdAddLot.SetFocus + Exit Sub + End If + + End If +End Sub + +Private Sub cmdDetail_Click() ' Not Used + gintPROJID = moRSPay!PROJ_ID + gintLOTID = moRSPay!Lot_ID + + Call ViewPayInfo +End Sub + +Private Sub cmdAllCrew_Click() +Dim strSQL As String, strEMPID As String, dtPAYDT As String +Dim oRS As Recordset +Dim intCREWCNT As Integer, intCOUNT As Integer +Dim sglRTWages, sglOTWages As Single, strCODES As String + + On Error GoTo Error_EH + intCOUNT = 0 + intCREWCNT = lstCrew.ListCount + Do Until intCOUNT = intCREWCNT ' - 1 + + lstCrew.col = 1 + strEMPID = lstCrew.ColText + + ' strSQL = "SELECT * FROM tblHOURLIST WHERE PAY_DATE = #" & dtpPayDate.Value & "#" + strSQL = "SELECT * FROM tblHOURLIST WHERE EMP_ID = '" & strEMPID & "' AND PAY_DATE = #" & dtpPayDate.Value & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + strCODES = Field2Str(oRS!CODES) + If strCODES = "1" Then + txtHours = CSng(Field2Str(oRS!RTHours)) '+ CSng(Field2Str(oRS!Reg_HRS2)) + txtOTHrs = CSng(Field2Str(oRS!OTHours)) ' + CSng(Field2Str(oRS!OT_HRS2)) + txtHRate = Format(CSng(Field2Str(oRS!Rate)), "#,#.00") '+ CSng(Field2Str(oRS!Reg_RT2))) / 2 + txtOTRate = Format(CSng(Field2Str(oRS!OT_Rate)), "#,#.00") ' + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) + ' sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_Hrs2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) + ' sglOTWages = sglOTWages + ((CSng(Field2Str(oRS!OT_Hrs2)) * (CSng(Field2Str(oRS!OT_RT2))))) + txtGross = Format(sglRTWages, "#,#.00") + txtOTAmt = Format(sglOTWages, "#,#.00") + txtTTLAmt = sglOTWages + sglRTWages + txtTTLAmt = Format(txtTTLAmt, "#,#.00") + ElseIf strCODES = "2" Then + txtHours = CSng(Field2Str(oRS!RTHours)) '+ CSng(Field2Str(oRS!Reg_HRS2)) + txtOTHrs = CSng(Field2Str(oRS!OTHours)) ' + CSng(Field2Str(oRS!OT_HRS2)) + If Field2Str2(oRS!Reg_RT2) > 0 Then + txtHRate = (CSng(Field2Str(oRS!Rate)) + CSng(Field2Str(oRS!Reg_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) + sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_HRS2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + Else + txtHRate = CSng(Field2Str(oRS!Rate)) ' + CSng(Field2Str(oRS!Reg_RT2))) / 2 + sglRTWages = (CSng(Field2Str(oRS!reg_hrs)) * (CSng(Field2Str(oRS!Rate)))) + End If + If Field2Str2(oRS!OT_RT2) > 0 Then + txtOTRate = (CSng(Field2Str(oRS!OT_Rate)) + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) + sglOTWages = sglOTWages + ((CSng(Field2Str(oRS!OT_Hrs2)) * (CSng(Field2Str(oRS!OT_RT2))))) + Else + txtOTRate = CSng(Field2Str(oRS!OT_Rate)) ' + CSng(Field2Str(oRS!OT_RT2))) / 2 + sglOTWages = (CSng(Field2Str(oRS!OT_Hrs)) * (CSng(Field2Str(oRS!OT_Rate)))) + End If + ' txtOTRate = (CSng(Field2Str(oRS!OT_Rate)) + CSng(Field2Str(oRS!OT_RT2))) / 2 + ' sglRTWages = (CSng(Field2Str(oRS!Reg_Hrs)) * (CSng(Field2Str(oRS!Rate)))) + ' sglRTWages = sglRTWages + ((CSng(Field2Str(oRS!Reg_Hrs2)) * (CSng(Field2Str(oRS!Reg_RT2))))) + txtGross = Format(sglRTWages, "#,#.00") + txtOTAmt = Format(sglOTWages, "#,#.00") + txtTTLAmt = sglOTWages + sglRTWages + txtTTLAmt = Format(txtTTLAmt, "#,#.00") + End If + Else + MsgBox "No Employee Time Information Found", vbOKOnly, "No Time" + End If + Call CrewSave + lstCrew.ListIndex = lstCrew.ListIndex + 1 + intCOUNT = intCOUNT + 1 + Loop + cmdSavePay.Enabled = False + Call cmdTotal_Click + Exit Sub +Error_EH: + gstrMODULE = "Form PayHead - Module cmd1Emp_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdCalc_Click() + Call CalcWages +End Sub + +Private Sub cmdCertPR_Click() + frmCertified.Show 1 +End Sub + +Private Sub cmdDivide_Click() +Dim dblPay As Double, intCOUNT As Integer, intZERO As Integer +Dim strSQL As String, strMSG As String, strSELECT As String +Dim oRS As Recordset, strPCID As String + + On Error GoTo Error_EH + If mbytCOUNT = 0 Then + strMSG = "There Are No Crew Workers Shown, This Will Cause An Error" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Exit Payroll and Add The Workers For This Crew!" + MsgBox strMSG, vbOKOnly, "Enter Crew Members" + Exit Sub + End If + + strSELECT = "SELECT COUNT(pay_id) as cntPAY FROM tblPAYCREW WHERE gross = 0 and pay_id = " & gintPAYID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + intZERO = Field2Integer(oRS!cntpay) + + If intZERO > 0 Then + dblPay = Round((Field2Str2(lblDifference.Caption) / intZERO), 2) + + intCOUNT = 1 + Do Until intCOUNT > mbytCOUNT + lstCrew.ListIndex = intCOUNT - 1 + lstCrew.col = 0 + strPCID = lstCrew.ColText + strSQL = "SELECT * FROM tblPayCrew WHERE pc_Id = " & strPCID 'lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Field2Str2(moRSCREW!gross) = 0 Then + If Field2Str2(moRSCREW!hours) = 0 Then + If Field2Str2(dblPay) < 120 Then + moRSCREW!hours = 10 + ElseIf Field2Str2(dblPay) < 240 Then + moRSCREW!hours = 20 + ElseIf Field2Str2(dblPay) < 360 Then + moRSCREW!hours = 30 + ' ElseIf Field2Str2(dblPay) < 480 Then + ' moRSCREW!hours = 60 + Else + moRSCREW!hours = 40 + End If + End If + moRSCREW!gross = Field2Str2(dblPay) + moRSCREW!REG_WAGE = Field2Str2(dblPay) + moRSCREW!Rate = Format((Field2Str2(moRSCREW!gross) / Field2Str2(moRSCREW!hours)), "#0.00##") + moRSCREW.Update + End If + intCOUNT = intCOUNT + 1 + Loop + End If + Call CrewLoad + Call cmdTotal_Click + Exit Sub +Error_EH: + gstrMODULE = "Form PayHead - Module cmdDivide_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdGetCrew_Click() + Call GetCrew +End Sub + +Private Sub ClearCrew() +Dim strSQL As String, oRS As Recordset, intCNTC As Integer, intALLC As Integer +Dim lngCrewID As Integer, boolDONE As Boolean, strCrewID As String + + boolDONE = False + intCNTC = 1 + intALLC = lstCrew.ListCount + lstCrew.ListIndex = 0 + + Do Until boolDONE + lstCrew.col = 0 + strCrewID = Format(Field2Str2(lstCrew.ColText), "######") + strSQL = "SELECT * FROM tblPAYCREW WHERE PC_ID = " & strCrewID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + oRS!INCLUDE = vbFalse + oRS.Update + oRS.Close + End If + If intCNTC = intALLC Then + boolDONE = True + intCNTC = 1 + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = intCNTC + intCNTC = intCNTC + 1 + End If + Loop + Call CrewLoad +End Sub + +Private Sub ClearHouse() +Dim strSQL As String, oRS As Recordset, intCNTH As Integer, intALLH As Integer +Dim lngPAYID As Integer, boolDONE As Boolean, strPAYID As String + + boolDONE = False + intCNTH = 1 + intALLH = lstHouses.ListCount + lstHouses.ListIndex = 0 + + Do Until boolDONE + lstHouses.col = 0 + strPAYID = Format(Field2Str2(lstHouses.ColText), "######") + strSQL = "SELECT * FROM tbltime WHERE IDNUM = " & strPAYID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + oRS!INCLUDE = vbFalse + oRS.Update + oRS.Close + End If + If intCNTH = intALLH Then + boolDONE = True + intCNTH = 1 + lstHouses.ListIndex = 0 + Else + lstHouses.ListIndex = intCNTH + intCNTH = intCNTH + 1 + End If + Loop + Call PayLoad +End Sub + +Private Sub cmdMoveHouse_Click() +Dim bytCOUNT As Byte, sglPerHouse As Single, strID As String +Dim intCOUNT As Integer, oRS As Recordset, strSQL As String + + intCOUNT = 0 + bytCOUNT = lstHouses.ListCount + sglPerHouse = CSng(txtSumCrew) / bytCOUNT + + lstHouses.ListIndex = 0 + Do Until intCOUNT = lstHouses.ListCount + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "SELECT * FROM tblTIME WHERE IdNum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If Not oRS.EOF Then + oRS!pay_amt = sglPerHouse + oRS.Update + End If + lstHouses.ListIndex = lstHouses.ListIndex + 1 + intCOUNT = intCOUNT + 1 + Loop + Call cmdTotal_Click +End Sub + +Private Sub cmdPaySheet_Click() + +End Sub + +Private Sub cmdSavePay_Click() + Call CrewSave + cmdSavePay.Enabled = False + Call cmdTotal_Click + lstCrew.SetFocus +End Sub + +Private Sub cmdTest_Click() + frmProjList.Show 1 +End Sub + +Private Sub cmdTotal_Click() +Dim strSQL As String +Dim oRS As Recordset +'***FIX On Error GoTo Error_EH + + strSQL = "SELECT sum(pay_amt) as SumHouse FROM tblTime where pay_id = " & gintPAYID & " and crew = " & gintCREWID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + txtSumHouse = Format(Field2Str2(oRS!SumHouse), "##,###.00") + End If + + strSQL = "SELECT sum(gross) as SumWorker FROM tblpaycrew where pay_id = " & gintPAYID & " and crew_id = " & gintCREWID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + txtSumCrew = Format(Field2Str2(oRS!SumWorker), "##,###.00") + End If + + lblDifference.Caption = Format(Field2Str2(txtSumHouse) - Field2Str2(txtSumCrew), "##,##0.00;(##,##0.00)") + If Field2Str2(lblDifference.Caption) < 0 Then + lblDifference.ForeColor = &HFF& + lblBalance.Caption = "Crew Greater Than Houses" + ElseIf Field2Str2(lblDifference.Caption) > 0 Then + lblDifference.ForeColor = &H0& + lblBalance.Caption = "Houses Greater Than Crew" + Else + lblDifference.ForeColor = &H0& + lblBalance.Caption = "Payroll is Balanced" + End If + Call UpCrewPS + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module cmdTotal_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub UpCrewPS() +Dim strSQL As String, oRS As Recordset, lngTIMEID As Long +Dim strSQL1 As String, strSql2 As String, strSQL3 As String +Dim strFIXTYPE As String, strFIXWORKDONE As String + + lstHouses.col = 0 + lngTIMEID = Field2Long(lstHouses.ColText) + + If lblWorkDone = "A" Then + strFIXTYPE = "W" + strFIXWORKDONE = "C" + lblWorkDone = strFIXWORKDONE + lblTYPE2 = strFIXTYPE + If lblTYPE2 = "" Then + lblTYPE2 = lblTYPE3 + End If + End If + If txtCrewId <> "" Then + strSQL = "SELECT * FROM tblPaySheet WHERE LotID = " & Field2Long(lblLOTID) +' strSQL1 = " AND CrewID = " & Field2Long(txtCrewId) +' strSQL = strSQL & " and TYPE = '" & strFIXTYPE & "' AND WORKTYPE = '" & strFIXWORKDONE & "'" + strSQL = strSQL & " and TYPE = '" & lblTYPE2 & "' AND WORKTYPE = '" & lblWorkDone & "'" + +' strSQL = "SELECT * FROM tblPaySheet WHERE LotID = 42471" '& Field2Long(lblLOTID) +' strSQL1 = " AND CrewID = 419" ' & Field2Long(txtCrewId) +' strSQL2 = " and TYPE = 'W' AND WORKTYPE = 'C'" +' strSQL3 = strSQL & strSQL2 +' strSQL3 = strSQL & strSQL1 & strSQL2 + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not mboolDelete Then + If Not oRS.EOF Then + oRS!timeid = lngTIMEID + oRS!crewID = Field2Long(txtCrewId) + oRS!paid = vbTrue + oRS.Update + End If + Else + mboolDelete = False + End If + End If +End Sub + +Private Sub cmdLook_Click() + gintPROJID = moRSPay!PROJ_ID + gintLOTID = moRSPay!Lot_ID + Load frmPayroll +' frmPayroll.mboolLOOK = vbTrue + frmPayroll.chkLOOK = vbChecked +' cmdLook.Visible = False +' cmdDetail.Visible = False + frmPayroll.Show 1 +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + mboolDelete = False + +' If chkBiWeekly = True Then +' chkBiWeekly.Visible = True +' Else +' chkBiWeekly.Visible = False +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim intLOC As Integer, strWCCODE As String, lngID As Long +Dim oRS As Recordset, strSQL As String + +' *** CtrlA - Set record for NoCalcuations - All calculations will have be be done manually +' *** CtrlH - Delete the highlighted house +' *** CtrlR - Delete the highlighted crew +' *** CtrlS - Select The Higlighted Lot in lstLots +' *** CtrlT - Add the Out of Balance Amount to the Highlighted Crew Member +' *** CtrlK - View the payroll information for the Highlighted House +' *** CtrlQ - Fix the WC code for the highlighted crew member +' *** CtrlD - Mark The Highlighted Pay Sheet as Paid +' *** CtrlY - Fix TIME yardage for hi-lited house + + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyH Then ' Display key combinations. + If CtrlDown Then + Call HouseDelete + Call PayLoad + Call cmdTotal_Click +' txtHours.SetFocus + If txtHours = "" Or IsNull(txtHours) Then + txtHours = 0 + End If + End If + Exit Sub + End If + If KeyCode = vbKeyR Then ' Display key combinations. + If CtrlDown Then + Call CrewDelete + Call CrewLoad + Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstLots_DblClick + End If + Exit Sub + End If + + If KeyCode = vbKeyY Then + If CtrlDown Then + + End If + Exit Sub + End If + If KeyCode = vbKeyT Then ' Put the out of balance amount to this employee + If CtrlDown Then + Call BalancePay + End If + Exit Sub + End If + + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call NoCalc + End If + Exit Sub + End If + +' If KeyCode = vbKeyF Then ' Display key combinations. +' If CtrlDown Then +' Call ViewPayInfo +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyK Then ' Display key combinations. + If CtrlDown Then + Call cmdLook_Click + End If + Exit Sub + End If + + If KeyCode = vbKeyQ Then ' Fix The Project Code (WC Code) for the highlighted employee + If CtrlDown Then + intLOC = lstCrew.ListIndex + strWCCODE = InputBox("Enter The Correct WC Code", "WC Code", moRSCREW!wc_code) + moRSCREW!wc_code = strWCCODE + moRSCREW.Update + End If + Exit Sub + End If + +' If KeyCode = vbKeyW Then ' Clear Marked Crew Members in lstCrew +' If CtrlDown Then +' Call ClearCrew +' End If +' Exit Sub +' End If + + If KeyCode = vbKeyD Then ' Clear Marked Crew Members in lstCrew + If CtrlDown Then + If lstPaySheets.ListIndex > -1 Then + lstPaySheets.col = 0 + lngID = Field2Long(lstPaySheets.ColText) + strSQL = "SELECT * FROM tblPaySheet WHERE PAYID = " & lngID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + oRS!paid = vbChecked + oRS.Update + End If + End If + End If + Exit Sub + End If + + If KeyCode = vbKeyE Then ' Clear Marked Houses in lstHouses + If CtrlDown Then + If lstPaySheets.ListIndex > -1 Then + lstPaySheets.col = 0 + lngID = Field2Long(lstPaySheets.ColText) + strSQL = "SELECT * FROM tblPaySheet WHERE PAYID = " & lngID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + oRS!invalid = vbChecked + oRS!movepay = vbChecked + oRS.Update + End If + End If + End If + Exit Sub + End If + +End Sub + +Private Sub NoCalc() +Dim strSQL As String +Dim oRS As Recordset + +' On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblpayheader WHERE pay_id = " & gintPAYID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!NoCalc = vbTrue + Else + oRS!NoCalc = vbFalse + End If +End Sub + +Private Sub BalancePay() +Dim dblGROSS As Double, dblDIFF As Double + dblDIFF = CDbl(lblDifference) + dblGROSS = Field2Str2(moRSCREW!gross) + If lblBalance.Caption = "Payroll is Balanced" Then + moRSCREW!tiebreak = vbFalse + moRSCREW.Update + Call CrewLoad + ElseIf lblBalance.Caption = "Crew Greater Than Houses" Then + dblGROSS = dblGROSS + dblDIFF +' dblGROSS = dblGROSS - dblDIFF + moRSCREW!REG_WAGE = dblGROSS + moRSCREW!gross = dblGROSS +' moRSCREW!Gross = Field2Str2(moRSCREW!Gross) - Field2Str2(lblDifference) + moRSCREW!tiebreak = vbTrue + moRSCREW.Update + Call cmdTotal_Click + Call CrewLoad + ElseIf lblBalance.Caption = "Houses Greater Than Crew" Then + dblGROSS = dblGROSS + dblDIFF +' moRSCREW!Gross = Field2Str2(moRSCREW!Gross) + Field2Str2(lblDifference) + moRSCREW!gross = dblGROSS + moRSCREW!REG_WAGE = dblGROSS + moRSCREW!tiebreak = vbTrue + moRSCREW.Update + Call cmdTotal_Click + Call CrewLoad + End If +End Sub + +Private Sub ViewPayInfo() + Load frmPayInput + frmPayInput.chkLOOK = vbChecked +' cmdLook.Visible = False +' cmdDetail.Visible = False + frmPayInput.Show 1 + +End Sub + +Private Sub CrewDelete() +Dim strSQL As String, strPCID As String + + lstCrew.col = 0 + strPCID = lstCrew.ColText + strSQL = "DELETE * FROM tblPayCrew where Pc_id = " & strPCID 'lstCrew.ItemData(lstCrew.ListIndex) + goConn.Execute strSQL + +End Sub + +Private Sub HouseDelete() +Dim strSQL As String, strID As String + Call CheckScaf + mboolDelete = True + Call PaySheetUpdate + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "DELETE * FROM tblTime where idnum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) + goConn.Execute strSQL +' mboolDelete = False +End Sub + +Private Sub PaySheetUpdate() +Dim strSQL As String, strID As String +Dim oRS As Recordset + + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "SELECT * FROM tblPaySheet WHERE timeid = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then +' oRS!crewID = 0 + oRS!paid = False +' oRS!paid = vbUnchecked + oRS!timeid = 0 + oRS!movepay = False +' oRS!movepay = vbNo +' oRS!Amt = 0 +' oRS!Y_Rate = 0 +' oRS!m_Rate = 0 + oRS.Update + oRS.Close + End If +End Sub + +Private Sub CheckScaf() +Dim strSQL As String, oRS As Recordset, strID As String +Dim strSQLL As String, oRSS As Recordset + + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "SELECT * FROM tblTIME WHERE idnum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + If oRS!scafid Then + strSQLL = "SELECT * FROM tblSCAFFOLD WHERE scaf_id = " & Field2Long(oRS!scafid) + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + oRSS!paid = vbUnchecked + oRSS!pdamt = 0 +' oRSS!prcrew = 0 + oRSS.Update + oRSS.Close + End If + End If + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + lblCertPR.Visible = False + cmdCertPR.Visible = False + txtHours = 0 + txtOTHrs = 0 + txtHRate = 0 + txtOTRate = 0 + txtGross = 0 + txtOTAmt = 0 + txtTTLAmt = 0 + mboolNOYDS = False + mintYDS = 0 + + frmPayHead.Width = 12495 +' frmPayHead.Width = 12315 + lstCrew.Width = 3900 + Call GetWage + Call GetHeader + Call PayLoad + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + Call FormShowCrew + End If + End If + Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindPay() As Boolean +Dim strSQL As String, strID As String + On Error GoTo Error_EH + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "SELECT * FROM tblTIME WHERE IdNum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + FormFindPay = False + Else + FormFindPay = True + lblProjID = Field2Str2(moRSPay!PROJ_ID) + lblLOTID = Field2Str2(moRSPay!Lot_ID) + lblWorkDone = Field2Str(moRSPay!WorkDone) +' If moRSPay!certpr Then +' mboolCERTIFIED = True +' End If + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PayHead - Module FormFindPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindCrew() As Boolean +Dim strSQL As String, strPCID As String + On Error GoTo Error_EH + lstCrew.col = 0 + strPCID = lstCrew.ColText + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPayCrew " + strSQL = strSQL & "WHERE Pc_Id = " & Field2Str2(strPCID) +' strSQL = strSQL & "WHERE Pc_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PayHead - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindPS() +Dim strSQL As String, strPCID As String + On Error GoTo Error_EH + lstPaySheets.col = 0 + mlngPSPAYID = Field2Long(lstPaySheets.ColText) +' strPCID = lstCrew.ColText + strSQL = "SELECT * FROM tblPaySheet WHERE PayId = " & mlngPSPAYID +' strSQL = strSQL & "WHERE Pc_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + Set moRSPS = New Recordset + moRSPS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSCREW.EOF Then + FormFindPS = False + Else + FormFindPS = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PayHead - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function + +End Function + +Private Sub FormShowPay() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSC As Recordset + + On Error GoTo Error_EH + + With moRSPay + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = " & Field2Str(!Lot_ID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + lblAddress.Caption = Field2Str(oRS!address) + If !pay_type = "S" Then + lblDYds.Caption = Field2Str(oRS!s_yds) + lblDMetal.Caption = "" + lblDFin2.Caption = Field2Str2(oRS!fin2) + ElseIf !pay_type = "L" Or !pay_type = "W" Then + lblDYds.Caption = Field2Str(oRS!l_yds) + lblDMetal.Caption = Field2Str2(oRS!METAL) + lblDFin2.Caption = "" + ElseIf !pay_type = "V" Then + txtStone = Field2Str(oRS!ST_SQFT) + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + ElseIf !pay_type = "C" Then + lblYds = "Frames:" + lblDYds.Caption = Field2Str2(oRS!Scaf6) + lblDMetal.Caption = "" +' End If + lblDFin2.Caption = Field2Str2(oRS!scaf10) + lblFrames.Visible = True + lblFrameCnt.Visible = True + ElseIf !pay_type = "X" Then + txtPaint = Field2Str(oRS!PNT_SQFT) + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + Else + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + End If + End If + If mboolCERTIFIED Then + lblCertPR.Visible = True + cmdCertPR.Visible = True +' Else +' lblCertPR.Visible = False + End If + If Field2Str(!pay_type) = "S" Then + lblType.Caption = "STUCCO" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "L" Then + lblType.Caption = "LATH" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "V" Then + lblType.Caption = "V_STONE" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "R" Then + lblType.Caption = "REPAIR/PO" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "C" Then + lblType.Caption = "SCAFFOLD" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "X" Then + lblType.Caption = "PAINT" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "W" Then + lblType.Caption = "WRAP" + lblTYPE2 = Field2Str(!pay_type) + ElseIf Field2Str(!pay_type) = "Q" Then + lblType.Caption = "MISC" + lblTYPE2 = Field2Str(!pay_type) + End If + + If lblTYPE2 = "" Then + lblTYPE2 = lblTYPE3 + End If + + If !bc Then + lblBC.Caption = "Back Chg" + ElseIf Field2Str(!WorkDone) = "W" Then + lblBC.Caption = "PO Work" + ElseIf Field2Str(!WorkDone) = "F" Then + lblBC.Caption = "Fence" + ElseIf Field2Str(!WorkDone) = "U" Then + lblBC.Caption = "CMU" + Else + lblBC.Caption = "" + End If + lblPay.Caption = Format(Field2Str2(!pay_amt), "##,##0.00;(##,##0.00)") + lblDRate.Caption = Field2Str2(!yd_rate) + lblDRate2.Caption = Field2Str2(!fin2_Rate) + lblDMRate.Caption = Field2Str2(!mtl_Rate) + lblFrameCnt = Field2Str2(!frames) + + + End With + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module FormShowPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowCrew() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + lblEmpId.Caption = Field2Str(!Emp_ID) + lblEmpName.Caption = Field2Str(!EmpName) + lblWCCode = Field2Str(!wc_code) + strSql2 = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & Field2Str2(!Emp_ID) & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenDynamic, adLockPessimistic +' oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then +' oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSS!Terminated <> "A" Then + lblTerm.Visible = True + Else + lblTerm.Visible = False + End If + End If + txtHRate = Format(Field2Str2(!Rate), "#0.00##") + txtHours = Format(Field2Str2(!hours), "#0.0#") + txtGross = Format(Field2Str2(!REG_WAGE), "##,##0.00") + txtOTRate = Format(Field2Str2(!OT_Rate), "#0.00##") + txtOTHrs = Format(Field2Str2(!OT_Hours), "#0.0#") + txtOTAmt = Format(Field2Str2(!OT_Wage), "##,##0.00") + txtTTLAmt = Format(Field2Str2(!gross), "##,##0.00") + txtTTLHrs = Field2Str2(!TTLHrs) + txtTTLPay = Format(Field2Str2(!TTLPay), "#,##0.00##") + If Field2Str(!autodeduct) = "Y" Then + chkDeduct = vbChecked + Else + chkDeduct = vbUnchecked + End If + If !tiebreak Then + lblTIE.Visible = True + Else + lblTIE.Visible = False + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetPay() +Dim strSQL As String, strID As String + + lstPaySheets.col = 0 + strID = lstPaySheets.ColText + strSQL = "SELECT * FROM tblTIME WHERE IdNum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + End If +End Sub + +Private Sub GetHRS() +Dim strSQL As String, strID As String + + lstHouses.col = 0 + strID = lstHouses.ColText + strSQL = "SELECT * FROM tblTIME WHERE IdNum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If Not moRSPay.EOF Then + If Field2Str2(moRSPay!pay_type) = "S" Or Field2Str2(moRSPay!pay_type) = "L" Then + If Field2Str2(moRSPay!yds) = 0 Then + moRSPay!yds = CInt(lblDYds) + moRSPay.Update + End If + End If + End If + +End Sub + +Private Sub GetPS() +Dim strSQL As String, strID As String + + lstPaySheets.col = 0 + strID = lstPaySheets.ColText + strSQL = "SELECT * FROM tblPAYSHEET WHERE PAYID = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSSPS = New Recordset + moRSSPS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSSPS.EOF Then + End If +End Sub + +Private Sub GetCrew() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strCREW As String + On Error GoTo Error_EH + strCREW = "SELECT * FROM tblPayCrew WHERE pc_id = 1" + Set oRSS = New Recordset + oRSS.Open strCREW, goConn, adOpenForwardOnly, adLockOptimistic + + strSQL = "SELECT * FROM tblCrewList WHERE crew_id = " & Str2Field(txtCrewId) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "No Workers Were Found For The Highlited Crew. Exit and Enter the Workers", vbOKOnly, "Workers Not Dound" + Exit Sub + End If + Do Until oRS.EOF + oRSS.AddNew + oRSS!pay_id = gintPAYID + oRSS!CREW_ID = Field2Str(oRS!CREW_ID) + oRSS!Emp_ID = Field2Str(oRS!Emp_ID) + oRSS!EmpName = Left(Field2Str(oRS!EmpName), 30) + oRSS!Pay_Date = Field2Str(txtPayDate) + oRSS!wc_code = Field2Str(oRS!wc_code) + oRSS.Update + oRS.MoveNext + Loop + Call CrewLoad + Exit Sub +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Crew Member - This Member will not be saved", , "Duplicate Record" + Resume Next +' Exit Sub + End If + gstrMODULE = "Form PayHead - Module GetCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetHeader() +Dim strSQL As String + On Error GoTo Error_EH + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = " & gintPAYID + Set moRSHEAD = New Recordset + moRSHEAD.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + chkReady = Field2CheckBox(moRSHEAD!P_FLAG) +' chkReady = moRSHEAD!p_flag + + Exit Sub +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Crew List - This will not be saved", , "Duplicate Record" + Exit Sub + End If + gstrMODULE = "Form PayHead - Module CrewSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetWage() +Dim strSQL As String, oRS As Recordset + + strSQL = "SELECT * FROM tblSYSInfo" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + gsngWAGE = Field2Str2(oRS!WAGE) + End If +End Sub + +Private Sub CrewSave() + On Error GoTo Error_EH + + If moRSCREW.State = adStateClosed Then + Exit Sub + End If + + With moRSCREW + !Rate = Str2Field(txtHRate.Text) + !hours = Str2Field(txtHours.Text) + !gross = Str2Field(txtTTLAmt.Text) + !OT_Wage = Str2Field(txtOTAmt.Text) + !REG_WAGE = Str2Field(txtGross.Text) + !OT_Hours = Str2Field(txtOTHrs.Text) + !OT_Rate = Str2Field(txtOTRate) + !TTLHrs = Str2Field(txtTTLHrs) + !TTLPay = Str2Field(txtTTLPay) + If chkDeduct Then + !autodeduct = "Y" + Else + !autodeduct = "N" + End If + End With + moRSCREW.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module CrewSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetWorkType() +Dim strSQL As String, oRSW As Recordset + + strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" + Set oRSW = New Recordset + oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSW.EOF Then + mstrWTYPE = Field2Str(oRSW!worktype) + End If + + oRSW.Close +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strLOT As String, strY As String +Dim strLine As String, strWORK As String +'Add to New 11/15/17 + On Error GoTo Error_EH + + lblCertPR.Visible = False + cmdCertPR.Visible = False + strSQL = "SELECT * from tblTime WHERE Pay_id = " & gintPAYID + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHouses.Clear + + Do Until moRSPay.EOF + If moRSPay!certpr Then + lblCertPR.Visible = True + cmdCertPR.Visible = True + End If + With lstHouses + mstrWDone = Field2Str(moRSPay!WorkDone) + If CInt(Field2Str2(moRSPay!yds)) > 0 Then + mintYDS = mintYDS + CInt(Field2Str2(moRSPay!yds)) + Else + mboolNOYDS = True + End If + Call GetWorkType + strWORK = mstrWTYPE + If moRSPay!INCLUDE = vbTrue Then + strY = "Y" + Else + strY = "" + End If +' if morspay! + If moRSPay!bc Then + strLOT = Field2Long(moRSPay!idnum) & vbTab & Field2Str(moRSPay!proj_lot) & vbTab & "BACK CHARGE" & vbTab & strY + Else + strLOT = Field2Long(moRSPay!idnum) & vbTab & Field2Str(moRSPay!proj_lot) & vbTab & strWORK & vbTab & strY + End If + +' ElseIf Field2Str(moRSPay!workdone) = "W" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "PO WORK" +' ElseIf Field2Str(moRSPay!workdone) = "U" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "CMU" +' ElseIf Field2Str(moRSPay!workdone) = "A" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "TYPAR WRAP" +' ElseIf Field2Str(moRSPay!workdone) = "C" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "COMPLETE" +' ElseIf Field2Str(moRSPay!workdone) = "P" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "PARTIAL" +' ElseIf Field2Str(moRSPay!workdone) = "F" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "FENCES" +' ElseIf Field2Str(moRSPay!workdone = "Y") Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "UP" +' ElseIf Field2Str(moRSPay!workdone = "Z") Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "DOWN" +' Else +' strLOT = Field2Str(moRSPay!proj_lot) +' End If + .AddItem strLOT +' .ItemData(.NewIndex) = Field2Long(moRSPay!idnum) + End With + + moRSPay.MoveNext + Loop +' moRSPay.Close + + If lstHouses.ListCount Then + lstHouses.ListIndex = 0 + Else + lstHouses.ListIndex = -1 + lblType.Caption = "" + lblAddress.Caption = "" + lblPay.Caption = "" + End If + lblTEST = mintYDS + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String, strY As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPaycrew WHERE Pay_id = " & gintPAYID + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + mbytCOUNT = 0 + Do Until moRSCREW.EOF + With lstCrew + If moRSCREW!INCLUDE = vbTrue Then + strY = "Y" + Else + strY = "" + End If + strLine = Field2Str2(moRSCREW!pc_id) & vbTab & Field2Str(moRSCREW!Emp_ID) & vbTab & Field2Str(moRSCREW!EmpName) & vbTab & strY + .AddItem strLine +' .ItemData(.NewIndex) = moRSCREW!pc_id + End With + mbytCOUNT = Field2Str2(mbytCOUNT) + 1 + moRSCREW.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + lblEmpId.Caption = "" + lblEmpName.Caption = "" + lblWCCode = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoadOld() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPaycrew WHERE Pay_id = " & gintPAYID + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + mbytCOUNT = 0 + Do Until moRSCREW.EOF + With lstCrew + strLine = Field2Str(moRSCREW!Emp_ID) & " " & Field2Str(moRSCREW!EmpName) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!pc_id + End With + mbytCOUNT = Field2Str2(mbytCOUNT) + 1 + moRSCREW.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + lblEmpId.Caption = "" + lblEmpName.Caption = "" + lblWCCode = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module CrewLoadOld" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub SavePay() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblpayheader WHERE pay_id = " & gintPAYID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!sum_houses = Field2Str2(txtSumHouse) + oRS!sum_workers = Field2Str2(txtSumCrew) + oRS!P_FLAG = chkReady + oRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module SavePay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + Call SavePay + If cmdSavePay.Enabled Then + + strMSG = "Employee Pay Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call CrewSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + If Field2Str2(lblDifference.Caption) <> 0 Then + strMSG = "The Payroll Is Not Balanced" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Are You Sure You Want To Exit ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNo, "PAYROLL UNBALANCED") + Select Case intResponse + Case vbYes + + Case vbNo + Cancel = True + Exit Sub + End Select + End If + + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lblStart_Click() + +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then +' If gboolMAS90 Then '***FIX Need to remove when new tables are setup +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + Call FormShowCrew + Else + lblEmpId.Caption = "" + lblEmpName.Caption = "" + lblWCCode = "" + txtHRate = "0" + txtHours = "0" + txtGross = "0" + txtTTLAmt = "0" + txtOTHrs = "0" + txtOTRate = "0" + txtOTAmt = "0" + txtTTLHrs = "" + txtTTLPay = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() +Dim intBOOKMARK As Integer +' frmCrewList.Show 1 +' Call CrewLoad + intBOOKMARK = lstCrew.ListIndex + If moRSCREW!INCLUDE = vbTrue Then + moRSCREW!INCLUDE = vbFalse + ElseIf moRSCREW!INCLUDE = vbFalse Then + moRSCREW!INCLUDE = vbTrue + End If + moRSCREW.Update + Call CrewLoad + lstCrew.ListIndex = intBOOKMARK + cmdSavePay.Enabled = True + +End Sub + +Private Sub lstHouses_Click() + On Error GoTo Error_EH + + If lstHouses.ListIndex <> -1 Then + If FormFindPay() Then + Call FormShowPay + Else + lblType.Caption = "" + lblAddress.Caption = "" + lblPay.Caption = "" + lblDYds.Caption = "" + lblDFin2.Caption = "" + lblDMetal.Caption = "" + lblDRate.Caption = "" + lblDRate2.Caption = "" + lblDMRate.Caption = "" + txtStone = "" + txtPaint = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module lstHouses_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstHouses_DblClick() +Dim intBOOKMARK As Integer +' frmCrewList.Show 1 +' Call CrewLoad + If lstHouses.ListCount > 0 Then + intBOOKMARK = lstHouses.ListIndex + If moRSPay!INCLUDE = vbTrue Then + moRSPay!INCLUDE = vbFalse + ElseIf moRSPay!INCLUDE = vbFalse Then + moRSPay!INCLUDE = vbTrue + End If + moRSPay.Update + Call PayLoad + lstHouses.ListIndex = intBOOKMARK + End If +' cmdSavePay.Enabled = True +' cmdDetail.Visible = True +' cmdLook.Visible = True +' gintPROJID = moRSPay!proj_id +' gintLOTID = moRSPay!Lot_id +End Sub + +Private Sub lstLots_DblClick() +Dim strPAYID As String + strPAYID = gintPAYID + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + lblLOTID = gintLOTID + lstLots.Visible = False + Load frmPayInput + frmPayInput.txtCrewNo = Field2Str(txtCrewId) + frmPayInput.txtCrewName = Field2Str(lblCrewName.Caption) + frmPayInput.chkADD = vbChecked + frmPayInput.Show 1 + lblSelect.Visible = False + lblCtrl.Visible = False + Call PayLoad + Call cmdTotal_Click + cmdAddLot.SetFocus +End Sub + +Private Sub lstPaySheets_Click() +Dim strSQL As String, strID As String +Dim oRS As Recordset, strPAYID As String +'Got to find out where to get the tblTIME id or just open the tblTIME and add a new one. + + lstPaySheets.col = 0 + strID = lstPaySheets.ColText + strSQL = "SELECT * FROM tblPaySheet WHERE timeid = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then +' oRS!crewID = 0 + oRS!paid = vbUnchecked + oRS!timeid = 0 + oRS!movepay = vbNo +' oRS!Amt = 0 +' oRS!Y_Rate = 0 +' oRS!m_Rate = 0 + oRS.Update + oRS.Close + End If + glngPSID = strID + strPAYID = gintPAYID + +End Sub + +Private Sub lstPaySheets_DblClick() +Dim strPAYID As String, lngLOTID As Long, lngPROJID As Long +' Call lstPaySheets_Click + Call GetPay + mboolAdding = True + strPAYID = gintPAYID + lstPaySheets.col = 0 + glngPSID = Field2Long(lstPaySheets.ColText) + lstPaySheets.col = 6 + gintPROJID = Field2Long(lstPaySheets.ColText) + lstPaySheets.col = 7 + gintLOTID = Field2Long(lstPaySheets.ColText) + Call FormSavePS +' gintLOTID = lstLots.ItemData(lstLots.ListIndex) +' lstLots.Visible = False + lstPaySheets.Visible = False + Load frmPayInput +' frmPayInput.lblTimeID = gintPAYID + frmPayInput.txtCrewNo = Field2Str(txtCrewId) + frmPayInput.txtCrewName = Field2Str(lblCrewName.Caption) + frmPayInput.chkADD = vbChecked + frmPayInput.chkPS = vbChecked '**????? Not sure needed + frmPayInput.Show 1 + lblSelect.Visible = False + lblCtrl.Visible = False + Call PayLoad + Call cmdTotal_Click + cmdAddLot.SetFocus + + +End Sub + +Private Sub FormSavePS() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTIME" 'WHERE idnum = 1" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + moRSTIME.AddNew + End If + strSQL = "SELECT * FROM tblLOTINFO WHERE LOT_ID = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not moRS.EOF Then + mstrTexture = Field2Str(moRS!texture) + + End If + ' Store the controls to the recordset +' If Not moRS.EOF Then + Call FieldsSavePS +' End If + +' moRSMemo!payroll = Str2Field(txtLotNotes) +' moRSMemo.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub + +Private Sub FieldsSavePS() +Dim lngTIMEID As Long, strID As String, strWT As String, strDESC As String, strCrewType As String + + Call GetPS +' On Error GoTo Error_EH + With moRSTIME + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !lot_no = Str2Field(moRS!lot_no) + !paydt = Date + lstPaySheets.col = 2 + !pay_type = Str2Field(lstPaySheets.ColText) + strCrewType = Str2Field(lstPaySheets.ColText) +' cboWorkType.col = 0 +' strID = cboWorkType.ColText + lstPaySheets.col = 3 + strWT = lstPaySheets.ColText +' cboWorkType.col = 2 +' strDESC = cboWorkType.ColText +' !workdone = Left(Str2Field(cboWorkType.Text), 1) + !WorkDone = strWT + !C_USER = gstrLOGIN + !pct_done = 100 +' !pct_done = Integer2Field(txtPercentDone) + !pay_id = gintPAYID + lstPaySheets.col = 1 + !proj_lot = Field2Str(lstPaySheets.ColText) ') & " " & Trim(Field2Str(moRS!lot_no)) +' !proj_lot = Trim(Field2Str(moRSProj!Proj_Code)) & " " & Trim(Field2Str(moRS!lot_no)) + !yd_rate = Field2Str(moRSSPS!Y_Rate) +' !yd_rate = Double2Field(txtYRate) + If strCrewType = "S" And (mstrTexture = "DF" Or mstrTexture = "SS" Or mstrTexture = "RF" Or mstrTexture = "M2" Or mstrTexture = "M3" Or mstrTexture = "MF") Then + !fin2_Rate = Field2Str(moRSSPS!Y_Rate) +' !fin2_Rate = Field2Str(moRSSPS!m_Rate) + ElseIf strCrewType = "L" Then + !mtl_Rate = Field2Str(moRSSPS!M_Rate) + End If +' !bc = vbUnchecked + !ponum = 0 + !scafid = 0 + !up = vbUnchecked + !frames = 0 + !crew = Integer2Field(txtCrewId) + !notes = Field2Str(moRSSPS!notes) + !StrtTM = 0 + !Lunch = ".00" + !EndTM = 0 + !NetTime = "0.00" + !WorkDay = 0 + !pay_amt = Field2Str2(moRSSPS!GROSSPAY) +' !pay_amt = Str2Field(txtAmount) +' !notes = Str2Field(txtMDesc) +'' If chkBC Then +'' !bc = vbChecked +'' !pay_amt = (Double2Field(txtAmount) * -1) +' !pay_amt = (Integer2Field(txtAmount) * -1) +'' Else +'' !bc = vbUnchecked +'' !pay_amt = (Double2Field(txtAmount)) +' !pay_amt = (Integer2Field(txtAmount)) +'' End If + +' !office = Str2Field(txtNotes) + + !C_USER = gstrLOGIN + !Create = Date + !U_USER = gstrLOGIN + !Update = Date + End With + moRSTIME.Update + + lngTIMEID = FindMax("tblTIME", "IDNUM") + +'' With moRSPay +' !pdamt = Field2Str2(txtPayAmt) +'' !Amt = Field2Str2(txtAmount) +'' !GROSSPAY = Field2Str2(txtAmount) +'' !paid = vbChecked +'' !Y_Rate = Field2Str2(txtYRate) +'' !m_Rate = Field2Str2(txtMetal) +'' !crewID = Field2Str2(txtCrewID) + moRSSPS!timeid = lngTIMEID +'' End With + moRSSPS.Update + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormScaffold - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtGross_GotFocus() + mdblGROSS = Field2Str2(txtGross) + Call FieldSelect(txtGross) +End Sub + +Private Sub txtGross_LostFocus() + If Not IsNumeric(txtGross) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtGross = 0 + txtGross.SetFocus + Exit Sub + End If + If Field2Str2(txtGross) <> mdblGROSS Then + cmdSavePay.Enabled = True + End If + If Not moRSCREW!tiebreak Then + Call CalcPay + Call cmdTotal_Click + End If +End Sub + +Private Sub txtHours_GotFocus() + '********** Remove comment sign after moved to keeping track of time +' If Field2Str2(txtHours) = 0 And gbool2WK Then +' txtHours = 80 +' ElseIf Field2Str2(txtHours) = 0 And gbool1WK Then +' txtHours = 40 +' End If + If Field2Str2(txtHours) = 0 Then + txtHours = 40 + End If + mdblHours = Field2Str2(txtHours) + Call FieldSelect(txtHours) +End Sub + +Private Sub txtHours_LostFocus() + If Not IsNumeric(txtHours) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtHours = 0 + txtHours.SetFocus + Exit Sub + End If + If Field2Str2(txtHours) <> mdblHours Then + cmdSavePay.Enabled = True + End If +End Sub + +Private Sub txtHRate_GotFocus() + mdblRate = Field2Str2(txtHRate) + Call FieldSelect(txtHRate) +End Sub + +Private Sub txtHRate_LostFocus() + If txtHRate = "" Then + txtHRate = 0 + End If + If Not IsNumeric(txtHRate) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtHRate = 0 + txtHRate.SetFocus + Exit Sub + End If + If Field2Str2(txtHRate) <> mdblRate Then + cmdSavePay.Enabled = True + End If +End Sub + +Private Sub CalcPay() + If Field2Str2(txtGross) > 0 Then + If Field2Str2(txtHours = 0) Then + txtHours = 40 + mdblHours = Field2Str2(txtHours) + cmdSavePay.Enabled = True + End If + If Field2Str2(txtHRate) = 0 Then + txtHRate = Format((Field2Str2(txtGross) / Field2Str2(txtHours)), "##.00##") + mdblRate = Field2Str2(txtHRate) + cmdSavePay.Enabled = True + End If + If Field2Str2(txtHRate) < gsngWAGE Then + MsgBox "The Hourly Rate is below $" & Format(gsngWAGE, "###.00") & ", Change the Hours Worked To Correct This", vbOKOnly, "Hourly Rate Problem" + txtHRate = 0 + txtHours.SetFocus + End If +' Exit Sub + End If + If Field2Str2(txtHours) > 0 And Field2Str2(txtHRate) > 0 Then + If mdblHours <> Field2Str2(txtHours) Or mdblRate <> Field2Str2(txtHRate) Then + txtGross = Format((Field2Str2(txtHours) * Field2Str2(txtHRate)), "##,###.00") + cmdSavePay.Enabled = True + End If + If Field2Str2(txtGross) = 0 Then + txtGross = Format((Field2Str2(txtHours) * Field2Str2(txtHRate)), "##,###.00") + cmdSavePay.Enabled = True + End If +' Exit Sub + End If + If Field2Str2(txtOTHrs) > 0 And Field2Str2(txtOTRate) > 0 Then + If mdblOTHours <> Field2Str2(txtOTHrs) Or mdblOTRate <> Field2Str2(txtOTRate) Then + txtOTAmt = Format((Field2Str2(txtOTHrs) * Field2Str2(txtOTRate)), "##,###.00") + cmdSavePay.Enabled = True + ElseIf Field2Str2(txtOTAmt) = 0 Then + txtOTAmt = Format((Field2Str2(txtOTHrs) * Field2Str2(txtOTRate)), "##,###.00") + cmdSavePay.Enabled = True + End If +' Exit Sub + End If + If Field2Str2(txtGross) > 0 Or Field2Str2(txtOTAmt) > 0 Then + txtTTLAmt = CDbl(Field2Str2(txtGross)) + CDbl(Field2Str2(txtOTAmt)) + txtTTLAmt = Format(txtTTLAmt, "#,#,#.00") + End If +End Sub + +Private Sub txtOTAmt_GotFocus() + mdblOTGROSS = Field2Str2(txtOTAmt) + Call FieldSelect(txtOTAmt) +End Sub + +Private Sub txtOTAmt_LostFocus() + If Not IsNumeric(txtOTAmt) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtOTAmt = 0 + txtOTAmt.SetFocus + Exit Sub + End If + If Field2Str2(txtOTAmt) <> mdblOTGROSS Then + cmdSavePay.Enabled = True + End If + Call CalcPay + Call cmdTotal_Click +End Sub + +Private Sub txtOTHrs_GotFocus() + txtOTHrs = Field2Str2(txtOTHrs) + mdblOTHours = Field2Str2(txtOTHrs) + Call FieldSelect(txtOTHrs) + +End Sub + +Private Sub txtOTHrs_LostFocus() + If Not IsNumeric(txtOTHrs) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtOTHrs = 0 + txtOTHrs.SetFocus + Exit Sub + End If + If Field2Str2(txtOTHrs) <> mdblOTHours Then + cmdSavePay.Enabled = True + End If + +End Sub + +Private Sub txtOTRate_GotFocus() + mdblOTRate = Field2Str2(txtOTRate) + Call FieldSelect(txtOTRate) + +End Sub + +Private Sub txtOTRate_LostFocus() + If txtOTRate = "" Then + txtOTRate = 0 + End If + If Not IsNumeric(txtOTRate) Then +' Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtOTRate = 0 + txtOTRate.SetFocus + Exit Sub + End If + If Field2Str2(txtOTRate) <> mdblOTRate Then + cmdSavePay.Enabled = True + End If + +End Sub + +Private Sub txtTTLAmt_GotFocus() + Call FieldSelect(txtTTLAmt) +End Sub + +Private Sub txtTTLHrs_GotFocus() + Call FieldSelect(txtTTLHrs) +End Sub + +Private Sub CalcWages() + If Field2Str2(txtTTLHrs) <= 40 Then + lblCalcHrs = Field2Str2(txtTTLHrs) + txtHours = txtTTLHrs + txtHRate = Field2Str2(txtTTLPay) / Field2Str2(lblCalcHrs) + txtHRate = Format(Round(Field2Str2(txtHRate), 4), "#,0.00##") + ElseIf Field2Str2(txtTTLHrs) > 40 Then + lblCalcHrs = (((Field2Str2(txtTTLHrs) - 40) * 1.5) + 40) + txtHours = 40 + txtOTHrs = Field2Str2(txtTTLHrs) - 40 + txtHRate = Field2Str2(txtTTLPay) / Field2Str2(lblCalcHrs) + txtOTRate = Field2Str2(txtHRate) * 1.5 + txtHRate = Format(Round(Field2Str2(txtHRate), 4), "#,0.00##") + txtOTRate = Format(Round(Field2Str2(txtOTRate), 4), "#,0.00##") + End If + +End Sub + +Private Sub txtTTLPay_GotFocus() + Call FieldSelect(txtTTLPay) +End Sub + +Private Sub txtTTLPay_LostFocus() + txtTTLPay = Format(txtTTLPay, "#,##0.00") +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frx new file mode 100644 index 0000000..fe54480 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frm new file mode 100644 index 0000000..01a340f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frm @@ -0,0 +1,1782 @@ +VERSION 5.00 +Begin VB.Form frmPayHead2 + Caption = "Payroll Summary Information" + ClientHeight = 5355 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5355 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtPaint + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 11025 + TabIndex = 60 + Top = 420 + Width = 690 + End + Begin VB.CheckBox chkBiWeekly + BackColor = &H00C0FFFF& + Caption = "BiWeekly PR" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 285 + Left = 1935 + TabIndex = 58 + Top = 840 + Visible = 0 'False + Width = 1575 + End + Begin VB.CommandButton cmdDetail + Caption = "House Pay Details" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 855 + Left = 6840 + TabIndex = 57 + Top = 1740 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9240 + TabIndex = 53 + TabStop = 0 'False + Top = 420 + Width = 690 + End + Begin VB.CommandButton cmdLook + Caption = "Look" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 855 + Left = 4140 + Picture = "frmPayHead2.frx":0000 + Style = 1 'Graphical + TabIndex = 51 + Top = 1740 + Visible = 0 'False + Width = 915 + End + Begin VB.CheckBox chkReady + Caption = "Ready to Process" + Height = 255 + Left = 3840 + TabIndex = 40 + Top = 3720 + Width = 1995 + End + Begin VB.CheckBox chkDeduct + Caption = "Deductions" + Height = 255 + Left = 10680 + TabIndex = 37 + TabStop = 0 'False + Top = 4800 + Width = 1155 + End + Begin VB.CommandButton cmdDivide + Caption = "Divide Equally" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5400 + TabIndex = 36 + TabStop = 0 'False + Top = 4080 + Width = 1155 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Emp. Pay" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5400 + TabIndex = 14 + Top = 4740 + Width = 1155 + End + Begin VB.CommandButton cmdTotal + Caption = "Update &Totals" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6960 + TabIndex = 25 + TabStop = 0 'False + Top = 4740 + Width = 1155 + End + Begin VB.CommandButton cmdGetCrew + Caption = "Get &Crew List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6960 + TabIndex = 24 + TabStop = 0 'False + Top = 4080 + Width = 1155 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3840 + TabIndex = 23 + TabStop = 0 'False + Top = 4740 + Width = 1155 + End + Begin VB.CommandButton cmdAddLot + Caption = "Add &House/PO" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3840 + TabIndex = 15 + TabStop = 0 'False + Top = 4080 + Width = 1155 + End + Begin VB.TextBox txtGross + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 13 + Top = 4740 + Width = 1275 + End + Begin VB.TextBox txtHRate + Alignment = 1 'Right Justify + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 12 + Top = 4440 + Width = 1275 + End + Begin VB.TextBox txtHours + Alignment = 1 'Right Justify + Height = 315 + Left = 9300 + MaxLength = 10 + TabIndex = 11 + Top = 4140 + Width = 1275 + End + Begin VB.ListBox lstCrew + Height = 2400 + Left = 8220 + TabIndex = 10 + Top = 1200 + Width = 3615 + End + Begin VB.ListBox lstHouses + Height = 2400 + Left = 60 + Sorted = -1 'True + TabIndex = 9 + Top = 1200 + Width = 3615 + End + Begin VB.TextBox txtPayDate + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 1200 + TabIndex = 8 + TabStop = 0 'False + Top = 60 + Width = 1275 + End + Begin VB.TextBox txtSumCrew + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9600 + TabIndex = 2 + TabStop = 0 'False + Top = 60 + Width = 975 + End + Begin VB.TextBox txtSumHouse + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7500 + TabIndex = 1 + TabStop = 0 'False + Top = 60 + Width = 975 + End + Begin VB.TextBox txtCrewID + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 3180 + TabIndex = 0 + TabStop = 0 'False + Top = 60 + Width = 615 + End + Begin VB.ListBox lstLots + Height = 2400 + Left = 3780 + Sorted = -1 'True + TabIndex = 26 + TabStop = 0 'False + Top = 1200 + Visible = 0 'False + Width = 4335 + End + Begin VB.Label lblPaint + AutoSize = -1 'True + Caption = "Paint SqFt:" + Height = 195 + Left = 10110 + TabIndex = 59 + Top = 480 + Width = 780 + End + Begin VB.Label lblFrameCnt + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1740 + TabIndex = 56 + Top = 5040 + Width = 675 + End + Begin VB.Label lblFrames + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames:" + Height = 195 + Left = 1125 + TabIndex = 55 + Top = 5040 + Width = 555 + End + Begin VB.Label lblWCCode + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 10635 + TabIndex = 54 + Top = 4140 + Width = 1185 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 8355 + TabIndex = 52 + Top = 480 + Width = 840 + End + Begin VB.Label lblMRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 6705 + TabIndex = 50 + Top = 480 + Width = 825 + End + Begin VB.Label lblDMRate + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7605 + TabIndex = 49 + Top = 420 + Width = 690 + End + Begin VB.Label lblDRate2 + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5925 + TabIndex = 48 + Top = 420 + Width = 690 + End + Begin VB.Label lblDRate + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5220 + TabIndex = 47 + Top = 420 + Width = 690 + End + Begin VB.Label lblRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Rates:" + Height = 195 + Left = 4320 + TabIndex = 46 + Top = 480 + Width = 780 + End + Begin VB.Label lblDMetal + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3180 + TabIndex = 45 + Top = 420 + Width = 1035 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal:" + Height = 195 + Left = 2670 + TabIndex = 44 + Top = 480 + Width = 435 + End + Begin VB.Label lblDFin2 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1680 + TabIndex = 43 + Top = 420 + Width = 795 + End + Begin VB.Label lblDYds + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 600 + TabIndex = 42 + Top = 420 + Width = 1035 + End + Begin VB.Label lblYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yds:" + Height = 195 + Left = 240 + TabIndex = 41 + Top = 480 + Width = 315 + End + Begin VB.Label lblSelect + Alignment = 2 'Center + Caption = "CTRL-S to Select Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00000000& + Height = 195 + Left = 6240 + TabIndex = 39 + Top = 3720 + Visible = 0 'False + Width = 1935 + End + Begin VB.Label lblTerm + Caption = "TERMINATED" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 10590 + TabIndex = 38 + Top = 3615 + Visible = 0 'False + Width = 1215 + End + Begin VB.Label lblBalance + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3780 + TabIndex = 35 + Top = 840 + Width = 4335 + End + Begin VB.Label lblDelete + Caption = "CTRL R to Delete Crews CTRL H to Delete Houses" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4800 + TabIndex = 34 + Top = 3240 + Width = 2295 + End + Begin VB.Label lblDifference + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00000000& + Height = 315 + Left = 10680 + TabIndex = 33 + Top = 60 + Width = 1155 + End + Begin VB.Label lblBC + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 2700 + TabIndex = 32 + Top = 3840 + Width = 915 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Amount:" + Height = 195 + Left = 780 + TabIndex = 31 + Top = 4680 + Width = 900 + End + Begin VB.Label lblType + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 960 + TabIndex = 30 + Top = 3780 + Width = 1695 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 120 + TabIndex = 29 + Top = 3840 + Width = 810 + End + Begin VB.Label lblPay + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1740 + TabIndex = 28 + Top = 4680 + Width = 1875 + End + Begin VB.Label lblAddress + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 0 + TabIndex = 27 + Top = 4200 + Width = 3615 + End + Begin VB.Label lblGross + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Amount:" + Height = 195 + Left = 8295 + TabIndex = 22 + Top = 4860 + Width = 900 + End + Begin VB.Label lblHRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Hourly Rate:" + Height = 195 + Left = 8310 + TabIndex = 21 + Top = 4560 + Width = 885 + End + Begin VB.Label lblHours + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Hours:" + Height = 195 + Left = 8400 + TabIndex = 20 + Top = 4260 + Width = 795 + End + Begin VB.Label lblEmpName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9300 + TabIndex = 19 + Top = 3780 + Width = 2535 + End + Begin VB.Label lblEmpId + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8220 + TabIndex = 18 + Top = 3780 + Width = 1035 + End + Begin VB.Label lblCrewMember + AutoSize = -1 'True + Caption = "Crew Workers" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8280 + TabIndex = 17 + Top = 900 + Width = 1200 + End + Begin VB.Label lblHouse + AutoSize = -1 'True + Caption = "Houses && POs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 16 + Top = 900 + Width = 1215 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 0 + X2 = 11880 + Y1 = 780 + Y2 = 780 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 225 + TabIndex = 7 + Top = 120 + Width = 900 + End + Begin VB.Label lblCrewName + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3840 + TabIndex = 6 + Top = 60 + Width = 2595 + End + Begin VB.Label lblSumCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Workers Sum:" + Height = 195 + Left = 8520 + TabIndex = 5 + Top = 120 + Width = 1005 + End + Begin VB.Label lblSumHouse + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Houses Sum:" + Height = 195 + Left = 6480 + TabIndex = 4 + Top = 120 + Width = 945 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 2700 + TabIndex = 3 + Top = 120 + Width = 405 + End +End +Attribute VB_Name = "frmPayHead2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolDelete As Boolean +Dim moRSPay As Recordset +Dim moRSCREW As Recordset +Dim moRSHEAD As Recordset +Dim mdblHours As Double, mdblRate As Double, mdblGROSS As Double +Dim mbytCOUNT As Byte +Dim mstrWTYPE As String, mstrWDone As String + +Private Sub cmdAddLot_Click() +Dim strProj As String, strSQL As String, intPROJ As Integer +Dim strLine As String +Dim oRS As Recordset, oRSS As Recordset + + strProj = InputBox("Enter the Project Code 'JPAR' for the Lot Your Want To Add", "Enter Project Code") + If Len(strProj) > 0 Then + strProj = UCase(strProj) + strSQL = "SELECT proj_id FROM tblProject WHERE proj_code = '" & Field2Str(strProj) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "No Project Was Found For The Project Code You Entered. Determine The Correct Code And Re-Enter", vbOKOnly, "No Project Found" + Exit Sub + Else + gintPROJID = Field2Long(oRS!proj_id) +' gintPROJID = Field2Integer(oRS!proj_id) + strSQL = "SELECT Lot_No, Lot_id, Address FROM tblLotInfo where proj_id = " & gintPROJID + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lstLots.Clear + lstLots.Visible = True + Do Until oRSS.EOF + With lstLots + strLine = Field2Str(oRSS!lot_no) & vbTab & Field2Str(oRSS!address) + .AddItem strLine + .ItemData(.NewIndex) = oRSS!Lot_id + End With + + oRSS.MoveNext + Loop + If lstLots.ListCount Then + lblSelect.Visible = True + lstLots.ListIndex = 0 + End If +' cmdAddLot.SetFocus + lstLots.SetFocus + End If + Else + MsgBox "You Must Enter A Project Code", vbOKOnly, "No Project Code" + cmdAddLot.SetFocus + Exit Sub + End If + +End Sub + +Private Sub cmdDetail_Click() + Call ViewPayInfo +End Sub + +Private Sub cmdDivide_Click() +Dim dblPay As Double, intCount As Integer, intZERO As Integer +Dim strSQL As String, strMSG As String, strSELECT As String +Dim oRS As Recordset + + On Error GoTo Error_EH + If mbytCOUNT = 0 Then + strMSG = "There Are No Crew Workers Shown, This Will Cause An Error" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Exit Payroll and Add The Workers For This Crew!" + MsgBox strMSG, vbOKOnly, "Enter Crew Members" + Exit Sub + End If + + strSELECT = "SELECT COUNT(pay_id) as cntPAY FROM tblPAYCREW WHERE gross = 0 and pay_id = " & gintPAYID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + intZERO = Field2Integer(oRS!cntpay) + +' dblPay = Round((Field2Str2(txtSumHouse) / mbytCOUNT), 2) + dblPay = Round((Field2Str2(lblDifference.Caption) / intZERO), 2) + + intCount = 1 + Do Until intCount > mbytCOUNT + lstCrew.ListIndex = intCount - 1 + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPayCrew " + strSQL = strSQL & "WHERE pc_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + If Field2Str2(moRSCREW!gross) = 0 Then + If Field2Str2(dblPay) < 120 Then + moRSCREW!hours = 10 + ElseIf Field2Str2(dblPay) < 240 Then + moRSCREW!hours = 20 + ElseIf Field2Str2(dblPay) < 360 Then + moRSCREW!hours = 40 + ElseIf Field2Str2(dblPay) < 480 Then + moRSCREW!hours = 60 + Else + moRSCREW!hours = 80 + End If + moRSCREW!gross = Field2Str2(dblPay) + moRSCREW!Rate = Format((Field2Str2(moRSCREW!gross) / Field2Str2(moRSCREW!hours)), "#0.00#") + moRSCREW.Update + End If + intCount = intCount + 1 + Loop + Call CrewLoad + Call cmdTotal_Click + Exit Sub +Error_EH: + gstrMODULE = "Form PayHead - Module cmdDivide_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdGetCrew_Click() + Call GetCrew +End Sub + +Private Sub cmdSavePay_Click() + Call CrewSave + cmdSavePay.Enabled = False + Call cmdTotal_Click + lstCrew.SetFocus +End Sub + +Private Sub cmdTotal_Click() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT sum(pay_amt) as SumHouse FROM tblTime where pay_id = " & gintPAYID & " and crew = " & gintCREWID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + txtSumHouse = Format(Field2Str2(oRS!SumHouse), "##,###.00") + End If + + strSQL = "SELECT sum(gross) as SumWorker FROM tblpaycrew where pay_id = " & gintPAYID & " and crew_id = " & gintCREWID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + txtSumCrew = Format(Field2Str2(oRS!SumWorker), "##,###.00") + End If + + lblDifference.Caption = Format(Field2Str2(txtSumHouse) - Field2Str2(txtSumCrew), "##,##0.00;(##,##0.00)") + If Field2Str2(lblDifference.Caption) < 0 Then + lblDifference.ForeColor = &HFF& + lblBalance.Caption = "Crew Greater Than Houses" + ElseIf Field2Str2(lblDifference.Caption) > 0 Then + lblDifference.ForeColor = &H0& + lblBalance.Caption = "Houses Greater Than Crew" + Else + lblDifference.ForeColor = &H0& + lblBalance.Caption = "Payroll is Balanced" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module cmdTotal_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdLook_Click() + Load frmPayroll + frmPayroll.chkLook = vbChecked + cmdLook.Visible = False + cmdDetail.Visible = False + frmPayroll.Show 1 +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + mboolDelete = False + + If chkBiWeekly = True Then + chkBiWeekly.Visible = True + Else + chkBiWeekly.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyH Then ' Display key combinations. + If CtrlDown Then + Call HouseDelete + Call PayLoad + Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyR Then ' Display key combinations. + If CtrlDown Then + Call CrewDelete + Call CrewLoad + Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstLots_DblClick + End If + Exit Sub + End If + If KeyCode = vbKeyF Then ' Display key combinations. + If CtrlDown Then + Call ViewPayInfo +' Call HouseDelete +' Call PayLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + +End Sub + +Private Sub ViewPayInfo() + Load frmPayInput + frmPayInput.chkLook = vbChecked + cmdLook.Visible = False + cmdDetail.Visible = False + frmPayInput.Show 1 + +End Sub + +Private Sub CrewDelete() +Dim strSQL As String + + strSQL = "DELETE * FROM tblPayCrew where Pc_id = " & lstCrew.ItemData(lstCrew.ListIndex) + goConn.Execute strSQL + +End Sub + +Private Sub HouseDelete() +Dim strSQL As String + Call CheckScaf + mboolDelete = True + Call PaySheetUpdate + strSQL = "DELETE * FROM tblTime where idnum = " & lstHouses.ItemData(lstHouses.ListIndex) + goConn.Execute strSQL + mboolDelete = False +End Sub + +Private Sub PaySheetUpdate() +Dim strSQL As String +Dim oRS As Recordset + + strSQL = "SELECT * FROM tblPaySheet WHERE timeid = " & lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + oRS!crewid = 0 + oRS!paid = vbUnchecked + oRS!Amt = 0 + oRS!y_rate = 0 + oRS!m_Rate = 0 + oRS.Update + oRS.Close + End If +End Sub + +Private Sub CheckScaf() +Dim strSQL As String, oRS As Recordset +Dim strSQLL As String, oRSS As Recordset + + strSQL = "SELECT * FROM tblTIME WHERE idnum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + If oRS!scafid Then + strSQLL = "SELECT * FROM tblSCAFFOLD WHERE scaf_id = " & Field2Long(oRS!scafid) + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + oRSS!paid = vbUnchecked + oRSS!pdamt = 0 +' oRSS!prcrew = 0 + oRSS.Update + oRSS.Close + End If + End If + End If + If oRS.State = adStateOpen Then + oRS.Close + End If +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call GetHeader + Call PayLoad + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + Call FormShowCrew + End If + End If + Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindPay() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTIME " + strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + + Set moRSPay = New Recordset + + moRSPay.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + FormFindPay = False + Else + FormFindPay = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PayHead - Module FormFindPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPayCrew " + strSQL = strSQL & "WHERE Pc_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PayHead - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowPay() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSC As Recordset + + On Error GoTo Error_EH + + With moRSPay + strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = " & Field2Str(!Lot_id) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + lblAddress.Caption = Field2Str(oRS!address) + If !pay_type = "S" Then + lblDYds.Caption = Field2Str(oRS!s_yds) + lblDMetal.Caption = "" + lblDFin2.Caption = Field2Str2(oRS!fin2) + ElseIf !pay_type = "L" Then + lblDYds.Caption = Field2Str(oRS!l_yds) + lblDMetal.Caption = Field2Str2(oRS!METAL) + lblDFin2.Caption = "" + ElseIf !pay_type = "V" Then + txtStone = Field2Str(oRS!ST_SQFT) + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + ElseIf !pay_type = "C" Then +' strSQL2 = "SELECT * FROM tblScaffold WHERE Lot_id = " & Field2Str(!Lot_id) +' Set oRSC = New Recordset +' oRSC.Open strSQL2, goConn, adOpenForwardOnly, adLockReadOnly +' Call GetScaffold +' txtStone = Field2Str(oRSC!st_sqft) +' If oRSC!up Then + lblYds = "Frames:" + lblDYds.Caption = Field2Str2(oRS!Scaf6) + lblDMetal.Caption = "" +' End If + lblDFin2.Caption = Field2Str2(oRS!scaf10) + lblFrames.Visible = True + lblFrameCnt.Visible = True + ElseIf !pay_type = "X" Then + txtPaint = Field2Str(oRS!PNT_SQFT) + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + Else + lblDYds.Caption = "" + lblDMetal.Caption = "" + lblDFin2.Caption = "" + End If + End If + If Field2Str(!pay_type) = "S" Then + lblType.Caption = "STUCCO" + ElseIf Field2Str(!pay_type) = "L" Then + lblType.Caption = "LATH" + ElseIf Field2Str(!pay_type) = "V" Then + lblType.Caption = "V_STONE" + ElseIf Field2Str(!pay_type) = "R" Then + lblType.Caption = "REPAIR/PO" + ElseIf Field2Str(!pay_type) = "C" Then + lblType.Caption = "SCAFFOLD" + ElseIf Field2Str(!pay_type) = "X" Then + lblType.Caption = "PAINT" + End If + If !bc Then + lblBC.Caption = "Back Chg" + ElseIf Field2Str(!workdone) = "W" Then + lblBC.Caption = "PO Work" + ElseIf Field2Str(!workdone) = "F" Then + lblBC.Caption = "Fence" + ElseIf Field2Str(!workdone) = "U" Then + lblBC.Caption = "CMU" + Else + lblBC.Caption = "" + End If + lblPay.Caption = Format(Field2Str2(!pay_amt), "##,##0.00;(##,##0.00)") + lblDRate.Caption = Field2Str2(!yd_rate) + lblDRate2.Caption = Field2Str2(!fin2_Rate) + lblDMRate.Caption = Field2Str2(!mtl_Rate) + lblFrameCnt = Field2Str2(!frames) + + + End With + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module FormShowPay" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowCrew() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + lblEmpId.Caption = Field2Str(!emp_id) + lblEmpName.Caption = Field2Str(!empname) + lblWCCode = Field2Str(!wc_code) + strSql2 = "SELECT * FROM PR1_EmployeeMaster WHERE EmployeeNumber = '" & Field2Str2(!emp_id) & "'" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + If oRSS!employeestatus_AIT <> "A" Then + lblTerm.Visible = True + Else + lblTerm.Visible = False + End If + txtHRate = Format(Field2Str2(!Rate), "#0.00#") + txtHours = Format(Field2Str2(!hours), "#0.0#") + txtGross = Format(Field2Str2(!gross), "##,##0.00") + If Field2Str(!autodeduct) = "Y" Then + chkDeduct = vbChecked + Else + chkDeduct = vbUnchecked + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetCrew() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strCREW As String + On Error GoTo Error_EH + strCREW = "SELECT * FROM tblPayCrew WHERE pc_id = 1" + Set oRSS = New Recordset + oRSS.Open strCREW, goConn, adOpenForwardOnly, adLockOptimistic + + strSQL = "SELECT * FROM tblCrewList WHERE crew_id = " & Str2Field(txtCrewID) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If oRS.EOF Then + MsgBox "No Workers Were Found For The Highlited Crew. Exit and Enter the Workers", vbOKOnly, "Workers Not Dound" + Exit Sub + End If + Do Until oRS.EOF + oRSS.AddNew + oRSS!pay_id = gintPAYID + oRSS!crew_id = Field2Str(oRS!crew_id) + oRSS!emp_id = Field2Str(oRS!emp_id) + oRSS!empname = Field2Str(oRS!empname) + oRSS!Pay_Date = Field2Str(txtPayDate) + oRSS!wc_code = Field2Str(oRS!wc_code) + oRSS.Update + oRS.MoveNext + Loop + Call CrewLoad + Exit Sub +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Crew Member - This Member will not be saved", , "Duplicate Record" + Resume Next +' Exit Sub + End If + gstrMODULE = "Form PayHead - Module GetCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetHeader() +Dim strSQL As String + On Error GoTo Error_EH + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = " & gintPAYID + Set moRSHEAD = New Recordset + moRSHEAD.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + chkReady = Field2CheckBox(moRSHEAD!P_FLAG) +' chkReady = moRSHEAD!p_flag + + Exit Sub +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Crew List - This will not be saved", , "Duplicate Record" + Exit Sub + End If + gstrMODULE = "Form PayHead - Module CrewSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewSave() + On Error GoTo Error_EH + + If moRSCREW.State = adStateClosed Then + Exit Sub + End If + + With moRSCREW + !Rate = Str2Field(txtHRate.Text) + !hours = Str2Field(txtHours.Text) + !gross = Str2Field(txtGross.Text) + If chkDeduct Then + !autodeduct = "Y" + Else + !autodeduct = "N" + End If + End With + moRSCREW.Update + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module CrewSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub GetWorkType() +Dim strSQL As String, oRSW As Recordset + + strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" + Set oRSW = New Recordset + oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSW.EOF Then + mstrWTYPE = Field2Str(oRSW!worktype) + End If + + oRSW.Close +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strLOT As String +Dim strLine As String, strWORK As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblTime WHERE Pay_id = " & gintPAYID + + Set moRSPay = New Recordset + + moRSPay.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHouses.Clear + + Do Until moRSPay.EOF + With lstHouses + mstrWDone = Field2Str(moRSPay!workdone) + Call GetWorkType + strWORK = mstrWTYPE + + If moRSPay!bc Then + strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "BACK CHARGE" + Else + strLOT = Field2Str(moRSPay!proj_lot) & vbTab & strWORK + End If + +' ElseIf Field2Str(moRSPay!workdone) = "W" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "PO WORK" +' ElseIf Field2Str(moRSPay!workdone) = "U" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "CMU" +' ElseIf Field2Str(moRSPay!workdone) = "A" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "TYPAR WRAP" +' ElseIf Field2Str(moRSPay!workdone) = "C" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "COMPLETE" +' ElseIf Field2Str(moRSPay!workdone) = "P" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "PARTIAL" +' ElseIf Field2Str(moRSPay!workdone) = "F" Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "FENCES" +' ElseIf Field2Str(moRSPay!workdone = "Y") Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "UP" +' ElseIf Field2Str(moRSPay!workdone = "Z") Then +' strLOT = Field2Str(moRSPay!proj_lot) & vbTab & "DOWN" +' Else +' strLOT = Field2Str(moRSPay!proj_lot) +' End If + .AddItem strLOT + .ItemData(.NewIndex) = Field2Long(moRSPay!idnum) + End With + + moRSPay.MoveNext + Loop +' moRSPay.Close + + If lstHouses.ListCount Then + lstHouses.ListIndex = 0 + Else + lstHouses.ListIndex = -1 + lblType.Caption = "" + lblAddress.Caption = "" + lblPay.Caption = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPaycrew WHERE Pay_id = " & gintPAYID + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + mbytCOUNT = 0 + Do Until moRSCREW.EOF + With lstCrew + strLine = Field2Str(moRSCREW!emp_id) & " " & Field2Str(moRSCREW!empname) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!pc_id + End With + mbytCOUNT = Field2Str2(mbytCOUNT) + 1 + moRSCREW.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + lblEmpId.Caption = "" + lblEmpName.Caption = "" + lblWCCode = "" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub SavePay() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblpayheader WHERE pay_id = " & gintPAYID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!sum_houses = Field2Str2(txtSumHouse) + oRS!sum_workers = Field2Str2(txtSumCrew) + oRS!P_FLAG = chkReady + oRS.Update + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + Call SavePay + If cmdSavePay.Enabled Then + + strMSG = "Employee Pay Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call CrewSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + If Field2Str2(lblDifference.Caption) <> 0 Then + strMSG = "The Payroll Is Not Balanced" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Are You Sure You Want To Exit ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNo, "PAYROLL UNBALANCED") + Select Case intResponse + Case vbYes + + Case vbNo + Cancel = True + Exit Sub + End Select + End If + + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + Call FormShowCrew + Else + lblEmpId.Caption = "" + lblEmpName.Caption = "" + lblWCCode = "" + txtHRate = "" + txtHours = "" + txtGross = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + +' frmCrewList.Show 1 +' Call CrewLoad + cmdSavePay.Enabled = True +End Sub + +Private Sub lstHouses_Click() + On Error GoTo Error_EH + + If lstHouses.ListIndex <> -1 Then + If FormFindPay() Then + Call FormShowPay + Else + lblType.Caption = "" + lblAddress.Caption = "" + lblPay.Caption = "" + lblDYds.Caption = "" + lblDFin2.Caption = "" + lblDMetal.Caption = "" + lblDRate.Caption = "" + lblDRate2.Caption = "" + lblDMRate.Caption = "" + txtStone = "" + txtPaint = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayHead - Module lstHouses_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstHouses_DblClick() + cmdDetail.Visible = True + cmdLook.Visible = True + gintPROJID = moRSPay!proj_id + gintLOTID = moRSPay!Lot_id +End Sub + +Private Sub lstLots_DblClick() +Dim strPAYID As String + strPAYID = gintPAYID + gintLOTID = lstLots.ItemData(lstLots.ListIndex) + lstLots.Visible = False + Load frmPayInput + frmPayInput.txtCrewNo = Field2Str(txtCrewID) + frmPayInput.txtCrewName = Field2Str(lblCrewName.Caption) + frmPayInput.chkAdd = vbChecked + frmPayInput.Show 1 + lblSelect.Visible = False + Call PayLoad + Call cmdTotal_Click + cmdAddLot.SetFocus +End Sub + +Private Sub txtGross_GotFocus() + mdblGROSS = Field2Str2(txtGross) + Call FieldSelect(txtGross) +End Sub + +Private Sub txtGross_LostFocus() + If Not IsNumeric(txtGross) Then + Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtGross = 0 + txtGross.SetFocus + Exit Sub + End If + If Field2Str2(txtGross) <> mdblGROSS Then + cmdSavePay.Enabled = True + End If + Call CalcPay + Call cmdTotal_Click +End Sub + +Private Sub txtHours_GotFocus() + If Field2Str2(txtHours) = 0 Then + txtHours = 80 + End If + mdblHours = Field2Str2(txtHours) + Call FieldSelect(txtHours) +End Sub + +Private Sub txtHours_LostFocus() + If Not IsNumeric(txtHours) Then + Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtHours = 0 + txtHours.SetFocus + Exit Sub + End If + If Field2Str2(txtHours) <> mdblHours Then + cmdSavePay.Enabled = True + End If +End Sub + +Private Sub txtHRate_GotFocus() + mdblRate = Field2Str2(txtHRate) + Call FieldSelect(txtHRate) +End Sub + +Private Sub txtHRate_LostFocus() + If Not IsNumeric(txtHRate) Then + Beep + MsgBox "Invalid Number - ReEnter", vbOKOnly, "Invalid" + txtHRate = 0 + txtHRate.SetFocus + Exit Sub + End If + If Field2Str2(txtHRate) <> mdblRate Then + cmdSavePay.Enabled = True + End If +End Sub + +Private Sub CalcPay() + If Field2Str2(txtGross) > 0 Then + If Field2Str2(txtHours = 0) Then + txtHours = 80 + mdblHours = Field2Str2(txtHours) + cmdSavePay.Enabled = True + End If + If Field2Str2(txtHRate) = 0 Then + txtHRate = Format((Field2Str2(txtGross) / Field2Str2(txtHours)), "##.00#") + mdblRate = Field2Str2(txtHRate) + cmdSavePay.Enabled = True + End If + If Field2Str2(txtHRate) < 10 Then + MsgBox "The Hourly Rate is below $10.00, Change the Hours Worked To Correct This", vbOKOnly, "Hourly Rate Problem" + txtHRate = 0 + txtHours.SetFocus + End If + Exit Sub + End If + If Field2Str2(txtHours) > 0 And Field2Str2(txtHRate) > 0 Then + If mdblHours <> Field2Str2(txtHours) Or mdblRate <> Field2Str2(txtHRate) Then + txtGross = Format((Field2Str2(txtHours) * Field2Str2(txtHRate)), "##,###.00") + cmdSavePay.Enabled = True + End If + Exit Sub + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frx new file mode 100644 index 0000000..2fdcc63 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayHead2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frm new file mode 100644 index 0000000..bee0402 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frm @@ -0,0 +1,2412 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayInput + Caption = "Lot Payroll information" + ClientHeight = 5025 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11910 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5025 + ScaleWidth = 11910 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkPS + Caption = "Use PS" + Height = 360 + Left = 75 + TabIndex = 78 + Top = 3135 + Visible = 0 'False + Width = 660 + End + Begin VB.TextBox txtEPO + Height = 285 + Left = 1170 + TabIndex = 21 + Top = 3870 + Width = 1155 + End + Begin VB.TextBox txtStartTime + Height = 285 + Left = 900 + TabIndex = 24 + Top = 4695 + Width = 700 + End + Begin VB.TextBox txtWrkDate + Height = 285 + Left = 7815 + TabIndex = 27 + Top = 4695 + Width = 1080 + End + Begin VB.TextBox txtLunch + Height = 285 + Left = 2835 + TabIndex = 25 + Top = 4695 + Width = 700 + End + Begin VB.TextBox txtEndTime + Height = 285 + Left = 4365 + TabIndex = 26 + Top = 4695 + Width = 700 + End + Begin VB.CheckBox chkAdd + Caption = "AddInfo" + Height = 270 + Left = 90 + TabIndex = 68 + Top = 2865 + Visible = 0 'False + Width = 900 + End + Begin VB.TextBox txtPaint + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5475 + TabIndex = 67 + Top = 735 + Width = 855 + End + Begin VB.CheckBox chkLook + Caption = "Lookup" + Height = 315 + Left = 5985 + TabIndex = 65 + Top = 4200 + Visible = 0 'False + Width = 975 + End + Begin VB.CommandButton cmdGetPaySheet + Caption = "Get Pay Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7800 + TabIndex = 64 + Top = 1200 + Width = 975 + End + Begin VB.CommandButton cmdScaffold + Caption = "Get Scaffold" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8820 + TabIndex = 63 + Top = 1200 + Width = 975 + End + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5475 + TabIndex = 57 + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLotNotes + Height = 795 + Left = 7380 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 54 + Top = 1980 + Width = 4395 + End + Begin VB.TextBox txtOffice + Height = 975 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 34 + Top = 3660 + Width = 4815 + End + Begin VB.TextBox txtFinish + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 765 + TabIndex = 52 + TabStop = 0 'False + Top = 420 + Width = 1995 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 3690 + TabIndex = 50 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtMetalRate + Alignment = 1 'Right Justify + Height = 285 + Left = 4785 + MaxLength = 7 + TabIndex = 29 + Top = 3495 + Width = 1155 + End + Begin VB.TextBox txtPONum + Alignment = 1 'Right Justify + Height = 285 + Left = 4785 + MaxLength = 7 + TabIndex = 32 + Top = 4395 + Width = 1155 + End + Begin VB.TextBox txtFin2Rate + Alignment = 1 'Right Justify + Height = 285 + Left = 4785 + MaxLength = 7 + TabIndex = 30 + Top = 3795 + Width = 1155 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Height = 285 + Left = 4785 + MaxLength = 7 + TabIndex = 28 + Top = 3195 + Width = 1155 + End + Begin VB.CheckBox chkBC + Caption = "Back Charge:" + Height = 315 + Left = 2340 + TabIndex = 22 + Top = 3855 + Width = 1455 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + BeginProperty DataFormat + Type = 1 + Format = "0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = 10920 + TabIndex = 40 + Top = 60 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 10860 + TabIndex = 38 + TabStop = 0 'False + Top = 1200 + Width = 975 + End + Begin VB.TextBox txtVerify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 2325 + TabIndex = 37 + TabStop = 0 'False + Top = 4155 + Width = 1095 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9840 + TabIndex = 35 + Top = 1200 + Width = 975 + End + Begin VB.TextBox txtNotes + Height = 795 + Left = 6960 + MaxLength = 255 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 33 + Top = 2820 + Width = 4815 + End + Begin VB.ComboBox cboCrewType + Enabled = 0 'False + Height = 315 + ItemData = "frmPayInput.frx":0000 + Left = 1635 + List = "frmPayInput.frx":001C + Style = 2 'Dropdown List + TabIndex = 19 + TabStop = 0 'False + Top = 3165 + Width = 1815 + End + Begin VB.TextBox txtPayAmt + Alignment = 1 'Right Justify + Height = 285 + Left = 4785 + MaxLength = 10 + TabIndex = 31 + Top = 4095 + Width = 1155 + End + Begin VB.TextBox txtCrewName + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 2445 + TabIndex = 18 + Top = 2835 + Width = 3495 + End + Begin VB.TextBox txtCrewNo + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 1620 + MaxLength = 4 + TabIndex = 36 + Top = 2820 + Width = 675 + End + Begin VB.TextBox txtPercentDone + Alignment = 1 'Right Justify + Height = 315 + Left = 1605 + MaxLength = 3 + TabIndex = 23 + Top = 4155 + Width = 675 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9300 + TabIndex = 17 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7380 + TabIndex = 16 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5700 + TabIndex = 15 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 4080 + TabIndex = 14 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtModel + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 2400 + TabIndex = 13 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtProjLot + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 600 + TabIndex = 12 + Top = 60 + Width = 1695 + End + Begin VB.ListBox lstPayInfo + Height = 1425 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + TabStop = 0 'False + Top = 1245 + Width = 7155 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1620 + TabIndex = 20 + Top = 3525 + Width = 2310 + _Version = 196608 + _ExtentX = 4075 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 5 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 10 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPayInput.frx":0067 + End + Begin VB.Label lblTimeID + Caption = "TimeID" + Height = 285 + Left = 6045 + TabIndex = 79 + Top = 3105 + Visible = 0 'False + Width = 885 + End + Begin VB.Label lblEPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EPO: " + Height = 195 + Left = 720 + TabIndex = 77 + Top = 3915 + Width = 420 + End + Begin VB.Label lblNoCalc + Alignment = 2 'Center + BackColor = &H00FFFF80& + Caption = "No Calc" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2805 + TabIndex = 76 + Top = 750 + Visible = 0 'False + Width = 1215 + End + Begin VB.Label lblCertPR + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "CERTIFIED PAYROLL" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 330 + Left = 765 + TabIndex = 75 + Top = 735 + Visible = 0 'False + Width = 1995 + End + Begin VB.Label lblStart + AutoSize = -1 'True + Caption = "Start Time:" + Height = 195 + Left = 90 + TabIndex = 74 + Top = 4740 + Width = 765 + End + Begin VB.Label lblNetTime + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 6150 + TabIndex = 73 + Top = 4695 + Width = 705 + End + Begin VB.Label lblWrkDate + AutoSize = -1 'True + Caption = "Work Date:" + Height = 195 + Left = 6930 + TabIndex = 72 + Top = 4740 + Width = 825 + End + Begin VB.Label lblPayTime + AutoSize = -1 'True + Caption = "Payable Time:" + Height = 195 + Left = 5115 + TabIndex = 71 + Top = 4740 + Width = 1005 + End + Begin VB.Label lblEnd + AutoSize = -1 'True + Caption = "End Time:" + Height = 195 + Left = 3615 + TabIndex = 70 + Top = 4740 + Width = 720 + End + Begin VB.Label lblLunch + AutoSize = -1 'True + Caption = "Lunch Length" + Height = 195 + Left = 1740 + TabIndex = 69 + Top = 4740 + Width = 990 + End + Begin VB.Label lblPaint + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint SqFt:" + Height = 195 + Left = 4650 + TabIndex = 66 + Top = 825 + Width = 780 + End + Begin VB.Label lblD108 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 10500 + TabIndex = 62 + Top = 720 + Width = 1035 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"" :" + Height = 195 + Left = 9960 + TabIndex = 61 + Top = 780 + Width = 465 + End + Begin VB.Label lblD68 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 8880 + TabIndex = 60 + Top = 720 + Width = 1035 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"" :" + Height = 195 + Left = 8460 + TabIndex = 59 + Top = 780 + Width = 375 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffolding Frames:" + Height = 195 + Left = 6960 + TabIndex = 58 + Top = 780 + Width = 1395 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 4590 + TabIndex = 56 + Top = 480 + Width = 840 + End + Begin VB.Label lblLotNotes + AutoSize = -1 'True + Caption = "Lot Notes:" + Height = 195 + Left = 7440 + TabIndex = 55 + Top = 1740 + Width = 735 + End + Begin VB.Label lblOffice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Office Notes:" + Height = 195 + Left = 6000 + TabIndex = 53 + Top = 3660 + Width = 930 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 120 + TabIndex = 51 + Top = 480 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yds:" + Height = 195 + Left = 2805 + TabIndex = 49 + Top = 480 + Width = 870 + End + Begin VB.Label lblStucco + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7860 + TabIndex = 48 + Top = 420 + Width = 1275 + End + Begin VB.Label lblBillLath + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 10500 + TabIndex = 47 + Top = 420 + Width = 1275 + End + Begin VB.Label lblStuccoBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Billing Date:" + Height = 195 + Left = 6420 + TabIndex = 46 + Top = 480 + Width = 1395 + End + Begin VB.Label lblLathBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Billing Date:" + Height = 195 + Left = 9240 + TabIndex = 45 + Top = 480 + Width = 1200 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O. Number:" + Height = 195 + Left = 3795 + TabIndex = 44 + Top = 4440 + Width = 960 + End + Begin VB.Label lblFin2Rate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Rate:" + Height = 195 + Left = 3780 + TabIndex = 43 + Top = 3840 + Width = 975 + End + Begin VB.Label lblMtlRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 3930 + TabIndex = 42 + Top = 3540 + Width = 825 + End + Begin VB.Label lblYDRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage Rate:" + Height = 195 + Left = 3720 + TabIndex = 41 + Top = 3270 + Width = 1035 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2:" + Height = 195 + Left = 10260 + TabIndex = 39 + Top = 120 + Width = 585 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 60 + X2 = 11880 + Y1 = 1140 + Y2 = 1140 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 8340 + TabIndex = 11 + Top = 120 + Width = 915 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 6600 + TabIndex = 10 + Top = 120 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 4980 + TabIndex = 9 + Top = 120 + Width = 615 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 3300 + TabIndex = 8 + Top = 120 + Width = 675 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot #:" + Height = 195 + Left = 120 + TabIndex = 7 + Top = 120 + Width = 420 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PR Notes:" + Height = 195 + Left = 6195 + TabIndex = 6 + Top = 2820 + Width = 735 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Amt:" + Height = 195 + Left = 3990 + TabIndex = 5 + Top = 4140 + Width = 765 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 1125 + TabIndex = 4 + Top = 2880 + Width = 405 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage Done:" + Height = 195 + Left = 210 + TabIndex = 3 + Top = 4215 + Width = 1305 + End + Begin VB.Label lblWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Type of Work Done:" + Height = 195 + Left = 75 + TabIndex = 2 + Top = 3600 + Width = 1455 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 720 + TabIndex = 1 + Top = 3240 + Width = 810 + End +End +Attribute VB_Name = "frmPayInput" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSTIME As Recordset +Dim moRSProj As Recordset, moRSPay As Recordset +Dim moRSCREW As Recordset, moRSSPS As Recordset +Dim moRSMemo As Recordset, moRSPS As Recordset + +Dim mboolSHOW As Boolean, mboolEXIT As Boolean, mboolSCAF As Boolean +Dim mboolAdding As Boolean, mboolLOOK As Boolean +Dim mstrType As String, mstrCREW As String, mstrPROJLOT As String +Dim mlngFind As Long, mdblGROSS As Double +Dim mlngTIME As Long, mlngSCAFID As Long, mboolCKPS As Boolean +Dim mintCREW As Integer, mboolCERTIFIED As Boolean +Dim mstrWTYPE As String, mstrWDone As String +Dim mboolNOCALC As Boolean, mboolPULTE As Boolean +'Need to get the time being formated correctly and shown on the screen correctly +'Also need to make sure that it is saving in the tblTIME correctly +'Will also need to get a calculation routine setup to calc the net time. +'May need to look at saving the time as a string in the 24 hour format and then changing +'to AM/PM when displaying on the screen + +Private Sub CMUFix() +Dim intResponse As Integer + + intResponse = InputBox("Enter The Correct Square Yardage Of The CMU", "Correct CMU Yardage", 0) + moRS!CMU = Integer2Field(intResponse) + moRS.Update + Call FormShow + +End Sub + +Private Sub StoneFix() +Dim intResponse As Integer + + intResponse = InputBox("Enter The Correct Square Footage Of The Stone Veneer", "Correct Stone", 0) + moRS!ST_SQFT = Integer2Field(intResponse) + moRS.Update + Call FormShow + +End Sub + +Private Sub PaintFix() +Dim intResponse As Integer + + intResponse = InputBox("Enter The Correct Square Footage For The Paint", "Correct Paint", 0) + moRS!PNT_SQFT = Integer2Field(intResponse) + moRS!PNT_FLG = vbChecked + moRS.Update + Call FormShow + +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE & vbTab & oRS!Rate & vbTab & oRS!Type + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +Private Sub cmdFindCrew_Click() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrCREW = oRS!Crew_Boss + txtCrewName = mstrCREW + Else + Call CrewLoad + End If + + oRS.Close + +End Sub + +Private Sub cboWorkType_LostFocus() +Dim strWTYPE As String, intLEN As Integer +' mboolEXIT = False +' If Left(Field2Str(cboWorkType), 1) = "B" Or Left(Field2Str(cboWorkType), 1) = "S" _ +' Or Left(Field2Str(cboWorkType), 1) = "T" Or Left(Field2Str(cboWorkType), 1) = "C" _ +' Or Left(Field2Str(cboWorkType), 1) = "P" Then +' Call CheckPay +' End If + If cboWorkType.ListIndex <> -1 Then + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText + intLEN = Len(strWTYPE) + If intLEN > 1 Then + cboWorkType.col = 3 + txtPrimRate = Format(Field2Str2(cboWorkType.ColText), "#0.00") + + End If + End If +' If mboolEXIT Then +' cboWorkType.SetFocus +' End If + +End Sub + +Private Sub cmdGetPaySheet_Click() +Dim strPAYID As String + strPAYID = gintPAYID + Load frmGetPaySheet + frmGetPaySheet.txtCrewId = txtCrewNo + frmGetPaySheet.txtCrewType = Left(Str2Field(cboCrewType.Text), 1) + frmGetPaySheet.Show 1 + chkADD = vbUnchecked + mboolSCAF = True + mboolEXIT = True + Call PayLoad + mboolAdding = False + cmdSavePay.Enabled = False +' Call cmdExit_Click +End Sub + +Private Sub cmdScaffold_Click() + Load frmScafPay + frmScafPay.txtCrewNo = txtCrewNo + frmScafPay.Show 1 + mboolSCAF = True + mboolEXIT = True + Call PayLoad + mboolAdding = False + cmdSavePay.Enabled = False + Call cmdExit_Click +End Sub + +Private Sub Form_Activate() + lblNoCalc.Visible = False + If chkLOOK = vbChecked Then + mboolLOOK = True + End If + If chkPS Then + mboolCKPS = True + Call GetPS + Else + mboolCKPS = False + End If + Call FormShow + If mboolLOOK Then + cmdGetPaySheet.Enabled = False + cmdSavePay.Enabled = False + cmdScaffold.Enabled = False + cboCrewType.Enabled = False + cboWorkType.Enabled = False + txtPercentDone.Enabled = False + txtPrimRate.Enabled = False + txtMetalRate.Enabled = False + txtFin2Rate.Enabled = False + txtPayAmt.Enabled = False + txtPONum.Enabled = False + chkBC.Enabled = False + txtLotNotes.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + txtEPO.Enabled = False + txtWrkDate.Enabled = False + lblNetTime.Enabled = False + txtEndTime.Enabled = False + txtLunch.Enabled = False + txtStartTime.Enabled = False + Else + If Not mboolSCAF Then + Call cmdAddPay_Click + End If + End If +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + mstrPROJLOT = mstrPROJLOT + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyU Then ' Display key combinations. + If CtrlDown Then + Call CMUFix + End If + Exit Sub + End If + If KeyCode = vbKeyV Then ' Display key combinations. + If AltDown Then +' If CtrlDown Then + Call StoneFix + End If + Exit Sub + End If + If KeyCode = vbKeyX Then ' Display key combinations. + If CtrlDown Then + Call PaintFix + End If + Exit Sub + End If + + If KeyCode = vbKeyL Then ' Setup NoCalc Flag + If CtrlDown Then + If mboolNOCALC Then + mboolNOCALC = False +' moRSTIME!NoCalc = vbFalse + lblNoCalc.Visible = False + Else + mboolNOCALC = True +' moRSTIME!NoCalc = vbTrue + lblNoCalc.Visible = True + End If + End If + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSTIME.State = adStateOpen Then + moRSTIME.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSCREW = New Recordset + Set moRSMemo = New Recordset + + mboolSCAF = False + + Call ProjLoad + Call LotLoad + Call PayLoad + Call CrewLoad + Call WTLoad + If moRS!hold_stucco Then + MsgBox "This Lot Is On Hold - No Payments Allowed Until Paperwork is Corrected", vbOKOnly, "Stucco Hold" + Unload Me + End If + +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + moRSProj.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not moRSProj.EOF Then + If moRSProj!cont_id = 864 Or moRSProj!cont_id = 146 Then + mboolPULTE = True + Else + mboolPULTE = False + End If + End If + +' If moRSProj!certpr Then +' mboolCERTIFIED = True +' Else +' mboolCERTIFIED = False +' End If +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If moRSProj.EOF Then + If moRS.EOF Then + End If + End If + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no + + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +End Sub + +Private Sub FormShow() +Dim strMType As String, strMTDesc As String, sglPRate As Single, strCrewType As String +Dim strSQL As String, strWorkType As String, intINDEX As Integer, intINDEX2 As Integer +Dim oRS As Recordset, strSQLL As String, intCOUNT As Integer, strWT As String + + mboolSHOW = True + txtProjLot = Trim$(moRSProj!Proj_Code) & " " & moRS!lot_no + txtLathYds = Field2Integer(moRS!l_yds) + txtCMUYds = Field2Integer(moRS!CMU) + txtMatYds = Field2Integer(moRS!sq_yd) + txtMetalFt = Field2Double(moRS!METAL) + txtFin2 = Field2Integer(moRS!fin2) + txtModel = Field2Str(moRS!model) + txtStuccoYds = Field2Str2(moRS!s_yds) + txtStone = Field2Str(moRS!ST_SQFT) + txtPaint = Field2Str2(moRS!PNT_SQFT) + lblD68 = Field2Str2(moRS!Scaf6) + lblD108 = Field2Str2(moRS!scaf10) + lblStucco.Caption = Field2Str(moRS!BILLDT_S) + lblBillLath.Caption = Field2Str(moRS!BILLDT_L) + txtLotNotes = Field2Str(moRSMemo!payroll) +' txtStartTime = Format(Field2Str(moRS!StrtTm), "hh:mm") +' txtEndTime = Format(Field2Str(moRS!EndTm), "hh:mm") +' txtLunch = Field2Str2(moRS!Lunch) +' lblNetTime = Field2Str(moRS!NetTime) +' txtWrkDate = Field2Str(moRS!WorkDate) + + If mboolCERTIFIED Then + lblCertPR.Visible = True + Else + lblCertPR.Visible = False + End If + + If chkPS Then + strSQL = "SELECT * FROM tblPaySheet WHERE PAYID = " & glngPSID + Set moRSPS = New Recordset + moRSPS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intCOUNT = 1 + If Not moRSPS.EOF Then + txtPrimRate = Field2Str(moRSPS!Y_Rate) + txtMetalRate = Field2Str(moRSPS!M_Rate) + strWorkType = Field2Str(moRSPS!worktype) + Do Until intCOUNT = cboWorkType.ListCount - 1 + cboWorkType.col = 1 + strWT = Field2Str(cboWorkType.ColText) + If strWT = strWorkType Then + intINDEX = cboWorkType.ListIndex + Exit Sub + End If + intCOUNT = intCOUNT + 1 + cboWorkType.ListIndex = cboWorkType.ListIndex + 1 + Loop + cboWorkType.ListIndex = intINDEX + + + + End If + Else + If Field2Str(moRSCREW!Type) = "L" Then + If mboolPULTE Then + txtPrimRate = Field2Str2(moRSCREW!Smooth) + txtMetalRate = 0 + ' txtMetalRate = Field2Str2(moRSCREW!METAL) + txtFin2Rate = 0 + cboCrewType = "LATH" + lblFinish.Visible = False + txtFinish.Visible = False + Else + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtMetalRate = Field2Str2(moRSCREW!METAL) + txtFin2Rate = 0 + cboCrewType = "LATH" + lblFinish.Visible = False + txtFinish.Visible = False + End If + End If + + If Field2Str(moRSCREW!Type) = "V" Then + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + txtFin2Rate.Visible = False + txtFinish.Visible = False + lblFinish.Visible = False + cboCrewType = "V_STONE" + End If + If Field2Str(moRSCREW!Type) = "C" Then + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtMetalRate = 0 + lblMtlRate.Visible = False + txtMetalRate.Visible = False + txtFinish.Visible = False + lblFinish.Visible = False + txtFin2Rate = Field2Str2(moRSCREW!sand) + ' txtFin2Rate = 0 + cboCrewType = "C_SCAFFOLD" + ' cboWorkType = "Y_UP" + cmdScaffold.SetFocus + ' chkBC.Enabled = False + End If + If Field2Str(moRSCREW!Type) = "S" Then + If Field2Str(moRS!texture) = "SK" Then + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtFinish = "SKIP" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "SM" Then + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtFinish = "SMOOTH" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "SA" Then + txtPrimRate = Field2Str2(moRSCREW!sand) + txtFinish = "SAND" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "S2" Then + txtPrimRate = Field2Str2(moRSCREW!sand) + txtFinish = "SAND" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "S3" Then + txtPrimRate = Field2Str2(moRSCREW!sand) + txtFinish = "SAND" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "SB" Then + txtPrimRate = Field2Str2(moRSCREW!syn) + txtFinish = "SYNTHETIC" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "QU" Then + txtPrimRate = Field2Str2(moRSCREW!qu) + txtFinish = "QUERNAVACA" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "MN" Then + txtPrimRate = Field2Str2(moRSCREW!mn) + txtFinish = "MONTERREY" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "DA" Then + txtPrimRate = Field2Str2(moRSCREW!dash) + txtFinish = "DASH" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = 0 + ElseIf Field2Str(moRS!texture) = "DF" Then + txtPrimRate = Field2Str2(moRSCREW!lath_skip) + txtFinish = "SKIP AND SAND" + txtMetalRate = 0 + txtMetalRate.Visible = False + txtFin2Rate = Field2Str2(moRSCREW!sand) + End If + cboCrewType = "STUCCO" + End If + If Field2Str(moRSCREW!Type) = "X" Then + cboCrewType = "X_PAINT" + cboWorkType.col = 1 + strMType = Field2Str(cboWorkType.ColText) + cboWorkType.col = 2 + strMTDesc = Field2Str(cboWorkType.ColText) + cboWorkType.col = 3 + sglPRate = Format(CDbl(Field2Str2(cboWorkType.ColText)), "#0.00") + cboWorkType.col = 4 + strCrewType = Field2Str(cboWorkType.ColText) + txtMetalRate = 0 + txtFin2Rate = 0 + lblMtlRate.Visible = False + txtFin2Rate.Visible = False + lblFin2Rate.Visible = False + txtMetalRate.Visible = False + txtFinish.Visible = False + lblFinish.Visible = False + txtPrimRate = sglPRate + lblYdRate = "Paint SqFt:" + End If + End If + + mboolSHOW = False +End Sub + +Private Sub cmdAddPay_Click() + If chkPS = vbUnchecked Then + Call FormClear + txtVerify = Date + cmdSavePay.Enabled = True + End If +' mboolAdding = True + cboWorkType.SetFocus +End Sub +Private Sub cmdSavePay_Click() + cmdSavePay.Enabled = False + Call FormSave + Unload Me + +End Sub + +Private Sub FormSave() +Dim strSQL As String + + On Error GoTo Error_EH + If chkADD Then +' If mboolAdding Then + strSQL = "SELECT * FROM tblTIME" ' ORDER By IDNum" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + moRSTIME.AddNew + Else +' mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) +' Call FormFind + End If +' If mboolAdding Then +' moRSTIME.AddNew +' End If + + ' Store the controls to the recordset + Call FieldsSave + + mboolNOCALC = False + + moRS!lotnotes = Str2Field(txtLotNotes) + moRS.Update + + moRSMemo!payroll = Str2Field(txtLotNotes) + moRSMemo.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTIME " ' ORDER By IDNum " + strSQL = strSQL & "WHERE IDNUM = " & mlngTIME + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSTIME.EOF Then + FormFind = False + Else + FormFind = True + If moRSTIME!NoCalc Then + mboolNOCALC = True + lblNoCalc.Visible = True + Else + mboolNOCALC = False + lblNoCalc.Visible = False + End If + End If +End Function +Private Sub cmdExit_Click() + Unload Me +End Sub +Private Sub FieldsSave() +Dim strSQL As String + On Error GoTo Error_EH + + If moRSTIME.State = adStateOpen Then +' moRSTIME.Close + Else + strSQL = "SELECT * FROM tblTIME" ' ORDER By IDNum" ' WHERE idnum = 10" +' strSQL = "SELECT * FROM tblTIME WHERE idnum = 10" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' moRSTIME.AddNew + End If + + With moRSTIME +' If chkAdd Then 'And Not mboolAdding Then +' If chkAdd And Not mboolAdding Then +' .AddNew +' End If + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !lot_no = Str2Field(moRS!lot_no) + !paydt = Date + !C_USER = gstrLOGIN + !pct_done = Integer2Field(txtPercentDone) + !pay_id = gintPAYID + !proj_lot = Str2Field(txtProjLot) + !yd_rate = Double2Field(txtPrimRate) + !fin2_Rate = Double2Field(txtFin2Rate) + !mtl_Rate = Double2Field(txtMetalRate) + !ponum = Str2Field(txtPONum) + !bc = chkBC + !crew = Integer2Field(txtCrewNo) + !pay_amt = Str2Field(txtPayAmt) + !notes = Str2Field(txtNotes) + !pay_type = Left(Str2Field(cboCrewType.Text), 1) + cboWorkType.col = 1 + !WorkDone = cboWorkType.ColText +' !workdone = Left(Str2Field(cboWorkType.Text), 1) + !office = Str2Field(txtOffice) + !certpr = moRSProj!certpr + !U_USER = gstrLOGIN + !EPONum = Field2Str(txtEPO) +' !YDS = CInt(Field2Str2(!s_yds)) + !Update = Date + If mboolNOCALC Then + !NoCalc = vbTrue + Else + !NoCalc = vbFalse + End If + !StrtTM = Field2Str2(txtStartTime) + !Lunch = Format(Field2Str2(txtLunch), "##.00") + !EndTM = Field2Str2(txtEndTime) + !NetTime = Field2Str(lblNetTime) + If txtWrkDate = "" Then + !WorkDay = 0 + Else + !WorkDay = Field2Str2(txtWrkDate) + End If + End With + moRSTIME.Update + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayInput - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub +Private Sub FormClear() + txtPercentDone = "0" + txtVerify = "" + txtPayAmt = "0" + txtNotes = "" + txtOffice = "" +' txtLotNotes = "" + cboWorkType.ListIndex = -1 + +End Sub + +Private Sub ScaffoldLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!WorkDone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + +End Sub + +Private Sub PayLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!WorkDone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + +End Sub +Private Sub CheckPay() +Dim oRS As Recordset, oRSS As Recordset, strPAINTTYPE As String +Dim strSQL As String, intSUM As Integer, intLEN As Integer, intWSUM As Integer +Dim strLine As String, strWDONE As String, strWTYPE As String, strTYPE As String +Dim intPSUM As Integer, boolPARTIAL As Boolean, intCSUM As Integer, boolCOMPLETE As Boolean +Dim intDIFF As Integer, strMSG As String, strEPONum As String, boolWORDER As Boolean + + boolCOMPLETE = False + boolPARTIAL = False + boolWORDER = False + strEPONum = "" + + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText + intLEN = Len(strWTYPE) + If intLEN = 0 Then + Stop + End If + + If Left(Field2Str(cboCrewType), 1) = "C" Then + If strWTYPE = "R" Or strWTYPE = "W" Or strWTYPE = "Z" Or strWTYPE = "Y" _ + Or strWTYPE = "YHR" Or strWTYPE = "ZHR" Or strWTYPE = "WH" Then + Exit Sub + Else + MsgBox "You Have Selected an Invalid Work Type for Scaffolding - Reenter", vbOKOnly, "Invalid WOrkType" + mboolEXIT = True + Exit Sub + End If + End If + cboWorkType.col = 1 + strTYPE = cboWorkType.ColText + + If strTYPE = "B" Or strTYPE = "S" _ + Or strTYPE = "T" Then +' If Left(Field2Str(cboWorkType), 1) = "B" Or Left(Field2Str(cboWorkType), 1) = "S" _ +' Or Left(Field2Str(cboWorkType), 1) = "T" Then + If Left(Field2Str(cboCrewType), 1) = "L" Or Left(Field2Str(cboCrewType), 1) = "V" Or Left(Field2Str(cboCrewType), 1) = "C" Or Left(Field2Str(cboCrewType), 1) = "X" Then + strLine = "Invalid Work Type For Lath, Stone Veneer, Paint or Scaffolding" & vbCrLf & vbCrLf + strLine = strLine & "Select A Valid Work Type For Lath, Stone Veneer, Paint or Scaffolding And Continue" + MsgBox strLine, vbOKOnly, "Invalid WorkType" + mboolEXIT = True + Exit Sub + End If + End If +'****************Need to move the strWTYPE ="W" outside of this logic. +'****************It is causing the Complete Booleen to be triggered to soon. + + If strWTYPE = "C" Or strWTYPE = "P" Then +' If strWTYPE = "C" Or strWTYPE = "P" Or strWTYPE = "W" Then + strSQL = "SELECT * from tblTime WHERE lot_id = " & gintLOTID + strSQL = strSQL & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" + strSQL = strSQL & " and workdone = 'C'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + boolCOMPLETE = True + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" & " and workdone = 'C'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intCSUM = Integer2Field(oRSS!sumwork) ' + Integer2Field(txtPercentDone) + End If + + strSQL = "SELECT * from tblTime WHERE lot_id = " & gintLOTID + strSQL = strSQL & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" + strSQL = strSQL & " and workdone = 'P'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + boolPARTIAL = True + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" & " and workdone = 'P'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intPSUM = Integer2Field(oRSS!sumwork) ' + Integer2Field(txtPercentDone) + End If + End If + + If strWTYPE = "W" Then + strSQL = "SELECT * from tblTime WHERE lot_id = " & gintLOTID + strSQL = strSQL & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" + strSQL = strSQL & " and workdone = 'W'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + strEPONum = Field2Str(txtEPO) + boolWORDER = True + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" & " and workdone = 'W'" & " and EPONum = '" & Field2Str(strEPONum) & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intWSUM = Integer2Field(oRSS!sumwork) '+ Integer2Field(txtPercentDone) + End If + + End If + +' If strWTYPE = "P" Then +' strSQL = "SELECT * from tblTime WHERE lot_id = " & gintLOTID +' strSQL = strSQL & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" +' strSQL = strSQL & " and workdone = 'P'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' If Not oRS.EOF Then +' boolCOMPLETE = True +' strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" & " and workdone = 'P'" +' Set oRSS = New Recordset +' oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' intPSUM = Integer2Field(oRSS!sumwork) ' + Integer2Field(txtPercentDone) +' End If +' +' End If + + strSQL = "SELECT * from tblTime WHERE lot_id = " & gintLOTID + strSQL = strSQL & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" +' cboWorkType.col = 1 + strSQL = strSQL & " and workdone = '" & strWTYPE & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + '******* + If strWTYPE = "W" Then + intDIFF = intWSUM + Integer2Field(txtPercentDone) + If (boolWORDER) And intDIFF > 100 Then + strMSG = "You Can Only Have A Total Of 100% Combined. You " & vbCrLf & vbCrLf + strMSG = strMSG & "Already Have " & CStr(intWSUM) & "% Used For PO " & txtEPO & ". ReEnter" + MsgBox strMSG, vbOKOnly, "ReEnter" +' MsgBox "You have already done " & CStr(intCSUM) & "for COMPLETE, Only " & intDIFF & " More Than Can Be Done", vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If + End If + + If oRS.EOF And Not (boolCOMPLETE Or boolPARTIAL Or boolWORDER) Then + Else + If strWTYPE = "P" Or strWTYPE = "B" _ + Or strWTYPE = "C" Or strWTYPE = "S" Or strWTYPE = "T" Then +' Or strWTYPE = "C" Or strWTYPE = "S" Or strWTYPE = "T" Or strWTYPE = "W" Then + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and workdone = '" & strWTYPE & "'" & " and pay_type = '" & Left(Field2Str(cboCrewType), 1) & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intSUM = Integer2Field(oRSS!sumwork) + Integer2Field(txtPercentDone) + + intDIFF = intCSUM + intPSUM + Integer2Field(txtPercentDone) + If (boolCOMPLETE And Not boolPARTIAL) And intDIFF > 100 Then + strMSG = "You Can Only Have A Total Of 100% Combined. You Already Have " + strMSG = strMSG & CStr(intCSUM) & " Used For COMPLETE. ReEnter" + MsgBox strMSG, vbOKOnly, "ReEnter" +' MsgBox "You have already done " & CStr(intCSUM) & "for COMPLETE, Only " & intDIFF & " More Than Can Be Done", vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If + +' intDIFF = intSUM + intCSUM + intPSUM ' - Integer2Field(txtPercentDone) + If (boolPARTIAL And Not boolCOMPLETE) And intDIFF > 100 Then + strMSG = "You Can Only Have A Total Of 100% Combined. You Already Have " + strMSG = strMSG & CStr(intPSUM) & " Used For PARTIAL. ReEnter" + MsgBox strMSG, vbOKOnly, "ReEnter" +' MsgBox "You have already done " & CStr(intCSUM) & "for PARTIAL, Only " & intDIFF & " More Than Can Be Done", vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If + +' intDIFF = intSUM + intCSUM + intPSUM ' - Integer2Field(txtPercentDone) + If (boolPARTIAL And boolCOMPLETE) And intDIFF > 100 Then + strMSG = "You Can Only Have A Total Of 100% Combined PARTIAL And COMPLETE. You Already Have " + strMSG = strMSG & CStr(intDIFF) & " Used For Both Types. ReEnter" + MsgBox strMSG, vbOKOnly, "ReEnter" +' MsgBox "You have already done " & CStr(intCSUM) & "for PARTIAL, Only " & intDIFF & " More Than Can Be Done", vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If +'***********Need to take the mbookWORDER out of this logic and put it in its own +'***********Make sure the message being displayed is OK + +' intDIFF = intWSUM + Integer2Field(txtPercentDone) +' If (boolWORDER) And intDIFF > 100 Then +' strMSG = "You Can Only Have A Total Of 100% Combined. You Already Have " +' strMSG = strMSG & CStr(intCSUM) & " Used For PO " & txtEPO & ". ReEnter" +' MsgBox strMSG, vbOKOnly, "ReEnter" +'' MsgBox "You have already done " & CStr(intCSUM) & "for COMPLETE, Only " & intDIFF & " More Than Can Be Done", vbOKOnly, "ReEnter" +' mboolEXIT = True +' Exit Sub +' End If + + If intSUM > 100 Then + cboWorkType.col = 2 + MsgBox "You have already done 100% for " & cboWorkType.ColText, vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If + End If + + + If Left(Field2Str(cboCrewType), 1) = "S" And intLEN > 1 Then + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and workdone = '" & strWTYPE & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intSUM = Integer2Field(oRSS!sumwork) + Integer2Field(txtPercentDone) + If intSUM > 100 Then + cboWorkType.col = 2 + MsgBox "You have already done 100% for " & cboWorkType.ColText, vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If + End If + + + If Left(Field2Str(cboCrewType), 1) = "X" And intLEN = 1 Then + + cboWorkType.col = 2 + strLine = "'" & cboWorkType.ColText & "WorkType Is Not Valid For Paint " & vbCrLf & vbCrLf +' strLine = "You Have Already Used This Work Type " & vbCrLf & vbCrLf + strLine = strLine & "Correct The Work Type And Continue" + MsgBox strLine, vbOKOnly, "Invalid WorkType" + mboolEXIT = True + End If + + If Left(Field2Str(cboCrewType), 1) = "X" And intLEN > 1 And strWTYPE <> "CS" Then '10/10/2018 changed to allow multiple jobs + strSQL = "SELECT SUM(pct_done) as SUMWork FROM tblTIME WHERE Lot_id = " & gintLOTID & " and workdone = '" & strWTYPE & "'" + Set oRSS = New Recordset + oRSS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + intSUM = Integer2Field(oRSS!sumwork) + Integer2Field(txtPercentDone) + If intSUM > 100 Then + cboWorkType.col = 2 + MsgBox "You have already done 100% for " & cboWorkType.ColText, vbOKOnly, "ReEnter" + mboolEXIT = True + Exit Sub + End If +' cboWorkType.col = 2 +' strLine = "'" & cboWorkType.ColText & "WorkType Is Not Valid For Paint " & vbCrLf & vbCrLf +' strLine = "You Have Already Used This Work Type " & vbCrLf & vbCrLf +' strLine = strLine & "Correct The Work Type And Continue" +' MsgBox strLine, vbOKOnly, "Invalid WorkType" +' mboolEXIT = True + End If + + If Left(Field2Str(cboCrewType), 1) = "A" Then + strLine = "You Have Already Used This Work Type " & vbCrLf & vbCrLf + strLine = strLine & "Correct The Work Type And Continue" + MsgBox strLine, vbOKOnly, "Invalid WorkType" + mboolEXIT = True + End If + If Left(Field2Str(cboCrewType), 1) = "C" Then + strLine = "You Have Already Used This Work Type " & vbCrLf & vbCrLf + strLine = strLine & "Correct The Work Type And Continue" + MsgBox strLine, vbOKOnly, "Invalid WorkType" + mboolEXIT = True + End If + End If + +End Sub + +Private Sub CrewLoad() + Dim strSQL As String + +' strSQL = "SELECT * from tblcrew WHERE crew_id = " & gintCREWID + strSQL = "SELECT * from tblCrewRate WHERE crew_id = " & gintCREWID & " AND PROJ_ID = " & gintPROJID + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSCREW.EOF Then + strSQL = "SELECT * from tblCrewRate WHERE crew_id = " & gintCREWID & " AND PROJ_ID = 99999" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If + +End Sub + +Private Sub lstPayInfo_Click2() + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then + Call FormShow + Else + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayAmt = "0" + txtNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = -1 + End If + End If + +End Sub +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + mstrCREW = oRS!Crew_Boss + End If + + oRS.Close + +End Sub + +Private Sub GetPS() +Dim strSQL As String, strID As String + +' lstPaySheets.col = 0 +' strID = lstPaySheets.ColText + strSQL = "SELECT * FROM tblPAYSHEET WHERE PAYID = " & glngPSID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSSPS = New Recordset + moRSSPS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSSPS.EOF Then + End If +End Sub + +Private Sub GetPay() +Dim strSQL As String, strID As String + + strSQL = "SELECT * FROM tblTIME WHERE IdNum = " & strID 'lstHouses.ItemData(lstHouses.ListIndex) +' strSQL = strSQL & "FROM tblTIME " +' strSQL = strSQL & "WHERE IdNum = " & lstHouses.ItemData(lstHouses.ListIndex) + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + End If +End Sub + +Private Sub lstPayInfo_Click() + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + Call FormFind + Call FormShowPay + +End Sub + +Private Sub lstPayInfo_DblClick() + If Not mboolAdding Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + Call FormFind + Call FormShowPay + End If + If Not mboolLOOK Then + cmdSavePay.Enabled = True + End If + If mboolCKPS Then + cmdSavePay.Enabled = False + End If +' If FormFind() Then +' If Not mboolAdding And Field2Str(moRSCREW!Type) = "C" Then +' Call CBFindString1(cboWorkType, Field2Str(moRSTIME!workdone)) +' txtPayAmt = Field2Str2(moRSTIME!pay_amt) +' txtPercentDone = Field2Str2(moRSTIME!pct_done) +' End If +' End If + +' cmdFindCrew.Visible = True +End Sub + +Private Sub txtEndTime_LostFocus() +Dim intHR As Integer, intSTART As Integer, intEND As Integer, intLUNCH As Integer, intNET As Integer, strNET As String + If Len(txtEndTime) = 2 Then + intHR = (Field2Str2(txtEndTime)) + ElseIf Len(txtEndTime) = 4 Then + intHR = Format(Mid(txtEndTime, 1, 2), "00") + End If + If intHR > 24 Then + MsgBox "Invalid Time, ReEnter in 24-Hour (hhmm) Format Where hh I Less Than 25", vbOKOnly, "Invalid - ReEnter" + txtEndTime.SetFocus + Else + txtEndTime = TimeFormat(txtEndTime, "END") + End If + intSTART = MinuteCalc(txtStartTime) + intEND = MinuteCalc(txtEndTime) + intLUNCH = txtLunch * 60 + intNET = (intEND - intSTART - intLUNCH) ' / 60 + strNET = (intEND - intSTART - intLUNCH) / 60 + strNET = Format(strNET, "#0.00") + lblNetTime = strNET +End Sub + +Private Sub txtFin2Rate_GotFocus() + Call FieldSelect(txtFin2Rate) +End Sub + +Private Sub txtFin2Rate_LostFocus() + Call CalcPay +End Sub + +Private Sub txtLotNotes_LostFocus() + txtLotNotes = UCase(txtLotNotes) +End Sub + +Private Sub txtLunch_GotFocus() + txtLunch.SelStart = 0 + txtLunch.SelLength = 7 +End Sub + +Private Sub txtLunch_LostFocus() + If txtLunch = "" Then + txtLunch = 0 + End If + txtLunch = Format(txtLunch, "##.00") +End Sub + +Private Sub txtMetalRate_GotFocus() + Call FieldSelect(txtMetalRate) +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtPayAmt_GotFocus() + Call FieldSelect(txtPayAmt) +End Sub + +Private Sub txtPayAmt_LostFocus() + If Field2Str2(txtPayAmt) <> 0 Then + Call CalcPay + End If +End Sub + +Private Sub CalcPay() +Dim dblPAYAMT As Double, strWTYPE As String, intLEN As Integer + + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText + intLEN = Len(strWTYPE) + + If moRSCREW!Type = "L" Then +' If Not (Left(Str2Field(cboWorkType), 1) = "W" Or Left(Str2Field(cboWorkType), 1) = "R" Or chkBC = 1) Then + If mboolNOCALC Then + Else + If Not (strWTYPE = "W" Or strWTYPE = "R" Or chkBC = 1) Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * Field2Str2(txtLathYds)) * Field2Str(txtPercentDone)) / 100) + dblPAYAMT = dblPAYAMT + (((Field2Str2(txtMetalRate) * Field2Str2(txtMetalFt)) * Field2Str(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + End If + End If + End If + + If moRSCREW!Type = "V" Then +' If Not (Left(Str2Field(cboWorkType), 1) = "W" Or Left(Str2Field(cboWorkType), 1) = "R" Or chkBC = 1) Then + If mboolNOCALC Then + Else + + If strWTYPE = "WH" Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * 1) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + Exit Sub + End If + ' End If + + If Not (strWTYPE = "W" Or strWTYPE = "R" Or chkBC = 1) Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * Field2Str2(txtStone)) * Field2Str(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (((Field2Str2(txtMetalRate) * Field2Str2(txtMetalFt)) * Field2Str(txtPercentDone)) / 100) + ' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + End If + End If + End If + + If moRSCREW!Type = "C" Then +' If Not (Left(Str2Field(cboWorkType), 1) = "W" Or Left(Str2Field(cboWorkType), 1) = "R" Or chkBC = 1) Then + If (strWTYPE = "YHR" Or strWTYPE = "ZHR") Then ' Or strWTYPE = "WH") Then + txtPayAmt = Format(Field2Str2(txtPayAmt), "##,##0.00") + ElseIf strWTYPE = "WH" Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * 1) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + Exit Sub +' End If + ElseIf Not (strWTYPE = "W" Or strWTYPE = "R" Or chkBC = 1) Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * Field2Str2(txtStone)) * Field2Str(txtPercentDone)) / 100) +' dblPayAmt = dblPayAmt + (((Field2Str2(txtMetalRate) * Field2Str2(txtMetalFt)) * Field2Str(txtPercentDone)) / 100) +' dblPayAmt = dblPayAmt + (Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + End If + End If + + If moRSCREW!Type = "S" Then +' If Left(Str2Field(cboWorkType.Text), 1) = "U" Then + If mboolNOCALC Then + Else + If strWTYPE = "EFSH" Or strWTYPE = "EFOA" Or strWTYPE = "ERAS" Or strWTYPE = "ENET" _ + Or strWTYPE = "EFIN" Or strWTYPE = "EHIM" Or strWTYPE = "ESEN" Or strWTYPE = "EMPL" Or strWTYPE = "ESFL" Then + Exit Sub + End If + + If strWTYPE = "WH" Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * 1) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + Exit Sub + End If + + If strWTYPE = "U" Then + txtPayAmt = Format((((Field2Str2(txtPrimRate) * (Field2Str2(txtCMUYds)) * Field2Str(txtPercentDone)) / 100)), "##,##0.00") + ' ElseIf Not (Left(Str2Field(cboWorkType), 1) = "W" Or chkBC = 1 Or Left(Str2Field(cboWorkType), 1) = "F") Then + ElseIf Not (strWTYPE = "W" Or chkBC = 1 Or strWTYPE = "F") Then + If Field2Str(moRS!texture) = "DF" Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * (Field2Str2(txtStuccoYds) - Field2Str2(txtFin2))) * Field2Str(txtPercentDone)) / 100) + dblPAYAMT = dblPAYAMT + (((Field2Str2(txtFin2Rate) * Field2Str2(txtFin2)) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + Else + dblPAYAMT = (((Field2Str2(txtPrimRate) * Field2Str2(txtStuccoYds)) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + End If + End If + End If + End If + + If moRSCREW!Type = "X" Then + If mboolNOCALC Then + Else + If Not (intLEN = 1 Or chkBC = 1) Then + If strWTYPE = "SP" Or strWTYPE = "OH" Or strWTYPE = "FG1" Or strWTYPE = "FG2" Or strWTYPE = "WH" _ + Or strWTYPE = "RF1" Or strWTYPE = "RF2" Or strWTYPE = "AS1" Or strWTYPE = "AS2" Or strWTYPE = "ST" Then + dblPAYAMT = (((Field2Str2(txtPrimRate) * 1) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + ElseIf strWTYPE = "BT1" Or strWTYPE = "BT2" Or strWTYPE = "FO" Or strWTYPE = "PO" Or strWTYPE = "CS" Then + txtPayAmt = txtPrimRate + Else + dblPAYAMT = (((Field2Str2(txtPrimRate) * Field2Str2(txtPaint)) * Field2Str(txtPercentDone)) / 100) + txtPayAmt = Format(dblPAYAMT, "##,##0.00") + End If + End If + End If + End If + +End Sub +Private Sub txtPercentDone_GotFocus() + Call FieldSelect(txtPercentDone) +End Sub + +Private Sub txtPercentDone_LostFocus() +Dim strSQL As String, strWTYPE As String + + mboolEXIT = False + If cboWorkType.ListIndex = -1 Then + Exit Sub + End If + + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText + If Left(Field2Str(cboCrewType), 1) = "C" Then + Call CheckPay + End If + + If strWTYPE = "B" Or strWTYPE = "S" _ + Or strWTYPE = "T" Or strWTYPE = "C" _ + Or strWTYPE = "P" Or strWTYPE = "A" Or strWTYPE = "W" Then +' If Left(Field2Str(cboWorkType), 1) = "B" Or Left(Field2Str(cboWorkType), 1) = "S" _ +' Or Left(Field2Str(cboWorkType), 1) = "T" Or Left(Field2Str(cboWorkType), 1) = "C" _ +' Or Left(Field2Str(cboWorkType), 1) = "P" Or Left(Field2Str(cboWorkType), 1) = "A" Then + Call CheckPay + End If + + If Left(Field2Str(cboCrewType), 1) = "X" Then + Call CheckPay + End If + + If strWTYPE = "EFSH" Or strWTYPE = "EFOA" Or strWTYPE = "ERAS" Or strWTYPE = "ENET" Then + Call CheckPay + End If + + If strWTYPE = "EHIM" Or strWTYPE = "EFIN" Or strWTYPE = "ESEN" Or strWTYPE = "EMPL" Then + Call CheckPay + End If + + If mboolEXIT Then + cboWorkType.SetFocus + End If + +End Sub + +Private Sub txtPONum_GotFocus() + Call FieldSelect(txtPONum) +End Sub + +Private Sub txtPrimRate_GotFocus() + Call FieldSelect(txtPrimRate) +End Sub + +Private Sub FormShowPay() +Dim strWTYPE As String +Dim intLoop As Integer, strSTR As String, intLEN As Integer + + mboolSHOW = True + + With moRSTIME + If mboolLOOK Then + txtPrimRate = Field2Str(!yd_rate) + txtMetalRate = Field2Str(!mtl_Rate) + txtFin2Rate = Field2Str(!fin2_Rate) + End If + txtPercentDone = Field2Str(!pct_done) + txtVerify = IIf(Field2Str(!paydt) = "12:00:00 AM", "", Field2Str(!paydt)) + txtCrewNo = Field2Integer(!crew) + mintCREW = Field2Integer(!crew) + Call GetCrew + txtCrewName = mstrCREW +' txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) +' txtCheckNo = Field2Str(!prcheck) + txtPayAmt = Format(Field2Str(!pay_amt), "##,###.00") + txtNotes = Field2Str(!notes) + txtOffice = Field2Str(!office) + + If !pay_type = "L" Then + cboCrewType.Text = "LATH" + ElseIf !pay_type = "S" Then + cboCrewType.Text = "STUCCO" + ElseIf !pay_type = "R" Then + cboCrewType.Text = "Repair/PO" + ElseIf !pay_type = "V" Then + cboCrewType.Text = "V_Stone" + ElseIf !pay_type = "C" Then + cboCrewType.Text = "C_SCAFFOLD" + ElseIf !pay_type = "X" Then + cboCrewType.Text = "X_PAINT" + ElseIf !pay_type = "W" Then +' cboCrewType.Text = "LATH" + cboCrewType.Text = "W_WRAP" + ElseIf !pay_type = "Q" Then + cboCrewType.Text = "Q_MISC" + End If + +' If !pay_type = "W" Then +' strWTYPE = "A" +' intLEN = Len(strWTYPE) +' Else + strWTYPE = Field2Str(!WorkDone) + intLEN = Len(strWTYPE) +' End If + + strWTYPE = Field2Str(!WorkDone) + intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + + End With + txtLotNotes = Field2Str(moRSMemo!payroll) + + ' If chkLook Then + mboolSHOW = False +End Sub + +Private Sub txtPrimRate_LostFocus() + If moRSCREW!Type = "S" And Field2Str2(txtFin2) > 0 Then + txtFin2Rate = txtPrimRate + End If + If moRSCREW!Type = "X" Or moRSCREW!Type = "V" Then + Call CalcPay + End If +End Sub + +Private Sub txtStartTime_GotFocus() +' FieldSelect (txtStartTime) + txtStartTime.SelStart = 0 + txtStartTime.SelLength = 10 + +End Sub + +Private Sub txtStartTime_LostFocus() +Dim intHR As Integer + If Len(txtStartTime) = 2 Then + intHR = (Field2Str2(txtStartTime)) + ElseIf Len(txtStartTime) = 4 Then + intHR = Format(Mid(txtStartTime, 1, 2), "00") + End If + If intHR > 24 Then + MsgBox "Invalid Time, ReEnter in 24-Hour (hhmm) Format Where hh I Less Than 25", vbOKOnly, "Invalid - ReEnter" + txtStartTime.SetFocus + Else + txtStartTime = TimeFormat(txtStartTime, "START") + End If +End Sub + +Private Sub txtWrkDate_GotFocus() + txtWrkDate.SelStart = 0 + txtWrkDate.SelLength = 10 +End Sub + +Private Sub txtWrkDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtWrkDate, "/", 1) + If Not IsDate(txtWrkDate) Then + If lngPOS = 0 Then + If Len(txtWrkDate) > 0 Then + txtWrkDate = Format(txtWrkDate, "00/00/####") + If Not IsDate(txtWrkDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtWrkDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtWrkDate.SetFocus + End If + End If + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frx new file mode 100644 index 0000000..d9c55db Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayInput.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frm new file mode 100644 index 0000000..ed30f4e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frm @@ -0,0 +1,1750 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayList + Caption = "Payroll List" + ClientHeight = 8625 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9030 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 9030 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmd1DailyTS + Caption = "1 Daily Time Sht" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 25 + Top = 7380 + Width = 1035 + End + Begin LpLib.fpList lstPayCrews + Height = 3675 + Left = 45 + TabIndex = 24 + Top = 1545 + Width = 4590 + _Version = 196608 + _ExtentX = 8096 + _ExtentY = 6482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "Microsoft Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 255 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayList.frx":0000 + End + Begin VB.CommandButton cmdPrDetail + Caption = "Print Pay Detail" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1275 + TabIndex = 23 + Top = 8025 + Width = 1035 + End + Begin VB.CommandButton cmdUpEmpMaster + Caption = "Up Emp Master" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1275 + TabIndex = 22 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdMoveMAS90 + Caption = "Move PR to CMS" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 21 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdPRProcess + Caption = "Setup PR for CMS" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 20 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmd1TimeSheet + Caption = "1 Time Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 19 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPayLog + Caption = "Payroll Log" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1275 + TabIndex = 18 + TabStop = 0 'False + Top = 6705 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1Crew + Caption = "1 Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 17 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1 + Caption = "1 VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 16 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintTimeSheets + Caption = "Time Sheets" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 15 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintData + Caption = "Data Input Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 14 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintCrew + Caption = "Print Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 13 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin Crystal.CrystalReport crPay + Left = 6900 + Top = 5520 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 135 + TabIndex = 12 + TabStop = 0 'False + Top = 6045 + Width = 1035 + End + Begin VB.CommandButton cmdAddMember + Caption = "Add &Members" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 5 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 6 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.TextBox txtCrewID + Height = 375 + Left = 5160 + TabIndex = 11 + TabStop = 0 'False + Top = 5580 + Visible = 0 'False + Width = 1215 + End + Begin VB.ListBox lstCrew + Height = 3765 + Left = 4680 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 1560 + Width = 4215 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 7 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 135 + TabIndex = 4 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.ListBox lstPayCrews2 + Height = 450 + Left = 4725 + TabIndex = 2 + Top = 6270 + Width = 4350 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 315 + Left = 1320 + TabIndex = 0 + Top = 180 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 94830593 + CurrentDate = 43240 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired crew listed below to add the crew to the current payroll list." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5340 + TabIndex = 10 + Top = 660 + Width = 2955 + End + Begin VB.Label lblInstruct + Caption = "Double Click or CTRL P on the desired crew to view payroll informaton for that crew for the payroll date shown." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 9 + Top = 600 + Width = 4395 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Crews for this payroll:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 180 + TabIndex = 3 + Top = 1320 + Width = 1845 + End + Begin VB.Label lblPRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 360 + TabIndex = 1 + Top = 240 + Width = 900 + End +End +Attribute VB_Name = "frmPayList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSPay As Recordset +Dim moRSCREW As Recordset +Dim mboolAdding As Boolean, mboolPAINT As Boolean + +Private Sub cmd1TimeSheet_Click() +Dim strSQL As String, strSql2 As String, intYN As Integer +Dim oRS As Recordset, intCREWID As Long ', intCREWID As Integer + + On Error GoTo Error_EH + intYN = vbYes + '*Need to identify paint pay sheets ************************************************************* + + + gintPRINT = 1 + lstPayCrews.col = 1 + intCREWID = Field2Integer(lstPayCrews.ColText) + strSQL = "{tblcrew.crew_id} = " & intCREWID '3 +' strSQL = "{tblcrew.crew_id} = " & Left$(lstPayCrews.Text, 4) '3 + If mboolPAINT Then + crPAY.ReportFileName = App.Path & "\timesheetNewX.rpt" + Else + crPAY.ReportFileName = App.Path & "\timesheetNew.rpt" + End If +' crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPAY.SelectionFormula = strSQL + crPAY.Destination = crptToPrinter + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + +' ***************** Print Daily Pay Sheet - 5 copies +'' intYN = MsgBox("Do You Want To Print Daily Sheets?", vbYesNo + vbDefaultButton1, "Print Dailys") +' intYN = MsgBox("Do You Want To Print Daily Sheets?", "Print Dailys", vbYes) +' intYN = InputBox("Do You Want To Print Daily Sheets?", "Print Dailys", vbYes) +'' If intYN = vbYes Then +'' gintPRINT = 5 +' lstPayCrews.col = 1 +'' lstPayCrews.col = 0 +'' intCREWID = Field2Long(lstPayCrews.ColText) +' intCREWID = Field2Integer(lstPayCrews.ColText) +'' strSQL = "{tblpayCrew.Pay_id} = " & intCREWID '3 +'' crPay.ReportFileName = App.Path & "\dailyTimeSheet.rpt" +'' crPay.SelectionFormula = strSQL +'' crPay.Destination = crptToPrinter +'' crPay.CopiesToPrinter = gintPRINT + +'' crPay.Action = 1 +'' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmd1TimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmd1DailyTS_Click() +Dim strSQL As String, strSql2 As String, intYN As Integer +Dim oRS As Recordset, intCREWID As Long ', intCREWID As Integer + + On Error GoTo Error_EH +'' intYN = vbYes + '*Need to identify paint pay sheets ************************************************************* + + +'' gintPRINT = 1 +'' lstPayCrews.col = 1 +'' intCREWID = Field2Integer(lstPayCrews.ColText) +'' strSQL = "{tblcrew.crew_id} = " & intCREWID '3 +' strSQL = "{tblcrew.crew_id} = " & Left$(lstPayCrews.Text, 4) '3 +'' If mboolPAINT Then +'' crPay.ReportFileName = App.Path & "\timesheetNewX.rpt" +'' Else +'' crPay.ReportFileName = App.Path & "\timesheetNew.rpt" +'' End If +' crPay.ReportFileName = App.Path & "\timesheet.rpt" +'' crPay.SelectionFormula = strSQL +'' crPay.Destination = crptToPrinter +'' crPay.CopiesToPrinter = 1 +'' crPay.Action = 1 + +' ***************** Print Daily Pay Sheet - 5 copies +'' intYN = MsgBox("Do You Want To Print Daily Sheets?", vbYesNo + vbDefaultButton1, "Print Dailys") +' intYN = MsgBox("Do You Want To Print Daily Sheets?", "Print Dailys", vbYes) +' intYN = InputBox("Do You Want To Print Daily Sheets?", "Print Dailys", vbYes) +'' If intYN = vbYes Then + gintPRINT = 5 +' lstPayCrews.col = 1 + lstPayCrews.col = 0 + intCREWID = Field2Long(lstPayCrews.ColText) +' intCREWID = Field2Integer(lstPayCrews.ColText) + strSQL = "{tblpayCrew.Pay_id} = " & intCREWID '3 + crPAY.ReportFileName = App.Path & "\dailyTimeSheet.rpt" + crPAY.SelectionFormula = strSQL + crPAY.Destination = crptToPrinter + crPAY.CopiesToPrinter = gintPRINT + + crPAY.Action = 1 +'' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmd1DailyTimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() + +Dim intID As Integer, strSQL As String, lngINDEX As Long, lngFind As Long +Dim oRS As Recordset + On Error GoTo Error_EH + + cmdAdd.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = InputBox("Enter The Crew Number To Add", "Crew Number", 9999) + If intID > 0 Then + strSQL = "SELECT Crew_id, Crew_Boss, Type, Inactive FROM tblCREW WHERE crew_id = " & intID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!Crew_Boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + cmdAdd.Enabled = True + Exit Sub + End If + End If + If oRS.EOF Then + Call CrewLoad + Else + txtCrewId = oRS!CREW_ID + Call FormSave + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + + cmdAdd.SetFocus + End If + Else + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + cmdAdd.SetFocus + Exit Sub + End If + lngFind = Field2Long(intID) + Call CBFindString2(lstPayCrews, Field2Str(intID)) +' lstPayCrews.SetFocus +' lngINDEX = ListFindItem(lstPayCrews, lngFind) +' Call ListFindItem3(lstPayCrews, lngFind) +' lstPayCrews.ListIndex = lngINDEX + Exit Sub + +Error_EH: + If Err.Number = 13 Then + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + oRS.AddNew + oRS!C_USER = gstrLOGIN + End If + + + With oRS + !U_USER = gstrLOGIN + !Updated = Date + !CREW_ID = txtCrewId + !Pay_Date = dtpPayDate.Value + End With + + oRS.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSave + +' moRSPay.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + Exit Sub + +Error_EH: +' Call ErrorHandler(moRSPay.ActiveConnection) + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPayHeader WHERE Pay_Date = #" & dtpPayDate.Value & "# ORDER BY crew_id" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until moRSCREW.EOF + With lstPayCrews + strCREW = "SELECT * FROM tblCrew where CREW_id = " & moRSCREW!CREW_ID + Set oRS = New Recordset + oRS.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + strLine = Field2Str(moRSCREW!pay_id) & vbTab & Field2Str(moRSCREW!CREW_ID) & vbTab & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!Crew_Boss) + .AddItem strLine +' .ItemData(.NewIndex) = moRSCREW!pay_id +' strLine = Field2Str(moRSCREW!crew_id) & " " & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!crew_boss) +' .AddItem strLine +' .ItemData(.NewIndex) = moRSCREW!pay_id + End If + End With + + moRSCREW.MoveNext + Loop + moRSCREW.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + cmdAddMember.Enabled = True + cmdDelete.Enabled = True + cmdPrint.Enabled = True + cmdPrintCrew.Enabled = True + cmdPrintData.Enabled = True + cmdPrintTimeSheets.Enabled = True + cmdPrint1.Enabled = True + cmdPrint1Crew.Enabled = True + cmdPrintPayLog.Enabled = True + cmd1TimeSheet.Enabled = True + cmd1DailyTS.Enabled = True + cmdPRProcess.Enabled = True + cmdUpEmpMaster.Enabled = True + cmdMoveMAS90.Enabled = True + cmdPrDetail.Enabled = False +' cmdPrDetail.Enabled = True ' remove to turn back on. + + lstPayCrews.col = 0 + gintPAYID = Field2Long(lstPayCrews.ColText) + Else + cmdAddMember.Enabled = False + cmdDelete.Enabled = False + cmdPrint.Enabled = False + cmdPrintCrew.Enabled = False + cmdPrintData.Enabled = False + cmdPrintTimeSheets.Enabled = False + cmdPrint1.Enabled = False + cmdPrint1Crew.Enabled = False + cmdPrintPayLog.Enabled = False + cmd1TimeSheet.Enabled = False + cmd1DailyTS.Enabled = False + cmdPRProcess.Enabled = False + cmdUpEmpMaster.Enabled = False + cmdMoveMAS90.Enabled = False + cmdPrDetail.Enabled = False + ' Call ChangeButton + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddMember_Click() +Dim intINDEX As Integer + + If lstPayCrews.ListIndex <> -1 Then + intINDEX = lstPayCrews.ListIndex + lstPayCrews.col = 1 + gintCREWID = lstPayCrews.ColText +' gintCREWID = Left$(Field2Str2(lstPayCrews.Text), 4) '1 + frmCrewList.Show 1 + Call PayLoad + lstPayCrews.ListIndex = intINDEX + Else + MsgBox "You Must Select A Crew", vbOKOnly, "Select Crew" + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String, intPAYID As Long + + strYN = MsgBox("Are You Sure You Want To Delete This Crew?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + lstPayCrews.col = 0 + intPAYID = Field2Long(lstPayCrews.ColText) +' intPAYID = Field2Integer(lstPayCrews.ColText) + strSQL = "DELETE * FROM tblTIME where pay_id = " & intPAYID +' strSQL = "DELETE * FROM tblTIME where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayCrew where pay_id = " & intPAYID +' strSQL = "DELETE * FROM tblPayCrew where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayHeader WHERE pay_id = " & intPAYID +' strSQL = "DELETE * FROM tblPayHeader WHERE pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrintVWP_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintVWP_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMoveMAS90_Click() + Call CMSPRTransfer +End Sub + +Private Sub cmdMoveMAS90_Click_Hold() + MsgBox "Go to CMS and Import the Payroll As Daily Units", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub cmdPrDetail_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Remember to Update Check Information Before Printing - Are You Ready?", vbYesNo, "Ready to Print") + If intYN = vbNo Then + Exit Sub + End If + + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then +' strDate = dtpPayDate.Value + strDate = Format(dtpPayDate.Value, "MM/DD/YYYY") + intBYear = Mid(strDate, 7, 4) + intBDay = Format(Mid(strDate, 4, 2), "00") + intBMonth = Format(Mid(strDate, 1, 2), "00") +' intEYear = Mid(txtEndDate, 7, 4) +' intEDay = Format(Mid(txtEndDate, 4, 2), "00") +' intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crPAY.ReportFileName = App.Path & "\PayDetail.rpt" + + crPAY.Formulas(3) = "ZZ_Date = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" +' crpay.Formulas(4) = "Z_Crew = " & mintCREW +' crpay.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + crPAY.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrDetail_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + + +Private Sub cmdPrint_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint1_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, intPAYID As Long + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + lstPayCrews.col = 0 + intPAYID = Field2Long(lstPayCrews.ColText) +' intPAYID = Field2Integer(lstPayCrews.ColText) + strSQL = "{tblpayheader.pay_id} = " & intPAYID + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint1Crew_Click() +Dim strSQL As String, intPAYID As Long ', strSQL2 As String +'Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + lstPayCrews.col = 0 + intPAYID = Field2Long(lstPayCrews.ColText) +' intPAYID = Field2Integer(lstPayCrews.ColText) + + strSQL = "{tblpayheader.pay_id} = " & intPAYID + crPAY.ReportFileName = App.Path & "\payinfo2.rpt" + crPAY.SelectionFormula = strSQL + + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1Crew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintCrew_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo2.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintData_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + intMonth = Month(dtpPayDate.Value) + intDay = Day(dtpPayDate.Value) + intYear = Year(dtpPayDate.Value) +' Do Until oRS.EOF + strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPAY.ReportFileName = App.Path & "\paylist.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintData_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPayLog_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + intMonth = Month(dtpPayDate) + intDay = Day(dtpPayDate) + intYear = Year(dtpPayDate) +' Do Until oRS.EOF +' strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_Date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPAY.ReportFileName = App.Path & "\paylog.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintTimeSheets_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 +' frmReport.Show 1 + + strSql2 = "SELECT pay_id, crew_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblcrew.crew_id} = " & Field2Str2(oRS!CREW_ID) + crPAY.ReportFileName = App.Path & "\timesheetNew.rpt" +' crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + crPAY.Destination = crptToPrinter +' crPay.Destination = gintDEST + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + +' ***************** Print Daily Pay Sheet - 5 copies + gintPRINT = 5 +' lstPayCrews.col = 0 +' intCREWID = Field2Integer(lstPayCrews.ColText) + strSQL = "{tblpayCrew.Pay_id} = " & Field2Str2(oRS!pay_id) '3 + crPAY.ReportFileName = App.Path & "\dailyTimeSheet.rpt" + crPAY.SelectionFormula = strSQL + crPAY.Destination = crptToPrinter + crPAY.CopiesToPrinter = gintPRINT + + crPAY.Action = 1 + + + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintTimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPRProcess_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset + Screen.MousePointer = vbHourglass +' On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblPayHeader where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) + Set oRT = New Recordset + oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + Do Until oRT.EOF + With oRT + oRSS.AddNew + oRSS!employee_no = Field2Str(!Emp_ID) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str2(!gross) +' oRSS!amount = Field2Str2(!Reg_Wage) + oRSS!Rate = Field2Str2(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = "1" +' oRSS!earncode = "11" + oRSS!OT_Hours = Field2Str2(!OT_Hours) + oRSS!OT_Amt = Field2Str2(!OT_Wage) + oRSS!OT_TRANS = Field2Str2(!OT_Wage) / 1.5 + oRSS!REG_TRANS = Field2Str2(!REG_WAGE) +' oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End With + oRT.MoveNext + Loop + oRS!P_FLAG = vbUnchecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into CMS - Click On 'Move PR To CMS' to Setup Transfer File" + cmdMoveMAS90.SetFocus +' cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdUpEmp_Click() + frmEmployee.Show +End Sub + +Private Sub cmdUpEmpMaster_ClickOLD() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + +' If gboolMAS90 Then +' MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" +' Exit Sub +' End If + + strSql2 = "DELETE * FROM PR1_EmployeeMaster" + goConn.Execute strSql2 + + strSql2 = "SELECT department, employeenumber, lastname, firstname, socialsecuritynumber, DefaultWCCode, Terminated FROM PR1_EmployeeMaster" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE employeenumber = '" & Field2Str(oRSS!EmployeeNumber) & "' and department = '" & Field2Str(oRSS!department) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!EmployeeNumber = Field2Str(oRSS!EmployeeNumber) + oRS!LastName = Field2Str(Trim$(oRSS!LastName)) + oRS!FirstName = Field2Str(Trim$(oRSS!FirstName)) + oRS!SocialSecurityNumber = Field2Str(oRSS!SocialSecurityNumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!Terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + ElseIf Field2Str(oRSS!department) <> Field2Str(oRS!department) Then + oRS.Delete + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!EmployeeNumber = Field2Str(oRSS!EmployeeNumber) + oRS!LastName = Field2Str(Trim$(oRSS!LastName)) + oRS!FirstName = Field2Str(Trim$(oRSS!FirstName)) + oRS!SocialSecurityNumber = Field2Str(oRSS!SocialSecurityNumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!Terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update +' End If + Else + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!Terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + End If + oRSS.MoveNext + + Loop + Screen.MousePointer = vbDefault + MsgBox "Employee Master Information Has Been Updated" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdUpEmpMaster_Click() + frmEmployee.Show +End Sub + +Private Sub dtpPayDate_Change() + Call PayLoad + cmdAdd.SetFocus +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + glngPSID = 0 +' mboolSETUP = False +' mboolENTER = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyP Then ' Display key combinations. + If CtrlDown Then + Call lstPayCrews_DblClick +' Call PayLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAdd_Click +' Call CrewLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyM Then ' Display key combinations. + If CtrlDown Then + Call cmdAddMember_Click +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + frmPayList.Width = 4725 + dtpPayDate.Value = Date + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub CrewLoad() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblCrew Order BY Crew_Boss" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + .AddItem Field2Str(moRSCREW!Crew_Boss) + .ItemData(.NewIndex) = moRSCREW!CREW_ID + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmPayList.Width = 9150 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_DblClick() + txtCrewId = lstCrew.ItemData(lstCrew.ListIndex) + frmPayList.Width = 4725 + cmdAdd.Enabled = True + cmdDelete.Enabled = True + Call FormSave +End Sub + +Private Sub lstPayCrews_Click() +Dim strCrewType As String + lstPayCrews.col = 2 + strCrewType = Field2Str(lstPayCrews.ColText) + If strCrewType = "X" Then + mboolPAINT = True + Else + mboolPAINT = False + End If +End Sub + +Private Sub lstPayCrews_DblClick() +Dim strName As String, intPAYID As Long + lstPayCrews.col = 0 +' intPAYID = Field2Integer(lstPayCrews.ColText) + intPAYID = Field2Long(lstPayCrews.ColText) + + gintPAYID = intPAYID + lstPayCrews.col = 1 + gintCREWID = CInt(lstPayCrews.ColText) '2 +' gintCREWID = CInt(Left(lstPayCrews.Text, 4)) '2 + Load frmPayHead + lstPayCrews.col = 3 + strName = lstPayCrews.ColText + frmPayHead.lblCrewName = strName + frmPayHead.txtPayDate = dtpPayDate.Value + frmPayHead.txtCrewId = gintCREWID + lstPayCrews.col = 2 + frmPayHead.lblTYPE3 = lstPayCrews.ColText + + frmPayHead.Show 1 +End Sub + +Private Sub CMSPRTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strREGWAGE, strOTWAGE, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strREGHOUR, strOTHOUR ', strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String, strINV_DUE_Date As String, strDISC_Date As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long, strHR As String +Dim strMONTH As String, strDAY As String, strSEC As String, strWCCODE As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strDISC_PCT As String, strDISCYN As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") +' strMIN = Format(Minute(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + strFile = "PREXT" & strMONTH & strDAY & strHR & strMIN + strSQLLL = "SELECT * FROM tblPAYROLL ORDER BY EMPLOYEE_NO" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".csv" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + + Do Until oRSSS.EOF + strCUSTNo = oRSSS!employee_no + strINVDATE = dtpPayDate.Value +' strTType = "1" + strTType = "11" + strWCCODE = oRSSS!wc_code + strREGWAGE = oRSSS!REG_TRANS +' strREGWAGE = oRSSS!amount + strOTWAGE = oRSSS!OT_TRANS +' strOTWAGE = oRSSS!OT_Amt + strREGHOUR = oRSSS!HOURS_WAGES +' strOTHOUR = "2" + strOTHOUR = oRSSS!OT_Hours + + strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & strREGWAGE & "," & strOTWAGE & "," & "," & "," & "," & "," + strHEADER = strHEADER & "," & "," ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab +' strHEADER = strCUSTNo & vbTab & strINVDATE & vbTab & strTType & vbTab & strWCCODE & vbTab & strREGWAGE & vbTab & strOTWAGE & vbTab & vbTab & vbTab & vbTab & vbTab +' strHEADER = strHEADER & vbTab & vbTab ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + TStream.WriteLine (strHEADER) + + strTType = "9" + strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & "," & "," & "," & "," & "," & strREGHOUR & "," + strHEADER = strHEADER & "," & "," & strOTHOUR ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + TStream.WriteLine (strHEADER) + + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Payroll and IMPORT DAILY using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + + cmdExit.SetFocus +End Sub + +Private Sub CMSHRTransfer() +Dim strFile As String, strLINE1 As String, strLINE2 As String +Dim strHeadID, strCUSTNo, strSHIPADD, strCHG, strTType, strINVNO As String +Dim strREGWAGE, strOTWAGE, strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strREGHOUR, strOTHOUR ', strTaxCode, strINVDATE, strShipDate, strUDF1, strUDF2 As String +Dim strDetID, strSTOCK, strDESC, strTXABLE, strOQty, strSQty, strPRICE, strLType As String +Dim FSys As FileSystemObject, oRSSS As Recordset, strSQLLL As String, strEXT As String +Dim dblCHANGE As Double, lngDIF As Long, strMSG As String, strINV_DUE_Date As String, strDISC_Date As String +Dim lngCount As Long, lngSALES As Long, lngPO As Long, strHR As String +Dim strMONTH As String, strDAY As String, strSEC As String, strWCCODE As String +Dim strSTORE As String, strRate2 As String, strRate3 As String ', strRate3 As String +Dim strHEADER As String, strDETAIL As String, strLastInvNo As String +Dim TStream As TextStream, strMIN As String, strDISC_PCT As String, strDISCYN As String + + strDAY = Format(Day(Date), "00") + strMONTH = Format(Month(Date), "00") +' strMIN = Format(Minute(Date), "00") + strMIN = Format(Minute(Now), "00") + strHR = Format(Hour(Now), "00") + strFile = "PREXT" & strMONTH & strDAY & strHR & strMIN + strSQLLL = "SELECT * FROM tblPAYROLL ORDER BY EMPLOYEE_NO" + Set oRSSS = New Recordset + oRSSS.Open strSQLLL, goConn, adOpenDynamic, adLockOptimistic + + strEXT = "G:\CMSTrans\" & strFile & ".csv" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" +' strEXT = "G:\CMSTrans\" & strFile & ".VWP018" ' & gstrCOMPANY '& "Count\" & Trim$(strMONTH) & Trim$(strDAY) & Trim$(gstrCOMPANY) & Trim$(strSEC) & ".TXT" 'invXport.txt" 'Field2Str(oRSSS!companycode)" + Set FSys = New FileSystemObject + + Set TStream = FSys.CreateTextFile(strEXT, True) + + + Do Until oRSSS.EOF + strCUSTNo = oRSSS!employee_no + strINVDATE = dtpPayDate.Value +' strTType = "1" + strTType = "11" + strWCCODE = oRSSS!wc_code + strREGWAGE = oRSSS!REG_TRANS +' strREGWAGE = oRSSS!amount + strOTWAGE = oRSSS!OT_TRANS +' strOTWAGE = oRSSS!OT_Amt + strREGHOUR = oRSSS!HOURS_WAGES +' strOTHOUR = "2" + strOTHOUR = oRSSS!OT_Hours + + strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & strREGWAGE & "," & strOTWAGE & "," & "," & "," & "," & "," + strHEADER = strHEADER & "," & "," ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab +' strHEADER = strCUSTNo & vbTab & strINVDATE & vbTab & strTType & vbTab & strWCCODE & vbTab & strREGWAGE & vbTab & strOTWAGE & vbTab & vbTab & vbTab & vbTab & vbTab +' strHEADER = strHEADER & vbTab & vbTab ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + TStream.WriteLine (strHEADER) + + strTType = "9" + strHEADER = strCUSTNo & "," & strINVDATE & "," & strTType & "," & strWCCODE & "," & "," & "," & "," & "," & "," & strREGHOUR & "," + strHEADER = strHEADER & "," & "," & strOTHOUR ' & strINVDATE & vbTab & strINV_DUE_Date & vbTab & strDISC_Date & vbTab & vbTab & strINV_DUE_Date & vbTab & strDISCYN & vbTab + TStream.WriteLine (strHEADER) + + oRSSS.MoveNext + Loop + strMSG = "Export Complete - Go To CMS Payroll and IMPORT DAILY using an External File" ', vbInformation + vbOKOnly, "Export Complete") + strMSG = strMSG & vbCrLf & vbCrLf & "File Name: " & strEXT + MsgBox strMSG, vbInformation + vbOKOnly, "Export Complete" + + + Close #1 + + cmdExit.SetFocus +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frx new file mode 100644 index 0000000..6dd35c1 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frm new file mode 100644 index 0000000..aac1cbd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frm @@ -0,0 +1,1455 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayList + Caption = "Payroll List" + ClientHeight = 7995 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9030 + ControlBox = 0 'False + Enabled = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 7995 + ScaleWidth = 9030 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstCrew + Height = 3765 + Left = 4680 + TabIndex = 25 + Top = 1560 + Width = 4215 + _Version = 196608 + _ExtentX = 7435 + _ExtentY = 6641 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 3 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayList.frx":0000 + End + Begin VB.CheckBox chkBiWeekly + Caption = "Paid BiWeekly" + Height = 330 + Left = 5160 + TabIndex = 24 + Top = 6105 + Width = 1590 + End + Begin VB.CommandButton cmdPrDetail + Caption = "Print Pay Detail" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 23 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdUpEmpMaster + Caption = "Up Emp Master" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 22 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdMoveMAS90 + Caption = "Move PR to MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 21 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdPRProcess + Caption = "Setup PR for MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 20 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmd1TimeSheet + Caption = "1 Time Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 19 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPayLog + Caption = "Payroll Log" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 18 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1Crew + Caption = "1 Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 17 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1 + Caption = "1 VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 16 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintTimeSheets + Caption = "Time Sheets" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 15 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintData + Caption = "Data Input Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 14 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintCrew + Caption = "Print Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 13 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin Crystal.CrystalReport crPay + Left = 6900 + Top = 5520 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 12 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdAddMember + Caption = "Add &Members" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 5 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 6 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.TextBox txtCrewID + Height = 375 + Left = 5160 + TabIndex = 11 + TabStop = 0 'False + Top = 5580 + Visible = 0 'False + Width = 1215 + End + Begin VB.ListBox lstCrew5 + Height = 645 + ItemData = "frmPayList.frx":02BD + Left = 4680 + List = "frmPayList.frx":02C4 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 6600 + Width = 4215 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 7 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 4 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.ListBox lstPayCrews + Height = 3765 + Left = 120 + TabIndex = 2 + Top = 1560 + Width = 4455 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 315 + Left = 1320 + TabIndex = 0 + Top = 180 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 49086465 + CurrentDate = 36942 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired crew listed below to add the crew to the current payroll list." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5340 + TabIndex = 10 + Top = 660 + Width = 2955 + End + Begin VB.Label lblInstruct + Caption = "Double Click or CTRL P on the desired crew to view payroll informaton for that crew for the payroll date shown." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 9 + Top = 600 + Width = 4395 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Crews for this payroll:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 180 + TabIndex = 3 + Top = 1320 + Width = 1845 + End + Begin VB.Label lblPRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 360 + TabIndex = 1 + Top = 240 + Width = 900 + End +End +Attribute VB_Name = "frmPayList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSPay As Recordset +Dim moRSCREW As Recordset + +Dim mboolAdding As Boolean + +Private Sub cmd1TimeSheet_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + strSQL = "{tblcrew.crew_id} = " & Left$(lstPayCrews.Text, 3) + crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPay.SelectionFormula = strSQL + crPay.Destination = crptToPrinter + crPay.CopiesToPrinter = 1 + crPay.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmd1TimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +Dim intID As Integer, strSQL As String, lngINDEX As Long, lngFind As Long +Dim oRS As Recordset + On Error GoTo Error_EH + + cmdAdd.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = InputBox("Enter The Crew Number To Add", "Crew Number", 999) + If intID > 0 Then + strSQL = "SELECT Crew_id, Crew_Boss, Type, Inactive, BiWeekly FROM tblCREW WHERE crew_id = " & intID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + cmdAdd.Enabled = True + Exit Sub + End If + End If + If oRS.EOF Then + Call CrewLoad + Else + txtCrewID = oRS!crew_id + chkBiWeekly = Field2CheckBox(oRS!BiWeekly) + Call FormSave + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + + cmdAdd.SetFocus + End If + Else + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + cmdAdd.SetFocus + Exit Sub + End If + lngFind = Field2Long(intID) + Call CBFindString2(lstPayCrews, Field2Str(intID)) +' lstPayCrews.SetFocus +' lngINDEX = ListFindItem(lstPayCrews, lngFind) +' Call ListFindItem3(lstPayCrews, lngFind) +' lstPayCrews.ListIndex = lngINDEX + Exit Sub + +Error_EH: + If Err.Number = 13 Then + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + oRS.AddNew + oRS!C_USER = gstrLOGIN + End If + + + With oRS + !U_USER = gstrLOGIN + !Updated = Date + !crew_id = txtCrewID + !Pay_Date = dtpPayDate.Value + !BiWeekly = chkBiWeekly + End With + + oRS.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSave + +' moRSPay.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + Exit Sub + +Error_EH: +' Call ErrorHandler(moRSPay.ActiveConnection) + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPayHeader WHERE Pay_Date = #" & dtpPayDate.Value & "# ORDER BY crew_id" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until moRSCREW.EOF + With lstPayCrews + strCREW = "SELECT * FROM tblCrew where CREW_id = " & moRSCREW!crew_id + Set oRS = New Recordset + oRS.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + strLine = Field2Str(moRSCREW!crew_id) & " " & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!crew_boss) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!pay_id + End If + End With + + moRSCREW.MoveNext + Loop + moRSCREW.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + cmdAddMember.Enabled = True + cmdDelete.Enabled = True + cmdPrint.Enabled = True + cmdPrintCrew.Enabled = True + cmdPrintData.Enabled = True + cmdPrintTimeSheets.Enabled = True + cmdPrint1.Enabled = True + cmdPrint1Crew.Enabled = True + cmdPrintPayLog.Enabled = True + cmd1TimeSheet.Enabled = True + cmdPRProcess.Enabled = True + cmdUpEmpMaster.Enabled = True + cmdMoveMAS90.Enabled = True + cmdPrDetail.Enabled = True + + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + Else + cmdAddMember.Enabled = False + cmdDelete.Enabled = False + cmdPrint.Enabled = False + cmdPrintCrew.Enabled = False + cmdPrintData.Enabled = False + cmdPrintTimeSheets.Enabled = False + cmdPrint1.Enabled = False + cmdPrint1Crew.Enabled = False + cmdPrintPayLog.Enabled = False + cmd1TimeSheet.Enabled = False + cmdPRProcess.Enabled = False + cmdUpEmpMaster.Enabled = False + cmdMoveMAS90.Enabled = False + cmdPrDetail.Enabled = False + ' Call ChangeButton + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddMember_Click() +Dim intINDEX As Integer + If lstPayCrews.ListIndex <> -1 Then + intINDEX = lstPayCrews.ListIndex + gintCREWID = Left$(Field2Str2(lstPayCrews.Text), 3) + frmCrewList.Show 1 + Call PayLoad + lstPayCrews.ListIndex = intINDEX + Else + MsgBox "You Must Select A Crew", vbOKOnly, "Select Crew" + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + + strYN = MsgBox("Are You Sure You Want To Delete This Crew?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblTIME where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayCrew where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayHeader WHERE pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrintVWP_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintVWP_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMoveMAS90_Click() + MsgBox "Go to MAS90 and Import the Payroll", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub cmdPrDetail_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Remember to Update Check Information Before Printing - Are You Ready?", vbYesNo, "Ready to Print") + If intYN = vbNo Then + Exit Sub + End If + + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + strDate = dtpPayDate.Value + intBYear = Mid(strDate, 7, 4) + intBDay = Format(Mid(strDate, 4, 2), "00") + intBMonth = Format(Mid(strDate, 1, 2), "00") +' intEYear = Mid(txtEndDate, 7, 4) +' intEDay = Format(Mid(txtEndDate, 4, 2), "00") +' intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crPay.ReportFileName = App.Path & "\PayDetail.rpt" + + crPay.Formulas(3) = "ZZ_Date = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" +' crpay.Formulas(4) = "Z_Crew = " & mintCREW +' crpay.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crPay.Destination = crptToPrinter + Else + crPay.Destination = crptToWindow + End If + crPay.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrDetail_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + + +Private Sub cmdPrint_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint1_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPay.ReportFileName = App.Path & "\payinfo.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint1Crew_Click() +Dim strSQL As String ', strSQL2 As String +'Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPay.ReportFileName = App.Path & "\payinfo2.rpt" + crPay.SelectionFormula = strSQL + + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1Crew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintCrew_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPay.ReportFileName = App.Path & "\payinfo2.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintData_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + intMonth = Month(dtpPayDate.Value) + intDay = Day(dtpPayDate.Value) + intYear = Year(dtpPayDate.Value) +' Do Until oRS.EOF + strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPay.ReportFileName = App.Path & "\paylist.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintData_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPayLog_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + intMonth = Month(dtpPayDate) + intDay = Day(dtpPayDate) + intYear = Year(dtpPayDate) +' Do Until oRS.EOF +' strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_Date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPay.ReportFileName = App.Path & "\paylog.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPay.Destination = gintDEST + crPay.CopiesToPrinter = gintCOPY + crPay.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintTimeSheets_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 +' frmReport.Show 1 + + strSql2 = "SELECT crew_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblcrew.crew_id} = " & Field2Str2(oRS!crew_id) + crPay.ReportFileName = App.Path & "\timesheet.rpt" + crPay.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + crPay.Destination = crptToPrinter +' crPay.Destination = gintDEST + crPay.CopiesToPrinter = 1 + crPay.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintTimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPRProcess_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblPayHeader where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) + Set oRT = New Recordset + oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + Do Until oRT.EOF + With oRT + oRSS.AddNew + oRSS!employee_no = Field2Str(!emp_id) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str(!gross) + oRSS!Rate = Field2Str(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End With + oRT.MoveNext + Loop + oRS!P_FLAG = vbUnchecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into MAS90" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdUpEmpMaster_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strSql2 = "DELETE * FROM PR1_EmployeeMaster" + goConn.Execute strSql2 + + strSql2 = "SELECT department, employeenumber, lastname, firstname, socialsecuritynumber, DefaultWCCode, employeestatus_AIT FROM PR1_EmployeeMaster" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE employeenumber = '" & Field2Str(oRSS!employeenumber) & "' and department = '" & Field2Str(oRSS!department) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + ElseIf Field2Str(oRSS!department) <> Field2Str(oRS!department) Then + oRS.Delete + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update +' End If + Else + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + End If + oRSS.MoveNext + + Loop + Screen.MousePointer = vbDefault + MsgBox "Employee Master Information Has Been Updated" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub dtpPayDate_Change() + Call PayLoad + cmdAdd.SetFocus +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + +' mboolSETUP = False +' mboolENTER = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyP Then ' Display key combinations. + If CtrlDown Then + Call lstPayCrews_DblClick +' Call PayLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAdd_Click +' Call CrewLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyM Then ' Display key combinations. + If CtrlDown Then + Call cmdAddMember_Click +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + frmPayList.Width = 4725 + dtpPayDate.Value = Date + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub CrewLoad() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblCrew Order BY Crew_Boss" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + .AddItem Field2Str(moRSCREW!crew_id) & vbTab & Field2Str(moRSCREW!crew_boss) & vbTab & Field2Str(moRSCREW!BiWeekly) +' .ItemData(.NewIndex) = moRSCREW!crew_id + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmPayList.Width = 9150 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_Click() + lstCrew.col = 0 + txtCrewID = lstCrew.ColText + lstCrew.col = 2 + chkBiWeekly = Field2CheckBox(lstCrew.ColText) + +End Sub + +Private Sub lstCrew_DblClick() + lstCrew.col = 0 + txtCrewID = lstCrew.ColText + lstCrew.col = 2 + chkBiWeekly = Field2CheckBox(lstCrew.ColText) +'' txtCrewID = lstCrew.ItemData(lstCrew.ListIndex) + frmPayList.Width = 4725 + cmdAdd.Enabled = True + cmdDelete.Enabled = True + Call FormSave +End Sub + +Private Sub lstPayCrews_DblClick() + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + gintCREWID = CInt(Left(lstPayCrews.Text, 3)) + Load frmPayHead + frmPayHead.lblCrewName = Trim$(Mid$(lstPayCrews.Text, InStr(lstPayCrews.Text, vbTab) + 1)) + frmPayHead.txtPayDate = dtpPayDate.Value + frmPayHead.txtCrewID = gintCREWID + frmPayHead.chkBiWeekly = chkBiWeekly + frmPayHead.Show 1 +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frx new file mode 100644 index 0000000..fbe497a Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayList1015.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayListGood.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayListGood.frm new file mode 100644 index 0000000..5f2fe5f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayListGood.frm @@ -0,0 +1,1332 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" +Begin VB.Form frmPayList + Caption = "Payroll List" + ClientHeight = 7995 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9030 + ControlBox = 0 'False + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 7995 + ScaleWidth = 9030 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrDetail + Caption = "Print Pay Detail" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 23 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdUpEmpMaster + Caption = "Up Emp Master" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 22 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdMoveMAS90 + Caption = "Move PR to MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 21 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmdPRProcess + Caption = "Setup PR for MAS90" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 20 + Top = 7380 + Width = 1035 + End + Begin VB.CommandButton cmd1TimeSheet + Caption = "1 Time Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 19 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintPayLog + Caption = "Payroll Log" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 18 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1Crew + Caption = "1 Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 17 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrint1 + Caption = "1 VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 16 + TabStop = 0 'False + Top = 6720 + Width = 1035 + End + Begin VB.CommandButton cmdPrintTimeSheets + Caption = "Time Sheets" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 15 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintData + Caption = "Data Input Sheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 14 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdPrintCrew + Caption = "Print Crew Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 13 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin Crystal.CrystalReport crPay + Left = 6900 + Top = 5520 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "Print VWP Summary" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 12 + TabStop = 0 'False + Top = 6060 + Width = 1035 + End + Begin VB.CommandButton cmdAddMember + Caption = "Add &Members" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 1260 + TabIndex = 5 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 2400 + TabIndex = 6 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.TextBox txtCrewID + Height = 375 + Left = 5160 + TabIndex = 11 + TabStop = 0 'False + Top = 5580 + Visible = 0 'False + Width = 1215 + End + Begin VB.ListBox lstCrew + Height = 3765 + Left = 4680 + Sorted = -1 'True + TabIndex = 8 + TabStop = 0 'False + Top = 1560 + Width = 4215 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Crew" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 3540 + TabIndex = 7 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Crew" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 120 + TabIndex = 4 + TabStop = 0 'False + Top = 5400 + Width = 1035 + End + Begin VB.ListBox lstPayCrews + Height = 3765 + Left = 120 + TabIndex = 2 + Top = 1560 + Width = 4455 + End + Begin MSComCtl2.DTPicker dtpPayDate + Height = 315 + Left = 1320 + TabIndex = 0 + Top = 180 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 20250625 + CurrentDate = 36942 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblCrewInstruct + Caption = "Double Click or CTRL S on the desired crew listed below to add the crew to the current payroll list." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5340 + TabIndex = 10 + Top = 660 + Width = 2955 + End + Begin VB.Label lblInstruct + Caption = "Double Click or CTRL P on the desired crew to view payroll informaton for that crew for the payroll date shown." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 180 + TabIndex = 9 + Top = 600 + Width = 4395 + End + Begin VB.Label lblCrew + AutoSize = -1 'True + Caption = "Crews for this payroll:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 180 + TabIndex = 3 + Top = 1320 + Width = 1845 + End + Begin VB.Label lblPRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Payroll Date:" + Height = 195 + Left = 360 + TabIndex = 1 + Top = 240 + Width = 900 + End +End +Attribute VB_Name = "frmPayList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSPay As Recordset +Dim moRSCREW As Recordset + +Dim mboolAdding As Boolean + +Private Sub cmd1TimeSheet_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + strSQL = "{tblcrew.crew_id} = " & Left$(lstPayCrews.Text, 3) + crPAY.ReportFileName = App.Path & "\timesheet.rpt" + crPAY.SelectionFormula = strSQL + crPAY.Destination = crptToPrinter + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmd1TimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +Dim intID As Integer, strSQL As String, lngINDEX As Long, lngFind As Long +Dim oRS As Recordset + On Error GoTo Error_EH + + cmdAdd.Enabled = False + cmdDelete.Enabled = False + 'Code to Add a Crew + mboolAdding = True + intID = InputBox("Enter The Crew Number To Add", "Crew Number", 999) + If intID > 0 Then + strSQL = "SELECT Crew_id, Crew_Boss, Type, Inactive FROM tblCREW WHERE crew_id = " & intID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + cmdAdd.Enabled = True + Exit Sub + End If + End If + If oRS.EOF Then + Call CrewLoad + Else + txtCrewId = oRS!crew_id + Call FormSave + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + + cmdAdd.SetFocus + End If + Else + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + cmdAdd.SetFocus + Exit Sub + End If + lngFind = Field2Long(intID) + Call CBFindString2(lstPayCrews, Field2Str(intID)) +' lstPayCrews.SetFocus +' lngINDEX = ListFindItem(lstPayCrews, lngFind) +' Call ListFindItem3(lstPayCrews, lngFind) +' lstPayCrews.ListIndex = lngINDEX + Exit Sub + +Error_EH: + If Err.Number = 13 Then + cmdAdd.Enabled = True + If lstPayCrews.ListCount Then + cmdDelete.Enabled = True + End If + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPayHeader WHERE pay_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + oRS.AddNew + oRS!C_USER = gstrLOGIN + End If + + + With oRS + !U_USER = gstrLOGIN + !Updated = Date + !crew_id = txtCrewId + !Pay_Date = dtpPayDate.Value + End With + + oRS.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + + ' Store the controls to the recordset + Call FieldsSave + +' moRSPay.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call PayLoad + + Exit Sub + +Error_EH: +' Call ErrorHandler(moRSPay.ActiveConnection) + gstrMODULE = "Form PayList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, strCREW As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPayHeader WHERE Pay_Date = #" & dtpPayDate.Value & "# ORDER BY crew_id" + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayCrews.Clear + + Do Until moRSCREW.EOF + With lstPayCrews + strCREW = "SELECT * FROM tblCrew where CREW_id = " & moRSCREW!crew_id + Set oRS = New Recordset + oRS.Open strCREW, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + strLine = Field2Str(moRSCREW!crew_id) & " " & Field2Str(oRS!Type) & vbTab & Field2Str(oRS!crew_boss) + .AddItem strLine + .ItemData(.NewIndex) = moRSCREW!pay_id + End If + End With + + moRSCREW.MoveNext + Loop + moRSCREW.Close + + If lstPayCrews.ListCount Then + lstPayCrews.ListIndex = 0 + cmdAddMember.Enabled = True + cmdDelete.Enabled = True + cmdPrint.Enabled = True + cmdPrintCrew.Enabled = True + cmdPrintData.Enabled = True + cmdPrintTimeSheets.Enabled = True + cmdPrint1.Enabled = True + cmdPrint1Crew.Enabled = True + cmdPrintPayLog.Enabled = True + cmd1TimeSheet.Enabled = True + cmdPRProcess.Enabled = True + cmdUpEmpMaster.Enabled = True + cmdMoveMAS90.Enabled = True + cmdPrDetail.Enabled = True + + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + Else + cmdAddMember.Enabled = False + cmdDelete.Enabled = False + cmdPrint.Enabled = False + cmdPrintCrew.Enabled = False + cmdPrintData.Enabled = False + cmdPrintTimeSheets.Enabled = False + cmdPrint1.Enabled = False + cmdPrint1Crew.Enabled = False + cmdPrintPayLog.Enabled = False + cmd1TimeSheet.Enabled = False + cmdPRProcess.Enabled = False + cmdUpEmpMaster.Enabled = False + cmdMoveMAS90.Enabled = False + cmdPrDetail.Enabled = False + ' Call ChangeButton + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module PayLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAddMember_Click() +Dim intINDEX As Integer + If lstPayCrews.ListIndex <> -1 Then + intINDEX = lstPayCrews.ListIndex + gintCREWID = Left$(Field2Str2(lstPayCrews.Text), 3) + frmCrewList.Show 1 + Call PayLoad + lstPayCrews.ListIndex = intINDEX + Else + MsgBox "You Must Select A Crew", vbOKOnly, "Select Crew" + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + + strYN = MsgBox("Are You Sure You Want To Delete This Crew?", vbCritical + vbYesNo, "Delete?") + + If strYN <> vbYes Then + Exit Sub + End If + + strSQL = "DELETE * FROM tblTIME where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayCrew where pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + strSQL = "DELETE * FROM tblPayHeader WHERE pay_id = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + goConn.Execute strSQL + + Call PayLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrintVWP_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintVWP_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdMoveMAS90_Click() + MsgBox "Go to MAS90 and Import the Payroll", vbOKOnly, "Goto MAS90" +End Sub + +Private Sub cmdPrDetail_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String +Dim strBegDate As String, strEndDate As String +Dim intBYear As String, intBMonth As String, intBDay As String +Dim intEYear As String, intEMonth As String, intEDay As String + On Error GoTo Error_EH + + gboolPRINT = True + intYN = MsgBox("Remember to Update Check Information Before Printing - Are You Ready?", vbYesNo, "Ready to Print") + If intYN = vbNo Then + Exit Sub + End If + + intYN = MsgBox("Do You Want To Print to the Printer?", vbYesNo, "Window or Printer") + If gboolPRINT Then + strDate = dtpPayDate.Value + intBYear = Mid(strDate, 7, 4) + intBDay = Format(Mid(strDate, 4, 2), "00") + intBMonth = Format(Mid(strDate, 1, 2), "00") +' intEYear = Mid(txtEndDate, 7, 4) +' intEDay = Format(Mid(txtEndDate, 4, 2), "00") +' intEMonth = Format(Mid(txtEndDate, 1, 2), "00") + + crPAY.ReportFileName = App.Path & "\PayDetail.rpt" + + crPAY.Formulas(3) = "ZZ_Date = Date(" & intBYear & "," & intBMonth & "," & intBDay & ")" +' crpay.Formulas(4) = "Z_Crew = " & mintCREW +' crpay.Formulas(5) = "Z_EndDate = Date(" & intEYear & "," & intEMonth & "," & intEDay & ")" + + If intYN = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + crPAY.Action = 1 + + gboolPRINT = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrDetail_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + + +Private Sub cmdPrint_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint1_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPAY.ReportFileName = App.Path & "\payinfo.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint1Crew_Click() +Dim strSQL As String ', strSQL2 As String +'Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSQL = "{tblpayheader.pay_id} = " & lstPayCrews.ItemData(lstPayCrews.ListIndex) + crPAY.ReportFileName = App.Path & "\payinfo2.rpt" + crPAY.SelectionFormula = strSQL + + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint1Crew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintCrew_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + strSql2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblpayheader.pay_id} = " & Field2Str2(oRS!pay_id) + crPAY.ReportFileName = App.Path & "\payinfo2.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintData_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + intMonth = Month(dtpPayDate.Value) + intDay = Day(dtpPayDate.Value) + intYear = Year(dtpPayDate.Value) +' Do Until oRS.EOF + strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPAY.ReportFileName = App.Path & "\paylist.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintData_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintPayLog_Click() +Dim strSQL As String, intMonth As Integer, intDay As Integer, intYear As Integer + + On Error GoTo Error_EH + + gintPRINT = 1 + frmReport.Show 1 + + intMonth = Month(dtpPayDate) + intDay = Day(dtpPayDate) + intYear = Year(dtpPayDate) +' Do Until oRS.EOF +' strSQL = "{tblpaycrew.pay_date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + +' strSQL2 = "SELECT pay_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" +' Set oRS = New Recordset +' oRS.Open strSQL2, goConn, adOpenKeyset, adLockOptimistic +' oRS.MoveFirst +' Do Until oRS.EOF + strSQL = "{tblpayheader.pay_Date} = Date(" & intYear & "," & intMonth & "," & intDay & ")" + crPAY.ReportFileName = App.Path & "\paylog.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Destination = gintDEST + crPAY.CopiesToPrinter = gintCOPY + crPAY.Action = 1 +' oRS.MoveNext +' Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrintTimeSheets_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + gintPRINT = 1 +' frmReport.Show 1 + + strSql2 = "SELECT crew_id, Pay_Date FROM tblPayHeader WHERE pay_date = #" & dtpPayDate & "# ORDER BY Crew_Id" + Set oRS = New Recordset + oRS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + oRS.MoveFirst + Do Until oRS.EOF + strSQL = "{tblcrew.crew_id} = " & Field2Str2(oRS!crew_id) + crPAY.ReportFileName = App.Path & "\timesheet.rpt" + crPAY.SelectionFormula = strSQL +' crPay.Destination = crptToWindow + crPAY.Destination = crptToPrinter +' crPay.Destination = gintDEST + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + oRS.MoveNext + Loop + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module cmdPrintTimeSheet_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPRProcess_Click() +Dim strSQL As String, strSql2 As String, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset, oRT As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + strSql2 = "DELETE * FROM tblPayroll" + goConn.Execute strSql2 + + + strSQL = "SELECT * FROM tblPayHeader where Pay_Date = #" & dtpPayDate.Value & "# and p_flag" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPayroll" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + strSELECT = "SELECT * FROM tblPayCrew where Pay_Id = " & Field2Str2(oRS!pay_id) + Set oRT = New Recordset + oRT.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + Do Until oRT.EOF + With oRT + oRSS.AddNew + oRSS!employee_no = Field2Str(!emp_id) + oRSS!HOURS_WAGES = Field2Str(!hours) + oRSS!amount = Field2Str(!gross) + oRSS!Rate = Field2Str(!Rate) + oRSS!wc_code = Field2Str(!wc_code) + oRSS!earncode = "01" + If Field2Str(!autodeduct) = "" Then + oRSS!auto_deduction = "N" + Else + oRSS!auto_deduction = Field2Str(!autodeduct) + End If + oRSS.Update + End With + oRT.MoveNext + Loop + oRS!P_FLAG = vbUnchecked + oRS.Update + oRS.MoveNext + Loop + + + Screen.MousePointer = vbDefault + MsgBox "Payroll Is Ready To Be Imported Into MAS90" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub cmdUpEmpMaster_Click() +Dim strSQL As String, strSql2 As String +Dim oRS As Recordset, oRSS As Recordset + Screen.MousePointer = vbHourglass + On Error GoTo Error_EH + + If gboolMAS90 Then + MsgBox "No MAS90 Database on this computer", vbOKOnly, "No MAS90" + Exit Sub + End If + + strSql2 = "DELETE * FROM PR1_EmployeeMaster" + goConn.Execute strSql2 + + strSql2 = "SELECT department, employeenumber, lastname, firstname, socialsecuritynumber, DefaultWCCode, employeestatus_AIT FROM PR1_EmployeeMaster" + Set oRSS = New Recordset + oRSS.Open strSql2, goConn2, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + strSQL = "SELECT * FROM PR1_EmployeeMaster WHERE employeenumber = '" & Field2Str(oRSS!employeenumber) & "' and department = '" & Field2Str(oRSS!department) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If oRS.EOF Then + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + ElseIf Field2Str(oRSS!department) <> Field2Str(oRS!department) Then + oRS.Delete + oRS.AddNew + oRS!department = Field2Str(oRSS!department) + oRS!employeenumber = Field2Str(oRSS!employeenumber) + oRS!lastname = Field2Str(Trim$(oRSS!lastname)) + oRS!firstname = Field2Str(Trim$(oRSS!firstname)) + oRS!socialsecuritynumber = Field2Str(oRSS!socialsecuritynumber) + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update +' End If + Else + If Field2Str(oRSS!defaultwccode) = "" Then + If oRS!department = "53" Then + oRS!wc_code = "0005022" + ElseIf oRS!department = "52" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "54" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "55" Then + oRS!wc_code = "0005606" + ElseIf oRS!department = "50" Then + oRS!wc_code = "0005443" + ElseIf oRS!department = "62" Then + oRS!wc_code = "0008810" + ElseIf oRS!department = "61" Then + oRS!wc_code = "0008810" + End If + Else + oRS!wc_code = Field2Str(oRSS!defaultwccode) + End If + oRS!terminated = Field2Str(oRSS!employeestatus_AIT) + oRS.Update + End If + oRSS.MoveNext + + Loop + Screen.MousePointer = vbDefault + MsgBox "Employee Master Information Has Been Updated" + cmdExit.SetFocus + Exit Sub +Error_EH: + gstrMODULE = "Form PayList - Module cmdPRProcess_Click" + Call ErrorHandler2 + gstrMODULE = "" + Screen.MousePointer = vbDefault + Exit Sub +End Sub + +Private Sub dtpPayDate_Change() + Call PayLoad + cmdAdd.SetFocus +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + +' mboolSETUP = False +' mboolENTER = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyP Then ' Display key combinations. + If CtrlDown Then + Call lstPayCrews_DblClick +' Call PayLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyA Then ' Display key combinations. + If CtrlDown Then + Call cmdAdd_Click +' Call CrewLoad +' Call cmdTotal_Click + End If + Exit Sub + End If + If KeyCode = vbKeyM Then ' Display key combinations. + If CtrlDown Then + Call cmdAddMember_Click +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + If KeyCode = vbKeyS Then ' Display key combinations. + If CtrlDown Then + Call lstCrew_DblClick +' Call CrewLoad +' Call cmdTotal_Click +' Call lstLots_DblClick + End If + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + On Error GoTo Error_EH + frmPayList.Width = 4725 + dtpPayDate.Value = Date + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub CrewLoad() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblCrew Order BY Crew_Boss" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until moRSCREW.EOF + With lstCrew + .AddItem Field2Str(moRSCREW!crew_boss) + .ItemData(.NewIndex) = moRSCREW!crew_id + End With + moRSCREW.MoveNext + Loop +' moRSCrew.Close + frmPayList.Width = 9150 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PayList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstCrew_DblClick() + txtCrewId = lstCrew.ItemData(lstCrew.ListIndex) + frmPayList.Width = 4725 + cmdAdd.Enabled = True + cmdDelete.Enabled = True + Call FormSave +End Sub + +Private Sub lstPayCrews_DblClick() + gintPAYID = lstPayCrews.ItemData(lstPayCrews.ListIndex) + gintCREWID = CInt(Left(lstPayCrews.Text, 3)) + Load frmPayHead + frmPayHead.lblCrewName = Trim$(Mid$(lstPayCrews.Text, InStr(lstPayCrews.Text, vbTab) + 1)) + frmPayHead.txtPayDate = dtpPayDate.Value + frmPayHead.txtCrewId = gintCREWID + + frmPayHead.Show 1 +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frm new file mode 100644 index 0000000..91e2684 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frm @@ -0,0 +1,3903 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPaySheet + Caption = "Pay Sheet Information" + ClientHeight = 6435 + ClientLeft = 165 + ClientTop = 735 + ClientWidth = 8310 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6435 + ScaleWidth = 8310 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + Begin LpLib.fpList lstPayInfo + Height = 1620 + Left = 120 + TabIndex = 71 + Top = 480 + Width = 5055 + _Version = 196608 + _ExtentX = 8916 + _ExtentY = 2857 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPaySheet.frx":0000 + End + Begin VB.CommandButton cmdCREW + Appearance = 0 'Flat + Caption = "CREW" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1095 + Left = 7905 + TabIndex = 70 + Top = 3075 + Visible = 0 'False + Width = 360 + End + Begin VB.TextBox txtIWYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 65 + Top = 600 + Width = 750 + End + Begin VB.TextBox txtWrapYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 64 + Top = 600 + Width = 750 + End + Begin VB.CheckBox chkBC + Caption = "B/C" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 63 + Top = 3135 + Width = 975 + End + Begin VB.CheckBox chkPaid + Alignment = 1 'Right Justify + BackColor = &H00FFFF00& + Caption = "PaySheet Paid" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 3300 + TabIndex = 62 + Top = 2220 + Visible = 0 'False + Width = 1695 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 915 + Left = 1035 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 22 + Top = 5490 + Width = 7215 + End + Begin VB.TextBox txtMDesc + Enabled = 0 'False + Height = 375 + Left = 1035 + MaxLength = 40 + TabIndex = 21 + Top = 5070 + Width = 5505 + End + Begin VB.CheckBox chkInvalid + BackColor = &H0080FFFF& + Caption = "Invalid PaySheet" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 255 + Left = 5670 + TabIndex = 59 + Top = 3855 + Visible = 0 'False + Width = 2175 + End + Begin VB.TextBox txtIFrames + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 56 + Top = 2775 + Width = 750 + End + Begin VB.TextBox txtFrames + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 55 + Top = 2775 + Width = 750 + End + Begin VB.TextBox txtIStYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 54 + Top = 1695 + Width = 750 + End + Begin VB.TextBox txtStYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 53 + Top = 1695 + Width = 750 + End + Begin VB.TextBox txtMDollars + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 51 + Top = 3495 + Width = 750 + End + Begin VB.TextBox txtIStone + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 49 + Top = 2415 + Width = 750 + End + Begin VB.TextBox txtICMU + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 48 + Top = 2055 + Width = 750 + End + Begin VB.TextBox txtIMetal + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 47 + Top = 1335 + Width = 750 + End + Begin VB.TextBox txtILYds + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7050 + TabIndex = 46 + Top = 975 + Width = 750 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 39 + Top = 975 + Width = 750 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 38 + Top = 1335 + Width = 750 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 37 + Top = 2055 + Width = 750 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 36 + Top = 3135 + Width = 750 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6210 + TabIndex = 35 + Top = 2415 + Width = 750 + End + Begin VB.TextBox txtFtMetal + Height = 315 + Left = 1020 + TabIndex = 20 + Top = 3240 + Width = 1695 + End + Begin VB.TextBox txtYdge + Height = 315 + Left = 1020 + TabIndex = 19 + Top = 2880 + Width = 1695 + End + Begin VB.ComboBox cboType + Height = 315 + ItemData = "frmPaySheet.frx":039D + Left = 1020 + List = "frmPaySheet.frx":03BC + Style = 2 'Dropdown List + TabIndex = 17 + Top = 2160 + Width = 1695 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 6810 + TabIndex = 24 + Top = 4215 + Width = 1455 + End + Begin VB.CommandButton cmdAddPS + Caption = "&Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 5310 + TabIndex = 3 + Top = 4215 + Width = 1455 + End + Begin VB.CommandButton cmdRePrint + Caption = "Re&Print" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 5310 + TabIndex = 2 + Top = 4665 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 360 + Left = 6810 + TabIndex = 1 + Top = 4665 + Width = 1455 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1020 + TabIndex = 18 + Top = 2520 + Width = 2115 + _Version = 196608 + _ExtentX = 3731 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPaySheet.frx":0412 + End + Begin Crystal.CrystalReport crPAY + Left = 7830 + Top = 30 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.Label Label5 + Caption = "Crew" + Height = 180 + Left = 3765 + TabIndex = 76 + Top = 285 + Width = 750 + End + Begin VB.Label Label4 + Caption = "Metal" + Height = 180 + Left = 1980 + TabIndex = 75 + Top = 285 + Width = 630 + End + Begin VB.Label Label3 + Caption = "Yrds" + Height = 180 + Left = 1320 + TabIndex = 74 + Top = 285 + Width = 480 + End + Begin VB.Label Label2 + Caption = "Wrk" + Height = 180 + Left = 705 + TabIndex = 73 + Top = 285 + Width = 495 + End + Begin VB.Label Label1 + Alignment = 2 'Center + Caption = "Typ" + Height = 180 + Left = 195 + TabIndex = 72 + Top = 285 + Width = 390 + End + Begin VB.Label lblTexture + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5220 + TabIndex = 69 + Top = 3810 + Width = 390 + End + Begin VB.Label lblA + Caption = "A" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 7965 + TabIndex = 68 + Top = 120 + Width = 225 + End + Begin VB.Label lblUpPntPay + BackColor = &H0080FFFF& + Caption = "Paint Pay Updated" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 240 + Left = 6630 + TabIndex = 67 + Top = 5190 + Visible = 0 'False + Width = 1635 + End + Begin VB.Label lblWrap + AutoSize = -1 'True + Caption = "Wrap Yds:" + Height = 195 + Left = 5430 + TabIndex = 66 + Top = 630 + Width = 750 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + Caption = "PaySheet Notes:" + Height = 435 + Left = 195 + TabIndex = 61 + Top = 5550 + Width = 795 + End + Begin VB.Label lblMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Desc." + Height = 195 + Left = 255 + TabIndex = 60 + Top = 5130 + Width = 735 + End + Begin VB.Label txtWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Work Type:" + Height = 195 + Left = 120 + TabIndex = 58 + Top = 2580 + Width = 840 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames:" + Height = 195 + Left = 5625 + TabIndex = 57 + Top = 2835 + Width = 555 + End + Begin VB.Label lblStucco + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yds:" + Height = 195 + Left = 5310 + TabIndex = 52 + Top = 1755 + Width = 870 + End + Begin VB.Label lblMisc + Alignment = 1 'Right Justify + Caption = "Misc. Pay Dollars" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5370 + TabIndex = 50 + Top = 3555 + Width = 1575 + End + Begin VB.Label lblOrder + Alignment = 2 'Center + Caption = "Orders / Issued" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6180 + TabIndex = 45 + Top = 360 + Width = 1575 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 5505 + TabIndex = 44 + Top = 1035 + Width = 675 + End + Begin VB.Label lblMetalLI + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 5565 + TabIndex = 43 + Top = 1395 + Width = 615 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 5460 + TabIndex = 42 + Top = 2115 + Width = 720 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 5265 + TabIndex = 41 + Top = 3195 + Width = 915 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 5340 + TabIndex = 40 + Top = 2475 + Width = 840 + End + Begin VB.Label txtCrewName + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1860 + TabIndex = 34 + Top = 4680 + Width = 3255 + End + Begin VB.Label txtCrew + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 33 + Top = 4680 + Width = 795 + End + Begin VB.Label txtMetal + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 32 + Top = 4320 + Width = 1695 + End + Begin VB.Label txtYRate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 31 + Top = 3945 + Width = 1695 + End + Begin VB.Label txtAmount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1020 + TabIndex = 30 + Top = 3600 + Width = 1695 + End + Begin VB.Label txtRPDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 29 + Top = 4320 + Width = 1155 + End + Begin VB.Label txtRPId + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 28 + Top = 3960 + Width = 1155 + End + Begin VB.Label txtCDate + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 27 + Top = 3600 + Width = 1155 + End + Begin VB.Label txtLogin + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 26 + Top = 3240 + Width = 1155 + End + Begin VB.Label txtRPCount + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3960 + TabIndex = 25 + Top = 2880 + Width = 1155 + End + Begin VB.Label txtPSNum + BackColor = &H0080FFFF& + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4155 + TabIndex = 23 + Top = 2505 + Width = 1155 + End + Begin VB.Label lblRPCount + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Reprint Count:" + Height = 195 + Left = 2895 + TabIndex = 16 + Top = 2940 + Width = 1020 + End + Begin VB.Label lblRPDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date RePrinted:" + Height = 195 + Left = 2775 + TabIndex = 15 + Top = 4380 + Width = 1140 + End + Begin VB.Label lblReprint + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "RePrinted By:" + Height = 195 + Left = 2940 + TabIndex = 14 + Top = 4020 + Width = 975 + End + Begin VB.Label lblCDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Created:" + Height = 195 + Left = 2925 + TabIndex = 13 + Top = 3660 + Width = 990 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CreatedBy:" + Height = 195 + Left = 3135 + TabIndex = 12 + Top = 3300 + Width = 780 + End + Begin VB.Label lblPSNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Sheet #:" + Height = 195 + Left = 3180 + TabIndex = 11 + Top = 2565 + Width = 930 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 585 + TabIndex = 10 + Top = 4740 + Width = 405 + End + Begin VB.Label lblMRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Rate:" + Height = 195 + Left = 165 + TabIndex = 9 + Top = 4380 + Width = 825 + End + Begin VB.Label lblYRage + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rate/Yard:" + Height = 195 + Left = 195 + TabIndex = 8 + Top = 4020 + Width = 795 + End + Begin VB.Label lblAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amt. Paid:" + Height = 195 + Left = 270 + TabIndex = 7 + Top = 3660 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 375 + TabIndex = 6 + Top = 3300 + Width = 615 + End + Begin VB.Label lblYardge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = 345 + TabIndex = 5 + Top = 2940 + Width = 645 + End + Begin VB.Label lblType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 180 + TabIndex = 4 + Top = 2220 + Width = 810 + End + Begin VB.Label lblPSheet + Caption = "Pay Sheets for " + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 0 + Top = 15 + Width = 7035 + End + Begin VB.Menu mnuExit + Caption = "Exit" + End + Begin VB.Menu mnuHelp + Caption = "Help" + End +End +Attribute VB_Name = "frmPaySheet" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Dim mintCREW As Integer, mstrCREW As String, mlngLOTID As Long +Dim moRS As Recordset, moRSProj As Recordset, mboolAdding As Boolean +Dim mlngTIME As Long, mboolPRINT As Boolean, mboolSTOP As Boolean +Dim moRSPay As Recordset, moRSCREW As Recordset, mstrType As String +Dim mboolOVERRIDE As Boolean, mstrPROJLOT As String, mboolPULTE As Boolean +Dim mstrWDone As String, mstrWTYPE As String, mstrWPayType +Dim mstrYdRate As String, mstrMetal As String, mboolNOCREW As Boolean, mboolBADCREW As Boolean +Dim mintBOOKMARK As Integer, mstrCTYPE As String, mintPAYCREW As Integer, mboolNoPrint As Boolean + +Private Sub UpCrew() +Dim oRS As Recordset + Call PayLoad +End Sub + +Private Sub SetInvalid() +Dim intBOOKMARK As Integer +Dim intYARDS As Integer, intMETAL As Integer + + If chkInvalid Then + MsgBox "This PaySheet has already been marked Invalid", vbOKOnly, "Invalid Option" + Exit Sub + End If + intBOOKMARK = lstPayInfo.ListIndex + If Not chkPaid = vbChecked Then + moRSPay!invalid = vbChecked + moRSPay.Update + If moRSPay!Type = "S" Then + If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then + intYARDS = Field2Str2(moRS!pystucco) + moRS!pystucco = intYARDS - Int(Field2Long(moRSPay!pay_ydge)) + moRS.Update + End If + End If + If moRSPay!Type = "L" Then + If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then + intYARDS = Field2Str2(moRS!pylath) + intMETAL = Field2Str2(moRS!pmetal) + moRS!pmetal = intMETAL - Field2Integer(moRSPay!METAL) + moRS!pylath = intYARDS - Field2Integer(moRSPay!pay_ydge) + moRS.Update + End If + End If + If moRSPay!worktype = "W" Or moRSPay!worktype = "R" Or moRSPay!worktype = "F" Or moRSPay!worktype = "U" Then + intYARDS = Field2Str2(moRS!pmdollars) + moRS!pmdollars = intYARDS - Field2Integer(moRSPay!pay_ydge) + moRS.Update + End If + Call PayLoad + Else + MsgBox "This PaySheet Has Already Been Paid", vbOKOnly, "Already Paid" + End If + lstPayInfo.ListIndex = 0 + lstPayInfo.ListIndex = intBOOKMARK +End Sub + +Private Sub UpPaintPay() +Dim intBOOKMARK As Integer +Dim intYARDS As Integer, intMETAL As Integer +Dim strWTYPE As String + +' If chkInvalid Then +' MsgBox "This PaySheet has already been marked Invalid", vbOKOnly, "Invalid Option" +' Exit Sub +' End If + intBOOKMARK = lstPayInfo.ListIndex + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText + + If strWTYPE = "PREP" Then + moRS!PREPL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "PINT" Then + moRS!PINTL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "PEXT" Then + moRS!PEXTL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "IS" Then + moRS!ISL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "ES" Then + moRS!ESL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "2T" Then + moRS!TwoTL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "OH" Then + moRS!OHL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "FS" Then + moRS!FSL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "F2" Then + moRS!F2L = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "FG1" Then + moRS!FG1L = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "FG2" Then + moRS!FG2L = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "CC" Then + moRS!CCL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "BT1" Then + moRS!BT1L = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "BT2" Then + moRS!BT2L = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "PO" Then + moRS!POL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "CS" Then + moRS!CSL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + ElseIf strWTYPE = "WH" Then + moRS!WHL = vbTrue + moRS.Update + lblUpPntPay.Visible = True + End If + +' If Not chkPaid = vbChecked Then +' moRSPay!invalid = vbChecked +' moRSPay.Update +' If moRSPay!Type = "S" Then +' If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then +' intYARDS = Field2Str2(moRS!pystucco) +' moRS!pystucco = intYARDS - Int(Field2Long(moRSPay!pay_ydge)) +' moRS.Update +' End If +' End If +' If moRSPay!Type = "L" Then +' If moRSPay!worktype = "C" Or moRSPay!worktype = "P" Then +' intYARDS = Field2Str2(moRS!pylath) +' intMETAL = Field2Str2(moRS!pmetal) +' moRS!pmetal = intMETAL - Field2Integer(moRSPay!METAL) +' moRS!pylath = intYARDS - Field2Integer(moRSPay!pay_ydge) +' moRS.Update +' End If +' End If +' If moRSPay!worktype = "W" Or moRSPay!worktype = "R" Or moRSPay!worktype = "F" Or moRSPay!worktype = "U" Then +' intYARDS = Field2Str2(moRS!pmdollars) +' moRS!pmdollars = intYARDS - Field2Integer(moRSPay!pay_ydge) +' moRS.Update +' End If + Call PayLoad +' Else +' MsgBox "This PaySheet Has Already Been Paid", vbOKOnly, "Already Paid" +' End If + lstPayInfo.ListIndex = intBOOKMARK +End Sub + +Private Sub cboType_LostFocus() +Dim strTYPE As String + + If cboType.ListIndex > -1 Then + strTYPE = Left(Str2Field(cboType.Text), 1) + End If + + If strTYPE = "L" Then 'Or strTYPE = "R" Or strTYPE = "W" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE ' & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +Private Sub cboWorkType_LostFocus() +Dim strTYPE As String, strWTYPE As String, strMSG As String + + strTYPE = Left(Str2Field(cboType), 1) + mstrType = strTYPE + If cboWorkType.ListIndex > -1 Then + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText +' strWTYPE = Left(Str2Field(cboWorkType), 1) + mstrWTYPE = strWTYPE + End If + + If strTYPE = "S" Then + If strWTYPE = "Y" Or strWTYPE = "Z" Then +' If strWTYPE = "C" Or strWTYPE = "P" Or strWTYPE = "Y" Or strWTYPE = "Z" Then +' or strqtype="W" or strwtype = "F" or strwtypeThen + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "L" Then + If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ + strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Then +' lblyardage.Caption = "Pay Amount" + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If +'**** start here + +' ElseIf strTYPE = "L" Then +' If strWTYPE = "B" Or strWTYPE = "T" Or strWTYPE = "Y" Or strWTYPE = "Z" Or _ +' strWTYPE = "S" Or strWTYPE = "F" Or strWTYPE = "U" Then +' MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" +' cboWorkType.SetFocus +' Exit Sub +' End If + ElseIf strTYPE = "V" Then + If strWTYPE <> "C" And strWTYPE <> "W" Then + MsgBox "Invalid Work Type has been selected, Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "C" Then + lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "Y" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "Y" Or strWTYPE = "Z" Then + strMSG = "Invalid Work Type has been selected. Only 'T', 'B' or 'W' are allowed, Select a valid worktype" + MsgBox strMSG, vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "B" Or strWTYPE = "T" Then + ' lblYardge.Caption = "Sq Feet" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + ElseIf strTYPE = "C" Then + If strWTYPE = "F" Or strWTYPE = "U" Or strWTYPE = "R" Or strWTYPE = "S" Or strWTYPE = "P" Or strWTYPE = "C" Or strWTYPE = "B" Or strWTYPE = "T" Then + MsgBox "Invalid Work Type has been selected. Only 'Y', 'Z' or 'W' are allowed. Select a valid worktype", vbOKOnly, "Invalid WorkType" + cboWorkType.SetFocus + Exit Sub + End If + If strWTYPE = "Y" Or strWTYPE = "Z" Then + lblYardge.Caption = "Frames" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + If strWTYPE = "W" Then + lblYardge.Caption = "Pay Amount" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + txtMDesc.Enabled = True + txtNotes.Enabled = True + End If + End If + +End Sub + +Private Sub cmdCREW_Click() +Dim intCREW As Integer, strTYPE As String + mintBOOKMARK = lstPayInfo.ListIndex + + lstPayInfo.col = 1 + strTYPE = lstPayInfo.ColText + If strTYPE = "W" Then + strTYPE = "L" + End If + + If moRSPay!paid Then + MsgBox "This Pay Sheet Has Already Been Paid - Cannot Make Changes", vbOKOnly, "No Changes Allowed" + cmdCREW.Visible = False + mboolBADCREW = True + Exit Sub + End If + intCREW = InputBox("Enter The Crew Number For This PaySheet", "PaySheet Crew", 0) + mintPAYCREW = intCREW + If Not IsNumeric(intCREW) Then + MsgBox "Invalid Crew Entered - Must Be A Number Only", vbOKOnly, "Invalid Crew" + mboolBADCREW = True + Exit Sub + End If + mintCREW = intCREW + Call GetCrew + If mstrCTYPE <> strTYPE Then + MsgBox "The Crew Type Is Incorrect - Enter A Different Crew", vbOKOnly, "Incorrect Crew Type" + lstPayInfo.ListIndex = mintBOOKMARK + cmdCREW.Visible = False + mboolBADCREW = True + Exit Sub + End If + Call CalcPay + + moRSPay!crewID = intCREW + moRSPay.Update +' Call UpCrew 'This needs to be finished so it will load the crew + lstPayInfo.ListIndex = mintBOOKMARK + cmdCREW.Visible = False + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + +End Sub +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not moRSProj.EOF Then + If moRSProj!cont_id = 146 Or moRSProj!cont_id = 864 Then + mboolPULTE = True + Else + mboolPULTE = False + End If + End If +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String, boolBOOKMARK As Boolean +Dim strLine As String, intBOOKMARK As Integer + + boolBOOKMARK = False +' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblPaySheet WHERE lotid =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If lstPayInfo.ListCount > 0 Then + boolBOOKMARK = True + intBOOKMARK = lstPayInfo.ListIndex + End If + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crewID) + Call GetCrew + strLine = Field2Long(oRS!payid) & vbTab & oRS!Type & vbTab & oRS!worktype & vbTab & oRS!pay_ydge & vbTab & IIf(oRS!METAL = 0, "", oRS!METAL) + strLine = strLine & vbTab & IIf(oRS!paid, "Paid", (IIf(oRS!invalid, "InValid", (IIf(oRS!bc, "B/C", "Not Paid"))))) + If oRS!paid Then + strLine = strLine & vbTab & oRS!crewID & vbTab & mstrCREW + End If + .AddItem strLine +' .ItemData(.NewIndex) = Field2Long(oRS!payid) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + If boolBOOKMARK Then + lstPayInfo.ListIndex = intBOOKMARK + boolBOOKMARK = False + Else + lstPayInfo.ListIndex = 0 + End If + Else + strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + End If + +End Sub + +Private Sub PayLoad2() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, intBOOKMARK As Integer +Dim lngRET As Long, aTabs(4) As Long + + aTabs(0) = 25 + aTabs(1) = 50 + aTabs(2) = 90 + aTabs(3) = 150 + aTabs(4) = 200 + + On Error Resume Next + + intBOOKMARK = lstPayInfo.ListIndex + +' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblPaySheet WHERE lotid =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crewID) + Call GetCrew + strLine = oRS!Type & vbTab & oRS!worktype & vbTab & oRS!pay_ydge & vbTab & IIf(oRS!METAL = 0, "", oRS!METAL) + strLine = strLine & vbTab & IIf(oRS!paid, "Paid", (IIf(oRS!invalid, "InValid", (IIf(oRS!bc, "B/C", "Not Paid"))))) + If oRS!paid Then + strLine = strLine & vbTab & oRS!crewID & vbTab & mstrCREW + End If + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!payid) + End With + + oRS.MoveNext + Loop + oRS.Close + lstPayInfo.ListIndex = intBOOKMARK + +' If lstPayInfo.ListCount Then +' lstPayInfo.ListIndex = 0 +' Else +' strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" +' Set moRSPay = New Recordset +' moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' End If + +End Sub + +Private Sub GetCrew() +Dim oRS As Recordset, strCTYPE As String +Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrewrate WHERE not inactive and Proj_ID = " & gintPROJID & " and crew_id = " & mintCREW + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If moRSCREW.EOF Then + strSQL = "SELECT * from tblcrewrate WHERE not inactive and Proj_ID = 99999 and crew_id = " & mintCREW + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + End If + + If Not moRSCREW.EOF Then + mstrCTYPE = Field2Str(moRSCREW!Type) + mstrCREW = moRSCREW!Crew_Boss + mboolNOCREW = False + 'if moRSCREW +' mstrYdRate = moRSCREW!Lath_Skip +' mstrMetal = moRSCREW!Metal + 'End If + Else + mstrCREW = "" + mboolNOCREW = True + End If + +' moRSCREW.Close + +End Sub + +Private Sub GetCrewHold() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrewrate WHERE not inactive and Proj_ID = " & gintPROJID & " and crew_id = " & mintCREW + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + strSQL = "SELECT * from tblcrewrate WHERE not inactive and Proj_ID = 99999 and crew_id = " & mintCREW + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + End If + + If Not oRS.EOF Then + mstrCREW = oRS!Crew_Boss + 'if ors + mstrYdRate = oRS!lath_skip + mstrMetal = oRS!METAL + 'End If + Else + mstrCREW = "" + End If + + oRS.Close + +End Sub + +Private Sub cmdRePrint_Click() +Dim strTYPE As String, strREPORT As String, intCOUNT As Integer +Dim strSQL As String, i As Integer, intPAYCREW As Integer +Dim intTOTAL As Integer, intYDS As Integer +Dim strWORK As String, intResponse As Integer, strREPRINT As String + + On Error GoTo Error_EH + mboolBADCREW = False + + If moRSPay!paid Then + MsgBox "This PaySheet Has Already Been Paid, RePrint Not Allowed", vbOKOnly, "RePrint Not Allowed" + cmdRePrint.Enabled = False + cmdAddPS.Enabled = True + Exit Sub + End If + + gintCOPY = 1 + strTYPE = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + strWORK = cboWorkType.ColText +' strWORK = Left(Str2Field(cboWorkType.Text), 1) + + If strTYPE = "S" Then + If strWORK = "C" Or strWORK = "P" Then +' intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + Call cmdCREW_Click + If Not mboolBADCREW Then + moRSPay!crewID = mintPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPstuccopay.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") +' Exit Sub + End If + ElseIf strWORK = "S" Then + intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + moRSPay!crewID = intPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPstuccopayS.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + ElseIf strWORK = "B" Then + intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + moRSPay!crewID = intPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPstuccopayB.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + ElseIf strWORK = "T" Then + intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + moRSPay!crewID = intPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPstuccopayT.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "STC Paysheet RePrint") + End If + ElseIf strTYPE = "L" Then + If strWORK = "C" Or strWORK = "P" Then + Call cmdCREW_Click +' intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + If Not mboolBADCREW Then + moRSPay!crewID = mintPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPLathpay.rpt" + Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") +' Exit Sub + End If + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") + End If + ElseIf strTYPE = "W" Then + If strWORK = "C" Or strWORK = "P" Or strWORK = "A" Then + Call cmdCREW_Click +' intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + If Not mboolBADCREW Then + moRSPay!crewID = mintPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPWrapPay.rpt" + Call LotChange(mstrPROJLOT, "WP Paysheet RePrint") +' Exit Sub + End If +' Else +' strREPORT = App.Path & "\RPPOpay.rpt" +' Call LotChange(mstrPROJLOT, "LA Paysheet RePrint") + End If + ElseIf strTYPE = "V" Then + If strWORK = "C" Or strWORK = "P" Then + MsgBox "No PaySheet Defined", vbOKOnly, "No Report" + Call LotChange(mstrPROJLOT, "STN Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "STN Paysheet RePrint") + End If + ElseIf strTYPE = "C" Then + If strWORK = "Y" Or strWORK = "Z" Then + strREPORT = App.Path & "\RPScaffoldpay.rpt" + Call LotChange(mstrPROJLOT, "SCF Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "SCF Paysheet RePrint") + End If + ElseIf strTYPE = "Y" Then + If strWORK = "B" Then + intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + moRSPay!crewID = intPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPSYNpayB.rpt" + Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") + ElseIf strWORK = "T" Then + intPAYCREW = InputBox("Enter The Crew Number", "Crew Number", 0) + moRSPay!crewID = intPAYCREW + moRSPay.Update + strREPORT = App.Path & "\RPSYNpayT.rpt" + Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") + Else + strREPORT = App.Path & "\RPPOpay.rpt" + Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") + End If + ElseIf strTYPE = "X" Then + strREPORT = App.Path & "\RPPaintPay3.rpt" + strREPRINT = "PAINT " & strWORK & " Paysheet RePrint" + Call LotChange(mstrPROJLOT, strREPRINT) +'' Call LotChange(mstrPROJLOT, "PAINT Paysheet RePrint") +'' MsgBox "No Pay Sheet Reprint Setup For Paint", vbOKOnly, "Not Set Up" +'' cmdRePrint.Enabled = False +'' cmdAddPS.Enabled = True +'' Exit Sub +' If strWORK = "B" Or strWORK = "T" Then +' strREPORT = App.Path & "\RPSYNpay.rpt" +' Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") +' Else +' strREPORT = App.Path & "\RPPOpay.rpt" +' Call LotChange(mstrPROJLOT, "SYN Paysheet RePrint") +' End If + End If + + If Not mboolBADCREW Then + If Field2Str2(txtAmount) = 0 Then + If txtYRate = ".00" Then + + End If + dblAmt = (Field2Str2(txtYdge) * Field2Str2(txtYRate)) + (Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) + txtAmount = Format(Round(dblAmt, 2), "#,#.00") + moRSPay!Amt = txtAmount + moRSPay!GROSSPAY = txtAmount + moRSPay.Update + End If + intResponse = MsgBox("Do You Want To Print To The Printer?", vbQuestion + vbYesNo, "Print to Printer") + ' intRESPONSE = InputBox("Do You Want To Print To The Printer?", "Print to Printer") + If intResponse = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + strSQL = "{tblPAYSHEET.payid} = " & gintPAYID + crPAY.ReportFileName = strREPORT + crPAY.ReplaceSelectionFormula (strSQL) + ' crPAY.SelectionFormula = (strSQL) + crPAY.CopiesToPrinter = gintCOPY + 'crpay. + ' crPAY.Destination = crptToWindow + ' crpay.Destination = crptToPrinter + crPAY.Action = 1 + intCOUNT = Field2Integer(moRSPay!rpcount) + intCOUNT = intCOUNT + 1 + If moRSPay!printed = False Then + moRSPay!printed = True + End If + moRSPay!rpcount = intCOUNT + moRSPay!rpdate = Date + moRSPay!RPUSER = gstrLOGIN + moRSPay.Update +' Exit Sub + End If + cmdRePrint.Enabled = False + cmdAddPS.Enabled = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module cmdRePrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mboolSTOP = False + Call AddPay + If Not mboolSTOP Then + Call FormSave + lstPayInfo.Enabled = True + cmdSave.Enabled = False + cmdAddPS.Enabled = True + cmdExit.Enabled = True + txtMDesc.Enabled = False + txtNotes.Enabled = False + gintPAYID = FindMax("tblPaySHeet", "payid") + + If Not mboolNoPrint Then + Call PrintPay + End If + chkBC.Enabled = False + Else + cboType.SetFocus + End If + mboolNoPrint = False +' Call PrintPay + +End Sub + +Private Sub PrintPay() +Dim strSQL As String, strTYPE As String, strWTYPE As String +Dim intResponse As Integer + + strTYPE = mstrType + strWTYPE = mstrWTYPE + If strTYPE = "S" Then + If strWTYPE = "W" Or strWTYPE = "R" Or strWTYPE = "F" Or strWTYPE = "U" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSStuccopay.rpt" + End If + ElseIf strTYPE = "L" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSLathpay.rpt" + End If + ElseIf strTYPE = "V" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSStonepay.rpt" + End If + ElseIf strTYPE = "Y" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSSynPay.rpt" + End If + ElseIf strTYPE = "C" Then + If strWTYPE = "W" Or strWTYPE = "R" Then + crPAY.ReportFileName = App.Path & "\PSPOpay.rpt" + Else + crPAY.ReportFileName = App.Path & "\PSScaffoldpay.rpt" + End If + End If + If intResponse = vbYes Then + crPAY.Destination = crptToPrinter + Else + crPAY.Destination = crptToWindow + End If + gintCOPY = 2 + strSQL = "{tblPaySheet.PayId} = " & gintPAYID +' crPAY.ReportFileName = App.Path & "\PSLathpay.rpt" + crPAY.ReplaceSelectionFormula (strSQL) + crPAY.CopiesToPrinter = gintCOPY +' crPAY.Destination = crptToWindow +' crPAY.Destination = crptToPrinter +' crPAY.Formulas(1) = "PaySheetCount = " & i +' crPAY.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" +' crPAY.CopiesToPrinter = gintCOPY ' / 2 + crPAY.CopiesToPrinter = 1 + crPAY.Action = 1 + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + If Not mboolOVERRIDE Then + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + Call cmdAddPS_Click + strSQL = "SELECT * FROM tblPaySheet WHERE payid = 10" + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If moRSPay.EOF Then + End If + Else + Unload Me + End If + End If + End If + If chkLOOK Then + mboolLOOK = True + End If +' If chkLook Then + If mboolLOOK Then +' cmdSavePay.Enabled = False +' cmdDelPay.Enabled = False +' cmdAddPay.Enabled = False +' cmdFindCrew.Visible = False +' txtPercentDone.Enabled = False +' txtVerify.Enabled = False +' txtCrewNo.Enabled = False +' txtPayDate.Enabled = False +' txtCheckNo.Enabled = False +' txtPayAmt.Enabled = False +' txtNotes.Enabled = False +' txtOffice.Enabled = False + cboType.Enabled = False +' cboType.Enabled = False +' txtCrewName.Enabled = False + End If + +End Sub + +Private Sub mnuHelp_Click() +Dim strHELP As String + + strHELP = "Ctrl-B Mark Paysheet as InValid" & vbCrLf + strHELP = "Ctrl-T Update Pay Sheet Texture To Match LotInfo Texture" + strHELP = strHELP & "Ctrl-A Save New Yardage" & vbCrLf + strHELP = strHELP & "Ctrl-M Update Paint SqFtge" & vbCrLf + strHELP = strHELP & "Ctrl-F Update Stone SqFtge" & vbCrLf + strHELP = strHELP & "Ctrl-O Override" & vbCrLf + strHELP = strHELP & "Ctrl-W Update The Pay Crew For Highlighted Pay Sheet" & vbCrLf + strHELP = strHELP & "Ctrl-Q Mark PaySheet as PAID" & vbCrLf + strHELP = strHELP & "Ctrl-1 Fix Pay Rate 1 for Highlighted Pay Sheet" & vbCrLf + strHELP = strHELP & "Ctrl-2 Fix Pay Rate 2 for Highlighted Pay Sheet" & vbCrLf + strHELP = strHELP & "Ctrl-3 Calc New Pay Sheet Total" & vbCrLf + strHELP = strHELP & "Ctrl-N Allow Edit Of Pay Desc & Pay Sheet Notes" + + MsgBox strHELP, vbOKOnly, "Hot Keys" +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + Dim ShiftDown, AltDown, CtrlDown +Dim lngLOTID As Long, intCREW As Integer +Dim strSQL As String, oRT As Recordset, strTEX As String +'Dim txtYRate As String, lngLOTID As Long, intCREW As Integer +Dim txtRATE1 As String, txtRATE2 As String + +'B Mark Paysheet as InValid +'T Change PaySheet Texture To Match LotInfo Texture +'A Save New Yardage +'M Update Paint SqFtge +'F Update Stone SqFtge +'O Override +'W Show The Crew KEY to Update The Pay Crew For Highlighted Pay Sheet +'Q Mark PaySheet as PAID +'Ctrl-1 Fix Pay Rate 1 for Highlighted Pay Sheet +'Ctrl-2 Fix Pay Rate 2 for Highlighted Pay Sheet +'Ctrl-3 Calc New Pay Sheet Total +'N Turn on the SAVE button and activate the txtPayDesc and txtNotes fields + + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (vbAltMask) > 0 +' AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If KeyCode = vbKeyB Then ' Mark the Pay Sheet as invalid +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSPay!paid Then + MsgBox "This PaySheet Has Already Been Paid, Set Invalid Not Allowed", vbOKOnly, "Set Invalid Not Allowed" + cmdRePrint.Enabled = False + cmdAddPS.Enabled = True + Exit Sub + End If + Call SetInvalid + Call PayLoad + End If +' Call PayLoad +' Call PayLoad2 + Exit Sub + End If + + If KeyCode = vbKeyN And gbytSECURITY < 3 Then ' Mark the Pay Sheet as invalid +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then +' lstPayInfo.col = 0 +' strPAYID = lstPayInfo.ColText + txtMDesc.Enabled = True + txtNotes.Enabled = True + mboolNoPrint = True + cmdSave.Enabled = True + End If +' Call PayLoad +' Call PayLoad2 + Exit Sub + End If + + If KeyCode = vbKey1 And gbytSECURITY < 3 Then ' Fix Pay Rate 1 +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + txtRATE1 = InputBox("Enter The Corrected Pay Rate1", "Pay Rate 1") + txtYRate = txtRATE1 + moRSPay!Y_Rate = Field2Str2(txtRATE1) + If moRSPay.EOF Then + End If + moRSPay.Update + End If + Exit Sub + End If + + If KeyCode = vbKey2 And gbytSECURITY < 3 Then ' Fix Pay Rate 2 +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + txtRATE2 = InputBox("Enter The Corrected Pay Rate2", "Pay Rate 2") + txtMetal = txtRATE2 + moRSPay!M_Rate = Field2Str2(txtRATE2) + If moRSPay.EOF Then + End If + moRSPay.Update + End If + Exit Sub + End If + + If KeyCode = vbKey3 And gbytSECURITY < 3 Then ' Fix Pay TOTAL +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + dblAmt = (Field2Str2(txtYdge) * Field2Str2(txtYRate)) + (Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) + txtAmount = Format(Round(dblAmt, 2), "#,#.00") + moRSPay!Amt = txtAmount + moRSPay!GROSSPAY = txtAmount + If moRSPay.EOF Then + End If + moRSPay.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyQ And gbytSECURITY < 3 Then ' Mark the Pay Sheet as Paid or not Paid +' If KeyCode = vbKeyQ Then ' Mark the Pay Sheet as invalid +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + If moRSPay!paid = True Then + moRSPay!paid = False + moRSPay.Update + Else + moRSPay!paid = True + moRSPay.Update + End If + mintBOOKMARK = lstPayInfo.ListIndex + Call PayLoad + lstPayInfo.ListIndex = mintBOOKMARK + End If + Exit Sub + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' Update The Crew For The Highlighted Pay Sheet + If CtrlDown Then +' intCREW = InputBox("Enter The Crew Number For This PaySheet", "PaySheet Crew", 0) +' If Not IsNumeric(intCREW) Then +' MsgBox "Invalid Crew Entered - Must Be A Number Only", vbOKOnly, "Invalid Crew" +' Exit Sub +' End If +' moRSPay!crewID = intCREW +' moRSPay.Update +' Call UpCrew +' lstPayInfo.ListIndex = mintBOOKMARK +' End If + cmdCREW.Visible = True + End If + Exit Sub + + End If + + If KeyCode = vbKeyA Then ' Save New Yardage +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + lngLOTID = gintLOTID + If moRSPay!Type = "L" Then + moRS!l_yds = Integer2Field(txtYdge) + moRS!METAL = Integer2Field(txtFtMetal) + End If + If moRSPay!Type = "S" Then + moRS!s_yds = Integer2Field(txtYdge) + End If + moRS.Update + moRSPay!pay_ydge = Integer2Field(txtYdge) + moRSPay!METAL = Integer2Field(txtFtMetal) + moRSPay.Update + Call PayLoad + End If +' Call PayLoad +' Call PayLoad2 + Exit Sub + End If + +' If KeyCode = vbKeyA Then ' Save New Yardage + If KeyCode = vbKeyT And gbytSECURITY < 3 Then ' Change PaySheet Texture To Match LotInfo Texture + If CtrlDown Then + lngLOTID = gintLOTID + strTEX = Field2Str(moRS!texture) + moRSPay!texture = strTEX + moRSPay.Update + End If + Exit Sub + End If + + If KeyCode = vbKeyM Then ' Mark the Pay Sheet as duplicate +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + Call UpPaintPay + End If + Exit Sub + End If + + If KeyCode = vbKeyO Then ' Display key combinations. +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + mboolOVERRIDE = True + Call LotChange(mstrPROJLOT, "Paysheet OVERRIDE") + End If + Exit Sub + End If + + If KeyCode = vbKeyF Then ' Display key combinations. +' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + txtYRate = InputBox("Enter the Correct Stone Sq. Footage For This Lot", "New Rate", 0#) + Call LotChange(mstrPROJLOT, "Correct Stone SqFt") + moRS!ST_SQFT = Field2Str2(txtYRate) + moRS.Update + txtStone = txtYRate + End If + Exit Sub + End If + +' If Not cmdSave.Enabled Then +' cmdSave.Enabled = True +' End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call cmdSave_Click + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSPay.State = adStateOpen Then + moRSPay.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() +' Set moRS = New Recordset +' Set moRSProj = New Recordset + + If gbytSECURITY = 1 Then + ' cmdDelPay.Enabled = True + End If + + Call WTLoad + Call ProjLoad + Call LotLoad + mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no +' lblPSheet = "Pay Sheets for " & Trim$(moRSProj!proj_desc) & " Lot # " & Trim$(moRS!lot_no) + Call PayLoad + mboolOVERRIDE = False +' If lstPayInfo.ListCount Then +' If FormFind() Then +' Call FormShow +' End If +' End If + +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * FROM tblPaySheet WHERE payid = " & mlngTIME + Set moRSPay = New Recordset + moRSPay.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSPay.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function + +Private Sub FormClear() + txtCDate = "" + txtLogin = "" + txtRPDate = "" + txtRPId = "" + txtRPCount = "" + txtPSNum = "" + txtYdge = "" + txtFtMetal = "" + txtYRate = "" + txtMetal = "" + txtCrew = "" + txtCrewName = "" + txtAmount = "" + txtNotes = "" + txtMDesc = "" + chkBC = vbUnchecked + chkPaid = vbUnchecked + chkPaid.Visible = False + chkInvalid = vbUnchecked + chkInvalid.Visible = False + cboType.ListIndex = -1 + cboWorkType.ListIndex = -1 + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + mboolSTOP = False + + If mboolAdding Then + moRSPay.AddNew + End If + + ' Store the controls to the recordset + Call FieldsSave + If mboolSTOP = True Then + Exit Sub + End If + moRSPay.Update + + + If mboolAdding Then + mboolAdding = False + mboolPRINT = True + End If + mboolOVERRIDE = False + Exit Sub + +Error_EH: + Call ErrorHandler(moRSPay.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormShow() +Dim strWTYPE As String, strDONE As String ', boolTEST As Boolean +Dim intLoop As Integer, strSTR As String, intLEN As Integer, dblAmt As Double + + mboolSHOW = True +' boolTEST = mboolNOCREW +' txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtWrapYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtLathYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtStYds = Format((Field2Integer(moRS!s_yds)), "##,###") +' txtLathYds = Format((Field2Integer(moRS!sq_yd) - 19), "##,###") +' txtStYds = Format((Field2Integer(moRS!s_yds) -24), "##,###") + txtFrames = Format((Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10)), "##,###") + txtCMUYds = Format(Field2Integer(moRS!CMU), "##,###") + txtMatYds = Format(Field2Integer(moRS!sq_yd), "##,###") + txtMetalFt = Format(Field2Long(moRS!METAL), "##,###") + lblPSheet = "Pay Sheets for " & Trim$(moRSProj!Proj_Desc) & " Lot # " & Trim$(moRS!lot_no) & " " & Trim$(Field2Str(moRS!model)) +' txtModel = Field2Str(moRS!model) + txtStone = Format(Field2Str(moRS!ST_SQFT), "##,###") + txtIStone = Field2Str2(moRS!PMisc) + + With moRSPay + If !paid Then + chkPaid.Visible = True + chkPaid = vbChecked + Else + chkPaid.Visible = False + chkPaid = vbUnchecked + End If + If !invalid Then + chkInvalid.Visible = True + chkInvalid = vbChecked + Else + chkInvalid.Visible = False + chkInvalid = vbUnchecked + End If + lblTexture = Field2Str(moRSPay!texture) + chkBC = Field2CheckBox(!bc) + txtCDate = FormatDateTime(Field2Str(!C_Date), 2) + txtLogin = Field2Str(!Create) + txtRPDate = Field2Str(!rpdate) + txtRPId = Field2Str(!RPUSER) + txtRPCount = Field2Str2(!rpcount) + txtPSNum = Field2Str(!sheet) + txtYdge = Format(Field2Str2(!pay_ydge), "##,###") +' txtAmount = Field2Str2(!amt) + txtFtMetal = Format(Field2Str2(!METAL), "##,###") +' If !Y_Rate = 0 And txtYRate = 0 Then +' txtYRate = Field2Str2(!moRSCREWRATE!a) +' End If + txtYRate = IIf(Field2Str2(!Y_Rate) > 0, Format(Field2Str2(!Y_Rate), "#.00"), ".00") + txtMetal = IIf(Field2Str2(!M_Rate) > 0, Format(Field2Str2(!M_Rate), "#.00"), ".00") + txtMDesc = Field2Str(!m_desc) + txtCrew = Field2Integer(!crewID) + mintCREW = Field2Integer(!crewID) + txtNotes = Field2Str(!notes) + Call GetCrew + txtCrewName = mstrCREW +' txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) +' txtCheckNo = Field2Str(!prcheck) + txtAmount = IIf(Field2Str2(!Amt) > 0, Format(Field2Str(!Amt), "##,###.00"), ".00") + + + If !Type = "S" Then + cboType.Text = "Stucco" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + lblYardge = "Yardage:" + ElseIf !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + cboType.Text = "Lath" + lblYardge = "Yardage:" + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "V_Stone" + lblYardge = "Sq. Feet:" + ElseIf !Type = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Y_Synthetic" + lblYardge = "Yardage:" + ElseIf !Type = "C" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "C_Scaffold" + lblYardge = "Frames:" + ElseIf !Type = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Wrap" + lblYardge = "Yardage:" + ElseIf !Type = "X" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "X_Paint" + lblYardge = "SQ Feet:" + End If +'******* + + strWTYPE = Field2Str(!worktype) +' intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + + + If Not mboolNOCREW Then + If !worktype = "B" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Brown" + ElseIf !worktype = "A" Then + If !Type = "W" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) '******************************************** + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' If mboolPULTE Then + ' txtYRate = moRSCREW!Smooth + ' moRSPay!Y_Rate = moRSCREW!Smooth + ' Else + ' txtYRate = moRSCREW!lath_skip + ' moRSPay!Y_Rate = moRSCREW!lath_skip + ' End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update + End If + End If + ElseIf !worktype = "C" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + Else + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update + End If + ElseIf !Type = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + If Field2Str2(txtYRate) = 0 Then + If (lblTexture = "SK" Or lblTexture = "RL" Or lblTexture = "CS" Or lblTexture = "RS") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If + If (lblTexture = "SA" Or lblTexture = "S2" Or lblTexture = "S3" Or lblTexture = "S4" Or lblTexture = "RD") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "MN" Or lblTexture = "RM") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + moRSPay.Update + End If + If (lblTexture = "DF" Or lblTexture = "SS" Or lblTexture = "RF") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "M2" Or lblTexture = "M3" Or lblTexture = "MF") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "DA") Then + txtYRate = Field2Str2(moRSCREW!dash) + moRSPay!Y_Rate = Field2Str2(moRSCREW!dash) + moRSPay.Update + End If + If (lblTexture = "QU") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + moRSPay.Update + End If + If (lblTexture = "SM") Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + moRSPay.Update + End If + If (lblTexture = "QS") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "SC") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + End If + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + If Field2Str2(txtYRate) = 0 Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If + ElseIf !Type = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' If Field2Str(txtYRate) = 0 Or txtYRate = "" Then + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' moRSPay!Y_Rate = moRSCREW!lath_skip + moRSPay.Update + End If + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + ' cboWorkType.Text = "Complete" + '' ElseIf !worktype = "P" Then ' Many Need to Expand this so that it works with + '' If !Type = "L" Then ' Multiple paysheet per type (Large Yardage or commercial) + '' txtFtMetal.Enabled = True + '' txtFtMetal.BackColor = &H80000005 + '' Else + '' txtFtMetal.Enabled = False + '' txtFtMetal.BackColor = &H80FFFF + '' End If + ' cboWorkType.Text = "Partial" + ElseIf !worktype = "T" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Texture" + ElseIf !worktype = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Scratch" + ElseIf !worktype = "R" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Repair" + lblYardge = "Pay Amount:" + ' txtFtMetal.Enabled = False + + ElseIf !worktype = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "WorkOrder/PO" + lblYardge = "Pay Amount:" + ElseIf !worktype = "F" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Fence" + lblYardge = "Pay Amount:" + ElseIf !worktype = "U" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "U_CMU" + lblYardge = "Pay Amount:" + ElseIf !worktype = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Y_UP" + lblYardge = "Frames:" + ElseIf !worktype = "Z" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Z_DOWN" + lblYardge = "Frames:" + Else + ' cboWorkType.ListIndex = -1 + End If + End If + If Field2Str2(txtAmount) = 0 Then + dblAmt = (Field2Str2(txtYdge) * Field2Str2(txtYRate)) + (Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) + txtAmount = Format(Round(dblAmt, 2), "#,#.00") + moRSPay!Amt = txtAmount + moRSPay!GROSSPAY = txtAmount + moRSPay.Update + End If + End With + + If mboolLOOK Then + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboType.Enabled = False + End If + txtIWYds = IIf(Field2Str2(moRS!WrapAmt) > 0, Format(Field2Str2(moRS!WrapAmt), "##,###"), "") + txtILYds = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIStYds = IIf(Field2Str2(moRS!pystucco) > 0, Format(Field2Str2(moRS!pystucco), "##,###"), "") +' txtIFrames = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIMetal = IIf(Field2Str2(moRS!pmetal) > 0, Format(Field2Str2(moRS!pmetal), "##,###"), "") + txtICMU = IIf(Field2Str2(moRS!pcmu) > 0, Format(Field2Str2(moRS!pcmu), "##,###"), "") +' txtMYds = IIf(Field2Str2(moRS!pmisc) > 0, Format(Field2Str2(moRS!pmisc), "##,###"), "") + txtMDollars = IIf(Field2Str2(moRS!pmdollars) > 0, Format(Field2Str2(moRS!pmdollars), "##,###"), "") + mboolSHOW = False + +End Sub + +Private Sub FormShowHold() +Dim strWTYPE As String, strDONE As String +Dim intLoop As Integer, strSTR As String, intLEN As Integer + + mboolSHOW = True +' txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtWrapYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtLathYds = Format((Field2Integer(moRS!l_yds)), "##,###") + txtStYds = Format((Field2Integer(moRS!s_yds)), "##,###") +' txtLathYds = Format((Field2Integer(moRS!sq_yd) - 19), "##,###") +' txtStYds = Format((Field2Integer(moRS!s_yds) -24), "##,###") + txtFrames = Format((Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10)), "##,###") + txtCMUYds = Format(Field2Integer(moRS!CMU), "##,###") + txtMatYds = Format(Field2Integer(moRS!sq_yd), "##,###") + txtMetalFt = Format(Field2Long(moRS!METAL), "##,###") + lblPSheet = "Pay Sheets for " & Trim$(moRSProj!Proj_Desc) & " Lot # " & Trim$(moRS!lot_no) & " " & Trim$(Field2Str(moRS!model)) +' txtModel = Field2Str(moRS!model) + txtStone = Format(Field2Str(moRS!ST_SQFT), "##,###") + txtIStone = Field2Str2(moRS!PMisc) + + With moRSPay + If !paid Then + chkPaid.Visible = True + chkPaid = vbChecked + Else + chkPaid.Visible = False + chkPaid = vbUnchecked + End If + If !invalid Then + chkInvalid.Visible = True + chkInvalid = vbChecked + Else + chkInvalid.Visible = False + chkInvalid = vbUnchecked + End If + lblTexture = moRSPay!texture + chkBC = Field2CheckBox(!bc) + txtCDate = FormatDateTime(Field2Str(!C_Date), 2) + txtLogin = Field2Str(!Create) + txtRPDate = Field2Str(!rpdate) + txtRPId = Field2Str(!RPUSER) + txtRPCount = Field2Str2(!rpcount) + txtPSNum = Field2Str(!sheet) + txtYdge = Format(Field2Str2(!pay_ydge), "##,###") +' txtAmount = Field2Str2(!amt) + txtFtMetal = Format(Field2Str2(!METAL), "##,###") + txtYRate = IIf(Field2Str2(!Y_Rate) > 0, Format(Field2Str2(!Y_Rate), "#.00"), "") + txtMetal = IIf(Field2Str2(!M_Rate) > 0, Format(Field2Str2(!M_Rate), "#.00"), "") + txtMDesc = Field2Str(!m_desc) + txtCrew = Field2Integer(!crewID) + mintCREW = Field2Integer(!crewID) + txtNotes = Field2Str(!notes) + Call GetCrew + txtCrewName = mstrCREW +' txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) +' txtCheckNo = Field2Str(!prcheck) + txtAmount = IIf(Field2Str2(!Amt) > 0, Format(Field2Str(!Amt), "##,###.00"), "") + + + If !Type = "S" Then + cboType.Text = "Stucco" + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + lblYardge = "Yardage:" + ElseIf !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + cboType.Text = "Lath" + lblYardge = "Yardage:" + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "V_Stone" + lblYardge = "Sq. Feet:" + ElseIf !Type = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Y_Synthetic" + lblYardge = "Yardage:" + ElseIf !Type = "C" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "C_Scaffold" + lblYardge = "Frames:" + ElseIf !Type = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "Wrap" + lblYardge = "Yardage:" + ElseIf !Type = "X" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + cboType.Text = "X_Paint" + lblYardge = "SQ Feet:" + End If +'******* + + strWTYPE = Field2Str(!worktype) +' intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + + + + If !worktype = "B" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Brown" + ElseIf !worktype = "C" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Complete" + ElseIf !worktype = "P" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If +' cboWorkType.Text = "Partial" + ElseIf !worktype = "T" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Texture" + ElseIf !worktype = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Scratch" + ElseIf !worktype = "R" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Repair" + lblYardge = "Pay Amount:" +' txtFtMetal.Enabled = False + + ElseIf !worktype = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "WorkOrder/PO" + lblYardge = "Pay Amount:" + ElseIf !worktype = "F" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Fence" + lblYardge = "Pay Amount:" + ElseIf !worktype = "U" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "U_CMU" + lblYardge = "Pay Amount:" + ElseIf !worktype = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Y_UP" + lblYardge = "Frames:" + ElseIf !worktype = "Z" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF +' cboWorkType.Text = "Z_DOWN" + lblYardge = "Frames:" + Else +' cboWorkType.ListIndex = -1 + End If + + + End With + + If mboolLOOK Then + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboType.Enabled = False + End If + txtIWYds = IIf(Field2Str2(moRS!WrapAmt) > 0, Format(Field2Str2(moRS!WrapAmt), "##,###"), "") + txtILYds = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIStYds = IIf(Field2Str2(moRS!pystucco) > 0, Format(Field2Str2(moRS!pystucco), "##,###"), "") +' txtIFrames = IIf(Field2Str2(moRS!pylath) > 0, Format(Field2Str2(moRS!pylath), "##,###"), "") + txtIMetal = IIf(Field2Str2(moRS!pmetal) > 0, Format(Field2Str2(moRS!pmetal), "##,###"), "") + txtICMU = IIf(Field2Str2(moRS!pcmu) > 0, Format(Field2Str2(moRS!pcmu), "##,###"), "") +' txtMYds = IIf(Field2Str2(moRS!pmisc) > 0, Format(Field2Str2(moRS!pmisc), "##,###"), "") + txtMDollars = IIf(Field2Str2(moRS!pmdollars) > 0, Format(Field2Str2(moRS!pmdollars), "##,###"), "") + mboolSHOW = False + +End Sub + +Private Sub lstPayInfo_Click() +Dim strPAYID As String + + lstPayInfo.col = 0 + strPAYID = lstPayInfo.ColText + + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = Field2Long(strPAYID) + gintPAYID = Field2Long(strPAYID) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + lblUpPntPay.Visible = False +' mintBOOKMARK = lstPayInfo.ListIndex +End Sub + +Private Sub cmdAddPS_Click() + Call FormClear + lstPayInfo.Enabled = False +' txtVerify = Date + cmdSave.Enabled = True + cmdAddPS.Enabled = False +' cmdFindCrew.Visible = True + mboolAdding = True + chkBC.Enabled = True + cboType.SetFocus +End Sub + +Private Sub AddPay() +Dim intLATH As Long, intSTUCCO As Long, intMETAL As Long, strTYPE As String +Dim intPLATH As Long, intPSTUCCO As Long, intPMETAL As Long, strMSG As String +Dim intPCMU As Long, intPSTONE As Long, intPDOLLARS As Long, intCALC As Long +Dim intCLATH As Long, intCSTUCCO As Long, intCMETAL As Long, lngID As Long +Dim strWTYPE As String, intSTONE As Long, intCSTONE As Long +Dim intFRAMES As Long, intCFRAMES As Long, intPFRAMES As Long +Dim strSQL As String, oRSM As Recordset + + strTYPE = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + strWTYPE = cboWorkType.ColText +' strWTYPE = Left(Str2Field(cboWorkType.Text), 1) + + lngID = Field2Str2(moRS!Lot_ID) + intLATH = Field2Str2(moRS!l_yds) + intSTUCCO = Field2Str2(moRS!s_yds) + intMETAL = Field2Str2(moRS!METAL) + intSTONE = Field2Str2(moRS!ST_SQFT) + intFRAMES = Field2Integer(moRS!Scaf6) + Field2Integer(moRS!scaf10) + + intPLATH = Field2Str2(moRS!pylath) + intPSTUCCO = Field2Str2(moRS!pystucco) + intPMETAL = Field2Str2(moRS!pmetal) + intPCMU = Field2Str2(moRS!pcmu) + intPSTONE = Field2Str2(moRS!PMisc) + intPDOLLARS = Field2Str2(moRS!pmdollars) + + If strTYPE = "S" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCSTUCCO = intPSTUCCO + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards to High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!pystucco = intCSTUCCO + moRS.Update + ElseIf strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "S" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Scratch Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) +' intCSTUCCO = intCALC + Field2Str2(txtYdge) +' If intCSTUCCO > intSTUCCO Then +' strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" +' MsgBox strMSG, vbOKOnly, "Yards to High" +' mboolSTOP = True +' mboolAdding = False +' Exit Sub +' End If + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + + End If +' moRS!pystucco = intCSTUCCO +' moRS.Update + ElseIf strTYPE = "L" Then + If strWTYPE = "C" Or strWTYPE = "P" Then + intCLATH = intPLATH + Field2Str2(txtYdge) + intCMETAL = intPMETAL + Field2Str2(txtFtMetal) + If Not mboolOVERRIDE Then + If intCLATH > intLATH Then + strMSG = CStr(intCLATH) & " is greater than the " & CStr(intLATH) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + If Not mboolOVERRIDE Then + If intCMETAL > intMETAL Then + strMSG = CStr(intCMETAL) & " is greater than the " & CStr(intMETAL) & " metal feet allowed" + MsgBox strMSG, vbOKOnly, "Metal too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!pylath = intCLATH + moRS!pmetal = intCMETAL + moRS.Update + ElseIf strWTYPE = "W" Or strWTYPE = "F" Or strWTYPE = "R" Or strWTYPE = "U" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + + ElseIf strTYPE = "V" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTONE = intPSTONE + Field2Str2(txtYdge) + If strWTYPE = "C" Then + If Not mboolOVERRIDE Then + If intCSTONE > intSTONE Then + strMSG = CStr(intCSTONE) & " Sq Feet of Stone is greater than the " & CStr(intSTONE) & " Sq Feet allowed" + MsgBox strMSG, vbOKOnly, "Square Footage to High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + moRS!PMisc = Field2Str2(intCSTONE) + moRS.Update + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "Y" Then +' intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCSTUCCO = Field2Str2(txtYdge) + If strWTYPE = "B" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Brown Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "T" Then + intCALC = FindMax4("tblPaySheet", "pay_ydge", "lotid", lngID, "worktype", strWTYPE) + intCSTUCCO = intCALC + Field2Str2(txtYdge) + If Not mboolOVERRIDE Then + If intCSTUCCO > intSTUCCO Then + strMSG = CStr(intCSTUCCO) & " Texture Yards is greater than the " & CStr(intSTUCCO) & " yards allowed" + MsgBox strMSG, vbOKOnly, "Yards too High" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + ElseIf strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + End If + ElseIf strTYPE = "C" Then + strSQL = "SELECT SUM(pay_ydge) as MAXField FROM tblPaySHeet WHERE lotid = " & lngID + strSQL = strSQL & " and type = 'C' and worktype = '" & strWTYPE & "'" 'W'" + Set oRSM = New Recordset + oRSM.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSM.EOF Then + intCALC = Field2Integer(oRSM!maxfield) + Else + intCALC = 0 + End If + oRSM.Close +' intCALC = FindSum("tblPaySheet", "pay_ydge", "lotid", lngID, "type", strTYPE) + intCFRAMES = intCALC + Field2Str2(txtYdge) + If strWTYPE = "Y" Or strWTYPE = "Z" Then + If Not mboolOVERRIDE Then + If intCFRAMES > intFRAMES Then + strMSG = CStr(intCFRAMES) & " Scaffold Frames is greater than the " & CStr(intFRAMES) & " frames allowed" + MsgBox strMSG, vbOKOnly, "Too Many Frames" + mboolSTOP = True + ' mboolAdding = False + Exit Sub + End If + End If + End If + If strWTYPE = "W" Then + moRS!pmdollars = Field2Integer(txtYdge) + intPDOLLARS + moRS.Update + Exit Sub + End If +' moRS!PMisc = intCFRAMES +' moRS.Update + End If + +End Sub + +Private Sub FieldsSave() + On Error GoTo Error_EH + + If mboolAdding Then +' moRSPay!proj_id = gintPROJID + moRSPay!lotid = gintLOTID + moRSPay!Create = gstrLOGIN + moRSPay!totalsheet = 1 + moRSPay!sheet = 1 +' Call AddPay + If mboolSTOP Then + Exit Sub + End If + End If +'need to make this so that if different types of work are selected only certain type of pay can ge celected + + With moRSPay + If mstrWTYPE = "W" Then + !Amt = Field2Str2(txtYdge) + End If + !pay_ydge = Integer2Field(txtYdge) +' !crew = Integer2Field(txtCrewNo) + !METAL = Integer2Field(txtFtMetal) + !Type = Left(Str2Field(cboType.Text), 1) + cboWorkType.col = 1 + !worktype = cboWorkType.ColText 'this will not save correctly if worktype length is greater than one. +' !worktype = Left(Str2Field(cboWorkType), 1) 'this will not save correctly if worktype length is greater than one. + !m_desc = Str2Field(txtMDesc) + !notes = Str2Field(txtNotes) + If chkBC Then + !bc = vbChecked + Else + !bc = vbUnchecked + End If + If chkPaid Then + !paid = vbChecked + Else + !paid = vbUnchecked + End If +' !rpdate = Date +' !RPUSER = gstrLOGIN +' !Update = Date + End With + +' On Error Resume Next +' moRS.Update +' On Error GoTo 0 + moRSPay.Update + If mboolAdding Then +' Call GetLotID +' Call POptLoad + mboolAdding = False + mboolPRINT = True + End If + Call PayLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstPayInfo_DblClick() + If chkInvalid Then + MsgBox "Reprint of this PaySheet is not allowed", vbOKOnly, "No Reprint" + Exit Sub + End If + If chkPaid Then + MsgBox "No Reprint Allowed - Already Paid", vbOKOnly, "No Reprint" + Exit Sub + End If + cmdAddPS.Enabled = False + cmdRePrint.Enabled = True + txtNotes.Enabled = True +' cmdSave.Enabled = True +End Sub + +Private Sub txtFtMetal_GotFocus() + Call FieldSelect(txtFtMetal) +End Sub + +Private Sub txtMDesc_GotFocus() + Call FieldSelect(txtMDesc) +End Sub + +Private Sub txtMDesc_LostFocus() + txtMDesc = UCase(txtMDesc) +End Sub + +Private Sub txtNotes_GotFocus() + txtNotes.SelStart = 2000 +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtYdge_GotFocus() + Call FieldSelect(txtYdge) +End Sub + +Private Sub CalcPay() + + + + With moRSPay + + If Not mboolNOCREW Then +' If !worktype = "B" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Brown" + If !worktype = "A" Then + If !Type = "W" Then + ' txtFtMetal.Enabled = True + ' txtFtMetal.BackColor = &H80000005 + ' If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) '******************************************** + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' If mboolPULTE Then + ' txtYRate = moRSCREW!Smooth + ' moRSPay!Y_Rate = moRSCREW!Smooth + ' Else + ' txtYRate = moRSCREW!lath_skip + ' moRSPay!Y_Rate = moRSCREW!lath_skip + ' End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update +' End If + End If + ElseIf !worktype = "C" Then + If !Type = "L" Then +' txtFtMetal.Enabled = True +' txtFtMetal.BackColor = &H80000005 +' If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + Else + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update +' End If + ElseIf !Type = "W" Then + ' txtFtMetal.Enabled = True + ' txtFtMetal.BackColor = &H80000005 + ' If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) '******************************************** + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' If mboolPULTE Then + ' txtYRate = moRSCREW!Smooth + ' moRSPay!Y_Rate = moRSCREW!Smooth + ' Else + ' txtYRate = moRSCREW!lath_skip + ' moRSPay!Y_Rate = moRSCREW!lath_skip + ' End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update +' End If +' End If + ElseIf !Type = "S" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF +' If Field2Str2(txtYRate) = 0 Then + If (lblTexture = "SK" Or lblTexture = "RL" Or lblTexture = "CS" Or lblTexture = "RS") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If + If (lblTexture = "SA" Or lblTexture = "S2" Or lblTexture = "S3" Or lblTexture = "S4" Or lblTexture = "RD") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "MN" Or lblTexture = "RM") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + moRSPay.Update + End If + If (lblTexture = "DF" Or lblTexture = "SS" Or lblTexture = "RF") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "M2" Or lblTexture = "M3" Or lblTexture = "MF") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "DA") Then + txtYRate = Field2Str2(moRSCREW!dash) + moRSPay!Y_Rate = Field2Str2(moRSCREW!dash) + moRSPay.Update + End If + If (lblTexture = "QU") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + moRSPay.Update + End If + If (lblTexture = "SM") Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + moRSPay.Update + End If + If (lblTexture = "QS") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "SC") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If +' End If + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + If Field2Str2(txtYRate) = 0 Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If +' ElseIf !Type = "W" Then +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF + ' If Field2Str(txtYRate) = 0 Or txtYRate = "" Then +' If Field2Str2(txtYRate) = 0 Then +' If mboolPULTE Then +' txtYRate = Field2Str2(moRSCREW!sand) +' moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) +' Else +' txtYRate = 0 +' moRSPay!Y_Rate = 0 +' End If + ' moRSPay!Y_Rate = moRSCREW!lath_skip +' moRSPay.Update +' End If +' Else +' txtFtMetal.Enabled = False +' txtFtMetal.BackColor = &H80FFFF + End If + ' cboWorkType.Text = "Complete" + '' ElseIf !worktype = "P" Then ' Many Need to Expand this so that it works with + '' If !Type = "L" Then ' Multiple paysheet per type (Large Yardage or commercial) + '' txtFtMetal.Enabled = True + '' txtFtMetal.BackColor = &H80000005 + '' Else + '' txtFtMetal.Enabled = False + '' txtFtMetal.BackColor = &H80FFFF + '' End If + ' cboWorkType.Text = "Partial" +''' ElseIf !worktype = "T" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Texture" +''' ElseIf !worktype = "S" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Scratch" +''' ElseIf !worktype = "R" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Repair" +''' lblYardge = "Pay Amount:" + ' txtFtMetal.Enabled = False + +''' ElseIf !worktype = "W" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "WorkOrder/PO" +''' lblYardge = "Pay Amount:" +''' ElseIf !worktype = "F" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Fence" +''' lblYardge = "Pay Amount:" +''' ElseIf !worktype = "U" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "U_CMU" +''' lblYardge = "Pay Amount:" +''' ElseIf !worktype = "Y" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Y_UP" +''' lblYardge = "Frames:" +''' ElseIf !worktype = "Z" Then +''' txtFtMetal.Enabled = False +''' txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Z_DOWN" +''' lblYardge = "Frames:" + Else + ' cboWorkType.ListIndex = -1 + End If + End If +''' If Field2Str2(txtAmount) = 0 Then + dblAmt = (Field2Str2(txtYdge) * Field2Str2(txtYRate)) + (Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) + txtAmount = Format(Round(dblAmt, 2), "#,#.00") + moRSPay!Amt = txtAmount + moRSPay!GROSSPAY = txtAmount + moRSPay.Update +''' End If + End With + +End Sub + +Private Sub CalcPayHOLD() + + With moRSPay + + If Not mboolNOCREW Then + If !worktype = "B" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Brown" + ElseIf !worktype = "A" Then + If !Type = "W" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) '******************************************** + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' If mboolPULTE Then + ' txtYRate = moRSCREW!Smooth + ' moRSPay!Y_Rate = moRSCREW!Smooth + ' Else + ' txtYRate = moRSCREW!lath_skip + ' moRSPay!Y_Rate = moRSCREW!lath_skip + ' End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update + End If + End If + ElseIf !worktype = "C" Then + If !Type = "L" Then + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + Else + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + End If + txtMetal = Field2Str2(moRSCREW!METAL) + moRSPay!M_Rate = Field2Str2(moRSCREW!METAL) + moRSPay.Update + End If + ElseIf !Type = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + If Field2Str2(txtYRate) = 0 Then + If (lblTexture = "SK" Or lblTexture = "RL" Or lblTexture = "CS" Or lblTexture = "RS") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If + If (lblTexture = "SA" Or lblTexture = "S2" Or lblTexture = "S3" Or lblTexture = "S4" Or lblTexture = "RD") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "MN" Or lblTexture = "RM") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + moRSPay.Update + End If + If (lblTexture = "DF" Or lblTexture = "SS" Or lblTexture = "RF") Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "M2" Or lblTexture = "M3" Or lblTexture = "MF") Then + txtYRate = Field2Str2(moRSCREW!mn) + moRSPay!Y_Rate = Field2Str2(moRSCREW!mn) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "DA") Then + txtYRate = Field2Str2(moRSCREW!dash) + moRSPay!Y_Rate = Field2Str2(moRSCREW!dash) + moRSPay.Update + End If + If (lblTexture = "QU") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + moRSPay.Update + End If + If (lblTexture = "SM") Then + txtYRate = Field2Str2(moRSCREW!Smooth) + moRSPay!Y_Rate = Field2Str2(moRSCREW!Smooth) + moRSPay.Update + End If + If (lblTexture = "QS") Then + txtYRate = Field2Str2(moRSCREW!qu) + moRSPay!Y_Rate = Field2Str2(moRSCREW!qu) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + If (lblTexture = "SC") Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + txtFtMetal.Enabled = True + txtFtMetal.BackColor = &H80000005 + txtMetal = Field2Str2(moRSCREW!sand) + moRSPay!M_Rate = Field2Str2(moRSCREW!sand) + moRSPay.Update + End If + End If + ElseIf !Type = "V" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + If Field2Str2(txtYRate) = 0 Then + txtYRate = Field2Str2(moRSCREW!lath_skip) + moRSPay!Y_Rate = Field2Str2(moRSCREW!lath_skip) + moRSPay.Update + End If + ElseIf !Type = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' If Field2Str(txtYRate) = 0 Or txtYRate = "" Then + If Field2Str2(txtYRate) = 0 Then + If mboolPULTE Then + txtYRate = Field2Str2(moRSCREW!sand) + moRSPay!Y_Rate = Field2Str2(moRSCREW!sand) + Else + txtYRate = 0 + moRSPay!Y_Rate = 0 + End If + ' moRSPay!Y_Rate = moRSCREW!lath_skip + moRSPay.Update + End If + Else + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + End If + ' cboWorkType.Text = "Complete" + '' ElseIf !worktype = "P" Then ' Many Need to Expand this so that it works with + '' If !Type = "L" Then ' Multiple paysheet per type (Large Yardage or commercial) + '' txtFtMetal.Enabled = True + '' txtFtMetal.BackColor = &H80000005 + '' Else + '' txtFtMetal.Enabled = False + '' txtFtMetal.BackColor = &H80FFFF + '' End If + ' cboWorkType.Text = "Partial" + ElseIf !worktype = "T" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Texture" + ElseIf !worktype = "S" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Scratch" + ElseIf !worktype = "R" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Repair" + lblYardge = "Pay Amount:" + ' txtFtMetal.Enabled = False + + ElseIf !worktype = "W" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "WorkOrder/PO" + lblYardge = "Pay Amount:" + ElseIf !worktype = "F" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Fence" + lblYardge = "Pay Amount:" + ElseIf !worktype = "U" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "U_CMU" + lblYardge = "Pay Amount:" + ElseIf !worktype = "Y" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Y_UP" + lblYardge = "Frames:" + ElseIf !worktype = "Z" Then + txtFtMetal.Enabled = False + txtFtMetal.BackColor = &H80FFFF + ' cboWorkType.Text = "Z_DOWN" + lblYardge = "Frames:" + Else + ' cboWorkType.ListIndex = -1 + End If + End If + If Field2Str2(txtAmount) = 0 Then + dblAmt = (Field2Str2(txtYdge) * Field2Str2(txtYRate)) + (Field2Str2(txtMetal) * Field2Str2(txtFtMetal)) + txtAmount = Format(Round(dblAmt, 2), "#,#.00") + moRSPay!Amt = txtAmount + moRSPay!GROSSPAY = txtAmount + moRSPay.Update + End If + End With + +End Sub + +Private Sub txtYdge_LostFocus() + If mstrWTYPE = "W" Then + txtAmount = txtYdge + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frx new file mode 100644 index 0000000..72d51ce Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPaySheet.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frm new file mode 100644 index 0000000..f64adb4 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frm @@ -0,0 +1,1602 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayroll + Caption = "Payroll Information" + ClientHeight = 4920 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4920 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstPayInfo + Height = 1425 + Left = 120 + TabIndex = 55 + Top = 810 + Width = 6735 + _Version = 196608 + _ExtentX = 11880 + _ExtentY = 2514 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPayroll.frx":0000 + End + Begin VB.TextBox txtMtlRate + BackColor = &H00C0FFFF& + Height = 285 + Left = 5370 + TabIndex = 54 + Top = 420 + Width = 810 + End + Begin VB.TextBox txtPayMetal + BackColor = &H00C0FFFF& + Height = 315 + Left = 3675 + TabIndex = 52 + Top = 390 + Width = 780 + End + Begin VB.TextBox txtYdRate + BackColor = &H00C0FFFF& + Height = 315 + Left = 1995 + TabIndex = 50 + Top = 390 + Width = 780 + End + Begin VB.TextBox txtPayYds + BackColor = &H00C0FFFF& + Height = 315 + Left = 660 + TabIndex = 48 + Top = 390 + Width = 780 + End + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 11010 + TabIndex = 41 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLotNotes + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 38 + Top = 4020 + Width = 4815 + End + Begin VB.CheckBox chkLook + Caption = "Look" + Height = 315 + Left = 240 + TabIndex = 37 + Top = 3900 + Visible = 0 'False + Width = 540 + End + Begin VB.TextBox txtOffice + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 29 + Top = 3180 + Width = 4815 + End + Begin VB.ListBox lstCrew + Height = 1425 + Left = 6960 + Sorted = -1 'True + TabIndex = 35 + Top = 900 + Visible = 0 'False + Width = 4815 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 0 + TabIndex = 34 + Top = 4380 + Width = 1155 + End + Begin VB.TextBox txtVerify + Enabled = 0 'False + Height = 315 + Left = 2340 + TabIndex = 33 + Top = 3240 + Width = 1095 + End + Begin VB.CommandButton cmdAddPay + Caption = "&Add Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1780 + TabIndex = 32 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3680 + TabIndex = 30 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdDelPay + Caption = "&Delete Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5580 + TabIndex = 31 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdFindCrew + Height = 435 + Left = 1080 + Picture = "frmPayroll.frx":0589 + Style = 1 'Graphical + TabIndex = 24 + Top = 3900 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtNotes + Height = 735 + Left = 6960 + MaxLength = 255 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 28 + Top = 2400 + Width = 4815 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1620 + TabIndex = 21 + Top = 2865 + Width = 2355 + _Version = 196608 + _ExtentX = 4154 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 5 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPayroll.frx":09CB + End + Begin VB.ComboBox cboCrewType + Height = 315 + ItemData = "frmPayroll.frx":0F40 + Left = 1620 + List = "frmPayroll.frx":0F5C + Style = 2 'Dropdown List + TabIndex = 20 + Top = 2520 + Width = 1815 + End + Begin VB.TextBox txtPayAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 27 + Top = 3240 + Width = 1035 + End + Begin VB.TextBox txtCheckNo + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 26 + Top = 2880 + Width = 1035 + End + Begin VB.TextBox txtPayDate + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 25 + Top = 2520 + Width = 1035 + End + Begin VB.TextBox txtCrewName + Height = 315 + Left = 1620 + TabIndex = 19 + Top = 3960 + Width = 3255 + End + Begin VB.TextBox txtCrewNo + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 4 + TabIndex = 23 + Top = 3600 + Width = 675 + End + Begin VB.TextBox txtPercentDone + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 3 + TabIndex = 22 + Top = 3240 + Width = 675 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9270 + TabIndex = 18 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7410 + TabIndex = 17 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5715 + TabIndex = 16 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 4095 + TabIndex = 15 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtModel + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 2415 + TabIndex = 14 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtProjLot + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 600 + TabIndex = 13 + Top = 60 + Width = 1695 + End + Begin VB.Label lblMtlRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "MetalRate: " + Height = 195 + Left = 4575 + TabIndex = 53 + Top = 450 + Width = 825 + End + Begin VB.Label lblPayMtl + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PayMetal: " + Height = 195 + Left = 2895 + TabIndex = 51 + Top = 450 + Width = 750 + End + Begin VB.Label lblYdRate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Rate: " + Height = 195 + Left = 1545 + TabIndex = 49 + Top = 450 + Width = 435 + End + Begin VB.Label lblPayYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PayYds: " + Height = 195 + Left = 60 + TabIndex = 47 + Top = 450 + Width = 630 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffolding Frames:" + Height = 195 + Left = 7380 + TabIndex = 46 + Top = 480 + Width = 1395 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"" :" + Height = 195 + Left = 8880 + TabIndex = 45 + Top = 480 + Width = 375 + End + Begin VB.Label lblD68 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9270 + TabIndex = 44 + Top = 420 + Width = 855 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"" :" + Height = 195 + Left = 10500 + TabIndex = 43 + Top = 480 + Width = 465 + End + Begin VB.Label lblD108 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 11010 + TabIndex = 42 + Top = 420 + Width = 855 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 10155 + TabIndex = 40 + Top = 135 + Width = 840 + End + Begin VB.Label lblLotNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot Notes:" + Height = 195 + Left = 6150 + TabIndex = 39 + Top = 4020 + Width = 735 + End + Begin VB.Label lblOffice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Office Notes:" + Height = 195 + Left = 5955 + TabIndex = 36 + Top = 3180 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 60 + X2 = 11880 + Y1 = 780 + Y2 = 780 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 8310 + TabIndex = 12 + Top = 120 + Width = 915 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 6630 + TabIndex = 11 + Top = 120 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 4995 + TabIndex = 10 + Top = 120 + Width = 615 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 3315 + TabIndex = 9 + Top = 120 + Width = 675 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot #:" + Height = 195 + Left = 120 + TabIndex = 8 + Top = 120 + Width = 420 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PR Notes:" + Height = 195 + Left = 6135 + TabIndex = 7 + Top = 2490 + Width = 735 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amt:" + Height = 195 + Left = 3885 + TabIndex = 6 + Top = 3300 + Width = 825 + End + Begin VB.Label lblCheck + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check #:" + Height = 195 + Left = 4050 + TabIndex = 5 + Top = 2940 + Width = 660 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date:" + Height = 195 + Left = 3810 + TabIndex = 4 + Top = 2580 + Width = 900 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 1125 + TabIndex = 3 + Top = 3660 + Width = 405 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage Done:" + Height = 195 + Left = 225 + TabIndex = 2 + Top = 3300 + Width = 1305 + End + Begin VB.Label lblWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Type of Work Done:" + Height = 195 + Left = 75 + TabIndex = 1 + Top = 2940 + Width = 1455 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 720 + TabIndex = 0 + Top = 2580 + Width = 810 + End +End +Attribute VB_Name = "frmPayroll" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSTIME As Recordset +Dim moRSProj As Recordset +Dim moRSMemo As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mboolSAVE As Boolean +Dim mstrType As String, mstrCREW As String +Dim mlngFind As Long, mboolLOOK As Boolean +Dim mlngTIME As Long +Dim mintCREW As Integer + +Private Sub cmdDelPay_Click() + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + moRSTIME.Delete + Call PayLoad +End Sub + +Private Sub FindPaySheet() +Dim oRS As Recordset, strSQL As String, strWORK As String, strPTYPE As String +Dim lngPSID As Long + + If moRSTIME!WorkDone = "A" And moRSTIME!pay_type = "L" Then + strWORK = "C" + strPTYPE = "W" + Else + strWORK = moRSTIME!WorkDone + strPTYPE = moRSTIME!pay_type + End If + +' strSQL = "SELECT * FROM tblPAYSHEET where LOTID = " & moRSTIME!LOT_ID & " AND TYPE = '" & Field2Str(moRSTIME!PAY_TYPE) & "' AND WORKTYPE = '" & Field2Str(moRSTIME!WorkDone) & "'" + strSQL = "SELECT * FROM tblPAYSHEET where LOTID = " & moRSTIME!Lot_ID & " AND TYPE = '" & strPTYPE & "' AND WORKTYPE = '" & strWORK & "'" +' strSQL = "SELECT * FROM tblPAYSHEET where LOTID = " & Field2Str2(moRSTIME!LOT_ID) & " AND TYPE = '" & Field2Str(moRSTIME!PAY_TYPE) & "' AND WORKTYPE = '" & Field2Str(moRSTIME!WorkDone) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + lngPSID = Field2Str2(oRS!payid) +' oRS!TIMEID = glngTIMEID + oRS!timeid = Field2Str2(moRSTIME!idnum) +' oRS!PAID = True + oRS!crewID = Field2Str2(txtCrewNo) + oRS.Update + End If +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE & vbTab & oRS!Rate & vbTab & oRS!Type + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +Private Sub cmdFindCrew_Click() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!Crew_Boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +''' cmdAdd.Enabled = True + Exit Sub + End If + End If + + + If Not oRS.EOF Then + mstrCREW = oRS!Crew_Boss + txtCrewName = mstrCREW + txtPayDate.SetFocus + Else + Call CrewLoad + lstCrew.SetFocus + End If + + oRS.Close + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + Call cmdAddPay_Click + Else + Unload Me + End If + End If + If chkLOOK Then + mboolLOOK = True + End If +''' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strLOK As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + strLOK = mboolLOOK + If Not cmdSavePay.Enabled And Not mboolLOOK Then '****** ??????? + cmdSavePay.Enabled = True + End If + + If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' Mark the Pay Sheet as invalid +'' If KeyCode = vbKeyV And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + Call FindPaySheet + End If + Exit Sub + End If + + + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled And Not mboolLOOK Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSTIME.State = adStateOpen Then + moRSTIME.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset +''' Set moRSTime = New Recordset + +''' gbytSECURITY = 1 + + If gbytSECURITY = 1 Then +''' cmdDelPay.Enabled = True + End If + + Call WTLoad + Call ProjLoad + Call LotLoad + Call PayLoad +' Call WTLoad + If FormFind() Then +''' Call PlanFind +''' Call FormShow +''' Call MatLoad +''' Call POptLoad +''' Call LOptLoad +''' Call OptMatLoad +''' Call OrderLoad +''' Call POLoad +''' Call POMatLoad + End If + +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.EOF Then + strSql2 = "SELECT * FROM tblYardMemo" ' WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo.Update + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + End If + +End Sub + +Private Sub FormShow() +Dim strWTYPE As String +Dim intLoop As Integer, strSTR As String, intLEN As Integer + + mboolSHOW = True + txtPayYds = "" + txtProjLot = Trim$(moRSProj!Proj_Code) & " " & moRS!lot_no + txtLathYds = Field2Integer(moRS!sq_yd) ' - 19 + txtCMUYds = Field2Integer(moRS!CMU) + txtMatYds = Field2Integer(moRS!sq_yd) + txtMetalFt = Field2Long(moRS!METAL) + txtModel = Field2Str(moRS!model) + txtStone = Field2Str(moRS!ST_SQFT) + lblD68 = Field2Str2(moRS!Scaf6) + lblD108 = Field2Str2(moRS!scaf10) + + + With moRSTIME + txtPercentDone = Field2Str(!pct_done) + txtVerify = IIf(Field2Str(!paydt) = "12:00:00 AM", "", Field2Str(!paydt)) + txtCrewNo = Field2Integer(!crew) + mintCREW = Field2Integer(!crew) + Call GetCrew + txtCrewName = mstrCREW + txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) + txtCheckNo = Field2Str(!prcheck) + txtPayAmt = Format(Field2Str(!pay_amt), "##,###.00") +' txtPayYds = Field2Str(!prcheck) + txtYdRate = Format(Field2Str(!yd_rate), "##,###.00") + txtPayMetal = Field2Str(moRS!METAL) + txtMtlRate = Format(Field2Str(!mtl_Rate), "##,###.00") + txtNotes = Field2Str(!notes) + txtOffice = Field2Str(!office) + + If !pay_type = "L" Then + cboCrewType.Text = "LATH" +' txtPayYds = Field2Str2(moRS!L_yds) + ElseIf !pay_type = "S" Then + cboCrewType.Text = "STUCCO" +' txtPayYds = Field2Str2(moRS!S_yds) + ElseIf !pay_type = "R" Then + cboCrewType.Text = "Repair/PO" + ElseIf !pay_type = "V" Then + cboCrewType.Text = "V_Stone" + ElseIf !pay_type = "C" Then + cboCrewType.Text = "C_SCAFFOLD" + ElseIf !pay_type = "X" Then + cboCrewType.Text = "X_PAINT" + ElseIf !pay_type = "Q" Then + cboCrewType.Text = "Q_MISC" + ElseIf !pay_type = "W" Then + cboCrewType.Text = "W_WRAP" + End If + + strWTYPE = Field2Str(!WorkDone) + intLEN = Len(strWTYPE) + + If !pay_type = "L" Then +' If !Pay_Type = "L" Or !Pay_Type = "W" Then + lblPayMtl.Visible = True + lblMtlRate.Visible = True + txtYdRate.Visible = True + txtPayMetal.Visible = True + txtMtlRate.Visible = True + txtPayYds.Visible = True + txtPayYds = Field2Integer(moRS!l_yds) + txtYdRate = Format(Field2Str(!yd_rate), "##,###.00") + txtPayMetal = Field2Str(moRS!METAL) + txtMtlRate = Format(Field2Str(!mtl_Rate), "##,###.00") + ElseIf !pay_type = "W" Then +' If !Pay_Type = "L" Or !Pay_Type = "W" Then + lblPayMtl.Visible = False + lblMtlRate.Visible = False + txtYdRate.Visible = True + txtPayMetal.Visible = False + txtMtlRate.Visible = False + txtPayYds.Visible = True + txtPayYds = Field2Integer(moRS!l_yds) + txtYdRate = Format(Field2Str(!yd_rate), "##,###.00") +' txtPayMetal = Field2Str(moRS!METAL) +' txtMtlRate = Format(Field2Str(!mtl_Rate), "##,###.00") + ElseIf !pay_type = "S" Then + txtYdRate.Visible = True + txtPayYds.Visible = True + lblPayMtl.Visible = False + lblMtlRate.Visible = False + txtPayMetal.Visible = False + txtMtlRate.Visible = False + txtPayYds = Field2Integer(moRS!s_yds) +' txtPayYds = Field2Integer(moRS!sq_yd) - 24 + txtYdRate = Format(Field2Str(!yd_rate), "##,###.00") + txtPayMetal = Field2Str(moRS!METAL) + txtMtlRate = Format(Field2Str(!mtl_Rate), "##,###.00") + Else + txtYdRate.Visible = True + txtYdRate = Format(Field2Str(!yd_rate), "##,###.00") + txtPayMetal.Visible = False + lblPayMtl.Visible = False + lblMtlRate.Visible = False + txtMtlRate.Visible = False + txtPayYds.Visible = False + End If + + For intLoop = 0 To cboWorkType.ListCount - 1 + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText + + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + Else + cboWorkType.ListIndex = -1 + End If + Next intLoop + +' If !workdone = "A" Then +' cboWorkType.Text = "A_WRAP" +' ElseIf !workdone = "C" Then +' cboWorkType.Text = "COMPLETE" +' ElseIf !workdone = "P" Then +' cboWorkType.Text = "PARTIAL" +' ElseIf !workdone = "B" Then +' cboWorkType.Text = "BROWN" +' ElseIf !workdone = "T" Then +' cboWorkType.Text = "TEXTURE" +' ElseIf !workdone = "S" Then +' cboWorkType.Text = "SCRATCH" +' ElseIf !workdone = "R" Then +' cboWorkType.Text = "REPAIR" +' ElseIf !workdone = "W" Then +' cboWorkType.Text = "WORK ORDER/PO" +' ElseIf !workdone = "F" Then +' cboWorkType.Text = "FENCE" +' ElseIf !workdone = "U" Then +' cboWorkType.Text = "U_CMU" +' ElseIf !workdone = "Y" Then +' cboWorkType.Text = "Y_UP" +' ElseIf !workdone = "Z" Then +' cboWorkType.Text = "Z_DOWN" +' End If + End With + txtLotNotes = Field2Str(moRSMemo!payroll) + +''' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + mboolSHOW = False +End Sub + +Private Sub cmdAddPay_Click() + Call FormClear + txtVerify = Date + cmdSavePay.Enabled = True + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = True + mboolAdding = True + cboCrewType.SetFocus +End Sub + +Private Sub cmdSavePay_Click() + mboolSAVE = False + Call CheckCrew + If mboolSAVE Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + cmdFindCrew.Visible = False + lstCrew.Visible = False + Call FormSave + Call PayLoad + End If +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSTIME.AddNew + End If + + ''' Store the controls to the recordset + Call FieldsSave + + moRSTIME.Update + + moRSMemo!payroll = Str2Field(txtLotNotes) + moRSMemo.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTIME " + strSQL = strSQL & "WHERE IDNUM = " & mlngTIME + + Set moRSTIME = New Recordset +''' If moRSTime.State = adStateOpen Then +''' moRSTime.Close +''' End If + + moRSTIME.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSTIME.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub cmdExit_Click() + Unload Me +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + If mboolAdding Then +''' moRS.AddNew + moRSTIME!PROJ_ID = gintPROJID + moRSTIME!Lot_ID = gintLOTID + moRSTIME!lot_no = Str2Field(moRS!lot_no) + moRSTIME!paydt = Date + moRSTIME!C_USER = gstrLOGIN + End If + + + With moRSTIME + !pct_done = Integer2Field(txtPercentDone) +''' !paydt = Date +''' !paydt = Str2Field(txtVerify) + !crew = Integer2Field(txtCrewNo) + !prdate = Str2Field(txtPayDate) + !prcheck = Str2Field(txtCheckNo) + !pay_amt = Str2Field(txtPayAmt) + !notes = Str2Field(txtNotes) + !office = Str2Field(txtOffice) + !pay_type = Left(Str2Field(cboCrewType.Text), 1) + cboWorkType.col = 1 + !WorkDone = cboWorkType.ColText +' !workdone = Left(Str2Field(cboWorkType.Text), 1) + !U_USER = gstrLOGIN + !Update = Date + End With +''' On Error Resume Next +''' moRS.Update +''' On Error GoTo 0 + moRSTIME.Update + If mboolAdding Then +''' Call GetLotID + Call PayLoad +''' Call POptLoad + mboolAdding = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub +Private Sub FormClear() + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + txtOffice = "" + txtLotNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = 0 + +End Sub + +Private Sub PayLoad2() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + aTabs(0) = 10 + aTabs(1) = 40 + aTabs(2) = 70 + aTabs(3) = 90 + aTabs(4) = 110 + + + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!WorkDone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + End If + +End Sub + +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!WorkDone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW & vbTab & Field2Long(oRS!idnum) '& "'" + .AddItem strLine +' .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + End If + +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long ', aTabs(4) As Long + +''' aTabs(0) = 10 +''' aTabs(1) = 20 +''' aTabs(2) = 40 +''' aTabs(3) = 90 +''' aTabs(4) = 110 + + strSQL = "SELECT * from tblcrew WHERE type = '" & Left(Field2Str(cboCrewType), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstCrew.hwnd, LB_SETTABSTOPS, 1, 160) + + lstCrew.Clear + lstCrew.Visible = True + + Do Until oRS.EOF + With lstCrew + mintCREW = Field2Integer(oRS!CREW_ID) + strLine = oRS!Crew_Boss & vbTab & oRS!CREW_ID +''' strLine = strLine & vbTab & oRS!paydt +''' strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = oRS!CREW_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + End If + +End Sub + +Private Sub lstCrew_DblClick() + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Call GetCrew + txtCrewName = mstrCREW + txtCrewNo = mintCREW + lstCrew.Visible = False + txtPayDate.SetFocus +End Sub + +Private Sub lstPayInfo_Click() +Dim intCOL As Integer + If lstPayInfo.ListIndex <> -1 Then + lstPayInfo.col = 6 + mlngTIME = lstPayInfo.ColText +' mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then + Call FormShow + Else + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = -1 + End If + End If + +End Sub +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrCREW = oRS!Crew_Boss + End If + + oRS.Close + +End Sub + +Private Sub lstPayInfo_DblClick() + If Not mboolLOOK Then + cmdDelPay.Enabled = True + cmdSavePay.Enabled = True + cmdFindCrew.Visible = True + End If +End Sub + +Private Sub txtCheckNo_GotFocus() + Call FieldSelect(txtCheckNo) +End Sub + +Private Sub txtCrewNo_GotFocus() + Call FieldSelect(txtCrewNo) +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtPayAmt_GotFocus() + Call FieldSelect(txtPayAmt) +End Sub + +Private Sub txtPayDate_GotFocus() + Call FieldSelect(txtPayDate) +End Sub + +Private Sub txtPayDate_LostFocus() + If Len(txtPayDate) > 0 Then + txtPayDate = Format(txtPayDate, "00/00/####") + If Not IsDate(txtPayDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPayDate.SetFocus + End If + End If +End Sub + +Private Sub txtPercentDone_GotFocus() + Call FieldSelect(txtPercentDone) +End Sub + +Private Sub CheckCrew() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!Crew_Boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +''' cmdAdd.Enabled = True + Exit Sub + End If + End If + mboolSAVE = True +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frx new file mode 100644 index 0000000..34a7678 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayroll.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollx.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollx.frm new file mode 100644 index 0000000..7f24e8c --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollx.frm @@ -0,0 +1,1140 @@ +VERSION 5.00 +Begin VB.Form frmPayroll + Caption = "Payroll Information" + ClientHeight = 4920 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4920 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 11010 + TabIndex = 42 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLotNotes + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 39 + Top = 4020 + Width = 4815 + End + Begin VB.CheckBox chkLook + Caption = "Look" + Height = 315 + Left = 240 + TabIndex = 38 + Top = 3900 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtOffice + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 30 + Top = 3180 + Width = 4815 + End + Begin VB.ListBox lstCrew + Height = 1425 + Left = 6960 + Sorted = -1 'True + TabIndex = 36 + Top = 900 + Visible = 0 'False + Width = 4815 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 0 + TabIndex = 35 + Top = 4380 + Width = 1155 + End + Begin VB.TextBox txtVerify + Enabled = 0 'False + Height = 315 + Left = 2340 + TabIndex = 34 + Top = 3240 + Width = 1095 + End + Begin VB.CommandButton cmdAddPay + Caption = "&Add Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1780 + TabIndex = 33 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3680 + TabIndex = 31 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdDelPay + Caption = "&Delete Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5580 + TabIndex = 32 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdFindCrew + Height = 435 + Left = 1080 + Picture = "frmPayroll.frx":0000 + Style = 1 'Graphical + TabIndex = 25 + Top = 3900 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtNotes + Height = 735 + Left = 6960 + MaxLength = 255 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 29 + Top = 2400 + Width = 4815 + End + Begin VB.ComboBox cboWorkType + Height = 315 + ItemData = "frmPayroll.frx":0442 + Left = 1620 + List = "frmPayroll.frx":046A + Style = 2 'Dropdown List + TabIndex = 22 + Top = 2880 + Width = 1815 + End + Begin VB.ComboBox cboCrewType + Height = 315 + ItemData = "frmPayroll.frx":04D5 + Left = 1620 + List = "frmPayroll.frx":04E8 + Style = 2 'Dropdown List + TabIndex = 21 + Top = 2520 + Width = 1815 + End + Begin VB.TextBox txtPayAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 28 + Top = 3240 + Width = 1035 + End + Begin VB.TextBox txtCheckNo + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 27 + Top = 2880 + Width = 1035 + End + Begin VB.TextBox txtPayDate + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 26 + Top = 2520 + Width = 1035 + End + Begin VB.TextBox txtCrewName + Height = 315 + Left = 1620 + TabIndex = 20 + Top = 3960 + Width = 3255 + End + Begin VB.TextBox txtCrewNo + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 4 + TabIndex = 24 + Top = 3600 + Width = 675 + End + Begin VB.TextBox txtPercentDone + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 3 + TabIndex = 23 + Top = 3240 + Width = 675 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9270 + TabIndex = 19 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7410 + TabIndex = 18 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5715 + TabIndex = 17 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 4095 + TabIndex = 16 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtModel + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 2400 + TabIndex = 15 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtProjLot + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 600 + TabIndex = 14 + Top = 60 + Width = 1695 + End + Begin VB.ListBox lstPayInfo + Height = 1425 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 900 + Width = 6735 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffolding Frames:" + Height = 195 + Left = 7380 + TabIndex = 47 + Top = 480 + Width = 1395 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"" :" + Height = 195 + Left = 8880 + TabIndex = 46 + Top = 480 + Width = 375 + End + Begin VB.Label lblD68 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9270 + TabIndex = 45 + Top = 420 + Width = 855 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"" :" + Height = 195 + Left = 10500 + TabIndex = 44 + Top = 480 + Width = 465 + End + Begin VB.Label lblD108 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 11010 + TabIndex = 43 + Top = 420 + Width = 855 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 10155 + TabIndex = 41 + Top = 135 + Width = 840 + End + Begin VB.Label lblLotNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot Notes:" + Height = 195 + Left = 6150 + TabIndex = 40 + Top = 4020 + Width = 735 + End + Begin VB.Label lblOffice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Office Notes:" + Height = 195 + Left = 5955 + TabIndex = 37 + Top = 3180 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 60 + X2 = 11880 + Y1 = 780 + Y2 = 780 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 8310 + TabIndex = 13 + Top = 120 + Width = 915 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 6630 + TabIndex = 12 + Top = 120 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 4995 + TabIndex = 11 + Top = 120 + Width = 615 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 3315 + TabIndex = 10 + Top = 120 + Width = 675 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot #:" + Height = 195 + Left = 120 + TabIndex = 9 + Top = 120 + Width = 420 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PR Notes:" + Height = 195 + Left = 6150 + TabIndex = 8 + Top = 2400 + Width = 735 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amt:" + Height = 195 + Left = 3885 + TabIndex = 7 + Top = 3300 + Width = 825 + End + Begin VB.Label lblCheck + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check #:" + Height = 195 + Left = 4050 + TabIndex = 6 + Top = 2940 + Width = 660 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date:" + Height = 195 + Left = 3810 + TabIndex = 5 + Top = 2580 + Width = 900 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 1125 + TabIndex = 4 + Top = 3660 + Width = 405 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage Done:" + Height = 195 + Left = 225 + TabIndex = 3 + Top = 3300 + Width = 1305 + End + Begin VB.Label lblWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Type of Work Done:" + Height = 195 + Left = 75 + TabIndex = 2 + Top = 2940 + Width = 1455 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 720 + TabIndex = 1 + Top = 2580 + Width = 810 + End +End +Attribute VB_Name = "frmPayroll" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSTIME As Recordset +Dim moRSProj As Recordset +Dim moRSMemo As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mboolSAVE As Boolean +Dim mstrType As String, mstrCREW As String +Dim mlngFind As Long, mboolLOOK As Boolean +Dim mlngTIME As Long +Dim mintCREW As Integer + +Private Sub cmdDelPay_Click() + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + moRSTIME.Delete + Call PayLoad +End Sub + +Private Sub cmdFindCrew_Click() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +''' cmdAdd.Enabled = True + Exit Sub + End If + End If + + If Not oRS.EOF Then + mstrCREW = oRS!crew_boss + txtCrewName = mstrCREW + txtPayDate.SetFocus + Else + Call CrewLoad + lstCrew.SetFocus + End If + + oRS.Close + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + Call cmdAddPay_Click + Else + Unload Me + End If + End If + If chkLook Then + mboolLOOK = True + End If +''' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSavePay.Enabled Then + cmdSavePay.Enabled = True + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSTIME.State = adStateOpen Then + moRSTIME.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset +''' Set moRSTime = New Recordset + +''' gbytSECURITY = 1 + + If gbytSECURITY = 1 Then +''' cmdDelPay.Enabled = True + End If + + Call ProjLoad + Call LotLoad + Call PayLoad + If FormFind() Then +''' Call PlanFind +''' Call FormShow +''' Call MatLoad +''' Call POptLoad +''' Call LOptLoad +''' Call OptMatLoad +''' Call OrderLoad +''' Call POLoad +''' Call POMatLoad + End If + +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.EOF Then + strSql2 = "SELECT * FROM tblYardMemo" ' WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + moRSMemo.AddNew + moRSMemo!Lot_id = gintLOTID + moRSMemo.Update + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + End If + +End Sub + +Private Sub FormShow() + mboolSHOW = True + txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtLathYds = Field2Integer(moRS!sq_yd) - 19 + txtCMUYds = Field2Integer(moRS!CMU) + txtMatYds = Field2Integer(moRS!sq_yd) + txtMetalFt = Field2Long(moRS!METAL) + txtModel = Field2Str(moRS!model) + txtStone = Field2Str(moRS!ST_SQFT) + lblD68 = Field2Str2(moRS!Scaf6) + lblD108 = Field2Str2(moRS!scaf10) + + With moRSTIME + txtPercentDone = Field2Str(!pct_done) + txtVerify = IIf(Field2Str(!paydt) = "12:00:00 AM", "", Field2Str(!paydt)) + txtCrewNo = Field2Integer(!crew) + mintCREW = Field2Integer(!crew) + Call GetCrew + txtCrewName = mstrCREW + txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) + txtCheckNo = Field2Str(!prcheck) + txtPayAmt = Format(Field2Str(!pay_amt), "##,###.00") + txtNotes = Field2Str(!notes) + txtOffice = Field2Str(!office) + + If !pay_type = "L" Then + cboCrewType.Text = "LATH" + ElseIf !pay_type = "S" Then + cboCrewType.Text = "STUCCO" + ElseIf !pay_type = "R" Then + cboCrewType.Text = "Repair/PO" + ElseIf !pay_type = "V" Then + cboCrewType.Text = "V_Stone" + ElseIf !pay_type = "C" Then + cboCrewType.Text = "C_SCAFFOLD" + End If + + If !workdone = "A" Then + cboWorkType.Text = "A_WRAP" + ElseIf !workdone = "C" Then + cboWorkType.Text = "COMPLETE" + ElseIf !workdone = "P" Then + cboWorkType.Text = "PARTIAL" + ElseIf !workdone = "B" Then + cboWorkType.Text = "BROWN" + ElseIf !workdone = "T" Then + cboWorkType.Text = "TEXTURE" + ElseIf !workdone = "S" Then + cboWorkType.Text = "SCRATCH" + ElseIf !workdone = "R" Then + cboWorkType.Text = "REPAIR" + ElseIf !workdone = "W" Then + cboWorkType.Text = "WORK ORDER/PO" + ElseIf !workdone = "F" Then + cboWorkType.Text = "FENCE" + ElseIf !workdone = "U" Then + cboWorkType.Text = "U_CMU" + ElseIf !workdone = "Y" Then + cboWorkType.Text = "Y_UP" + ElseIf !workdone = "Z" Then + cboWorkType.Text = "Z_DOWN" + End If + End With + txtLotNotes = Field2Str(moRSMemo!payroll) + +''' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + mboolSHOW = False +End Sub + +Private Sub cmdAddPay_Click() + Call FormClear + txtVerify = Date + cmdSavePay.Enabled = True + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = True + mboolAdding = True + cboCrewType.SetFocus +End Sub +Private Sub cmdSavePay_Click() + mboolSAVE = False + Call CheckCrew + If mboolSAVE Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + cmdFindCrew.Visible = False + lstCrew.Visible = False + Call FormSave + Call PayLoad + End If +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSTIME.AddNew + End If + + ''' Store the controls to the recordset + Call FieldsSave + + moRSTIME.Update + + moRSMemo!payroll = Str2Field(txtLotNotes) + moRSMemo.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTIME " + strSQL = strSQL & "WHERE IDNUM = " & mlngTIME + + Set moRSTIME = New Recordset +''' If moRSTime.State = adStateOpen Then +''' moRSTime.Close +''' End If + + moRSTIME.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSTIME.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub cmdExit_Click() + Unload Me +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + If mboolAdding Then +''' moRS.AddNew + moRSTIME!proj_id = gintPROJID + moRSTIME!Lot_id = gintLOTID + moRSTIME!lot_no = Str2Field(moRS!lot_no) + moRSTIME!paydt = Date + moRSTIME!C_USER = gstrLOGIN + End If + + + With moRSTIME + !pct_done = Integer2Field(txtPercentDone) +''' !paydt = Date +''' !paydt = Str2Field(txtVerify) + !crew = Integer2Field(txtCrewNo) + !prdate = Str2Field(txtPayDate) + !prcheck = Str2Field(txtCheckNo) + !pay_amt = Str2Field(txtPayAmt) + !notes = Str2Field(txtNotes) + !office = Str2Field(txtOffice) + !pay_type = Left(Str2Field(cboCrewType.Text), 1) + !workdone = Left(Str2Field(cboWorkType.Text), 1) + !U_USER = gstrLOGIN + !Update = Date + End With +''' On Error Resume Next +''' moRS.Update +''' On Error GoTo 0 + moRSTIME.Update + If mboolAdding Then +''' Call GetLotID + Call PayLoad +''' Call POptLoad + mboolAdding = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub +Private Sub FormClear() + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + txtOffice = "" + txtLotNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = -1 + +End Sub +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + aTabs(0) = 10 + aTabs(1) = 20 + aTabs(2) = 40 + aTabs(3) = 90 + aTabs(4) = 110 + +''' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!workdone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + End If + +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long ', aTabs(4) As Long + +''' aTabs(0) = 10 +''' aTabs(1) = 20 +''' aTabs(2) = 40 +''' aTabs(3) = 90 +''' aTabs(4) = 110 + + strSQL = "SELECT * from tblcrew WHERE type = '" & Left(Field2Str(cboCrewType), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstCrew.hwnd, LB_SETTABSTOPS, 1, 160) + + lstCrew.Clear + lstCrew.Visible = True + + Do Until oRS.EOF + With lstCrew + mintCREW = Field2Integer(oRS!crew_id) + strLine = oRS!crew_boss & vbTab & oRS!crew_id +''' strLine = strLine & vbTab & oRS!paydt +''' strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + End If + +End Sub + +Private Sub lstCrew_DblClick() + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Call GetCrew + txtCrewName = mstrCREW + txtCrewNo = mintCREW + lstCrew.Visible = False + txtPayDate.SetFocus +End Sub + +Private Sub lstPayInfo_Click() + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then + Call FormShow + Else + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = -1 + End If + End If + +End Sub +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrCREW = oRS!crew_boss + End If + + oRS.Close + +End Sub + +Private Sub lstPayInfo_DblClick() + If Not mboolLOOK Then + cmdDelPay.Enabled = True + cmdSavePay.Enabled = True + cmdFindCrew.Visible = True + End If +End Sub + +Private Sub txtCheckNo_GotFocus() + Call FieldSelect(txtCheckNo) +End Sub + +Private Sub txtCrewNo_GotFocus() + Call FieldSelect(txtCrewNo) +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtPayAmt_GotFocus() + Call FieldSelect(txtPayAmt) +End Sub + +Private Sub txtPayDate_GotFocus() + Call FieldSelect(txtPayDate) +End Sub + +Private Sub txtPayDate_LostFocus() + If Len(txtPayDate) > 0 Then + txtPayDate = Format(txtPayDate, "00/00/####") + If Not IsDate(txtPayDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPayDate.SetFocus + End If + End If +End Sub + +Private Sub txtPercentDone_GotFocus() + Call FieldSelect(txtPercentDone) +End Sub + +Private Sub CheckCrew() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +''' cmdAdd.Enabled = True + Exit Sub + End If + End If + mboolSAVE = True +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frm new file mode 100644 index 0000000..e417f04 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frm @@ -0,0 +1,1334 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPayroll + Caption = "Payroll Information" + ClientHeight = 4920 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4920 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtStone + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 11010 + TabIndex = 42 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLotNotes + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 39 + Top = 4020 + Width = 4815 + End + Begin VB.CheckBox chkLook + Caption = "Look" + Height = 315 + Left = 240 + TabIndex = 38 + Top = 3900 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtOffice + Height = 795 + Left = 6960 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 30 + Top = 3180 + Width = 4815 + End + Begin VB.ListBox lstCrew + Height = 1425 + Left = 6960 + Sorted = -1 'True + TabIndex = 36 + Top = 900 + Visible = 0 'False + Width = 4815 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 0 + TabIndex = 35 + Top = 4380 + Width = 1155 + End + Begin VB.TextBox txtVerify + Enabled = 0 'False + Height = 315 + Left = 2340 + TabIndex = 34 + Top = 3240 + Width = 1095 + End + Begin VB.CommandButton cmdAddPay + Caption = "&Add Payroll" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1780 + TabIndex = 33 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdSavePay + Caption = "&Save Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3680 + TabIndex = 31 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdDelPay + Caption = "&Delete Payroll" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5580 + TabIndex = 32 + Top = 4380 + Width = 1275 + End + Begin VB.CommandButton cmdFindCrew + Height = 435 + Left = 1080 + Picture = "frmPayroll.frx":0000 + Style = 1 'Graphical + TabIndex = 25 + Top = 3900 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtNotes + Height = 735 + Left = 6960 + MaxLength = 255 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 29 + Top = 2400 + Width = 4815 + End + Begin VB.ComboBox cboCrewType + Height = 315 + ItemData = "frmPayroll.frx":0442 + Left = 1620 + List = "frmPayroll.frx":0458 + Style = 2 'Dropdown List + TabIndex = 21 + Top = 2520 + Width = 1815 + End + Begin VB.TextBox txtPayAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 28 + Top = 3240 + Width = 1035 + End + Begin VB.TextBox txtCheckNo + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 27 + Top = 2880 + Width = 1035 + End + Begin VB.TextBox txtPayDate + Height = 315 + Left = 4800 + MaxLength = 10 + TabIndex = 26 + Top = 2520 + Width = 1035 + End + Begin VB.TextBox txtCrewName + Height = 315 + Left = 1620 + TabIndex = 20 + Top = 3960 + Width = 3255 + End + Begin VB.TextBox txtCrewNo + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 4 + TabIndex = 24 + Top = 3600 + Width = 675 + End + Begin VB.TextBox txtPercentDone + Alignment = 1 'Right Justify + Height = 315 + Left = 1620 + MaxLength = 3 + TabIndex = 23 + Top = 3240 + Width = 675 + End + Begin VB.TextBox txtMatYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 9270 + TabIndex = 19 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 315 + Left = 7410 + TabIndex = 18 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 5715 + TabIndex = 17 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 4095 + TabIndex = 16 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtModel + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 2400 + TabIndex = 15 + Top = 60 + Width = 855 + End + Begin VB.TextBox txtProjLot + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 285 + Left = 600 + TabIndex = 14 + Top = 60 + Width = 1695 + End + Begin VB.ListBox lstPayInfo + Height = 1425 + Left = 120 + Sorted = -1 'True + TabIndex = 0 + Top = 900 + Width = 6735 + End + Begin LpLib.fpCombo cboWorkType + Height = 315 + Left = 1620 + TabIndex = 22 + Top = 2865 + Width = 2355 + _Version = 196608 + _ExtentX = 4154 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 1 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPayroll.frx":0493 + End + Begin VB.Label lblScaf + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffolding Frames:" + Height = 195 + Left = 7380 + TabIndex = 47 + Top = 480 + Width = 1395 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"" :" + Height = 195 + Left = 8880 + TabIndex = 46 + Top = 480 + Width = 375 + End + Begin VB.Label lblD68 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 9270 + TabIndex = 45 + Top = 420 + Width = 855 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"" :" + Height = 195 + Left = 10500 + TabIndex = 44 + Top = 480 + Width = 465 + End + Begin VB.Label lblD108 + BackColor = &H00C0FFFF& + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 11010 + TabIndex = 43 + Top = 420 + Width = 855 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone SqFt:" + Height = 195 + Left = 10155 + TabIndex = 41 + Top = 135 + Width = 840 + End + Begin VB.Label lblLotNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot Notes:" + Height = 195 + Left = 6150 + TabIndex = 40 + Top = 4020 + Width = 735 + End + Begin VB.Label lblOffice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Office Notes:" + Height = 195 + Left = 5955 + TabIndex = 37 + Top = 3180 + Width = 930 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 60 + X2 = 11880 + Y1 = 780 + Y2 = 780 + End + Begin VB.Label lblMaterial + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yds:" + Height = 195 + Left = 8310 + TabIndex = 13 + Top = 120 + Width = 915 + End + Begin VB.Label lblCMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yds:" + Height = 195 + Left = 6630 + TabIndex = 12 + Top = 120 + Width = 720 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Ft:" + Height = 195 + Left = 4995 + TabIndex = 11 + Top = 120 + Width = 615 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yds:" + Height = 195 + Left = 3315 + TabIndex = 10 + Top = 120 + Width = 675 + End + Begin VB.Label lblLotNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lot #:" + Height = 195 + Left = 120 + TabIndex = 9 + Top = 120 + Width = 420 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PR Notes:" + Height = 195 + Left = 6150 + TabIndex = 8 + Top = 2400 + Width = 735 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amt:" + Height = 195 + Left = 3885 + TabIndex = 7 + Top = 3300 + Width = 825 + End + Begin VB.Label lblCheck + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check #:" + Height = 195 + Left = 4050 + TabIndex = 6 + Top = 2940 + Width = 660 + End + Begin VB.Label lblPayDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date:" + Height = 195 + Left = 3810 + TabIndex = 5 + Top = 2580 + Width = 900 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 1125 + TabIndex = 4 + Top = 3660 + Width = 405 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage Done:" + Height = 195 + Left = 225 + TabIndex = 3 + Top = 3300 + Width = 1305 + End + Begin VB.Label lblWorkType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Type of Work Done:" + Height = 195 + Left = 75 + TabIndex = 2 + Top = 2940 + Width = 1455 + End + Begin VB.Label lblCrewType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew Type:" + Height = 195 + Left = 720 + TabIndex = 1 + Top = 2580 + Width = 810 + End +End +Attribute VB_Name = "frmPayroll" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSTIME As Recordset +Dim moRSProj As Recordset +Dim moRSMemo As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mboolSAVE As Boolean +Dim mstrType As String, mstrCREW As String +Dim mlngFind As Long, mboolLOOK As Boolean +Dim mlngTIME As Long, mboolDONE As Boolean +Dim mintCREW As Integer +Dim mstrWTYPE As String, mstrWDone As String + +Private Sub cmdDelPay_Click() + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + moRSTIME.Delete + Call PayLoad +End Sub + +Private Sub WTLoad() +Dim oRS As Recordset, strSQL As String +Dim strID As String, strWT As String, strWTYPE As String + + cboWorkType.Clear + strSQL = "SELECT * FROM tblCBOWorkType" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + Do Until oRS.EOF + strID = (oRS!WTID) + strWT = (oRS!WTCode) + strWTYPE = (oRS!worktype) + cboWorkType.AddItem strID & vbTab & strWT & vbTab & strWTYPE ' & vbTab & Format(strPHONE, "(###) ###-####") & vbTab & Format(strFAX, "(###) ###-####") + + oRS.MoveNext + Loop + + End If + + If cboWorkType.ListCount Then + cboWorkType.ListIndex = 0 + Else + cboWorkType.ListIndex = -1 + End If + +End Sub + +Private Sub cmdFindCrew_Click() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +' cmdAdd.Enabled = True + Exit Sub + End If + End If + + If Not oRS.EOF Then + mstrCREW = oRS!crew_boss + txtCrewName = mstrCREW + txtPayDate.SetFocus + Else + Call CrewLoad + lstCrew.SetFocus + End If + + oRS.Close + +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer, strSQL As String + +' Call WTLoad + mboolDONE = False + + If lstPayInfo.ListCount = 0 Then + intResponse = MsgBox("No Payroll Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tblTIME" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If moRSTIME.EOF Then + End If + Call cmdAddPay_Click + Else + Unload Me + End If + End If + If chkLook Then + mboolLOOK = True + End If +' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSavePay.Enabled Then + cmdSavePay.Enabled = True + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePay.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSTIME.State = adStateOpen Then + moRSTIME.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset +' Set moRSTime = New Recordset + + ' gbytSECURITY = 1 + + If gbytSECURITY = 1 Then + ' cmdDelPay.Enabled = True + End If + + Call ProjLoad + Call LotLoad + Call PayLoad + Call WTLoad + mboolDONE = True +' If FormFind() Then +' Call PlanFind +' Call FormShow +' Call MatLoad +' Call POptLoad +' Call LOptLoad +' Call OptMatLoad +' Call OrderLoad +' Call POLoad +' Call POMatLoad +' End If + +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + +End Sub + +Private Sub LotLoad() + Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblLotInfo where lot_id = " & gintLOTID + + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.EOF Then + strSql2 = "SELECT * FROM tblYardMemo" ' WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + moRSMemo.AddNew + moRSMemo!Lot_id = gintLOTID + moRSMemo.Update + strSql2 = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + End If + +End Sub + +Private Sub FormShow() +Dim strWTYPE As String +Dim intLoop As Integer, strSTR As String, intLEN As Integer + + mboolSHOW = True + txtProjLot = Trim$(moRSProj!proj_code) & " " & moRS!lot_no + txtLathYds = Field2Integer(moRS!sq_yd) - 19 + txtCMUYds = Field2Integer(moRS!CMU) + txtMatYds = Field2Integer(moRS!sq_yd) + txtMetalFt = Field2Long(moRS!METAL) + txtModel = Field2Str(moRS!model) + txtStone = Field2Str(moRS!ST_SQFT) + lblD68 = Field2Str2(moRS!Scaf6) + lblD108 = Field2Str2(moRS!scaf10) + + With moRSTIME + txtPercentDone = Field2Str(!pct_done) + txtVerify = IIf(Field2Str(!paydt) = "12:00:00 AM", "", Field2Str(!paydt)) + txtCrewNo = Field2Integer(!crew) + mintCREW = Field2Integer(!crew) + Call GetCrew + txtCrewName = mstrCREW + txtPayDate = IIf(Field2Str(!prdate) = "12:00:00 AM", "", Field2Str(!prdate)) + txtCheckNo = Field2Str(!prcheck) + txtPayAmt = Format(Field2Str(!pay_amt), "##,###.00") + txtNotes = Field2Str(!notes) + txtOffice = Field2Str(!office) + + If !pay_type = "L" Then + cboCrewType.Text = "LATH" + ElseIf !pay_type = "S" Then + cboCrewType.Text = "STUCCO" + ElseIf !pay_type = "R" Then + cboCrewType.Text = "Repair/PO" + ElseIf !pay_type = "V" Then + cboCrewType.Text = "V_Stone" + ElseIf !pay_type = "C" Then + cboCrewType.Text = "C_SCAFFOLD" + ElseIf !pay_type = "X" Then + cboCrewType.Text = "X_PAINT" + End If +' strWTYPE = "X" + strWTYPE = Field2Str(!workdone) + intLEN = Len(strWTYPE) + + For intLoop = 0 To cboWorkType.ListCount - 1 +' strStr = cboWorkType.ItemData(2) + cboWorkType.ListIndex = (intLoop) + cboWorkType.col = 1 + strSTR = cboWorkType.ColText +' strStr = cboWorkType.ColDataField +' strStr = cboWorkType.List(intLoop) + +' If intLEN = 1 Then +' If Left$(UCase$(strStr), 1) = Trim(UCase$(strWTYPE)) Then + If Trim(UCase$(strSTR)) = Trim(UCase$(strWTYPE)) Then + cboWorkType.ListIndex = intLoop + intLoop = cboWorkType.ListCount + ' ctrControlName.SetFocus + Else + cboWorkType.ListIndex = -1 + End If +' ElseIf intLEN > 1 Then + +' End If + Next intLoop + +' Call CBFindString1(cboWorkType, strWTYPE) +' If !workdone = "A" Then +' cboWorkType.Text = "A_WRAP" +' ElseIf !workdone = "C" Then +' cboWorkType.Text = "COMPLETE" +' ElseIf !workdone = "P" Then +' cboWorkType.Text = "PARTIAL" +' ElseIf !workdone = "B" Then +' cboWorkType.Text = "BROWN" +' ElseIf !workdone = "T" Then +' cboWorkType.Text = "TEXTURE" +' ElseIf !workdone = "S" Then +' cboWorkType.Text = "SCRATCH" +' ElseIf !workdone = "R" Then +' cboWorkType.Text = "REPAIR" +' ElseIf !workdone = "W" Then +' cboWorkType.Text = "WORK ORDER/PO" +' ElseIf !workdone = "F" Then +' cboWorkType.Text = "FENCE" +' ElseIf !workdone = "U" Then +' cboWorkType.Text = "U_CMU" +' ElseIf !workdone = "Y" Then +' cboWorkType.Text = "Y_UP" +' ElseIf !workdone = "Z" Then +' cboWorkType.Text = "Z_DOWN" +' End If + End With + txtLotNotes = Field2Str(moRSMemo!payroll) + +' If chkLook Then + If mboolLOOK Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = False + txtPercentDone.Enabled = False + txtVerify.Enabled = False + txtCrewNo.Enabled = False + txtPayDate.Enabled = False + txtCheckNo.Enabled = False + txtPayAmt.Enabled = False + txtNotes.Enabled = False + txtOffice.Enabled = False + cboWorkType.Enabled = False + cboCrewType.Enabled = False + txtCrewName.Enabled = False + End If + mboolSHOW = False +End Sub + +Private Sub cmdAddPay_Click() + Call FormClear + txtVerify = Date + cmdSavePay.Enabled = True + cmdDelPay.Enabled = False + cmdAddPay.Enabled = False + cmdFindCrew.Visible = True + mboolAdding = True + cboCrewType.SetFocus +End Sub +Private Sub cmdSavePay_Click() + mboolSAVE = False + Call CheckCrew + If mboolSAVE Then + cmdSavePay.Enabled = False + cmdDelPay.Enabled = False + cmdAddPay.Enabled = True + cmdFindCrew.Visible = False + lstCrew.Visible = False + Call FormSave + Call PayLoad + End If +End Sub + +Private Sub FormSave() + Dim strName As String, strSQL As String, moRSTIME As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then +' Set moRSTIME = New Recordset +'' If moRSTIME.State = adStateOpen Then +'' moRSTIME.AddNew +' moRSTIME.Close +'' Else + strSQL = "SELECT * FROM tblTIME WHERE IDNUM = " & mlngTIME +' strSQL = strSQL & "WHERE IDNUM = " & mlngTIME + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +'' If Not moRSTIME.EOF Then + moRSTIME.AddNew +'' End If +'' End If + + End If + + ' Store the controls to the recordset + Call FieldsSave + +' moRSTIME.Update + + moRSMemo!payroll = Str2Field(txtLotNotes) + moRSMemo.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTIME " + strSQL = strSQL & "WHERE IDNUM = " & mlngTIME + + Set moRSTIME = New Recordset +' If moRSTime.State = adStateOpen Then +' moRSTime.Close +' End If + + moRSTIME.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSTIME.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub cmdExit_Click() + Unload Me +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + If mboolAdding Then +' moRS.AddNew + moRSTIME!proj_id = gintPROJID + moRSTIME!Lot_id = gintLOTID + moRSTIME!lot_no = Str2Field(moRS!lot_no) + moRSTIME!paydt = Date + moRSTIME!C_USER = gstrLOGIN + End If + + + With moRSTIME + !pct_done = Integer2Field(txtPercentDone) +' !paydt = Date +' !paydt = Str2Field(txtVerify) + !crew = Integer2Field(txtCrewNo) + !prdate = Str2Field(txtPayDate) + !prcheck = Str2Field(txtCheckNo) + !pay_amt = Str2Field(txtPayAmt) + !notes = Str2Field(txtNotes) + !office = Str2Field(txtOffice) + !pay_type = Left(Str2Field(cboCrewType.Text), 1) + cboWorkType.col = 1 + !workdone = cboWorkType.ColText +' !workdone = Left(Str2Field(cboWorkType.Text), 4) + !U_USER = gstrLOGIN + !Update = Date + End With +' On Error Resume Next +' moRS.Update +' On Error GoTo 0 + moRSTIME.Update + If mboolAdding Then +' Call GetLotID + Call PayLoad +' Call POptLoad + mboolAdding = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Payroll - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub +Private Sub FormClear() + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + txtOffice = "" + txtLotNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = 0 + +End Sub +Private Sub PayLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long, aTabs(4) As Long + + aTabs(0) = 10 + aTabs(1) = 40 + aTabs(2) = 70 + aTabs(3) = 90 + aTabs(4) = 110 + +' strSQL = "SELECT idnum, lot_id, pay_type, workdone, pct_done, paydt, crew from tblTime WHERE lot_id =" & gintLOTID + strSQL = "SELECT * from tblTime WHERE lot_id =" & gintLOTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstPayInfo.hwnd, LB_SETTABSTOPS, 5, aTabs(0)) + + lstPayInfo.Clear + + Do Until oRS.EOF + With lstPayInfo + mintCREW = Field2Integer(oRS!crew) + Call GetCrew + strLine = oRS!pay_type & vbTab & oRS!workdone & vbTab & oRS!pct_done + strLine = strLine & vbTab & oRS!prdate + strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!idnum) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPayInfo.ListCount Then + lstPayInfo.ListIndex = 0 + End If + +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String +Dim lngRET As Long ', aTabs(4) As Long + +' aTabs(0) = 10 +' aTabs(1) = 20 +' aTabs(2) = 40 +' aTabs(3) = 90 +' aTabs(4) = 110 + + strSQL = "SELECT * from tblcrew WHERE type = '" & Left(Field2Str(cboCrewType), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lngRET = SendMessage(lstCrew.hwnd, LB_SETTABSTOPS, 1, 160) + + lstCrew.Clear + lstCrew.Visible = True + + Do Until oRS.EOF + With lstCrew + mintCREW = Field2Integer(oRS!crew_id) + strLine = oRS!crew_boss & vbTab & oRS!crew_id +' strLine = strLine & vbTab & oRS!paydt +' strLine = strLine & vbTab & oRS!crew & vbTab & mstrCREW + .AddItem strLine + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + End If + +End Sub + +Private Sub lstCrew_DblClick() + mintCREW = lstCrew.ItemData(lstCrew.ListIndex) + Call GetCrew + txtCrewName = mstrCREW + txtCrewNo = mintCREW + lstCrew.Visible = False + txtPayDate.SetFocus +End Sub + +Private Sub lstPayInfo_Click() + If lstPayInfo.ListIndex <> -1 Then + mlngTIME = lstPayInfo.ItemData(lstPayInfo.ListIndex) + If FormFind() Then 'And mboolDONE Then + Call FormShow + Else + txtPercentDone = "0" + txtVerify = "" + txtCrewNo = "0" + txtCrewName = "" + txtPayDate = "" + txtCheckNo = "0" + txtPayAmt = "0" + txtNotes = "" + cboCrewType.ListIndex = -1 + cboWorkType.ListIndex = -1 + End If + End If + +End Sub +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintCREW + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + mstrCREW = oRS!crew_boss + End If + + oRS.Close + +End Sub + +Private Sub lstPayInfo_DblClick() + If Not mboolLOOK Then + cmdDelPay.Enabled = True + cmdSavePay.Enabled = True + cmdFindCrew.Visible = True + End If +End Sub + +Private Sub txtCheckNo_GotFocus() + Call FieldSelect(txtCheckNo) +End Sub + +Private Sub txtCrewNo_GotFocus() + Call FieldSelect(txtCrewNo) +End Sub + +Private Sub txtNotes_GotFocus() + Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtPayAmt_GotFocus() + Call FieldSelect(txtPayAmt) +End Sub + +Private Sub txtPayDate_GotFocus() + Call FieldSelect(txtPayDate) +End Sub + +Private Sub txtPayDate_LostFocus() + If Len(txtPayDate) > 0 Then + txtPayDate = Format(txtPayDate, "00/00/####") + If Not IsDate(txtPayDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtPayDate.SetFocus + End If + End If +End Sub + +Private Sub txtPercentDone_GotFocus() + Call FieldSelect(txtPercentDone) +End Sub + +Private Sub CheckCrew() + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + + strSQL = "SELECT * from tblcrew WHERE crew_id = " & Field2Integer(txtCrewNo) & " and type = '" & Left(Str2Field(cboCrewType.Text), 1) & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + If oRS!inactive Then + MsgBox "This Crew - " & oRS!crew_boss & " - Is Inactive - Select an Active Crew", vbOKOnly, "Inactive Crew" + txtCrewNo.SetFocus +' cmdAdd.Enabled = True + Exit Sub + End If + End If + mboolSAVE = True +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frx new file mode 100644 index 0000000..491bce7 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPayrollxx.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frm new file mode 100644 index 0000000..864fe45 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frm @@ -0,0 +1,6851 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPlans + BorderStyle = 1 'Fixed Single + Caption = "Plans" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 11910 + KeyPreview = -1 'True + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + StartUpPosition = 3 'Windows Default + Visible = 0 'False + Begin VB.CheckBox chkHLNotes + Alignment = 1 'Right Justify + Caption = "Hi-Lite Notes" + Height = 195 + Left = 10410 + TabIndex = 141 + Top = 1245 + Width = 1380 + End + Begin VB.CommandButton cmdPictures + Caption = "Elevation Pictures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 7200 + TabIndex = 138 + Top = 1200 + Visible = 0 'False + Width = 1335 + End + Begin VB.CheckBox chkPaint + Alignment = 1 'Right Justify + Caption = "Paint" + Height = 285 + Left = 6450 + TabIndex = 137 + Top = 870 + Width = 690 + End + Begin VB.TextBox txtPaintSQFT + Alignment = 1 'Right Justify + Height = 315 + Left = 5520 + TabIndex = 136 + Top = 990 + Width = 855 + End + Begin VB.CheckBox chk2STORY + Alignment = 1 'Right Justify + Caption = "2 Story Plan" + Height = 255 + Left = 7320 + TabIndex = 16 + Top = 900 + Width = 1215 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 3780 + TabIndex = 20 + Top = 1740 + Width = 675 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 2520 + TabIndex = 19 + Top = 1740 + Width = 675 + End + Begin VB.CheckBox chkVerified + Alignment = 1 'Right Justify + Caption = "Verified Plan:" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 765 + TabIndex = 120 + Top = 225 + Width = 1500 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings:" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 210 + Left = 300 + TabIndex = 119 + Top = 30 + Width = 1965 + End + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 195 + Left = 2880 + TabIndex = 116 + Top = 225 + Width = 975 + End + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 8340 + MaxLength = 4 + TabIndex = 13 + Top = -30 + Width = 855 + End + Begin VB.CommandButton cmdUpPlan + Caption = "Update From Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8640 + TabIndex = 107 + Top = 1200 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 5520 + TabIndex = 10 + Top = -45 + Width = 855 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 195 + Left = 2415 + TabIndex = 9 + Top = 45 + Width = 1455 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update Inventory #'s" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8640 + TabIndex = 103 + TabStop = 0 'False + Top = 3120 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtOld + Height = 315 + Left = 555 + TabIndex = 100 + Top = 855 + Visible = 0 'False + Width = 855 + End + Begin VB.TextBox txtNew + Height = 315 + Left = 2055 + TabIndex = 102 + Top = 855 + Visible = 0 'False + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 7200 + TabIndex = 98 + TabStop = 0 'False + Top = 3120 + Width = 1335 + End + Begin VB.CommandButton cmdCProj + Caption = "Copy Plan to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8640 + TabIndex = 97 + TabStop = 0 'False + Top = 2640 + Width = 1335 + End + Begin VB.CommandButton cmdCopyAll + Caption = "Copy All TakeOffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8640 + TabIndex = 96 + TabStop = 0 'False + Top = 1680 + Width = 1335 + End + Begin VB.ListBox lstProject + Height = 1230 + Left = 10260 + Sorted = -1 'True + TabIndex = 95 + TabStop = 0 'False + Top = 1920 + Visible = 0 'False + Width = 1395 + End + Begin VB.ListBox lstTake + Height = 1620 + Left = 10260 + Sorted = -1 'True + TabIndex = 92 + TabStop = 0 'False + Top = 1920 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdCopyTakeoff + Caption = "Copy 1 TakeOff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 8640 + TabIndex = 91 + TabStop = 0 'False + Top = 2145 + Width = 1335 + End + Begin VB.TextBox txtNewModel + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2280 + MaxLength = 8 + TabIndex = 8 + Top = 1080 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdDelPlan + Caption = "&Delete Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 7200 + TabIndex = 88 + TabStop = 0 'False + Top = 2640 + Width = 1335 + End + Begin VB.CommandButton cmdSavePlan + Caption = "&Save Plan" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 7200 + TabIndex = 23 + Top = 2160 + Width = 1335 + End + Begin VB.CommandButton cmdNewPlan + Caption = "New &Plan" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 465 + Left = 7200 + TabIndex = 87 + TabStop = 0 'False + Top = 1680 + Width = 1335 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 315 + Left = 975 + TabIndex = 78 + TabStop = 0 'False + Top = 510 + Width = 3075 + End + Begin VB.TextBox txtPLAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 10800 + MaxLength = 4 + TabIndex = 18 + Top = 300 + Width = 855 + End + Begin VB.TextBox txtPFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 10800 + MaxLength = 4 + TabIndex = 17 + Top = -15 + Width = 855 + End + Begin TabDlg.SSTab tabPlans + Height = 4815 + Left = 180 + TabIndex = 25 + Top = 3600 + Width = 11535 + _ExtentX = 20346 + _ExtentY = 8493 + _Version = 393216 + Tabs = 2 + TabsPerRow = 2 + TabHeight = 520 + TabCaption(0) = "&Materials" + TabPicture(0) = "frmPlans.frx":0000 + Tab(0).ControlEnabled= -1 'True + Tab(0).Control(0)= "lblPMInvNo" + Tab(0).Control(0).Enabled= 0 'False + Tab(0).Control(1)= "lblPMDesc" + Tab(0).Control(1).Enabled= 0 'False + Tab(0).Control(2)= "lblPMQty" + Tab(0).Control(2).Enabled= 0 'False + Tab(0).Control(3)= "lblPMPrice" + Tab(0).Control(3).Enabled= 0 'False + Tab(0).Control(4)= "lblPMDFLag" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "lblPMType" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "lblPMMetal" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "lblPMLength" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "txtPMInvNo" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "txtPMDesc" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtPMQty" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "txtPMPrice" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "txtPMLength" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "cboPMDFlag" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).Control(14)= "cboPMType" + Tab(0).Control(14).Enabled= 0 'False + Tab(0).Control(15)= "cboPMMetal" + Tab(0).Control(15).Enabled= 0 'False + Tab(0).Control(16)= "cmdAddMat" + Tab(0).Control(16).Enabled= 0 'False + Tab(0).Control(17)= "cmdSaveMat" + Tab(0).Control(17).Enabled= 0 'False + Tab(0).Control(18)= "cmdDelMat" + Tab(0).Control(18).Enabled= 0 'False + Tab(0).Control(19)= "cmdInventory" + Tab(0).Control(19).Enabled= 0 'False + Tab(0).Control(20)= "cmdFindMat" + Tab(0).Control(20).Enabled= 0 'False + Tab(0).Control(21)= "lstPMaterial" + Tab(0).Control(21).Enabled= 0 'False + Tab(0).Control(22)= "lstMInventory" + Tab(0).Control(22).Enabled= 0 'False + Tab(0).ControlCount= 23 + TabCaption(1) = "&Options" + TabPicture(1) = "frmPlans.frx":001C + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblOptYdge" + Tab(1).Control(1)= "lblOptFin2" + Tab(1).Control(2)= "lblOptFAdjYdge" + Tab(1).Control(3)= "lblOTexture" + Tab(1).Control(4)= "lblOMInvNo" + Tab(1).Control(5)= "lblOMDesc" + Tab(1).Control(6)= "lblOMQty" + Tab(1).Control(7)= "lblOMDflag" + Tab(1).Control(8)= "lblOMMType" + Tab(1).Control(9)= "lblOMetal" + Tab(1).Control(10)= "lblOMLength" + Tab(1).Control(11)= "lblBill" + Tab(1).Control(12)= "lblElev" + Tab(1).Control(13)= "lblOSt_SqFt" + Tab(1).Control(14)= "lblO68" + Tab(1).Control(15)= "lblO108" + Tab(1).Control(16)= "lblOptNum" + Tab(1).Control(17)= "lblOEffDate" + Tab(1).Control(18)= "lblOptUsed" + Tab(1).Control(19)= "lblTOptID" + Tab(1).Control(20)= "lstOptions" + Tab(1).Control(20).Enabled= 0 'False + Tab(1).Control(21)= "txtODesc" + Tab(1).Control(22)= "txtOYdge" + Tab(1).Control(23)= "txtOFin2" + Tab(1).Control(24)= "txtOFAdj" + Tab(1).Control(25)= "cboOTexture" + Tab(1).Control(26)= "txtOMDesc" + Tab(1).Control(27)= "txtOMInvNo" + Tab(1).Control(28)= "txtOMQty" + Tab(1).Control(29)= "txtOMLength" + Tab(1).Control(30)= "cboOMDflag" + Tab(1).Control(31)= "cboOMType" + Tab(1).Control(32)= "cboOMMetal" + Tab(1).Control(33)= "cmdAddOpt" + Tab(1).Control(33).Enabled= 0 'False + Tab(1).Control(34)= "cmdDelOpt" + Tab(1).Control(34).Enabled= 0 'False + Tab(1).Control(35)= "cmdSaveOpt" + Tab(1).Control(36)= "cmdAddOptMat" + Tab(1).Control(36).Enabled= 0 'False + Tab(1).Control(37)= "cmdDelOptMat" + Tab(1).Control(37).Enabled= 0 'False + Tab(1).Control(38)= "cmdSaveOptMat" + Tab(1).Control(39)= "cmdInvList" + Tab(1).Control(39).Enabled= 0 'False + Tab(1).Control(40)= "cmdCopyOpt" + Tab(1).Control(40).Enabled= 0 'False + Tab(1).Control(41)= "cmdFindOptMat" + Tab(1).Control(42)= "txtBillAmt" + Tab(1).Control(43)= "txtNote" + Tab(1).Control(44)= "txtElev" + Tab(1).Control(45)= "chkOStone" + Tab(1).Control(46)= "txtOSt_SqFt" + Tab(1).Control(47)= "txtO68" + Tab(1).Control(48)= "txtO108" + Tab(1).Control(49)= "chkInv" + Tab(1).Control(50)= "lstInventory" + Tab(1).Control(50).Enabled= 0 'False + Tab(1).Control(51)= "lstOPTMatrl" + Tab(1).ControlCount= 52 + Begin LpLib.fpList lstOPTMatrl + Height = 1035 + Left = -74760 + TabIndex = 145 + Top = 3600 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1826 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPlans.frx":0038 + End + Begin LpLib.fpList lstInventory + Height = 1650 + Left = -74760 + TabIndex = 144 + Top = 600 + Visible = 0 'False + Width = 3195 + _Version = 196608 + _ExtentX = 5636 + _ExtentY = 2910 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPlans.frx":0444 + End + Begin LpLib.fpList lstMInventory + Height = 3435 + Left = 8310 + TabIndex = 143 + Top = 1185 + Visible = 0 'False + Width = 3105 + _Version = 196608 + _ExtentX = 5477 + _ExtentY = 6059 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPlans.frx":074E + End + Begin LpLib.fpList lstPMaterial + Height = 3975 + Left = 180 + TabIndex = 142 + Top = 480 + Width = 5535 + _Version = 196608 + _ExtentX = 9763 + _ExtentY = 7011 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPlans.frx":0A57 + End + Begin VB.CheckBox chkInv + Caption = "No Invoice" + Height = 315 + Left = -64740 + TabIndex = 128 + Top = 480 + Width = 1140 + End + Begin VB.TextBox txtO108 + Height = 315 + Left = -65460 + TabIndex = 127 + Top = 480 + Width = 705 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -67200 + TabIndex = 126 + Top = 480 + Width = 705 + End + Begin VB.TextBox txtOSt_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64710 + TabIndex = 38 + Top = 2310 + Width = 855 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 285 + Left = -65685 + TabIndex = 37 + Top = 1950 + Width = 1830 + End + Begin VB.TextBox txtElev + Height = 315 + Left = -65820 + MaxLength = 15 + TabIndex = 36 + Top = 1590 + Width = 1935 + End + Begin VB.TextBox txtNote + Height = 915 + Left = -74760 + TabIndex = 40 + Top = 2640 + Width = 5475 + End + Begin VB.TextBox txtBillAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -67200 + MaxLength = 6 + TabIndex = 34 + Top = 1065 + Visible = 0 'False + Width = 705 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = 9765 + Picture = "frmPlans.frx":0E62 + Style = 1 'Graphical + TabIndex = 67 + Top = 435 + Width = 495 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -65415 + Picture = "frmPlans.frx":12A4 + Style = 1 'Graphical + TabIndex = 50 + Top = 3060 + Width = 495 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -70080 + TabIndex = 89 + TabStop = 0 'False + Top = 1440 + Width = 1335 + End + Begin VB.CommandButton cmdInventory + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7035 + TabIndex = 86 + TabStop = 0 'False + Top = 4020 + Visible = 0 'False + Width = 1230 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7035 + TabIndex = 85 + TabStop = 0 'False + Top = 3480 + Width = 1230 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5760 + TabIndex = 75 + Top = 4020 + Width = 1230 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5760 + TabIndex = 84 + TabStop = 0 'False + Top = 3480 + Width = 1230 + End + Begin VB.CommandButton cmdInvList + Caption = "Inventory List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67320 + TabIndex = 83 + TabStop = 0 'False + Top = 2040 + Visible = 0 'False + Width = 1335 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68700 + TabIndex = 57 + Top = 2040 + Width = 1335 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67320 + TabIndex = 82 + TabStop = 0 'False + Top = 1440 + Width = 1335 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -68700 + TabIndex = 81 + TabStop = 0 'False + Top = 1440 + Width = 1335 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -71460 + TabIndex = 39 + Top = 2025 + Width = 1335 + End + Begin VB.CommandButton cmdDelOpt + Caption = "Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -70080 + TabIndex = 80 + TabStop = 0 'False + Top = 2025 + Width = 1335 + End + Begin VB.CommandButton cmdAddOpt + Caption = "Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -71460 + TabIndex = 79 + TabStop = 0 'False + Top = 1440 + Width = 1335 + End + Begin VB.ComboBox cboPMMetal + Height = 315 + ItemData = "frmPlans.frx":16E6 + Left = 7080 + List = "frmPlans.frx":16F0 + Style = 2 'Dropdown List + TabIndex = 73 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboPMType + Height = 315 + ItemData = "frmPlans.frx":1701 + Left = 7080 + List = "frmPlans.frx":1703 + Style = 2 'Dropdown List + TabIndex = 72 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboPMDFlag + Height = 315 + ItemData = "frmPlans.frx":1705 + Left = 7080 + List = "frmPlans.frx":170F + Style = 2 'Dropdown List + TabIndex = 71 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtPMLength + Alignment = 1 'Right Justify + Height = 315 + Left = 7080 + MaxLength = 2 + TabIndex = 74 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtPMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 7080 + MaxLength = 6 + TabIndex = 70 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtPMQty + Alignment = 1 'Right Justify + Height = 315 + Left = 7080 + MaxLength = 4 + TabIndex = 69 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtPMDesc + Height = 315 + Left = 7080 + MaxLength = 50 + TabIndex = 68 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtPMInvNo + Height = 315 + Left = 7080 + MaxLength = 18 + TabIndex = 66 + Top = 480 + Width = 2625 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmPlans.frx":1723 + Left = -64875 + List = "frmPlans.frx":172D + Style = 2 'Dropdown List + TabIndex = 55 + Top = 4020 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmPlans.frx":173E + Left = -64875 + List = "frmPlans.frx":1740 + Style = 2 'Dropdown List + TabIndex = 54 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDflag + Height = 315 + ItemData = "frmPlans.frx":1742 + Left = -68100 + List = "frmPlans.frx":174C + Style = 2 'Dropdown List + TabIndex = 53 + Top = 4020 + Width = 1155 + End + Begin VB.TextBox txtOMLength + Height = 315 + Left = -64875 + MaxLength = 2 + TabIndex = 56 + Top = 4365 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 52 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMInvNo + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 49 + Top = 3120 + Width = 2625 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 51 + Top = 2700 + Width = 4275 + End + Begin VB.ComboBox cboOTexture + Height = 315 + ItemData = "frmPlans.frx":1760 + Left = -70320 + List = "frmPlans.frx":1762 + Style = 2 'Dropdown List + TabIndex = 35 + Top = 990 + Width = 2235 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64740 + MaxLength = 4 + TabIndex = 33 + Top = 1065 + Width = 705 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -64740 + MaxLength = 4 + TabIndex = 32 + Top = 780 + Width = 705 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -67200 + MaxLength = 4 + TabIndex = 31 + Top = 795 + Width = 705 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71475 + MaxLength = 40 + TabIndex = 30 + Top = 615 + Width = 3375 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 26 + TabStop = 0 'False + Top = 600 + Width = 3195 + End + Begin VB.Label lblTOptID + DataMember = "lblTOptID" + Height = 210 + Left = -74760 + TabIndex = 134 + Top = 390 + Width = 3120 + End + Begin VB.Label lblOptUsed + Caption = "OPTION USED" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 210 + Left = -69120 + TabIndex = 133 + Top = 105 + Visible = 0 'False + Width = 1500 + End + Begin VB.Label lblOEffDate + Alignment = 1 'Right Justify + Height = 240 + Left = -69525 + TabIndex = 132 + Top = 360 + Width = 1410 + End + Begin VB.Label lblOptNum + Height = 240 + Left = -71460 + TabIndex = 131 + Top = 360 + Width = 1890 + End + Begin VB.Label lblO108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"" Frames" + Height = 195 + Left = -66420 + TabIndex = 125 + Top = 540 + Width = 930 + End + Begin VB.Label lblO68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"" Frames" + Height = 195 + Left = -68040 + TabIndex = 124 + Top = 540 + Width = 840 + End + Begin VB.Label lblOSt_SqFt + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option SqFt:" + Height = 435 + Left = -65880 + TabIndex = 108 + Top = 2235 + Width = 1170 + End + Begin VB.Label lblElev + AutoSize = -1 'True + Caption = "Elevation File Name:" + Height = 195 + Left = -65760 + TabIndex = 106 + Top = 1380 + Width = 1455 + End + Begin VB.Label lblBill + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billing Amt:" + Height = 195 + Left = -68040 + TabIndex = 94 + Top = 1125 + Visible = 0 'False + Width = 765 + End + Begin VB.Label lblPMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = 6000 + TabIndex = 65 + Top = 3060 + Width = 975 + End + Begin VB.Label lblPMMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal:" + Height = 195 + Left = 6540 + TabIndex = 64 + Top = 2700 + Width = 435 + End + Begin VB.Label lblPMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Materials Type:" + Height = 195 + Left = 5895 + TabIndex = 63 + Top = 2340 + Width = 1080 + End + Begin VB.Label lblPMDFLag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = 6015 + TabIndex = 62 + Top = 1980 + Width = 960 + End + Begin VB.Label lblPMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = 6570 + TabIndex = 61 + Top = 1620 + Width = 405 + End + Begin VB.Label lblPMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = 6345 + TabIndex = 60 + Top = 1260 + Width = 630 + End + Begin VB.Label lblPMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 6135 + TabIndex = 59 + Top = 900 + Width = 840 + End + Begin VB.Label lblPMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = 6015 + TabIndex = 58 + Top = 540 + Width = 960 + End + Begin VB.Label lblOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -65910 + TabIndex = 48 + Top = 4395 + Width = 975 + End + Begin VB.Label lblOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -65715 + TabIndex = 47 + Top = 4050 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -65940 + TabIndex = 46 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDflag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69120 + TabIndex = 45 + Top = 4080 + Width = 960 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68790 + TabIndex = 44 + Top = 3640 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69000 + TabIndex = 43 + Top = 2760 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69120 + TabIndex = 42 + Top = 3200 + Width = 960 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71445 + TabIndex = 41 + Top = 1065 + Width = 1095 + End + Begin VB.Label lblOptFAdjYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Yardage:" + Height = 195 + Left = -66210 + TabIndex = 29 + Top = 1125 + Width = 1395 + End + Begin VB.Label lblOptFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = -66060 + TabIndex = 28 + Top = 855 + Width = 1230 + End + Begin VB.Label lblOptYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67935 + TabIndex = 27 + Top = 855 + Width = 645 + End + End + Begin VB.TextBox txtPNotes + Height = 855 + Left = 2175 + MultiLine = -1 'True + TabIndex = 22 + Top = 2265 + Width = 4875 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 8340 + MaxLength = 4 + TabIndex = 15 + Top = 600 + Width = 855 + End + Begin VB.ComboBox cboTexture + Height = 315 + ItemData = "frmPlans.frx":1764 + Left = 9915 + List = "frmPlans.frx":1766 + Style = 2 'Dropdown List + TabIndex = 21 + Top = 645 + Width = 1935 + End + Begin VB.TextBox txt12Foam + Alignment = 1 'Right Justify + Height = 315 + Left = 8340 + MaxLength = 4 + TabIndex = 14 + Top = 300 + Width = 855 + End + Begin VB.TextBox txtCMUYdge + Alignment = 1 'Right Justify + Height = 315 + Left = 5520 + MaxLength = 4 + TabIndex = 12 + Top = 660 + Width = 855 + End + Begin VB.TextBox txtMatYdge + Alignment = 1 'Right Justify + Height = 315 + Left = 5520 + MaxLength = 6 + TabIndex = 11 + Top = 300 + Width = 855 + End + Begin VB.ListBox lstMod_Elv + Height = 1620 + Left = 600 + Sorted = -1 'True + TabIndex = 2 + TabStop = 0 'False + Top = 1395 + Width = 1395 + End + Begin VB.Label lblP_RL + AutoSize = -1 'True + Caption = "RL OK" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 2325 + TabIndex = 140 + Top = 225 + Visible = 0 'False + Width = 570 + End + Begin VB.Label lblEstID + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = " " + Height = 195 + Left = 180 + TabIndex = 139 + Top = 225 + Width = 525 + End + Begin VB.Label lblPaint + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint SqFt:" + Height = 195 + Left = 4650 + TabIndex = 135 + Top = 1050 + Width = 780 + End + Begin VB.Label txtEffDate + BorderStyle = 1 'Fixed Single + Caption = "12/31/2005" + Height = 255 + Left = 10800 + TabIndex = 130 + Top = 960 + Width = 975 + End + Begin VB.Label lblEffDate + Alignment = 1 'Right Justify + Caption = "Effective Date:" + Height = 195 + Left = 9420 + TabIndex = 129 + Top = 1020 + Width = 1335 + End + Begin VB.Label lbl108 + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = 3300 + TabIndex = 123 + Top = 1800 + Width = 375 + End + Begin VB.Label lbl68 + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = 2220 + TabIndex = 122 + Top = 1800 + Width = 285 + End + Begin VB.Label lblScaffold + AutoSize = -1 'True + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2280 + TabIndex = 121 + Top = 1440 + Width = 2460 + End + Begin VB.Label txtImport + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3900 + TabIndex = 118 + Top = 3375 + Width = 3225 + End + Begin VB.Label lblImport + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Import:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3285 + TabIndex = 117 + Top = 3375 + Width = 600 + End + Begin VB.Label txtUpdate + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3900 + TabIndex = 115 + Top = 3165 + Width = 1725 + End + Begin VB.Label lblUpdate + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3060 + TabIndex = 114 + Top = 3165 + Width = 825 + End + Begin VB.Label txtLSave + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1125 + TabIndex = 113 + Top = 3375 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 135 + TabIndex = 112 + Top = 3375 + Width = 930 + End + Begin VB.Label txtCreate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1125 + TabIndex = 111 + Top = 3150 + Width = 1725 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Create:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 435 + TabIndex = 110 + Top = 3165 + Width = 630 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Yardage:" + Height = 195 + Left = 6930 + TabIndex = 109 + Top = 45 + Width = 1335 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone Veneer Sq Ft:" + Height = 195 + Left = 4005 + TabIndex = 105 + Top = 75 + Width = 1440 + End + Begin VB.Label lblOld + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "OLD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 75 + TabIndex = 104 + Top = 915 + Visible = 0 'False + Width = 450 + End + Begin VB.Label lblNew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "NEW:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1500 + TabIndex = 101 + Top = 915 + Visible = 0 'False + Width = 510 + End + Begin VB.Label lblSQL + Caption = $"frmPlans.frx":1768 + Height = 615 + Left = 2205 + TabIndex = 99 + Top = 1455 + Visible = 0 'False + Width = 4695 + End + Begin VB.Label lblTake + Alignment = 2 'Center + Caption = "Double Click the Desired Elevation" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 10110 + TabIndex = 93 + Top = 1485 + Visible = 0 'False + Width = 1695 + End + Begin VB.Label lblNewModel + AutoSize = -1 'True + Caption = "New Model/Elevation:" + Height = 195 + Left = 2175 + TabIndex = 90 + Top = 885 + Visible = 0 'False + Width = 1590 + End + Begin VB.Label lblPLAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Yardage:" + Height = 195 + Left = 9285 + TabIndex = 77 + Top = 360 + Width = 1410 + End + Begin VB.Label lblPFAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Yardage:" + Height = 195 + Left = 9300 + TabIndex = 76 + Top = 60 + Width = 1395 + End + Begin VB.Label lblPNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2280 + TabIndex = 24 + Top = 2040 + Width = 690 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 7035 + TabIndex = 7 + Top = 660 + Width = 1230 + End + Begin VB.Label lbl12Foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2X8 Foam Percentage:" + Height = 195 + Left = 6630 + TabIndex = 6 + Top = 360 + Width = 1635 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 9300 + TabIndex = 5 + Top = 720 + Width = 585 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 4380 + TabIndex = 4 + Top = 720 + Width = 1050 + End + Begin VB.Label lblMatYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yardage:" + Height = 195 + Left = 4185 + TabIndex = 3 + Top = 360 + Width = 1245 + End + Begin VB.Label lblModel_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 195 + TabIndex = 1 + Top = 1140 + Width = 1770 + End + Begin VB.Label lblProj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Subdivision:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 585 + Width = 855 + End +End +Attribute VB_Name = "frmPlans" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRS As Recordset +Dim moRSMat As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSPB As Recordset +Dim moRSPOB As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mstrType As String, mstrMODEL As String, strTYPE As String +Dim mintESTID As Long, mintPROJID As Long +Dim mintOPTID As Long, mintLOTID As Long +Dim mstrSQL As String, mstrProj As String, mstrEffDate As String +Dim mstrOriginal As String, mstrINVNO As String +Dim mboolOPTUSED As Boolean + +Const conCOL_NAME As Integer = 0 +Const conCOL_WAIT As Integer = 1 +Const conCOL_TYPE As Integer = 2 +Const conCOL_ID As Integer = 3 +Const conGable As Long = 4 + +Private Sub OpenBilling() +Dim strSQL As String, strSql2 As String + + strSQL = "SELECT * FROM tblplanbill WHERE est_id = 1" + Set moRSPB = New Recordset + moRSPB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSql2 = "SELECT * FROM tblPOptBill WHERE OptID = 1" + Set moRSPOB = New Recordset + moRSPOB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + +End Sub + +Private Sub cboOTexture_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOTexture.ListIndex = -1 + End If + +End Sub + +Private Sub cboTexture_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboTexture.ListIndex = -1 + End If + +End Sub + +Private Sub chkUpdate_Click() + cmdSavePlan.Enabled = True +End Sub + +Private Sub cmdCopyAll_Click() +Dim intCOPY As Integer +Dim strEffDate As String, intYN As Integer, intYN2 As Integer +Dim oRS As Recordset, strSQL As String + + intCOPY = MsgBox("Are You Sure You Want To Copy All Takeoffs?", vbQuestion + vbYesNo, "COPY TAKEOFF") + If intCOPY = vbNo Then + Exit Sub + End If + + strEffDate = FindMax2("tblProjDate", "startdate", "Proj_ID", gintPROJID) + mstrEffDate = InputBox("Enter the Effective Date for These Plans", "Effective Date", strEffDate) + + If IsDate(mstrEffDate) Then + + Else + If Len(mstrEffDate) > 0 Then + mstrEffDate = Format(mstrEffDate, "00/00/####") + If Not IsDate(mstrEffDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + + If Not mstrEffDate = strEffDate Then + intYN = MsgBox("Your Plan Price Effective Date is not the same as the most current date - Is This What You Want?", vbYesNo, "Check Effective Date") + If intYN = vbNo Then + strSQL = "Select * FROM tblPROJDATE WHERE Proj_id = " & gintPROJID & " and StartDate = #" & mstrEffDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + On Error Resume Next + If oRS.EOF Then + MsgBox "The Effective Date You Entered is InValid - Exit & Correct", vbOKOnly, "Invalid Effective Date" + Exit Sub + End If + Else + Call AddDate + End If + End If + mboolCopy = True + Call CopyAllTake + Call ListLoad + Call MatLoad + Call OptLoad + Call OptMatLoad +End Sub + +Private Sub cmdCopyTakeoff_Click() +Dim strEffDate As String, intYN As Integer, intYN2 As Integer +Dim oRS As Recordset, strSQL As String + +' Call SelectTake + strEffDate = FindMax2("tblProjDate", "startdate", "Proj_ID", gintPROJID) + mstrEffDate = InputBox("Enter the Effective Date for This Imported Plan", "Effective Date", strEffDate) + + If IsDate(mstrEffDate) Then + + Else + If Len(mstrEffDate) > 0 Then + mstrEffDate = Format(mstrEffDate, "00/00/####") + If Not IsDate(mstrEffDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter", vbCritical + vbOKOnly, "InValid Date" + Exit Sub + End If + End If + End If + + + If Not mstrEffDate = strEffDate Then + intYN = MsgBox("Your Plan Price Effective Date is not the same as the most current date - Is This What You Want?", vbYesNo, "Check Effective Date") + If intYN = vbNo Then + strSQL = "Select * FROM tblPROJDATE WHERE Proj_id = " & gintPROJID & " and StartDate = #" & mstrEffDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + On Error Resume Next + If oRS.EOF Then + MsgBox "The Effective Date You Entered is InValid - Exit & Correct", vbOKOnly, "Invalid Effective Date" + Exit Sub + End If + Else + Call AddDate + End If + End If + + Call SelectTake + If mboolCopy Then + Call CopyTake + mintBOOKMARK = lstMod_Elv.ListIndex + Call ListLoad + lstMod_Elv.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Call MatLoad + Call OptLoad + Call OptMatLoad + End If +End Sub + +Private Sub PlanMatLoad() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String +Dim strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 1" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockPessimistic + + Do Until oRS.EOF + oRSS.AddNew + oRSS!Lot_ID = gintLOTID + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS!qty = Field2Str(oRS!qty) + oRSS!price = Field2Str(oRS!price) + oRSS.Update + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + If Err = "-2147467259" Then + Resume Next + Else + Call ErrorHandler(oRSS.ActiveConnection) + Exit Sub + End If + +End Sub + +Private Sub CopyTake() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim dblMatCost As Double, strPLANELV As String + + On Error GoTo Error_EH + + mstrINVNO = "" + + strSQL = "SELECT * FROM tblTake where proj_id = " & gintPROJID & " and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSELECT = "SELECT * FROM tblPlans where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.RecordCount <> 0 Then + + intResponse = MsgBox("This is a duplicate Plan, Do You Want To Update It?", vbYesNo, "Duplicate Plan") + If intResponse = vbNo Then + mboolCopy = False + Exit Sub + Else + mboolUPDATE = True + If oRS.RecordCount > 0 Then + With oRS +'' If oRSS!mat_yds > 350 Then + ' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' Else +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' End If + If oRSS!mat_yds > 350 Then +' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 + oRSS!mat_yds = Field2Integer(!lath_yds) + Else + oRSS!mat_yds = Field2Integer(!lath_yds) + End If + + If Field2Integer(!CMUYDS) > 0 Then + oRSS!CMUYDS = Int((!CMUYDS / 9) + 0.99) + Else + oRSS!CMUYDS = 0 + End If + oRSS!openflg = !openflg + oRSS!P_RL = !P_RL + oRSS!texture = Field2Str(!finish) + oRSS!fin2 = Field2Integer(!fin2) + oRSS!foam = 25 + oRSS!f_adj = Field2Integer(!f_adj) + oRSS!l_adj = Field2Integer(!l_adj) + oRSS!st_adj = Field2Integer(!st_adj) + oRSS!w_adj = Field2Integer(!w_adj) + oRSS!opening = Int(((Field2Integer(!opening) * Field2Integer(!openpr)) / 100) + 0.99) + oRSS!openpr = Field2Integer(!openpr) + oRSS!notes = Field2Str(!notes) + oRSS!stone = !stone + oRSS!ST_SQFT = Field2Integer(!ST_SQFT) + oRSS!s_lab = Field2Str2(!pl) + oRSS!l_lab = Round((Field2Double(!ll) + Field2Double(!mlab)), 2) + oRSS!scaf = Field2Str2(!SL_TG) + oRSS!CMU = Field2Str2(!cmulab) + oRSS!burden = Field2Str2(!BRDN) + oRSS!MISC = Field2Str2(!MISC) + oRSS!mu = Field2Str2(!mu) + oRSS!ohead = Field2Str2(!OHPR) + dblMatCost = Field2Str2(!sand) * Field2Str2(!SAND_TONS) + dblMatCost = dblMatCost + Field2Double(!MATCOST) + Field2Double(!MATMUPR) + Field2Double(!TPE) + oRSS!MATCOST = dblMatCost + oRSS!ttlcost = Field2Str2(!BIDC) + oRSS!bidprice = Field2Str2(!bidp) + oRSS!LUUser = gstrLOGIN + oRSS!Update = Date + oRSS!toid = !toid + oRSS!TO_TTLYDS = Field2Str2(!TTL_Yds) + oRSS.Update + oRSS!import = Date + oRSS!imuser = gstrLOGIN + oRSS!Source = "TAKEOFF" + oRSS!TWOSTORY = !TWOSTORY + oRSS!Scaf6 = Field2Str2(!Scaf6) + oRSS!scaf10 = Field2Str2(!scaf10) + End With + End If + oRS.Close + End If + Else + If oRS.RecordCount > 0 Then + With oRS + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + oRSS!Mod_Elv = Field2Str(!pln_elv) + strPLANELV = Field2Str(!pln_elv) + If oRSS!mat_yds > 350 Then +' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 + oRSS!mat_yds = Field2Integer(!lath_yds) + Else + oRSS!mat_yds = Field2Integer(!lath_yds) + End If + + If Field2Integer(!CMUYDS) > 0 Then + oRSS!CMUYDS = Int((!CMUYDS / 9) + 0.99) + Else + oRSS!CMUYDS = 0 + End If + + oRSS!openflg = !openflg + oRSS!P_RL = !P_RL + oRSS!texture = Field2Str(!finish) + oRSS!fin2 = Field2Integer(!fin2) + oRSS!foam = 25 + oRSS!f_adj = Field2Integer(!f_adj) + oRSS!l_adj = Field2Integer(!l_adj) + oRSS!w_adj = Field2Integer(!w_adj) + oRSS!st_adj = Field2Integer(!st_adj) + oRSS!opening = Int(((Field2Integer(!opening) * Field2Integer(!openpr)) / 100) + 0.99) + oRSS!openpr = Field2Integer(!openpr) + oRSS!notes = Field2Str(!notes) + oRSS!stone = !stone + oRSS!ST_SQFT = Field2Integer(!ST_SQFT) + oRSS!s_lab = Field2Str2(!pl) + oRSS!l_lab = Round((Field2Double(!ll) + Field2Double(!mlab)), 2) + oRSS!scaf = Field2Str2(!SL_TG) + oRSS!CMU = Field2Str2(!cmulab) + oRSS!burden = Field2Str2(!BRDN) + oRSS!MISC = Field2Str2(!MISC) + oRSS!mu = Field2Str2(!mu) + oRSS!ohead = Field2Str2(!OHPR) + dblMatCost = Field2Str2(!sand) * Field2Str2(!SAND_TONS) + dblMatCost = dblMatCost + Field2Double(!MATCOST) + Field2Double(!MATMUPR) + Field2Double(!TPE) + oRSS!MATCOST = dblMatCost + oRSS!ttlcost = Field2Str2(!BIDC) + oRSS!bidprice = Field2Str2(!bidp) + oRSS!createuser = gstrLOGIN + oRSS!toid = Field2Str2(!toid) + oRSS!TO_TTLYDS = Field2Str2(!TTL_Yds) + oRSS.Update + oRSS!import = Date + oRSS!imuser = gstrLOGIN + oRSS!Source = "TAKEOFF" + oRSS!TWOSTORY = !TWOSTORY + oRSS!Scaf6 = Field2Str2(!Scaf6) + oRSS!scaf10 = Field2Str2(!scaf10) + End With + End If + oRS.Close + End If +' oRSS.Close + + If mboolUPDATE Then + mintESTID = gintESTID + strSELECT = "DELETE * FROM tblPlanMat WHERE est_id = " & mintESTID + goConn.Execute strSELECT + Else + strSQL = "SELECT Max(Est_id) as MAXestid from tblPlans" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintESTID = oRSMAX!maxestid + oRSMAX.Close + + If Not IsDate(mstrEffDate) Then + mstrEffDate = txtEffDate + End If + moRSPB.AddNew + moRSPB!est_id = mintESTID + moRSPB!PROJ_ID = gintPROJID + moRSPB!Mod_Elv = strPLANELV + moRSPB!effdate = mstrEffDate + moRSPB!Create = Date + moRSPB!Wrap = moRSProj!Wrap + moRSPB!WPctg = moRSProj!WPctg + moRSPB.Update + End If + + strSQL = "SELECT * FROM tblTomatrl where NOT TrnsFlag and TOID = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strSELECT = "SELECT * FROM tblPlanMat WHERE est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + If oRS!inv_no = "5220" Then + End If + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + If moRSProj!FHA And Field2Str2(oRS!inv_no) = "1130" Then + oRSS!inv_no = "1570" + oRSS!Desc = "1 3/8X3 FHA JMB" +' ElseIf oRS!inv = 1570 Then +' + Else + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + mstrINVNO = "RSS - " & Field2Str(oRS!inv_no) + End If + If oRS!inv_no < 1000 Then + oRSS!price = oRS!price + End If + oRSS!qty = Field2Str2(oRS!qty) + oRSS!est_id = mintESTID + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS.Update + oRS.MoveNext + Loop + oRSS.Close + Else + MsgBox "No Materials were found to transfer for this Plan" + End If + + oRS.Close + + strSQL = "SELECT * from tblOption WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolUPDATE Then + strOpt = "SELECT * FROM tblPOption where est_id = " & mintESTID + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRSS.EOF + strSELECT = "DELETE * FROM tblPOMatrl WHERE optid = " & Field2Long(oRSS!OPTID) + goConn.Execute strSELECT + oRSS.MoveNext + Loop + Do Until oRS.EOF + strOpt = "SELECT * FROM tblPOption where t_optid = " & Field2Long(oRS!OPTID) + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!Yardage = Field2Integer(oRS!yards) + oRSS!f_adj = Field2Integer(oRS!f_adj) + oRSS!texture = Field2Str(oRS!texture) + oRSS!fin2 = Field2Integer(oRS!fin2) + oRSS!notes = Field2Str(oRS!notes) + oRSS!T_OptID = Field2Long(oRS!OPTID) '**** Set TO Option ID + oRSS!ostone = oRS!ostone + oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSS!invoice = oRS!invoice + oRSS!Scaf6 = Field2Str2(oRS!Scaf6) + oRSS!scaf10 = Field2Str2(oRS!scaf10) + oRSS.Update + dblOPTID = Field2Str2(oRS!OPTID) +' strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" +' Set oRSMAX = New Recordset + +' oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSS!OPTID) +' oRSMAX.Close + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + mstrINVNO = "RTT - " & Field2Str(oRT!inv_no) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + If oRT!inv_no < 1000 Then + oRTT!price = Field2Single(oRT!price) + End If + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRS.MoveNext + Else + strOpt = "SELECT * FROM tblPOption where est_id = 7" + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!Yardage = Field2Integer(oRS!yards) + oRSS!f_adj = Field2Integer(oRS!f_adj) + oRSS!texture = Field2Str(oRS!texture) + oRSS!fin2 = Field2Integer(oRS!fin2) + oRSS!notes = Field2Str(oRS!notes) + oRSS!T_OptID = Field2Long(oRS!OPTID) '**** Set TO Option ID + oRSS!ostone = oRS!ostone + oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSS!invoice = oRS!invoice + oRSS!Scaf6 = Field2Str2(oRS!Scaf6) + oRSS!scaf10 = Field2Str2(oRS!scaf10) + oRSS.Update + dblOPTID = Field2Str2(oRS!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSMAX!maxoptid) + oRSMAX.Close + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + mstrINVNO = "RTT - " & Field2Str(oRT!inv_no) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + If oRT!inv_no < 1000 Then + oRTT!price = Field2Single(oRT!price) + End If + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRS.MoveNext + End If + Loop + Else + If oRS.RecordCount > 0 Then + strSELECT = "SELECT * FROM tblPOption where est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!Yardage = Field2Integer(oRS!yards) + oRSS!f_adj = Field2Integer(oRS!f_adj) + oRSS!texture = Field2Str(oRS!texture) + oRSS!fin2 = Field2Integer(oRS!fin2) + oRSS!notes = Field2Str(oRS!notes) + oRSS!T_OptID = Field2Long(oRS!OPTID) '**** Set TO Option ID + oRSS!ostone = oRS!ostone + oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSS.Update + dblOPTID = Field2Str2(oRS!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSMAX!maxoptid) + oRSMAX.Close + + moRSPOB.AddNew + moRSPOB!est_id = mintESTID + moRSPOB!OPTID = mintOPTID + moRSPOB!created = Date + moRSPOB!C_USER = gstrLOGIN + moRSPOB!Desc = Field2Str(oRS!Desc) + moRSPOB!effdate = mstrEffDate + moRSPOB.Update + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + mstrINVNO = "RTT - " & Field2Str(oRT!inv_no) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + If oRT!inv_no < 1000 Then + oRTT!price = Field2Single(oRT!price) + End If + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRS.MoveNext + Loop + End If + End If + +' oRS.Close +' oRSS.Close + mboolCopy = False + mboolAdding = False + mboolUPDATE = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module CopyTake - InvNO = " & mstrINVNO + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyUpTake() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim oRX As Recordset, strPOPT As String +Dim oRTOP As Recordset, strTOPT As String +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim dblMatCost As Double + + On Error GoTo Error_EH + + If gintTOID = 0 Then + Exit Sub + Else + strSQL = "SELECT * FROM tblTake where proj_id = " & gintPROJID & " and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSELECT = "SELECT * FROM tblPlans where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + End If + + mboolCopy = False + mboolAdding = False + mboolUPDATE = True + If oRS.RecordCount > 0 Then + With oRS +'' If oRSS!mat_yds > 350 Then +''' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' Else +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' End If + If oRSS!mat_yds > 350 Then +'' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 + oRSS!mat_yds = Field2Integer(!lath_yds) + Else + oRSS!mat_yds = Field2Integer(!lath_yds) + End If + + If Field2Integer(!CMUYDS) > 0 Then + oRSS!CMUYDS = Int((!CMUYDS / 9) + 0.99) + Else + oRSS!CMUYDS = 0 + End If + oRSS!openflg = !openflg + oRSS!P_RL = !P_RL + oRSS!texture = Field2Str(!finish) + oRSS!fin2 = Field2Integer(!fin2) + oRSS!foam = 25 + oRSS!f_adj = Field2Integer(!f_adj) + oRSS!l_adj = Field2Integer(!l_adj) + oRSS!st_adj = Field2Integer(!st_adj) + oRSS!w_adj = Field2Integer(!w_adj) + oRSS!opening = Int(((Field2Integer(!opening) * Field2Integer(!openpr)) / 100) + 0.99) + oRSS!openpr = Field2Integer(!openpr) + oRSS!notes = Field2Str(!notes) + oRSS!stone = !stone + oRSS!ST_SQFT = Field2Integer(!ST_SQFT) + oRSS!s_lab = Field2Str2(!pl) + oRSS!l_lab = Round((Field2Double(!ll) + Field2Double(!mlab)), 2) + oRSS!scaf = Field2Str2(!SL_TG) + oRSS!CMU = Field2Str2(!cmulab) + oRSS!burden = Field2Str2(!BRDN) + oRSS!MISC = Field2Str2(!MISC) + oRSS!mu = Field2Str2(!mu) + oRSS!ohead = Field2Str2(!OHPR) + dblMatCost = Field2Str2(!sand) * Field2Str2(!SAND_TONS) + dblMatCost = dblMatCost + Field2Double(!MATCOST) + Field2Double(!MATMUPR) + Field2Double(!TPE) + oRSS!MATCOST = dblMatCost + oRSS!ttlcost = Field2Str2(!BIDC) + oRSS!bidprice = Field2Str2(!bidp) + oRSS!LUUser = gstrLOGIN + oRSS!Update = Date + oRSS!import = Date + oRSS!imuser = gstrLOGIN + oRSS!Source = "TAKEOFF" + oRSS!TWOSTORY = !TWOSTORY + oRSS!Scaf6 = Field2Str2(!Scaf6) + oRSS!scaf10 = Field2Str2(!scaf10) + oRSS!toid = Field2Str2(!toid) + oRSS!TO_TTLYDS = Field2Str2(!TTL_Yds) + oRSS.Update + End With + End If + oRS.Close + oRSS.Close + + If mboolUPDATE Then + mintESTID = Field2Long(lblEstID) +' mintESTID = gintESTID + strSELECT = "DELETE * FROM tblPlanMat WHERE est_id = " & mintESTID + goConn.Execute strSELECT + End If + + strSQL = "SELECT * FROM tblTomatrl where NOT TrnsFlag and TOID = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + strSELECT = "SELECT * FROM tblPlanMat WHERE est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + If oRS!inv_no = "5220" Then + End If + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + If moRSProj!FHA And Field2Str2(oRS!inv_no) = "1130" Then + oRSS!inv_no = "1570" + oRSS!Desc = "1 3/8X3 FHA JMB" +' ElseIf oRS!inv_no = 1570 Then +' + Else + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + End If + oRSS!qty = Field2Str2(oRS!qty) + oRSS!est_id = mintESTID + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS.Update + oRS.MoveNext + Loop + oRSS.Close + Else + MsgBox "No Materials were found to transfer for this Plan" + End If + + oRS.Close + + strTOPT = "SELECT * from tblOption WHERE toid = " & gintTOID + Set oRTOP = New Recordset + oRTOP.Open strTOPT, goConn, adOpenForwardOnly, adLockReadOnly + +' strSQL = "SELECT * from tblOption WHERE toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolUPDATE Then + + strOpt = "SELECT * FROM tblPOption where est_id = " & mintESTID + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + strSELECT = "DELETE * FROM tblPOMatrl WHERE optid = " & Field2Long(oRSS!OPTID) + goConn.Execute strSELECT + oRSS.MoveNext + Loop + oRSS.MoveFirst 'check this + + Do Until oRTOP.EOF + If Not oRSS.EOF Then + + If oRSS!T_OptID = 0 Then + strPOPT = "SELECT * FROM tblPOption where EST_ID = " & mintESTID & " AND DESC = '" & Field2Str(oRTOP!Desc) & "'" ' Field2Long(oRS!Desc)" + ' strPOPT = "SELECT * FROM tblPOption where DESC = '" & Field2Str(oRS!Desc) & "'" ' Field2Long(oRS!Desc)" + Else + strPOPT = "SELECT * FROM tblPOption where t_optid = " & Field2Long(oRTOP!OPTID) + End If + Set oRX = New Recordset + oRX.Open strPOPT, goConn, adOpenKeyset, adLockOptimistic + ' Set oRSS = New Recordset + ' oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + + If Not oRX.EOF Then + oRX!est_id = mintESTID + oRX!Desc = Field2Str(oRTOP!Desc) + oRX!Yardage = Field2Integer(oRTOP!yards) + oRX!f_adj = Field2Integer(oRTOP!f_adj) + oRX!texture = Field2Str(oRTOP!texture) + oRX!fin2 = Field2Integer(oRTOP!fin2) + oRX!notes = Field2Str(oRTOP!notes) + oRX!T_OptID = Field2Long(oRTOP!OPTID) + oRX!ostone = oRTOP!ostone + oRX!OSt_SqFt = Field2Str2(oRTOP!OSt_SqFt) + oRX!Scaf6 = Field2Str2(oRTOP!Scaf6) + oRX!scaf10 = Field2Str2(oRTOP!scaf10) + oRX!invoice = oRTOP!invoice + oRX.Update + dblOPTID = Field2Str2(oRTOP!OPTID) + mintOPTID = Field2Long(oRX!OPTID) + + ' If Not oRSS.EOF Then + ' oRSS!est_id = mintESTID + ' oRSS!Desc = Field2Str(oRS!Desc) + ' oRSS!Yardage = Field2Integer(oRS!yards) + ' oRSS!f_adj = Field2Integer(oRS!f_adj) + ' oRSS!texture = Field2Str(oRS!texture) + ' oRSS!fin2 = Field2Integer(oRS!fin2) + ' oRSS!notes = Field2Str(oRS!notes) + ' oRSS!T_OptID = Field2Long(oRS!OPTID) + ' oRSS!ostone = oRS!ostone + ' oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + ' oRSS!Scaf6 = Field2Str2(oRS!Scaf6) + ' oRSS!scaf10 = Field2Str2(oRS!scaf10) + ' oRSS!invoice = oRS!invoice + ' oRSS.Update + ' dblOPTID = Field2Str2(oRS!OPTID) + ' mintOPTID = Field2Long(oRSS!OPTID) + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRTOP.MoveNext + Else + strOpt = "SELECT * FROM tblPOption where est_id = 7" + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Inside Add Aoption" + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRTOP!Desc) + oRSS!Yardage = Field2Integer(oRTOP!yards) + oRSS!f_adj = Field2Integer(oRTOP!f_adj) + oRSS!texture = Field2Str(oRTOP!texture) + oRSS!fin2 = Field2Integer(oRTOP!fin2) + oRSS!notes = Field2Str(oRTOP!notes) + oRSS!T_OptID = Field2Long(oRTOP!OPTID) + oRSS!ostone = oRTOP!ostone + oRSS!OSt_SqFt = Field2Str2(oRTOP!OSt_SqFt) + oRSS!Scaf6 = Field2Str2(oRTOP!Scaf6) + oRSS!scaf10 = Field2Str2(oRTOP!scaf10) + oRSS!invoice = oRTOP!invoice + '***** orss!EffDate= + oRSS.Update + dblOPTID = Field2Str2(oRTOP!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSMAX!maxoptid) + oRSMAX.Close + '****** + ' strBILL = "SELECT * FROM tblPlanBill" + ' Set oRB = New Recordset + ' oRB.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + Call AddOptBill + ' If Not oRB.EOF Then + ' oRB.AddNew + ' oRB!est_id = mintESTID + ' oRB!proj_id = gintPROJID + ' oRB!mod_elv = strPLANELV + ' oRB!effdate = mstrEffDate + ' oRB!Create = Date + ' oRB.Update + ' oRB.Close + ' End If + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRTOP.MoveNext + End If 'SHOULD BE END + Else + strOpt = "SELECT * FROM tblPOption where est_id = 7" + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Inside Add Aoption" + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRTOP!Desc) + oRSS!Yardage = Field2Integer(oRTOP!yards) + oRSS!f_adj = Field2Integer(oRTOP!f_adj) + oRSS!texture = Field2Str(oRTOP!texture) + oRSS!fin2 = Field2Integer(oRTOP!fin2) + oRSS!notes = Field2Str(oRTOP!notes) + oRSS!T_OptID = Field2Long(oRTOP!OPTID) + oRSS!ostone = oRTOP!ostone + oRSS!OSt_SqFt = Field2Str2(oRTOP!OSt_SqFt) + oRSS!Scaf6 = Field2Str2(oRTOP!Scaf6) + oRSS!scaf10 = Field2Str2(oRTOP!scaf10) + oRSS!invoice = oRTOP!invoice +'***** orss!EffDate= + oRSS.Update + dblOPTID = Field2Str2(oRTOP!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSMAX!maxoptid) + oRSMAX.Close + '****** +' strBILL = "SELECT * FROM tblPlanBill" +' Set oRB = New Recordset +' oRB.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + Call AddOptBill +' If Not oRB.EOF Then +' oRB.AddNew +' oRB!est_id = mintESTID +' oRB!proj_id = gintPROJID +' oRB!mod_elv = strPLANELV +' oRB!effdate = mstrEffDate +' oRB!Create = Date +' oRB.Update +' oRB.Close +' End If + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRTOP.MoveNext + End If + oRSS.MoveNext + Loop + End If + + oRTOP.Close + mboolCopy = False + mboolAdding = False + mboolUPDATE = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module CopyUpTake" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyUpTakeOLD() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, intResponse As Integer +Dim oRX As Recordset, strPOPT As String +Dim strBILL As String, strPBILL As String, oRB As Recordset, oRPB As Recordset +Dim strOpt As String, strOPTMAT As String, dblOPTID As Double +Dim strSQL As String, strSELECT As String, strMAX As String +Dim dblMatCost As Double + +'***FIX On Error GoTo Error_EH + + If gintTOID = 0 Then + Exit Sub + Else + strSQL = "SELECT * FROM tblTake where proj_id = " & gintPROJID & " and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSELECT = "SELECT * FROM tblPlans where proj_id = " & gintPROJID & " and mod_elv = '" & mstrMODEL & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + End If + + mboolCopy = False + mboolAdding = False + mboolUPDATE = True + If oRS.RecordCount > 0 Then + With oRS +'' If oRSS!mat_yds > 350 Then +''' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' Else +'' oRSS!mat_yds = Field2Integer(!TTL_Yds) +'' End If + If oRSS!mat_yds > 350 Then +'' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 + oRSS!mat_yds = Field2Integer(!lath_yds) + Else + oRSS!mat_yds = Field2Integer(!lath_yds) + End If + + If Field2Integer(!CMUYDS) > 0 Then + oRSS!CMUYDS = Int((!CMUYDS / 9) + 0.99) + Else + oRSS!CMUYDS = 0 + End If + oRSS!openflg = !openflg + oRSS!P_RL = !P_RL + oRSS!texture = Field2Str(!finish) + oRSS!fin2 = Field2Integer(!fin2) + oRSS!foam = 25 + oRSS!f_adj = Field2Integer(!f_adj) + oRSS!l_adj = Field2Integer(!l_adj) + oRSS!st_adj = Field2Integer(!st_adj) + oRSS!w_adj = Field2Integer(!w_adj) + oRSS!opening = Int(((Field2Integer(!opening) * Field2Integer(!openpr)) / 100) + 0.99) + oRSS!openpr = Field2Integer(!openpr) + oRSS!notes = Field2Str(!notes) + oRSS!stone = !stone + oRSS!ST_SQFT = Field2Integer(!ST_SQFT) + oRSS!s_lab = Field2Str2(!pl) + oRSS!l_lab = Round((Field2Double(!ll) + Field2Double(!mlab)), 2) + oRSS!scaf = Field2Str2(!SL_TG) + oRSS!CMU = Field2Str2(!cmulab) + oRSS!burden = Field2Str2(!BRDN) + oRSS!MISC = Field2Str2(!MISC) + oRSS!mu = Field2Str2(!mu) + oRSS!ohead = Field2Str2(!OHPR) + dblMatCost = Field2Str2(!sand) * Field2Str2(!SAND_TONS) + dblMatCost = dblMatCost + Field2Double(!MATCOST) + Field2Double(!MATMUPR) + Field2Double(!TPE) + oRSS!MATCOST = dblMatCost + oRSS!ttlcost = Field2Str2(!BIDC) + oRSS!bidprice = Field2Str2(!bidp) + oRSS!LUUser = gstrLOGIN + oRSS!Update = Date + oRSS!import = Date + oRSS!imuser = gstrLOGIN + oRSS!Source = "TAKEOFF" + oRSS!TWOSTORY = !TWOSTORY + oRSS!Scaf6 = Field2Str2(!Scaf6) + oRSS!scaf10 = Field2Str2(!scaf10) + oRSS!toid = Field2Str2(!toid) + oRSS!TO_TTLYDS = Field2Str2(!TTL_Yds) + oRSS.Update + End With + End If + oRS.Close + oRSS.Close + + If mboolUPDATE Then + mintESTID = gintESTID + strSELECT = "DELETE * FROM tblPlanMat WHERE est_id = " & mintESTID + goConn.Execute strSELECT + End If + + strSQL = "SELECT * FROM tblTomatrl where NOT TrnsFlag and TOID = " & gintTOID + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + strSELECT = "SELECT * FROM tblPlanMat WHERE est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + If oRS!inv_no = "5220" Then + End If + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + If moRSProj!FHA And Field2Str2(oRS!inv_no) = "1130" Then + oRSS!inv_no = "1570" + oRSS!Desc = "1 3/8X3 FHA JMB" +' ElseIf oRS!inv_no = 1570 Then +' + Else + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + End If + oRSS!qty = Field2Str2(oRS!qty) + oRSS!est_id = mintESTID + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + oRSS.Update + oRS.MoveNext + Loop + oRSS.Close + Else + MsgBox "No Materials were found to transfer for this Plan" + End If + + oRS.Close + + strSQL = "SELECT * from tblOption WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolUPDATE Then + + strOpt = "SELECT * FROM tblPOption where est_id = " & mintESTID + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + strSELECT = "DELETE * FROM tblPOMatrl WHERE optid = " & Field2Long(oRSS!OPTID) + goConn.Execute strSELECT + oRSS.MoveNext + Loop + oRSS.MoveFirst + + Do Until oRS.EOF + If oRSS!T_OptID = 0 Then + strPOPT = "SELECT * FROM tblPOption where EST_ID = " & mintESTID & " AND DESC = '" & Field2Str(oRS!Desc) & "'" ' Field2Long(oRS!Desc)" +' strPOPT = "SELECT * FROM tblPOption where DESC = '" & Field2Str(oRS!Desc) & "'" ' Field2Long(oRS!Desc)" + Else + strPOPT = "SELECT * FROM tblPOption where t_optid = " & Field2Long(oRS!OPTID) + End If + Set oRX = New Recordset + oRX.Open strPOPT, goConn, adOpenKeyset, adLockOptimistic +' Set oRSS = New Recordset +' oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + + If Not oRX.EOF Then + oRX!est_id = mintESTID + oRX!Desc = Field2Str(oRS!Desc) + oRX!Yardage = Field2Integer(oRS!yards) + oRX!f_adj = Field2Integer(oRS!f_adj) + oRX!texture = Field2Str(oRS!texture) + oRX!fin2 = Field2Integer(oRS!fin2) + oRX!notes = Field2Str(oRS!notes) + oRX!T_OptID = Field2Long(oRS!OPTID) + oRX!ostone = oRS!ostone + oRX!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRX!Scaf6 = Field2Str2(oRS!Scaf6) + oRX!scaf10 = Field2Str2(oRS!scaf10) + oRX!invoice = oRS!invoice + oRX.Update + dblOPTID = Field2Str2(oRS!OPTID) + mintOPTID = Field2Long(oRX!OPTID) + +' If Not oRSS.EOF Then +' oRSS!est_id = mintESTID +' oRSS!Desc = Field2Str(oRS!Desc) +' oRSS!Yardage = Field2Integer(oRS!yards) +' oRSS!f_adj = Field2Integer(oRS!f_adj) +' oRSS!texture = Field2Str(oRS!texture) +' oRSS!fin2 = Field2Integer(oRS!fin2) +' oRSS!notes = Field2Str(oRS!notes) +' oRSS!T_OptID = Field2Long(oRS!OPTID) +' oRSS!ostone = oRS!ostone +' oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) +' oRSS!Scaf6 = Field2Str2(oRS!Scaf6) +' oRSS!scaf10 = Field2Str2(oRS!scaf10) +' oRSS!invoice = oRS!invoice +' oRSS.Update +' dblOPTID = Field2Str2(oRS!OPTID) +' mintOPTID = Field2Long(oRSS!OPTID) + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRS.MoveNext + Else + strOpt = "SELECT * FROM tblPOption where est_id = 7" + Set oRSS = New Recordset + oRSS.Open strOpt, goConn, adOpenKeyset, adLockOptimistic + gstrMODULE = "Inside Add Aoption" + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!Yardage = Field2Integer(oRS!yards) + oRSS!f_adj = Field2Integer(oRS!f_adj) + oRSS!texture = Field2Str(oRS!texture) + oRSS!fin2 = Field2Integer(oRS!fin2) + oRSS!notes = Field2Str(oRS!notes) + oRSS!T_OptID = Field2Long(oRS!OPTID) + oRSS!ostone = oRS!ostone + oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSS!Scaf6 = Field2Str2(oRS!Scaf6) + oRSS!scaf10 = Field2Str2(oRS!scaf10) + oRSS!invoice = oRS!invoice +'***** orss!EffDate= + oRSS.Update + dblOPTID = Field2Str2(oRS!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = Field2Long(oRSMAX!maxoptid) + oRSMAX.Close + '****** +' strBILL = "SELECT * FROM tblPlanBill" +' Set oRB = New Recordset +' oRB.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + Call AddOptBill +' If Not oRB.EOF Then +' oRB.AddNew +' oRB!est_id = mintESTID +' oRB!proj_id = gintPROJID +' oRB!mod_elv = strPLANELV +' oRB!effdate = mstrEffDate +' oRB!Create = Date +' oRB.Update +' oRB.Close +' End If + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!PROJ_ID = gintPROJID + oRTT!OPTID = mintOPTID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + End If + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + + oRS.MoveNext + End If + oRSS.MoveNext + Loop + End If + + mboolCopy = False + mboolAdding = False + mboolUPDATE = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module CopyUpTakeOLD" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyAllTake() +Dim oRS As Recordset, oRSS As Recordset, oRSMAX As Recordset +Dim oRT As Recordset, oRTT As Recordset, oRSTAKE As Recordset +Dim oRX As Recordset, lngFIXOPTID As Long, strFIXOPTID As String +Dim strOpt As String, strOPTMAT As String, strTAKE As String +Dim strSQL As String, strSELECT As String, strMAX As String +Dim strMSG As String, dblOPTID As Double, dblMatCost As Double +Dim strMODELV As String + + On Error GoTo Error_EH '******COPY + + mstrINVNO = "" + Screen.MousePointer = vbHourglass + + strSQL = "SELECT * FROM tblTake where proj_id = " & gintPROJID ' & " and toid = " & gintTOID + Set oRSTAKE = New Recordset + oRSTAKE.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSTAKE.EOF + strMODELV = oRSTAKE!pln_elv + gintTOID = oRSTAKE!toid + + strSELECT = "SELECT * FROM tblPlans where proj_id = " & gintPROJID & " and mod_elv = '" & oRSTAKE!pln_elv & "'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + If oRSS.RecordCount <> 0 Then + strMSG = Field2Str(oRSTAKE!pln_elv) & " has already been copied and will be skipped" + MsgBox strMSG + GoTo Cont_Copy '************** Cont_Copy + Else + If oRSTAKE.RecordCount > 0 Then + With oRSTAKE + dblMatCost = 0 + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + oRSS!Mod_Elv = Field2Str(!pln_elv) +' If oRSS!mat_yds > 350 Then + ' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 +' oRSS!mat_yds = Field2Integer(!TTL_Yds) +' Else +' oRSS!mat_yds = Field2Integer(!TTL_Yds) +' End If + + If oRSS!mat_yds > 350 Then +'' oRSS!mat_yds = Field2Integer(!lath_yds) - 10 + oRSS!mat_yds = Field2Integer(!lath_yds) + Else + oRSS!mat_yds = Field2Integer(!lath_yds) + End If + + If Field2Integer(!CMUYDS) > 0 Then + oRSS!CMUYDS = Int((!CMUYDS / 9) + 0.99) + Else + oRSS!CMUYDS = 0 + End If + oRSS!openflg = !openflg + oRSS!P_RL = !P_RL + oRSS!texture = Field2Str(!finish) + oRSS!fin2 = Field2Integer(!fin2) + oRSS!foam = 25 + oRSS!f_adj = Field2Integer(!f_adj) + oRSS!l_adj = Field2Integer(!l_adj) + oRSS!st_adj = Field2Integer(!st_adj) + oRSS!w_adj = Field2Integer(!w_adj) + oRSS!opening = Int(((Field2Integer(!opening) * Field2Integer(!openpr)) / 100) + 0.99) + oRSS!openpr = Field2Integer(!openpr) + oRSS!notes = Field2Str(!notes) + oRSS!stone = !stone + oRSS!ST_SQFT = Field2Integer(!ST_SQFT) + oRSS!s_lab = Field2Str2(!pl) + oRSS!l_lab = Round((Field2Double(!ll) + Field2Double(!mlab)), 2) + oRSS!scaf = Field2Str2(!SL_TG) + oRSS!CMU = Field2Str2(!cmulab) + oRSS!burden = Field2Str2(!BRDN) + oRSS!MISC = Field2Str2(!MISC) + oRSS!mu = Field2Str2(!mu) + oRSS!ohead = Field2Str2(!OHPR) + dblMatCost = Field2Str2(!sand) * Field2Str2(!SAND_TONS) + dblMatCost = dblMatCost + Field2Double(!MATCOST) + Field2Double(!MATMUPR) + Field2Double(!TPE) + oRSS!MATCOST = dblMatCost + oRSS!ttlcost = Field2Str2(!BIDC) + oRSS!bidprice = Field2Str2(!bidp) + oRSS!createuser = gstrLOGIN + oRSS!import = Date + oRSS!imuser = gstrLOGIN + oRSS!Source = "TAKEOFF" + oRSS!TWOSTORY = !TWOSTORY + oRSS!Scaf6 = Field2Str2(!Scaf6) + oRSS!scaf10 = Field2Str2(!scaf10) + oRSS!effdate = mstrEffDate + oRSS!toid = Field2Str2(!toid) + oRSS!TO_TTLYDS = Field2Str2(!TTL_Yds) + oRSS.Update + End With + End If + + End If + oRSS.Close + + strSQL = "SELECT Max(Est_id) as MAXestid from tblPlans" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintESTID = oRSMAX!maxestid + oRSMAX.Close + moRSPB.AddNew + moRSPB!est_id = mintESTID + moRSPB!PROJ_ID = gintPROJID + moRSPB!Mod_Elv = oRSTAKE!pln_elv + moRSPB!Create = Date + moRSPB!effdate = mstrEffDate + moRSPB!Wrap = moRSProj!Wrap + moRSPB!WPctg = moRSProj!WPctg + moRSPB.Update + + strSQL = "SELECT * FROM tblTomatrl where NOT TrnsFlag and TOID = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strSELECT = "SELECT * FROM tblPlanMat WHERE est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + If oRS!inv_no = "5220" Then + End If + oRSS.AddNew + oRSS!PROJ_ID = gintPROJID + If moRSProj!FHA And Field2Str2(oRS!inv_no) = "1130" Then + oRSS!inv_no = "1570" + oRSS!Desc = "1 3/8X3 FHA JMB" + Else + oRSS!inv_no = Field2Str(oRS!inv_no) + oRSS!Desc = Field2Str(oRS!Desc) + mstrINVNO = "RSS - " & Field2Str(oRS!inv_no) + End If +' oRSS!Desc = Field2Str(oRS!Desc) +' oRSS!inv_no = Field2Integer(oRS!inv_no) + oRSS!qty = Field2Str(oRS!qty) + oRSS!est_id = mintESTID + oRSS!d_flag = Field2Str(oRS!d_flag) + oRSS!m_type = Field2Str(oRS!m_type) + oRSS!calc_flag = Field2Str(oRS!calc_flag) + oRSS!calc_amt = Field2Integer(oRS!calc_amt) + If oRS!inv_no < 1000 Then + oRSS!price = Field2Single(oRS!price) + End If + oRSS.Update + oRS.MoveNext + Loop + oRSS.Close + Else + MsgBox "No Materials were found to transfer for this Plan" + End If + oRS.Close + + strSQL = "SELECT * from tblOption WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strSELECT = "SELECT * FROM tblPOption where est_id = 1" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRSS.AddNew + oRSS!est_id = mintESTID + oRSS!Desc = Field2Str(oRS!Desc) + oRSS!Yardage = Field2Integer(oRS!yards) + oRSS!f_adj = Field2Integer(oRS!f_adj) + oRSS!texture = Field2Str(oRS!texture) + oRSS!fin2 = Field2Integer(oRS!fin2) + oRSS!notes = Field2Str(oRS!notes) + oRSS!ostone = oRS!ostone + oRSS!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSS!invoice = oRS!invoice + oRSS!Scaf6 = Field2Str2(oRS!Scaf6) + oRSS!scaf10 = Field2Str2(oRS!scaf10) + oRSS!effdate = mstrEffDate + oRSS.Update + dblOPTID = Field2Str2(oRS!OPTID) + strMAX = "SELECT MAX(Optid) as MAXOptid FROM tblPOption" + Set oRSMAX = New Recordset + + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + strFIXOPTID = "SELECT * FROM tblPOption where OPTID = " & mintOPTID ' 1" + Set oRX = New Recordset + oRX.Open strFIXOPTID, goConn, adOpenKeyset, adLockOptimistic + oRX!T_OptID = Field2Long(oRS!OPTID) +' oRSS!T_OptID = mintOPTID '**** Set TO Option ID (T_OptID) + oRX.Update + oRX.Close + oRSMAX.Close + moRSPOB.AddNew + moRSPOB!est_id = mintESTID + moRSPOB!OPTID = mintOPTID +' moRSPOB!Create = Date + moRSPOB!C_USER = gstrLOGIN + moRSPOB!Desc = oRS!Desc + moRSPOB!effdate = mstrEffDate + moRSPOB.Update + + strOpt = "SELECT * FROM tblOptMatrl where optid = " & dblOPTID + Set oRT = New Recordset + oRT.Open strOpt, goConn, adOpenForwardOnly, adLockReadOnly + + If oRT.RecordCount > 0 Then + + strOPTMAT = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRTT = New Recordset + oRTT.Open strOPTMAT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRT.EOF + oRTT.AddNew + oRTT!OPTID = mintOPTID + oRTT!PROJ_ID = gintPROJID + If moRSProj!FHA And Field2Str2(oRT!inv_no) = "1130" Then + oRTT!inv_no = "1570" + oRTT!Desc = "1 3/8X3 FHA JMB" + Else + oRTT!inv_no = Field2Str(oRT!inv_no) + oRTT!Desc = Field2Str(oRT!Desc) + mstrINVNO = "RTT - " & Field2Str(oRT!inv_no) + End If +' oRTT!inv_no = Field2Integer(oRT!inv_no) +' oRTT!Desc = Field2Str(oRT!Desc) + oRTT!qty = Field2Str(oRT!qty) + oRTT!d_flag = Field2Str(oRT!d_flag) + oRTT!m_type = Field2Str(oRT!m_type) + oRTT!calc_flag = Field2Str(oRT!calc_flag) + oRTT!calc_amt = Field2Integer(oRT!calc_amt) + If oRT!inv_no < 1000 Then + oRTT!price = Field2Single(oRT!price) + End If + oRTT.Update + oRT.MoveNext + Loop + oRT.Close + oRTT.Close + End If + oRS.MoveNext + Loop + + End If +Cont_Copy: + oRSTAKE.MoveNext + Loop + +' oRS.Close +' oRSS.Close + mboolCopy = False + mboolAdding = False + Screen.MousePointer = vbDefault + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module CopyAllTake - InvNO = " & mstrINVNO & " - Plan " & strMODELV + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectTake() +Dim oRS As Recordset +Dim strSQL As String, strMODEL As String + On Error GoTo Error_EH + mboolCopy = True + + strMODEL = InputBox("Enter the Elevation to copy from Takeoff", "Copy from Takeoff") + mstrMODEL = strMODEL + If strMODEL <> "" Then + strSQL = "SELECT TOID from tblTake WHERE Pln_elv = '" & strMODEL & "' and proj_id = " & gintPROJID + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Else + mboolCopy = False + Exit Sub + End If + If oRS.EOF Then + mboolCopy = False + oRS.Close + Call TakeLoad + Else + gintTOID = Field2Str(oRS!toid) + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module SelectTake" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub SelectUpTake() +Dim oRS As Recordset +Dim strSQL As String, strMODEL As String + On Error GoTo Error_EH + mboolCopy = True + + mstrMODEL = lstMod_Elv.List(lstMod_Elv.ListIndex) +' strSQL = "SELECT TOID from tblTake WHERE Pln_elv = '" & mstrMODEL & "' and proj_id = " & gintPROJID + strSQL = "SELECT TOID from tblTake WHERE Pln_elv = '" & mstrMODEL & "' and proj_id = " & gintPROJID & " and not SUPERSEDE" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + gintTOID = 0 + Else + gintTOID = Field2Str(oRS!toid) + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module SelectUpTake" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpdate_Click() +Dim strSQL As String, strFIND As String +Dim oRS As Recordset + + If cmdUpdate.Caption = "Process Update" Then + cmdUpdate.Caption = "Update Inventory #'s" + If Len(txtOld) = 0 Or Len(txtNew) = 0 Then + MsgBox "A number must be entered into both the OLD and NEW boxes", vbOKOnly, "ReEnter" + lblSQL.Visible = False + lblOld.Visible = False + lblNew.Visible = False + txtOld.Visible = False + txtNew.Visible = False + txt68.Visible = True + txt108.Visible = True + lbl68.Visible = True + lbl108.Visible = True + lblScaffold.Visible = True + cmdCopyAll.Enabled = True + cmdCopyTakeoff.Enabled = True + cmdSavePlan.Enabled = False + cmdCProj.Enabled = True + cmdNewPlan.Enabled = True + cmdDelPlan.Enabled = True + Exit Sub + End If + strFIND = "SELECT * FROM tblInvtry WHERE Inv_No = " & Field2Str2(txtNew) + Set oRS = New Recordset + oRS.Open strFIND, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.EOF Then + MsgBox "You have entered an invalid Inventory Number into the NEW box", vbOKOnly, "REENTER" + lblSQL.Visible = False + lblOld.Visible = False + lblNew.Visible = False + txtOld.Visible = False + txtNew.Visible = False + txt68.Visible = True + txt108.Visible = True + lbl68.Visible = True + lbl108.Visible = True + lblScaffold.Visible = True + cmdCopyAll.Enabled = True + cmdCopyTakeoff.Enabled = True + cmdCProj.Enabled = True + cmdNewPlan.Enabled = True + cmdDelPlan.Enabled = True + cmdSavePlan.Enabled = False + Exit Sub + Else + Screen.MousePointer = vbHourglass + strSQL = "UPDATE tblPlanMat SET [inv_no] = " & Field2Str2(oRS!inv_no) + strSQL = strSQL & ", [desc] = '" & Field2Str2(oRS!Desc) + strSQL = strSQL & "', [d_flag] = '" & Field2Str2(oRS!d_flag) + strSQL = strSQL & "', [M_type] = '" & Field2Str2(oRS!m_type) + strSQL = strSQL & "', [calc_flag] = '" & Field2Str(oRS!calc_flag) + strSQL = strSQL & "', [calc_amt] = " & Field2Str2(oRS!calc_amt) + strSQL = strSQL & ", [price] = " & Field2Str2(oRS!price) + strSQL = strSQL & " WHERE proj_id = " & gintPROJID & " and inv_no = " & Field2Str2(txtOld) + goConn.Execute strSQL + strSQL = "UPDATE tblPOMatrl SET [inv_no] = " & Field2Str2(oRS!inv_no) +' strSQL = "UPDATE tblPOMatrl SET " '[inv_no] = " & Field2Str2(oRS!inv_no) + strSQL = strSQL & ", [desc] = '" & Field2Str2(oRS!Desc) + strSQL = strSQL & "', [d_flag] = '" & Field2Str2(oRS!d_flag) + strSQL = strSQL & "', [M_type] = '" & Field2Str2(oRS!m_type) + strSQL = strSQL & "', [calc_flag] = '" & Field2Str(oRS!calc_flag) + strSQL = strSQL & "', [calc_amt] = " & Field2Str2(oRS!calc_amt) +' strSQL = strSQL & ", [price] = " & Field2Str2(oRS!price) + strSQL = strSQL & " WHERE proj_id = " & gintPROJID & " and inv_no = " & Field2Str2(txtOld) + goConn.Execute strSQL + lblSQL.Visible = False + lblOld.Visible = False + lblNew.Visible = False + txtOld.Visible = False + txtNew.Visible = False + txt68.Visible = True + txt108.Visible = True + lbl68.Visible = True + lbl108.Visible = True + lblScaffold.Visible = True + cmdCopyAll.Enabled = True + cmdCopyTakeoff.Enabled = True + cmdSavePlan.Enabled = False + cmdCProj.Enabled = True + cmdNewPlan.Enabled = True + cmdDelPlan.Enabled = True + Screen.MousePointer = vbDefault + + End If + Else + txtOld = vbNullString + txtNew = vbNullString + lblSQL.Visible = True + lblOld.Visible = True + lblNew.Visible = True + txtOld.Visible = True + txtNew.Visible = True + txt68.Visible = False + txt108.Visible = False + lbl68.Visible = False + lbl108.Visible = False + lblScaffold.Visible = False + cmdUpdate.Caption = "Process Update" + txtOld.SetFocus + cmdCopyAll.Enabled = False + cmdCopyTakeoff.Enabled = False + cmdCProj.Enabled = False + cmdSavePlan.Enabled = False + cmdNewPlan.Enabled = False + cmdDelPlan.Enabled = False + End If +End Sub + +Private Sub cmdUpPlan_Click() + Call SelectUpTake + If mboolCopy Then + Call CopyUpTake + mintBOOKMARK = lstMod_Elv.ListIndex + Call ListLoad + lstMod_Elv.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Call MatLoad + Call OptLoad + Call OptMatLoad + End If +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub cboOMMetal_Change() + If cboOMMetal.Text = "None" Then + txtOMLength.Text = 0 + End If + +End Sub + +Private Sub cboOMMetal_Click() + If cboOMMetal.Text = "None" Then + txtOMLength.Text = 0 + End If +End Sub + +Private Sub cmdAddMat_Click() + Call ToggleMatButtons + cmdInventory.Visible = True + mboolAdding = True + Call MatClear + txtPMInvNo.SetFocus + cmdFindMat.Visible = True + lstPMaterial.Enabled = False +End Sub + +Private Sub cmdAddOpt_Click() + cmdAddOptMat.Enabled = False + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = False + cmdDelOptMat.Enabled = False + cmdAddOpt.Enabled = False + mboolAdding = True + lstOptions.Enabled = False + lstOptMatrl.Enabled = False + Call OptClear + txtODesc.SetFocus +End Sub + +Private Sub cmdAddOptMat_Click() + cmdInvList.Visible = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + lstOptMatrl.Enabled = False + lstOptions.Enabled = False + mboolAdding = True + Call OptMatClear + txtOMInvNo.SetFocus + cmdFindOptMat.Visible = True + +End Sub + +Private Sub cmdCopyPlan_Click() +Dim oRS2 As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + Set oRS2 = New Recordset + Set oRS2 = moRS.Clone + + oRS2.AddNew + oRS2!PROJ_ID = gintPROJID + oRS2!Mod_Elv = "test2" + oRS2!mat_yds = Field2Integer(moRS!mat_yds) + oRS2.Update + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module cmdCopyPlan_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSavePlan.Enabled Then + Call ToggleButtons + End If + End If +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + strMODEL = UCase(strMODEL) + If strMODEL <> "" Then + strSQL = "SELECT Est_id, proj_id, mod_elv from tblPlans WHERE Proj_id = " & gintPROJID & " and mod_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintESTID = oRS!est_id + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstPMaterial.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdAddMat.Enabled = True + If lstPMaterial.ListCount > 0 Then + If lstPMaterial.ListCount > mintBOOKMARK Then + lstPMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstPMaterial.ListIndex = mintBOOKMARK - 1 + End If + End If +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String +Dim oRS As Recordset + strYN = MsgBox("Are You Sure You Want To Delete this Option?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + strSQL = "SELECT * FROM tblLOption WHERE opt_id = " & gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + MsgBox "This Option Has Been Used With A Lot - No Delete Allowed", vbCritical + vbOKOnly, "No DELETE" + Exit Sub + End If + mintBOOKMARK = lstOptions.ListIndex + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + strSQL = "DELETE * FROM tblPOMatrl where OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOptBill where OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOption WHERE Est_ID = " & gintESTID & " and Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptClear + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + End If +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstOptions.ListIndex + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + End If +End Sub + +Private Sub cmdDelPlan_Click() +Dim strSQL As String, strSELECT As String, strYN As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strYN = MsgBox("Are you sure you want to delete this plan?", vbCritical + vbYesNo, "Delete??") + If strYN = vbNo Then + Exit Sub + End If + + strSQL = "SELECT * FROM tblLotInfo WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + MsgBox "This Plan Has Been Used In Orders - No Delete Allowed", vbCritical + vbOKOnly, "No DELETE" + Exit Sub + End If + + mintBOOKMARK = lstMod_Elv.ListIndex + + cmdDelPlan.Enabled = True + cmdNewPlan.Enabled = True + strSELECT = "SELECT * FROM tblPOption WHERE Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + Do Until oRS.EOF + strSQL = "DELETE * FROM tblPOMatrl where OPTid = " & oRS!OPTID + goConn.Execute strSQL + oRS.MoveNext + Loop + End If + strSQL = "DELETE * FROM tblPlanBill WHERE Est_ID = " & gintESTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOptBill WHERE Est_ID = " & gintESTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPOption WHERE Est_ID = " & gintESTID '& " and Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + strSQL = "DELETE * FROM tblPlanMat WHERE Est_id = " & gintESTID + goConn.Execute strSQL + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 + Else + lstMod_Elv.ListIndex = mintBOOKMARK - 1 + End If + End If + If gstrFLAG = "D" Then + Unload Me + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module cmdDelPlan_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim oRS As Recordset, strSQL As String, strYN As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyO And (gbytSECURITY < 3 Or gbytSECURITY = 7) Then ' Display key combinations. + If CtrlDown Then +' Call UpStart + Call AddOptBill3 + End If + End If + + If Not cmdSavePlan.Enabled Then + Call DataHasChanged + End If + +End Sub + +Private Sub UpStart() +Dim strEffDate As String +Dim strSQL As String, oRS As Recordset + + strEffDate = InputBox("Enter the New Effective Date for This Plan", "New Effective Date", txtEffDate) + If IsDate(strEffDate) Then + txtEffDate = strEffDate + + End If +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSavePlan.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + gintPROJID = 0 + gintESTID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub DataHasChanged() + + cmdSavePlan.Enabled = True + cmdNewPlan.Enabled = False + +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPMInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtPMInvNo = Field2Str(!inv_no) + txtPMDesc = Field2Str(!Desc) + txtPMLength = Field2Integer(!calc_amt) + txtPMPrice = Field2Str(!price) + + If !d_flag = "S" Then + cboPMDFlag.Text = "Supplier" + Else + cboPMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + ' Call FindType(cboPMType, strTYPE) + + If !m_type = "L" Then + cboPMType.Text = "Lath" + ElseIf !m_type = "B" Then + cboPMType.Text = "Brown" + ElseIf !m_type = "S" Then + cboPMType.Text = "Scratch" + ElseIf !m_type = "T" Then + cboPMType.Text = "Texture" + ElseIf !m_type = "C" Then + cboPMType.Text = "CMU" + ElseIf !m_type = "P" Then + cboPMType.Text = "PreOrder" + ElseIf !m_type = "V" Then + cboPMType.Text = "Veneer-Stone" + ElseIf !m_type = "W" Then + cboPMType.Text = "Wrap Typar" + ElseIf !m_type = "Z" Then + cboPMType.Text = "Z-PreCast" + ElseIf !m_type = "E" Then + cboPMType.Text = "E_Synthetic" + ElseIf !m_type = "J" Then + cboPMType.Text = "J-PaintPrep" + ElseIf !m_type = "K" Then + cboPMType.Text = "K-P-Interior" + ElseIf !m_type = "N" Then + cboPMType.Text = "N-P-Exterior" + ElseIf !m_type = "M" Then + cboPMType.Text = "M-PaintFinal" + End If + + If !calc_flag = "M" Then + cboPMMetal.Text = "Metal" + Else + cboPMMetal.Text = "None" + End If + + End With + txtPMQty.SetFocus + Else + Call cmdInventory_Click + lngFind = Field2Long(txtPMInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtOMInvNo.Text & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + ElseIf !d_flag = "Y" Then + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) +' If !m_type = "L" Then +' cboOMType.Text = "Lath" +' ElseIf !m_type = "B" Then +' cboOMType.Text = "Brown" +' ElseIf !m_type = "S" Then +' cboOMType.Text = "Scratch" +' ElseIf !m_type = "T" Then +' cboOMType.Text = "Texture" +' ElseIf !m_type = "C" Then +' cboOMType.Text = "CMU" +' ElseIf !m_type = "P" Then +' cboOMType.Text = "PreOrder" +' End If + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + Call cmdInvList_Click + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdInventory_Click() + lstMInventory.Visible = True + Call MInventoryLoad + +End Sub + +Private Sub cmdInvList_Click() + lstOptions.Visible = False + lstInventory.Visible = True + Call InventoryLoad +End Sub + +Private Sub InventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module InventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MInventoryLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE & " ORDER BY Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module mInventoryLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSaveMat_Click() + lstPMaterial.Enabled = True + mintBOOKMARK = lstPMaterial.ListIndex + Call ToggleMatButtons + cmdInventory.Visible = False +' cmdFindMat.Visible = False + Call MatSave + Call MatLoad + lstPMaterial.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSavePlan_Click() + mintBOOKMARK = lstMod_Elv.ListIndex + txtNewModel.Visible = False + lblNewModel.Visible = False + cmdExit.Enabled = True + cmdNewPlan.Enabled = True + cmdDelPlan.Enabled = True + cmdSavePlan.Enabled = False + cmdCopyTakeoff.Enabled = True + tabPlans.Enabled = True + Call FormSave + lstMod_Elv.Enabled = True + lstMod_Elv.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) +' If !m_type = "L" Then +' cboOMType.Text = "Lath" +' ElseIf !m_type = "B" Then +' cboOMType.Text = "Brown" +' ElseIf !m_type = "S" Then +' cboOMType.Text = "Scratch" +' ElseIf !m_type = "T" Then +' cboOMType.Text = "Texture" +' ElseIf !m_type = "C" Then +' cboOMType.Text = "CMU" +' ElseIf !m_type = "P" Then +' cboOMType.Text = "PreOrder" +' End If + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstMInventory.col = 0 + strINVNO = lstMInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, price from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, price from tblInvtry where Inv_no = '" & strINVNO & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtPMInvNo = Field2Str(!inv_no) + txtPMDesc = Field2Str(!Desc) + txtPMLength = Field2Integer(!calc_amt) + txtPMPrice = Field2Str(!price) + + If !d_flag = "S" Then + cboPMDFlag.Text = "Supplier" + Else + cboPMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) +' Call FindType(cboPMType, strTYPE) + + If !m_type = "L" Then + cboPMType.Text = "Lath" + ElseIf !m_type = "B" Then + cboPMType.Text = "Brown" + ElseIf !m_type = "S" Then + cboPMType.Text = "Scratch" + ElseIf !m_type = "T" Then + cboPMType.Text = "Texture" + ElseIf !m_type = "C" Then + cboPMType.Text = "CMU" + ElseIf !m_type = "P" Then + cboPMType.Text = "PreOrder" + ElseIf !m_type = "V" Then + cboPMType.Text = "Veneer-Stone" + ElseIf !m_type = "W" Then + cboPMType.Text = "Wrap Typar" + ElseIf !m_type = "Z" Then + cboPMType.Text = "Z-PreCast" + ElseIf !m_type = "E" Then + cboPMType.Text = "E_Synthetic" + ElseIf !m_type = "J" Then + cboPMType.Text = "J-PaintPrep" + ElseIf !m_type = "K" Then + cboPMType.Text = "K-P-Interior" + ElseIf !m_type = "N" Then + cboPMType.Text = "N-P-Exterior" + ElseIf !m_type = "M" Then + cboPMType.Text = "M-PaintFinal" + End If + + If !calc_flag = "M" Then + cboPMMetal.Text = "Metal" + Else + cboPMMetal.Text = "None" + End If + + End With + + oRS.Close + txtPMQty.SetFocus + lstMInventory.Visible = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSaveOpt_Click() + lstOptions.Enabled = True + lstOptMatrl.Enabled = True + mintBOOKMARK = lstOptions.ListIndex + cmdSaveOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub cmdSaveOptMat_Click() + lstInventory.Visible = False + lstOptions.Visible = True + lstOptions.Enabled = True + lstOptMatrl.Enabled = True + mintBOOKMARK = lstOptions.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + cmdInvList.Visible = False +' cmdFindOptMat.Visible = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Set moRS = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboPMType) + Call MTypeLoad(cboOMType) + If gbytSECURITY < 3 Then + cmdUpdate.Visible = True + chkVerified.Enabled = True + End If +' Call ProjLoad + Call TextureLoad +' Call ListLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + +End Sub +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboTexture.AddItem oRSFinish("Desc") + cboTexture.ItemData(cboTexture.NewIndex) = Field2Long(oRSFinish("AUTOID")) + cboOTexture.AddItem oRSFinish("Desc") + cboOTexture.ItemData(cboOTexture.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT EST_ID, Mod_Elv from tblPLANS WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!Mod_Elv) + .ItemData(.NewIndex) = oRS("est_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + Else + gstrFLAG = "D" + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() +Dim strSQL As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + mboolSHOW = True + gintESTID = moRS!est_id + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + mstrProj = Trim$(moRSProj!Proj_Code) +' strSQL = "SELECT Max( effdate ) as MAXField FROM tblplanbill WHERE est_id = " & gintESTID 'tblOption" +' Set oRSMAX = New Recordset +' oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' txtEffDate = oRSMAX!maxfield +' oRSMAX.Close + txtEffDate = FindMax2("tblPlanBill", "effdate", "EST_Id", gintESTID) +' txtEffDate = FindMax6("tblPlanBill", "effdate", "Proj_ID", gintPROJID, "EST_Id", gintESTID) + With moRS + txtMatYdge = Field2Long(!mat_yds) + txt12Foam = Field2Integer(!foam) + txtFin2 = Field2Integer(!fin2) + txtCMUYdge = Field2Integer(!CMUYDS) + txtPNotes = Field2Str(!notes) + txtPFAdj = Field2Integer(!f_adj) + txtWireAdj = Field2Integer(!w_adj) + txtPLAdj = Field2Integer(!l_adj) + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + chk2Story = Field2CheckBox(!TWOSTORY) + chkHLNotes = Field2CheckBox(!HLNotes) + chkStone = Field2CheckBox(!stone) + chkPaint = Field2CheckBox(!Paint) + txtPaintSQFT = Field2Str2(!PNT_SQFT) + chkOpen = Field2CheckBox(!openflg) + If !P_RL Then + lblP_RL.Visible = True + Else + lblP_RL.Visible = False + End If + chkVerified = Field2CheckBox(!verified) +' chkUpdate = Field2CheckBox(!Update) + txtStone = Field2Str2(!ST_SQFT) + txtCreate = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtImport = Format(Field2Str(!import), "mm/dd/yyyy") & " - " & Field2Str(!imuser) & " - " & Field2Str(!Source) +' txtElev = Field2Str(!FileName) + + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboTexture.ListIndex = -1 + Else + cboTexture = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub MatClear() + + With moRSMat + txtPMInvNo = "0" + txtPMDesc = "" + txtPMQty = "0" + txtPMPrice = "0" + txtPMLength = "0" + +' cboPMDFlag.Text = "" + cboPMDFlag.ListIndex = -1 +' cboPMType.Text = "" + cboPMType.ListIndex = -1 +' cboPMMetal.Text = "" + cboPMMetal.ListIndex = -1 + + End With + +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + mboolSHOW = True + + With moRSMat + txtPMInvNo = Field2Str(!inv_no) + txtPMDesc = Field2Str(!Desc) + txtPMQty = Field2Str(!qty) + txtPMPrice = Format$(Field2Str(!price), "##,###.00") + txtPMLength = Field2Integer(!calc_amt) + If !d_flag = "S" Then + cboPMDFlag.Text = "Supplier" + Else + cboPMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) +' Call FindType(cboPMType, strTYPE) + + If !m_type = "L" Then + cboPMType.Text = "Lath" + ElseIf !m_type = "B" Then + cboPMType.Text = "Brown" + ElseIf !m_type = "S" Then + cboPMType.Text = "Scratch" + ElseIf !m_type = "T" Then + cboPMType.Text = "Texture" + ElseIf !m_type = "C" Then + cboPMType.Text = "CMU" + ElseIf !m_type = "P" Then + cboPMType.Text = "PreOrder" + ElseIf !m_type = "V" Then + cboPMType.Text = "Veneer-Stone" + ElseIf !m_type = "W" Then + cboPMType.Text = "Wrap Typar" + ElseIf !m_type = "Z" Then + cboPMType.Text = "Z-PreCast" + ElseIf !m_type = "E" Then + cboPMType.Text = "E_Synthetic" + ElseIf !m_type = "J" Then + cboPMType.Text = "J-PaintPrep" + ElseIf !m_type = "K" Then + cboPMType.Text = "K-P-Interior" + ElseIf !m_type = "N" Then + cboPMType.Text = "N-P-Exterior" + ElseIf !m_type = "M" Then + cboPMType.Text = "M-P-PaintFinal" + End If + + If !calc_flag = "M" Then + cboPMMetal.Text = "Metal" + Else + cboPMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblPlanMat WHERE est_id = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !PROJ_ID = gintPROJID + !est_id = gintESTID + !inv_no = Str2Field(txtPMInvNo) + !Desc = Str2Field(txtPMDesc) + !qty = Str2Field(txtPMQty) + !price = Str2Field(txtPMPrice) + !calc_amt = Integer2Field(txtPMLength) + + If cboPMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboPMType.Text, 1) +' If cboPMType.Text = "Lath" Then +' !m_type = "L" +' ElseIf cboPMType.Text = "Brown" Then +' !m_type = "B" +' ElseIf cboPMType.Text = "Scratch" Then +' !m_type = "S" +' ElseIf cboPMType.Text = "Texture" Then +' !m_type = "T" +' ElseIf cboPMType.Text = "CMU" Then +' !m_type = "C" +' ElseIf cboPMType.Text = "PreOrder" Then +' !m_type = "P" +' End If + + If cboPMMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboPMMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close + Call MatLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !PROJ_ID = gintPROJID + !est_id = gintESTID + !inv_no = Str2Field(txtPMInvNo) + !Desc = Str2Field(txtPMDesc) + !qty = Str2Field(txtPMQty) + !price = Str2Field(txtPMPrice) + !calc_amt = Integer2Field(txtPMLength) + + If cboPMDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboPMDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboPMType.Text, 1) +' If cboPMType.Text = "Lath" Then +' !m_type = "L" +' ElseIf cboPMType.Text = "Brown" Then +' !m_type = "B" +' ElseIf cboPMType.Text = "Scratch" Then +' !m_type = "S" +' ElseIf cboPMType.Text = "Texture" Then +' !m_type = "T" +' ElseIf cboPMType.Text = "CMU" Then +' !m_type = "C" +' ElseIf cboPMType.Text = "PreOrder" Then +' !m_type = "P" +' End If + + If cboPMMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboPMMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + lblOEffDate = "" + lblOptNum = "" + lblTOptID = "" + + + With moRSOpt + txtOYdge = Field2Integer(!Yardage) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOFAdj = Field2Integer(!f_adj) +' txtBillAmt = Field2Integer(!Amt) + txtNote = Field2Str(!notes) + txtElev = Field2Str(!FileName) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkInv = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOTexture.ListIndex = -1 + Else + cboOTexture = strTYPE + End If + lblOEffDate = Field2Str(!effdate) + lblOptNum = "Option Number " & Trim(Field2Str(!OPTID)) + lblTOptID = "T_Option Number " & Trim(Field2Str(!T_OptID)) + If mboolOPTUSED Then + lblOptUsed.Visible = True + ElseIf mboolOPTUSED = False Then + lblOptUsed.Visible = False + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOption WHERE est_id = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!est_id = gintESTID + + oRS!Yardage = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!invoice = Field2CheckBox(chkInv) +' oRS!Amt = Integer2Field(txtBillAmt) + oRS!notes = Str2Field(txtNote) + oRS!FileName = Str2Field(txtElev) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!Updated = Date + oRS!U_USER = gstrLOGIN + oRS!C_USER = gstrLOGIN + Call FindTexture(cboOTexture, strTYPE) + oRS!texture = strTYPE + + oRS.Update +'' Else + +'' oRS!Yardage = Integer2Field(txtOYdge) +'' oRS!Desc = Str2Field(txtODesc) +'' oRS!fin2 = Integer2Field(txtOFin2) +'' oRS!f_adj = Integer2Field(txtOFAdj) +'' oRS!invoice = Field2CheckBox(chkInv) +' oRS!Amt = Integer2Field(txtBillAmt) +'' oRS!notes = Str2Field(txtNote) +'' oRS!FileName = Str2Field(txtElev) +'' oRS!ostone = chkOStone +'' oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) +'' oRS!Updated = Date +'' oRS!U_USER = gstrLOGIN +'' oRS!C_USER = gstrLOGIN +'' Call FindTexture(cboOTexture, strTYPE) +'' oRS!texture = strTYPE + +'' oRS.Update + + Call AddOptBill + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew +' Call AddOptBill + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!est_id = mintESTID + moRSOpt!C_USER = gstrLOGIN + Else + moRSOpt!est_id = gintESTID + End If + + moRSOpt!Yardage = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) +' moRSOpt!Amt = Integer2Field(txtBillAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!FileName = Str2Field(txtElev) + moRSOpt!ostone = chkOStone + moRSOpt!invoice = Field2CheckBox(chkInv) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + moRSOpt!U_USER = gstrLOGIN + moRSOpt!Updated = Date + Call FindTexture(cboOTexture, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblPOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + Call AddOptBill + mboolAdding = False + End If + + If mboolCopy Then + Call AddOptBill + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptClear() + + txtOYdge = 0 + txtODesc = "" + txtOFin2 = 0 + txtOFAdj = 0 +' txtBillAmt = 0 + txtNote = "" + txtElev = "" + cboOTexture.ListIndex = -1 + +End Sub + +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMLength = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module FormShowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblPOMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!OPTID = gintOPTID + oRS!inv_no = Str2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMLength) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + moRSOptMat!PROJ_ID = gintPROJID + moRSOptMat!OPTID = gintOPTID + moRSOptMat!inv_no = Str2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMLength) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblPOMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Str(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatClear() + + txtOMInvNo = 0 + txtOMDesc = "" + txtOMQty = "0" + txtOMLength = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!Mod_Elv = Str2Field(txtNewModel.Text) + moRS!PROJ_ID = gintPROJID + moRS!createuser = gstrLOGIN + End If + + Call FieldsSave + + moRS.Update + + + If mboolAdding Then + Call AddBill + mboolAdding = False + cmdExit.Caption = "E&xit" + End If + + Call ListLoad +' Call ToggleButtons + chkUpdate = vbUnchecked + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub + +Private Sub AddBill() +Dim lngESTID As Long +Dim strSQL As String, oRS As Recordset + + lngESTID = FindMax("tblplans", "est_id") + moRSPB.AddNew + moRSPB!est_id = lngESTID + moRSPB!PROJ_ID = gintPROJID + moRSPB!Mod_Elv = Str2Field(txtNewModel.Text) + moRSPB!effdate = txtEffDate + moRSPB!Wrap = moRSProj!Wrap + moRSPB!WPctg = moRSProj!WPctg +' moRSPB!C_USER = gstrLOGIN + moRSPB.Update + + strSQL = "Select * FROM tblPROJDATE" 'WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate +' strSQL = "Select * FROM tblPROJDATE WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + On Error Resume Next + If Not oRS.EOF Then + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = txtEffDate + oRS.Update + End If + On Error GoTo 0 +End Sub + +Private Sub AddBill2() +Dim lngESTID As Long +Dim strSQL As String, oRS As Recordset, strMODELV As String + + lngESTID = FindMax("tblplans", "est_id") + moRSPB.AddNew + moRSPB!est_id = lngESTID + moRSPB!PROJ_ID = gintPROJID + strMODELV = lstMod_Elv.Text + moRSPB!Mod_Elv = strMODELV + moRSPB!effdate = txtEffDate + moRSPB!Wrap = moRSProj!Wrap + moRSPB!WPctg = moRSProj!WPctg +' moRSPB!C_USER = gstrLOGIN + moRSPB.Update + + strSQL = "Select * FROM tblPROJDATE" 'WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate +' strSQL = "Select * FROM tblPROJDATE WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + On Error Resume Next + If Not oRS.EOF Then + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = txtEffDate + oRS.Update + End If + On Error GoTo 0 +End Sub + +Private Sub AddDate() +Dim lngESTID As Long +Dim strSQL As String, oRS As Recordset + + + strSQL = "Select * FROM tblPROJDATE" 'WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate +' strSQL = "Select * FROM tblPROJDATE WHERE Proj_id = " & gintPROJID & " and effdate = " & txtEffDate + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + On Error Resume Next + If Not oRS.EOF Then + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = mstrEffDate + oRS.Update + End If + On Error GoTo 0 +End Sub + +Private Sub AddOptBill() +Dim lngOPTID As Long +Dim strSQL As String, oRS As Recordset + + On Error GoTo Error_EH + + lngOPTID = FindMax("tblpoption", "OptID") + moRSPOB.AddNew + If mboolCopy Then + moRSPOB!est_id = mintESTID + Else + moRSPOB!est_id = gintESTID + End If + moRSPOB!OPTID = lngOPTID + If txtODesc = "0" Or txtODesc = "" Or txtODesc = " " Then + strSQL = "Select * FROM tblPOption WHERE OptId = " & lngOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' On Error Resume Next + If Not oRS.EOF Then + moRSPOB!Desc = Str2Field(oRS!Desc) + End If + Else + moRSPOB!Desc = Str2Field(txtODesc) + End If + +' moRSPOB!Desc = Str2Field(txtODesc) + moRSPOB!effdate = txtEffDate + moRSPOB!C_USER = gstrLOGIN + moRSPOB.Update + +' strSQL = "Select * FROM tblPROJDATE" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' On Error Resume Next +' If Not oRS.EOF Then +' oRS.AddNew +' oRS!proj_id = gintPROJID +' oRS!startdate = txtEffDate +' oRS.Update +' End If +' On Error GoTo 0 + Exit Sub +Error_EH: + gstrMODULE = "Form Plans - Module AddOptBill" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub AddOptBill2() +Dim lngOPTID As Long +'Dim strSQL As String, oRS As Recordset + +' lngOPTID = FindMax("tblpoption", "OptID") + lngOPTID = lstOptions.ItemData(lstOptions.ListIndex) + On Error Resume Next + moRSPOB.AddNew +' If mboolCopy Then +' moRSPOB!est_id = mintESTID +' Else + moRSPOB!est_id = gintESTID +' End If + moRSPOB!OPTID = lngOPTID + moRSPOB!Desc = Str2Field(txtODesc) + moRSPOB!effdate = txtEffDate + moRSPOB!C_USER = gstrLOGIN + moRSPOB.Update + lstOptions.ListIndex = (lstOptions.ListIndex + 1) + On Error GoTo 0 + +End Sub + +Private Sub AddOptBill3() +Dim lngOPTID As Long, strDESC As String +Dim oRS As Recordset, strSQL As String, intYN As Integer + + On Error Resume Next + + intYN = vbNo + lngOPTID = lstOptions.ItemData(lstOptions.ListIndex) + strSQL = "SELECT * FROM tblPOptBill WHERE OPTID = " & lngOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + If Not oRS.EOF Then + strDESC = Field2Str(moRSOpt!Desc) + Else + strDESC = Field2Str(moRSOpt!Desc) + End If + + If oRS.EOF Then + intYN = vbYes + moRSPOB.AddNew + moRSPOB!est_id = gintESTID + moRSPOB!OPTID = lngOPTID + moRSPOB!Desc = strDESC +' moRSPOB!Desc = Str2Field(txtODesc) + moRSPOB!effdate = txtEffDate + moRSPOB!C_USER = gstrLOGIN + moRSPOB.Update + MsgBox "Option Has Been Added To The Billing Grid", vbOKOnly, "Option Copied" + Else + intYN = vbNo + MsgBox "NO OPTION Was Added To The Billing Grid", vbOKOnly, "Option Copy Failed" + End If + + On Error GoTo 0 + +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub ToggleMatButtons() + cmdSaveMat.Enabled = Not cmdSaveMat.Enabled + cmdAddMat.Enabled = Not cmdAddMat.Enabled + cmdDelMat.Enabled = Not cmdDelMat.Enabled + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + lblEstID = 0 + + strSQL = "SELECT * FROM tblPlans WHERE est_ID = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + If moRS.State = adStateOpen Then + moRS.Close + End If + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + lblEstID = moRS!est_id + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Plans - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String, strDate As String +Dim strSQLL As String, oRSO As Recordset + + On Error GoTo Error_EH + lblOEffDate = "" + lblOptNum = "" + lblTOptID = "" + + mboolOPTUSED = False + strSQL = "SELECT * FROM tblPOption WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + strDate = Field2Str(moRSOpt!effdate) + If Len(strDate) = 0 Then + moRSOpt!effdate = Field2Str(txtEffDate) + moRSOpt.Update + Call AddOptBill3 + End If + strSQLL = "SELECT * FROM tblLOPTION WHERE OPT_ID = " & lstOptions.ItemData(lstOptions.ListIndex) + Set oRSO = New Recordset + oRSO.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic +' strOPTID = Field2Str(oRSO!opt_id) +' strDESC = Field2Str(oRSO!lot_id) + + If Not oRSO.EOF Then + mboolOPTUSED = True + moRSOpt!USED = vbTrue + moRSOpt.Update + Else + mboolOPTUSED = False + End If + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Plans - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstOptMatrl.col = 4 + strINVNO = lstOptMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOPTMatrl.ItemData(lstOPTMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Plans - Module FormFindOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstPMaterial.col = 4 + strINVNO = lstPMaterial.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPlanMat " + strSQL = strSQL & "WHERE Est_Id = " & gintESTID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE Est_Id = " & gintESTID & " AND INV_NO = " & lstPMaterial.ItemData(lstPMaterial.ListIndex) + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Plans - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstMod_Elv_Click() + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call MatLoad + Call OptLoad + Call OptMatLoad + If moRS!P_RL Then + gboolPSpecialCALC = True + End If + End If + End If +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRS + !verified = chkVerified + !mat_yds = Integer2Field(txtMatYdge) + !foam = Integer2Field(txt12Foam) + !fin2 = Integer2Field(txtFin2) + !CMU = Integer2Field(txtCMUYdge) + !notes = Str2Field(txtPNotes) + !f_adj = Integer2Field(txtPFAdj) + !l_adj = Integer2Field(txtPLAdj) + !w_adj = Integer2Field(txtWireAdj) + !stone = chkStone + !Paint = chkPaint + !PNT_SQFT = Integer2Field(txtPaintSQFT) + !TWOSTORY = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) +' !FileName = Str2Field(txtElev) + !ST_SQFT = Integer2Field(txtStone) +' !Update = chkUpdate + !LSave = Date + !LSUser = gstrLOGIN + If chkHLNotes = vbChecked Then + !HLNotes = vbChecked + ElseIf chkHLNotes = vbUnchecked Then + !HLNotes = vbUnchecked + End If + If chkUpdate Then + !Update = Date + !LUUser = gstrLOGIN + End If + + Call FindTexture(cboTexture, strTYPE) + !texture = strTYPE + + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdNewPlan_Click() +Dim strEffDate As String, boolValid As Boolean +Dim strSQL As String +Dim oRS As Recordset + + strEffDate = FindMax2("tblProjDate", "startdate", "Proj_ID", gintPROJID) + mstrEffDate = InputBox("Enter the Effective Date for This Plan (07/15/2005)", "Effective Date", strEffDate) + If Not IsDate(mstrEffDate) Then + MsgBox "You Did Not Enter A Valid Date - No Plan Will Be Added", vbOKOnly, "Invalid Date" + Exit Sub + End If +' strSQL = "SELECT * FROM tblProjDate WHERE Proj_id = " & gintPROJID & " and STARTDATE = " & CDate(mstrEffDate) + If IsDate(strEffDate) Then + strSQL = "SELECT * FROM tblProjDate WHERE Proj_id = " & gintPROJID & " and STARTDATE = #" & mstrEffDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Else + strSQL = "SELECT * FROM tblProjDate WHERE Proj_id = " & gintPROJID '& " and STARTDATE = #" & mstrEffDate & "#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + oRS.AddNew + oRS!PROJ_ID = gintPROJID + oRS!startdate = mstrEffDate + oRS.Update + End If + If oRS.EOF Then + MsgBox "You Did Not Enter A Valid Effective Date for This Project - No Plan Will Be Added", vbOKOnly, "Invalid Date" + Exit Sub + End If + If IsDate(mstrEffDate) Then + txtEffDate = mstrEffDate + Else + MsgBox "You Did Not Enter A Valid Date - No Plan Will Be Added", vbOKOnly, "Invalid Date" + Exit Sub + End If + mboolAdding = True + Call FormClear + Call MatClear + Call OptClear + lstOptions.Clear + lstPMaterial.Clear + lstOptMatrl.Clear + lstMInventory.Clear + lstInventory.Clear + txtNewModel.Visible = True + lblNewModel.Visible = True + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNewPlan.Enabled = False + cmdDelPlan.Enabled = False + cmdSavePlan.Enabled = True + cmdCopyTakeoff.Enabled = False + tabPlans.Enabled = False + lstMod_Elv.Enabled = False + txtNewModel.SetFocus +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + Call ProjLoad + Call ListLoad + Call OpenBilling + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tblplans WHERE est_id = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + Call cmdNewPlan_Click + cmdCopyTakeoff.Enabled = True + Else + Unload Me + Exit Sub + End If + End If + lblEstID = moRS!est_id + chkUpdate = vbUnchecked +End Sub + +Private Sub FormClear() + txtMatYdge = 0 + txt12Foam = 0 + cboTexture.ListIndex = -1 +' cboTexture.Text = "" + txtCMUYdge = 0 + txtPNotes = "" + txtPFAdj = 0 + txtPLAdj = 0 + txtWireAdj = 0 + txtFin2 = 0 + txtNote = "" + chkStone = vbUnchecked + chkPaint = vbUnchecked + txtPaintSQFT = 0 + txtStone = 0 + txtElev = "" +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Est_ID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPMaterial.Clear + + Do Until oRS.EOF + With lstPMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPMaterial.ListCount Then + lstPMaterial.ListIndex = 0 + Else + txtPMInvNo = "0" + txtPMDesc = "" + txtPMQty = "0" + txtPMPrice = "0" + txtPMLength = "0" + cboPMDFlag.ListIndex = -1 + cboPMType.ListIndex = -1 + cboPMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub TakeLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv FROM tblTake WHERE proj_id = " & gintPROJID & " ORDER BY Pln_Elv" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTake.Clear + lstTake.Visible = True + lblTake.Visible = True + lblTake.Caption = "Double Click the Desired Elevation" + Do Until oRS.EOF + With lstTake + + .AddItem oRS!pln_elv + .ItemData(.NewIndex) = oRS!toid + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTake.ListCount Then + lstTake.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module TakeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMLength = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Est_ID, OPTID, Opt_No, Desc, Yardage from tblPOption WHERE EST_ID = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + lblOEffDate = "" + lblOptNum = "" + lblTOptID = "" + txtOYdge = "0" + txtODesc = "0" + txtOFin2 = "0" + txtOFAdj = "0" + txtNote = "" + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMLength = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdSavePlan.Enabled = False + cmdNewPlan.Enabled = False +End Sub + +Private Sub lstOptions_Click() + On Error GoTo Error_EH + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + gintOPTID = lstOptions.ItemData(lstOptions.ListIndex) + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMLength = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOFAdj = "0" + txtNote = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module lstOptions_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstOptions_DblClick() + cmdAddOpt.Enabled = False + cmdSaveOpt.Enabled = True + cmdCopyOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOptMat.Enabled = False +End Sub + +Private Sub lstOptMatrl_Click() + On Error GoTo Error_EH + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMLength = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module lstOptMatrl_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstOptMatrl_DblClick() + cmdAddOptMat.Enabled = False + cmdAddOpt.Enabled = False + cmdDelOptMat.Enabled = True + cmdSaveOptMat.Enabled = True +End Sub + +Private Sub lstPMaterial_Click() + On Error GoTo Error_EH + If lstPMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstPMaterial.Clear + txtPMInvNo = "0" + txtPMDesc = "" + txtPMQty = "0" + txtPMPrice = "0" + txtPMLength = "0" + cboPMDFlag.Text = "" + cboPMType.Text = "" + cboPMMetal.Text = "" + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module lstPMaterial_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstPMaterial_DblClick() + cmdSaveMat.Enabled = True + cmdDelMat.Enabled = True + cmdAddMat.Enabled = False +End Sub + +Private Sub lstTake_DblClick() + gintTOID = lstTake.ItemData(lstTake.ListIndex) + mstrMODEL = lstTake.List(lstTake.ListIndex) + Call CopyTake + Call ListLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + + lstTake.Visible = False + lblTake.Visible = False + +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt12Foam_GotFocus() + Call FieldSelect(txt12Foam) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +'Private Sub txtBillAmt_GotFocus() +' Call FieldSelect(txtBillAmt) +'End Sub + +Private Sub txtCMUYdge_GotFocus() + Call FieldSelect(txtCMUYdge) +End Sub + +Private Sub txtElev_GotFocus() + Call FieldSelect(txtElev) +End Sub + +Private Sub txtElev_LostFocus() + txtElev = UCase(txtElev) +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtMatYdge_GotFocus() + Call FieldSelect(txtMatYdge) +End Sub + +Private Sub txtNew_LostFocus() + cmdUpdate.SetFocus +End Sub + +Private Sub txtNewModel_LostFocus() + txtNewModel.Text = UCase(txtNewModel.Text) +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc.Text = UCase(txtODesc.Text) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc.Text = UCase(txtOMDesc.Text) +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMInvNo_LostFocus() + txtOMInvNo = UCase(txtOMInvNo) +End Sub + +Private Sub txtOMLength_GotFocus() + Call FieldSelect(txtOMLength) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOSt_SqFt_GotFocus() + Call FieldSelect(txtOST_SqFt) +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPFAdj_GotFocus() + Call FieldSelect(txtPFAdj) +End Sub + +Private Sub txtPLAdj_GotFocus() + Call FieldSelect(txtPLAdj) +End Sub + +Private Sub txtPMDesc_GotFocus() + Call FieldSelect(txtPMDesc) +End Sub + +Private Sub txtPMDesc_LostFocus() + txtPMDesc.Text = UCase(txtPMDesc.Text) +End Sub + +Private Sub txtPMInvNo_GotFocus() + Call FieldSelect(txtPMInvNo) +End Sub + +Private Sub txtPMInvNo_LostFocus() + txtPMInvNo = UCase(txtPMInvNo) +End Sub + +Private Sub txtPMLength_GotFocus() + Call FieldSelect(txtPMLength) +End Sub + +Private Sub txtPMPrice_GotFocus() + Call FieldSelect(txtPMPrice) +End Sub + +Private Sub txtPMQty_GotFocus() + Call FieldSelect(txtPMQty) +End Sub + +Private Sub cmdCProj_Click() + Call ProjectLoad + lstProject.SetFocus +End Sub +Private Sub lstProject_DblClick() +Dim strMODEL As String, strSQL As String +Dim lngESTID As Long +Dim oRS As Recordset + On Error GoTo Error_EH + mstrEffDate = InputBox("Enter the Effective Date for This Copied Plan", "Effective Date", Date) + mintPROJID = lstProject.ItemData(lstProject.ListIndex) +' mstrPROJ = Trim(lstProject.Text) +' mboolCopy = True + strMODEL = lstMod_Elv.List(lstMod_Elv.ListIndex) + strSQL = "SELECT est_id, proj_id, mod_elv from tblPlans WHERE Proj_id = " & mintPROJID & " and mod_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + ' txtNewElv = UCase(strMODEL) +' mboolCopy = True + moRS.AddNew + moRS!PROJ_ID = mintPROJID + moRS!Mod_Elv = strMODEL + moRS!createuser = gstrLOGIN + Call FieldsSave + moRS!LUUser = gstrLOGIN + moRS!Update = Date + moRS!Source = mstrProj + moRS!import = Date + moRS!imuser = gstrLOGIN + moRS.Update + lngESTID = FindMax("tblplans", "est_id") + moRSPB.AddNew + moRSPB!est_id = lngESTID + moRSPB!PROJ_ID = mintPROJID + moRSPB!Mod_Elv = strMODEL + moRSPB!Create = Date + moRSPB!Wrap = moRSProj!Wrap + moRSPB!WPctg = moRSProj!WPctg + moRSPB.Update + Call CopyTMat + Call CopyTOpt + lstProject.Visible = False + lblTake.Visible = False + Else + MsgBox "The Model/Elevation you selected is already being used in new Project. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + lstProject.Visible = False + lblTake.Visible = False +' mboolCopy = False + Exit Sub + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plan - Module lstProject_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblPOption where optid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblPOption where Est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + gintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!est_id = mintESTID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!Yardage = Field2Integer(oRS!Yardage) + oRSC!Amt = Field2Str2(oRS!Amt) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC!notes = Field2Str(oRS!notes) + oRSC!ostone = oRS!ostone + oRSC!OSt_SqFt = Field2Str2(oRS!OSt_SqFt) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblPOMatrl where optid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblPOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + mintOPTID = oRSS!maxoptid + + moRSPOB.AddNew + moRSPOB!est_id = mintESTID + moRSPOB!OPTID = mintOPTID + moRSPOB!Desc = Field2Str(oRS!Desc) + moRSPOB!created = Date + moRSPOB!C_USER = gstrLOGIN + moRSPOB!effdate = mstrEffDate + moRSPOB.Update + + strSELECT = "SELECT * FROM tblPOMatrl where optid = " & gintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!OPTID = mintOPTID + oRSSS!PROJ_ID = mintPROJID + oRSSS!inv_no = Field2Str(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plan - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblPlanMat where Est_id = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT est_id FROM tblPlans where proj_id = " & mintPROJID & " and mod_elv = '" & lstMod_Elv.List(lstMod_Elv.ListIndex) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + mintESTID = Field2Long(oRS!est_id) + + strSQL = "SELECT * FROM tblPlanMat where est_id = " & gintESTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!est_id = mintESTID + oRSC!PROJ_ID = mintPROJID + oRSC!inv_no = Field2Str(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!unit = Field2Str(oRS!unit) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Plan - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjectLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Proj_id, Proj_Code FROM tblProject ORDER BY Proj_Code" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstProject.Clear + lstProject.Visible = True + lblTake.Visible = True + lblTake.Caption = "Double Click the Desired Project" + Do Until oRS.EOF + With lstProject + + .AddItem oRS!Proj_Code + .ItemData(.NewIndex) = oRS!PROJ_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstProject.ListCount Then + lstProject.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module ProjectLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtPNotes_LostFocus() + txtPNotes.Text = UCase(txtPNotes.Text) +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frx new file mode 100644 index 0000000..aca2872 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlans.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frm new file mode 100644 index 0000000..c9988d2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frm @@ -0,0 +1,1404 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Begin VB.Form frmPlans + BorderStyle = 1 'Fixed Single + Caption = "Plans" + ClientHeight = 8625 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 11910 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 8625 + ScaleWidth = 11910 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtPLAdj + Height = 315 + Left = 10800 + TabIndex = 63 + Top = 840 + Width = 855 + End + Begin VB.TextBox txtPFAdj + Height = 315 + Left = 10800 + TabIndex = 62 + Top = 240 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 7380 + TabIndex = 59 + Top = 2640 + Width = 1455 + End + Begin TabDlg.SSTab tabPlans + Height = 4815 + Left = 180 + TabIndex = 16 + Top = 3600 + Width = 11535 + _ExtentX = 20346 + _ExtentY = 8493 + _Version = 393216 + Tabs = 2 + Tab = 1 + TabsPerRow = 2 + TabHeight = 520 + TabCaption(0) = "Materials" + TabPicture(0) = "frmPlans.frx":0000 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "cboPMMetal" + Tab(0).Control(1)= "cboPMType" + Tab(0).Control(2)= "cboPMDFlag" + Tab(0).Control(3)= "txtPMLength" + Tab(0).Control(4)= "txtPMPrice" + Tab(0).Control(5)= "txtPMQty" + Tab(0).Control(6)= "txtPMDesc" + Tab(0).Control(7)= "txtPMInvNo" + Tab(0).Control(8)= "lstPMaterial" + Tab(0).Control(9)= "lblPMLength" + Tab(0).Control(10)= "lblPMMetal" + Tab(0).Control(11)= "lblPMType" + Tab(0).Control(12)= "lblPMDFLag" + Tab(0).Control(13)= "lblPMPrice" + Tab(0).Control(14)= "lblPMQty" + Tab(0).Control(15)= "lblPMDesc" + Tab(0).Control(16)= "lblPMInvNo" + Tab(0).ControlCount= 17 + TabCaption(1) = "Options" + TabPicture(1) = "frmPlans.frx":001C + Tab(1).ControlEnabled= -1 'True + Tab(1).Control(0)= "lblOptYdge" + Tab(1).Control(0).Enabled= 0 'False + Tab(1).Control(1)= "lblOptFin2" + Tab(1).Control(1).Enabled= 0 'False + Tab(1).Control(2)= "lblOptFAdjYdge" + Tab(1).Control(2).Enabled= 0 'False + Tab(1).Control(3)= "lblOTexture" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "lblOMInvNo" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lblOMDesc" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "lblOMQty" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "lblOMDflag" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "lblOMMType" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "lblOMetal" + Tab(1).Control(9).Enabled= 0 'False + Tab(1).Control(10)= "lblOMLength" + Tab(1).Control(10).Enabled= 0 'False + Tab(1).Control(11)= "lstOptions" + Tab(1).Control(11).Enabled= 0 'False + Tab(1).Control(12)= "txtODesc" + Tab(1).Control(12).Enabled= 0 'False + Tab(1).Control(13)= "txtOYdge" + Tab(1).Control(13).Enabled= 0 'False + Tab(1).Control(14)= "txtOFin2" + Tab(1).Control(14).Enabled= 0 'False + Tab(1).Control(15)= "txtOFAdj" + Tab(1).Control(15).Enabled= 0 'False + Tab(1).Control(16)= "lstOptMatrl" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cboOTexture" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "txtOMDesc" + Tab(1).Control(18).Enabled= 0 'False + Tab(1).Control(19)= "txtOMInvNo" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "txtOMQty" + Tab(1).Control(20).Enabled= 0 'False + Tab(1).Control(21)= "txtOMLength" + Tab(1).Control(21).Enabled= 0 'False + Tab(1).Control(22)= "cboOMDflag" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "cboOMType" + Tab(1).Control(23).Enabled= 0 'False + Tab(1).Control(24)= "cboOMMetal" + Tab(1).Control(24).Enabled= 0 'False + Tab(1).ControlCount= 25 + Begin VB.ComboBox cboPMMetal + Height = 315 + ItemData = "frmPlans.frx":0038 + Left = -67920 + List = "frmPlans.frx":0042 + Style = 2 'Dropdown List + TabIndex = 58 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboPMType + Height = 315 + ItemData = "frmPlans.frx":0053 + Left = -67920 + List = "frmPlans.frx":0066 + Style = 2 'Dropdown List + TabIndex = 57 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboPMDFlag + Height = 315 + ItemData = "frmPlans.frx":008E + Left = -67920 + List = "frmPlans.frx":0098 + Style = 2 'Dropdown List + TabIndex = 56 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtPMLength + Height = 315 + Left = -67920 + TabIndex = 55 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtPMPrice + Height = 315 + Left = -67920 + TabIndex = 54 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtPMQty + Height = 315 + Left = -67920 + TabIndex = 53 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtPMDesc + Height = 315 + Left = -67920 + TabIndex = 52 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtPMInvNo + Height = 315 + Left = -67920 + TabIndex = 51 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstPMaterial + Height = 4155 + Left = -74820 + TabIndex = 42 + Top = 480 + Width = 5535 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmPlans.frx":00AC + Left = 9780 + List = "frmPlans.frx":00B6 + Style = 2 'Dropdown List + TabIndex = 41 + Top = 3570 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmPlans.frx":00C7 + Left = 9780 + List = "frmPlans.frx":00DA + Style = 2 'Dropdown List + TabIndex = 40 + Top = 3120 + Width = 1275 + End + Begin VB.ComboBox cboOMDflag + Height = 315 + ItemData = "frmPlans.frx":0102 + Left = 6900 + List = "frmPlans.frx":010C + Style = 2 'Dropdown List + TabIndex = 39 + Top = 4020 + Width = 1155 + End + Begin VB.TextBox txtOMLength + Height = 315 + Left = 9780 + TabIndex = 38 + Top = 4020 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = 6900 + TabIndex = 37 + Top = 3580 + Width = 915 + End + Begin VB.TextBox txtOMInvNo + Height = 315 + Left = 6900 + TabIndex = 36 + Top = 3120 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = 6900 + TabIndex = 35 + Top = 2700 + Width = 4275 + End + Begin VB.ComboBox cboOTexture + Height = 315 + Left = 4680 + TabIndex = 27 + Top = 1020 + Width = 2235 + End + Begin VB.ListBox lstOptMatrl + Height = 1815 + Left = 240 + TabIndex = 25 + Top = 2640 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Height = 315 + Left = 10260 + TabIndex = 24 + Top = 1020 + Width = 855 + End + Begin VB.TextBox txtOFin2 + Height = 315 + Left = 10260 + TabIndex = 23 + Top = 600 + Width = 855 + End + Begin VB.TextBox txtOYdge + Height = 315 + Left = 7800 + TabIndex = 22 + Top = 600 + Width = 855 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = 4080 + TabIndex = 21 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = 240 + TabIndex = 17 + Top = 600 + Width = 3195 + End + Begin VB.Label lblPMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69000 + TabIndex = 50 + Top = 3060 + Width = 975 + End + Begin VB.Label lblPMMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal:" + Height = 195 + Left = -68460 + TabIndex = 49 + Top = 2700 + Width = 435 + End + Begin VB.Label lblPMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Materials Type:" + Height = 195 + Left = -69105 + TabIndex = 48 + Top = 2340 + Width = 1080 + End + Begin VB.Label lblPMDFLag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -68985 + TabIndex = 47 + Top = 1980 + Width = 960 + End + Begin VB.Label lblPMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68430 + TabIndex = 46 + Top = 1620 + Width = 405 + End + Begin VB.Label lblPMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68655 + TabIndex = 45 + Top = 1260 + Width = 630 + End + Begin VB.Label lblPMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68865 + TabIndex = 44 + Top = 900 + Width = 840 + End + Begin VB.Label lblPMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -68985 + TabIndex = 43 + Top = 540 + Width = 960 + End + Begin VB.Label lblOMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = 8745 + TabIndex = 34 + Top = 4080 + Width = 975 + End + Begin VB.Label lblOMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = 8940 + TabIndex = 33 + Top = 3640 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = 8715 + TabIndex = 32 + Top = 3200 + Width = 1005 + End + Begin VB.Label lblOMDflag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = 5880 + TabIndex = 31 + Top = 4080 + Width = 960 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = 6210 + TabIndex = 30 + Top = 3640 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 6000 + TabIndex = 29 + Top = 2760 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = 5880 + TabIndex = 28 + Top = 3200 + Width = 960 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = 3540 + TabIndex = 26 + Top = 1080 + Width = 1095 + End + Begin VB.Label lblOptFAdjYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Yardage:" + Height = 195 + Left = 8790 + TabIndex = 20 + Top = 1080 + Width = 1395 + End + Begin VB.Label lblOptFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 8955 + TabIndex = 19 + Top = 660 + Width = 1230 + End + Begin VB.Label lblOptYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = 7080 + TabIndex = 18 + Top = 660 + Width = 645 + End + End + Begin VB.TextBox txtPNotes + Height = 1275 + Left = 2220 + TabIndex = 14 + Top = 1980 + Width = 4875 + End + Begin VB.TextBox txtFin2 + Height = 315 + Left = 8340 + TabIndex = 13 + Top = 840 + Width = 855 + End + Begin VB.ComboBox cboTexture + Height = 315 + Left = 4500 + TabIndex = 12 + Text = "cboTexture" + Top = 1440 + Width = 1935 + End + Begin VB.TextBox txt12Foam + Height = 315 + Left = 8340 + TabIndex = 11 + Top = 240 + Width = 855 + End + Begin VB.TextBox txtCMUYdge + Height = 315 + Left = 5520 + TabIndex = 10 + Top = 840 + Width = 855 + End + Begin VB.TextBox txtMatYdge + Height = 315 + Left = 5520 + TabIndex = 9 + Top = 240 + Width = 855 + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 600 + Sorted = -1 'True + TabIndex = 3 + Top = 1080 + Width = 1395 + End + Begin VB.ComboBox cboProject + Height = 315 + Left = 660 + Sorted = -1 'True + TabIndex = 0 + Top = 240 + Width = 3015 + End + Begin VB.Label lblPLAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Yardage:" + Height = 195 + Left = 9285 + TabIndex = 61 + Top = 900 + Width = 1410 + End + Begin VB.Label lblPFAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Yardage:" + Height = 195 + Left = 9300 + TabIndex = 60 + Top = 300 + Width = 1395 + End + Begin VB.Label lblPNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2340 + TabIndex = 15 + Top = 1680 + Width = 690 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 7035 + TabIndex = 8 + Top = 900 + Width = 1230 + End + Begin VB.Label lbl12Foam + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1/2 Foam Percentage:" + Height = 195 + Left = 6660 + TabIndex = 7 + Top = 300 + Width = 1605 + End + Begin VB.Label lblTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3720 + TabIndex = 6 + Top = 1500 + Width = 585 + End + Begin VB.Label lblCMUYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Yardage:" + Height = 195 + Left = 4380 + TabIndex = 5 + Top = 900 + Width = 1050 + End + Begin VB.Label lblMatYdge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Yardage:" + Height = 195 + Left = 4185 + TabIndex = 4 + Top = 300 + Width = 1245 + End + Begin VB.Label lblModel_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 240 + TabIndex = 2 + Top = 780 + Width = 1770 + End + Begin VB.Label lblProj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 300 + Width = 540 + End +End +Attribute VB_Name = "frmPlans" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRS As Recordset +Dim moRSMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset + +Dim mboolShow As Boolean +Dim mboolAdding As Boolean +Dim mstrType As String +'Dim xaFinish As New XArrayDB + +Const conCOL_NAME As Integer = 0 +Const conCOL_WAIT As Integer = 1 +Const conCOL_TYPE As Integer = 2 +Const conCOL_ID As Integer = 3 +Const conGable As Long = 4 + +Private Sub cboOMMetal_Change() + If cboOMMetal.Text = "None" Then + txtOMLength.Text = 0 + End If + +End Sub + +Private Sub cboOMMetal_Click() + If cboOMMetal.Text = "None" Then + txtOMLength.Text = 0 + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + + Call ProjLoad + Call TextureLoad + Call ListLoad +' Call StuccoLoad +' Call MeasLoad + Call MatLoad +' Call MeLocateLoad + Call OptLoad + Call OptMatLoad + +End Sub +Private Sub cboProject_Change() + Call ListLoad +End Sub + +Private Sub cboProject_Click() + Call ListLoad +End Sub +Private Sub ProjLoad() + Dim oRS As Recordset + Dim strSQL As String + + strSQL = "SELECT Proj_id, Proj_desc FROM tblProject " + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + cboProject.AddItem oRS("Proj_desc") + cboProject.ItemData(cboProject.NewIndex) = oRS("Proj_id") + + oRS.MoveNext + Loop + oRS.Close + cboProject.ListIndex = 40 +End Sub +Private Sub TextureLoad() + Dim oRSFinish As Recordset + Dim strSQL As String, intRows As Integer + Dim row, col As Long + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboTexture.AddItem oRSFinish("Desc") + cboTexture.ItemData(cboTexture.NewIndex) = Field2Long(oRSFinish("AUTOID")) + cboOTexture.AddItem oRSFinish("Desc") + cboOTexture.ItemData(cboOTexture.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close +End Sub +Private Sub ListLoad() + Dim oRS As Recordset + Dim strSQL As String, strProj As String + + gintPROJID = cboProject.ItemData(cboProject.ListIndex) + + strSQL = "SELECT EST_ID, Mod_Elv from tblPLANS WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!mod_elv) + .ItemData(.NewIndex) = oRS("est_id") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + + +End Sub + +Private Sub FormShow() + mboolShow = True + gintESTID = moRS!est_id + + With moRS + txtMatYdge = Field2Str(!MAT_Yds) + txt12Foam = Field2Str(!FOAM) + txtFin2 = Field2Str(!FIN2) + txtCMUYdge = Field2Str(!CMU) + txtPNotes = Field2Str(!NOTES) + txtPFAdj = Field2Str(!f_adj) + txtPLAdj = Field2Str(!l_adj) + + If !Texture = "SK" Then + cboTexture.Text = "SKIP TROWEL" + ElseIf !Texture = "SA" Then + cboTexture.Text = "Sand" + ElseIf !Texture = "S2" Then + cboTexture.Text = "Sand" + ElseIf !Texture = "S3" Then + cboTexture.Text = "Sand" + ElseIf !Texture = "DA" Then + cboTexture.Text = "Dash" + ElseIf !Texture = "DF" Then + cboTexture.Text = "Skip and Sand Finish" + ElseIf !Texture = "SM" Then + cboTexture.Text = "Smooth" + ElseIf !Texture = "QU" Then + cboTexture.Text = "Quernavaca" + ElseIf !Texture = "MN" Then + cboTexture.Text = "Monterrey" + End If + + + End With + mboolShow = False +End Sub + +Private Sub FormShowMat() + mboolShow = True + + With moRSMat + txtPMInvNo = Field2Str(!inv_no) + txtPMDesc = Field2Str(!Desc) + txtPMQty = Field2Str(!qty) + txtPMPrice = Format$(Field2Str(!price), "##,###.00") + txtPMLength = Field2Str(!calc_amt) + If !D_Flag = "S" Then + cboPMDFlag.Text = "Supplier" + Else + cboPMDFlag.Text = "Yard" + End If + + If !M_Type = "L" Then + cboPMType.Text = "Lath" + ElseIf !M_Type = "B" Then + cboPMType.Text = "Brown" + ElseIf !M_Type = "S" Then + cboPMType.Text = "Scratch" + ElseIf !M_Type = "T" Then + cboPMType.Text = "Texture" + ElseIf !M_Type = "C" Then + cboPMType.Text = "CMU" + End If + + If !Calc_Flag = "M" Then + cboPMMetal.Text = "Metal" + Else + cboPMMetal.Text = "None" + End If + + + End With + mboolShow = False +End Sub +Private Sub FormShowOpt() + mboolShow = True + gintOPTID = moRSOpt!optid + + With moRSOpt + txtOYdge = Field2Str(!yardage) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Str(!FIN2) + txtOFAdj = Field2Str(!f_adj) + + If !Texture = "SK" Then + cboOTexture.Text = "SKIP TROWEL" + ElseIf !Texture = "SA" Then + cboOTexture.Text = "Sand" + ElseIf !Texture = "S2" Then + cboOTexture.Text = "Sand" + ElseIf !Texture = "S3" Then + cboOTexture.Text = "Sand" + ElseIf !Texture = "DA" Then + cboOTexture.Text = "Dash" + ElseIf !Texture = "DF" Then + cboOTexture.Text = "Skip and Sand Finish" + ElseIf !Texture = "SM" Then + cboOTexture.Text = "Smooth" + ElseIf !Texture = "QU" Then + cboOTexture.Text = "Quernavaca" + ElseIf !Texture = "MN" Then + cboOTexture.Text = "Monterrey" + Else + cboOTexture.Text = "" + End If + + + End With + mboolShow = False +End Sub +Private Sub FormShowOptMat() + mboolShow = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMLength = Field2Str(!calc_amt) + + If !D_Flag = "S" Then + cboOMDflag.Text = "Supplier" + Else + cboOMDflag.Text = "Yard" + End If + + If !M_Type = "L" Then + cboOMType.Text = "Lath" + ElseIf !M_Type = "B" Then + cboOMType.Text = "Brown" + ElseIf !M_Type = "S" Then + cboOMType.Text = "Scratch" + ElseIf !M_Type = "T" Then + cboOMType.Text = "Texture" + ElseIf !M_Type = "C" Then + cboOMType.Text = "CMU" + End If + + If !Calc_Flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolShow = False +End Sub + + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + End If + + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Then + mboolAdding = False +' strName = Trim$(txtLast) & ", " & Trim$(txtFirst) + ' Reload list box +' Call ListLoad + +' lstNames.Text = strName +' Else + ' Update List Box +' With lstNames +' .List(.ListIndex) = txtLast & ", " & _ +' txtFirst +' End With + End If + + Call ToggleButtons + + Exit Sub + +Error_EH: + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub +End Sub +Private Sub ToggleButtons() + If cmdClose.Caption = "&Close" Then + cmdClose.Caption = "&Cancel" + Else + cmdClose.Caption = "&Close" + End If + cmdSave.Enabled = Not cmdSave.Enabled + cmdNew.Enabled = Not cmdNew.Enabled + cmdDelete.Enabled = Not cmdDelete.Enabled + lstNames.Enabled = Not lstNames.Enabled +End Sub + +Private Sub TextChanged() + If Not mboolShow Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub +Private Function FormFind() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPlans " + strSQL = strSQL & "WHERE est_ID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + If moRS.State = adStateOpen Then + moRS.Close + End If + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function + +Private Function FormFindOpt() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If +End Function +Private Function FormFindOptMat() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If +End Function +Private Function FormFindMat() As Boolean + Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPlanMat " + strSQL = strSQL & "WHERE Est_Id = " & gintESTID & " AND INV_NO = " & lstPMaterial.ItemData(lstPMaterial.ListIndex) + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If +End Function + + +Private Sub lstMod_Elv_Click() + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + Call MatLoad + Call OptLoad + Call OptMatLoad + + End If + End If +End Sub +Private Sub FieldsSave() + With moRS +' !TTL_Yds = Str2Field(txtTTL_Yds) +' !LATH_YDS = Str2Field(txtLathYds) +' !OPENING = Str2Field(txtOpenings) +' !OPENPR = Str2Field(txtPrcntge) +' !CMUYDS = Str2Field(txtCMUYds) +' !NOTES = Str2Field(txtNotes) +' !f_adj = Str2Field(txtFoamAdj) +' !l_adj = Str2Field(txtLaborAdj) +' !FIN2 = Str2Field(txtFin2) +' !SAND_TONS = Str2Field(txtSandTons) +' !SAND = Str2Field(txtSandPrice) +' !METAL = Str2Field(txtMetalFt) +' !PL = Str2Field(txtStucLab) +' !LL = Str2Field(txtLathLab) +' !MLAB = Str2Field(txtMetLab) +' !MISC = Str2Field(txtMisc) +' !MATMUP = Str2Field(txtMatMU) +' !BIDP = Str2Field(txtBidPrwCMU) +' = Str2Field(txtBidPrice) +' !BIDC = Str2Field(txtTtlCost) +' !OH = Str2Field(txtTtlMU) +' !OHPR = Str2Field(txtOH) +' = Str2Field(txtPrSQYD) +' = Str2Field(txtSandAmt) +' !SL_TG = Str2Field(txtScafGas) +' !TP = Str2Field(txtTape) +' !MATCOST = Str2Field(txtTtlMat) +' !BRDN = Str2Field(txtLabBur) +' !SR = Str2Field(txtSLRate) +' !LR = Str2Field(txtLLRate) +' !MR = Str2Field(txtMLRate) +' !SCR = Str2Field(txtSGRate) +' !TP = Str2Field(txtTPRate) +' !MU = Str2Field(txtMURate) +' !OHP = Str2Field(txtOHRate) +' !CR = Str2Field(txtCMURate) +' !CMULAB = Str2Field(txtCMUPrice) +' !TPE = Str2Field(txtTape) +' = Str2Field(txtSandPr) +' = Str2Field(txtSkipPr) +' = Str2Field(txtDashPr) +' = Str2Field(txtSmoothPr) +' = Str2Field(txtMonterreyPr) +' = Str2Field(txtQuernavacaPr) +' = Str2Field(txtDFPr) + + + End With +End Sub +Private Sub cmdNew_Click() + + mboolAdding = True + Call FormClear + +End Sub + +Private Sub cmdSave_Click() + Call FormSave +End Sub + +Private Sub Form_Activate() + Dim intResponse As Integer + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + Call cmdNew_Click + Else + Unload Me + End If + End If +End Sub + +Private Sub FormClear() + txtMatYdge = "" + txt12Foam = "" + cboTexture.ListIndex = -1 + txtCMUYdge = "" + txtPNotes = "" + txtPFAdj = "" + txtPLAdj = "" + txtFin2 = "" + + +End Sub + +Private Sub MatLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT Est_ID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPlanMat WHERE est_id = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPMaterial.Clear + + Do Until oRS.EOF + With lstPMaterial + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstPMaterial.ListCount Then + lstPMaterial.ListIndex = 0 + Else + txtPMInvNo = "" + txtPMDesc = "" + txtPMQty = "" + txtPMPrice = "" + txtPMLength = "" + cboPMDFlag.ListIndex = -1 + cboPMType.ListIndex = -1 + cboPMMetal.ListIndex = -1 + End If + + +End Sub +Private Sub OptMatLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "" + txtOMDesc = "" + txtOMQty = "" + txtOMLength = "" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + + +End Sub +Private Sub OptLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + +' strSQL = "SELECT * from tblPOption WHERE ESTID = " & gintESTID + strSQL = "SELECT Est_ID, OPTID, Opt_No, Desc, Yardage from tblPOption WHERE EST_ID = " & gintESTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Opt_no") & " " & oRS("Yardage") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "" + txtODesc = "" + txtOFin2 = "" + txtOFAdj = "" + lstOptMatrl.Clear + txtOMInvNo = "" + txtOMDesc = "" + txtOMQty = "" + txtOMLength = "" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + End If + + +End Sub + + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "" + txtOMDesc = "" + txtOMQty = "" + txtOMLength = "" + cboOMDflag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "" + txtODesc = "" + txtOFin2 = "" + txtOFAdj = "" + + End If + End If + + +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "" + txtOMDesc = "" + txtOMQty = "" + txtOMLength = "" + cboOMDflag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstPMaterial_Click() + If lstPMaterial.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstPMaterial.Clear + txtPMInvNo = "" + txtPMDesc = "" + txtPMQty = "" + txtPMPrice = "" + txtPMLength = "" + cboPMDFlag.Text = "" + cboPMType.Text = "" + cboPMMetal.Text = "" + End If + End If + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frx new file mode 100644 index 0000000..e17822c Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPlansbak.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frm new file mode 100644 index 0000000..12e1d67 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frm @@ -0,0 +1,807 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPosPayC + Caption = "Casa Rica PosPay Info" + ClientHeight = 4425 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8955 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4425 + ScaleWidth = 8955 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtNAME + Height = 315 + Left = 6765 + TabIndex = 22 + Top = 2550 + Width = 2130 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6270 + TabIndex = 21 + Top = 3420 + Width = 1275 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7620 + TabIndex = 20 + Top = 2925 + Width = 1275 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 7695 + MaxLength = 10 + TabIndex = 1 + Top = 45 + Width = 1200 + End + Begin VB.TextBox txtUser + Enabled = 0 'False + Height = 315 + Left = 7695 + TabIndex = 18 + Top = 2175 + Width = 1200 + End + Begin VB.TextBox txtSeq + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 7695 + TabIndex = 17 + Top = 1815 + Width = 1200 + End + Begin VB.TextBox txtSubDt + Enabled = 0 'False + Height = 315 + Left = 7695 + TabIndex = 16 + Top = 1470 + Width = 1200 + End + Begin VB.TextBox txtSearch + Height = 315 + Left = 3015 + TabIndex = 12 + Top = 150 + Width = 1200 + End + Begin VB.CommandButton cmdPrint + Caption = "Print List For 1 Seq #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6270 + TabIndex = 11 + Top = 2925 + Width = 1275 + End + Begin LpLib.fpList lstHeader + Height = 3675 + Left = 180 + TabIndex = 10 + Top = 585 + Width = 5985 + _Version = 196608 + _ExtentX = 10557 + _ExtentY = 6482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 7 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPosPayC.frx":0000 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7620 + TabIndex = 9 + Top = 3930 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7620 + TabIndex = 4 + Top = 3420 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 7695 + MaxLength = 10 + TabIndex = 5 + Top = 1110 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 7695 + MaxLength = 13 + TabIndex = 3 + Top = 765 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Enabled = 0 'False + Height = 315 + Left = 7695 + MaxLength = 10 + TabIndex = 2 + Top = 405 + Width = 1200 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 6270 + TabIndex = 23 + Top = 2610 + Width = 465 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Number: " + Height = 195 + Left = 6420 + TabIndex = 19 + Top = 120 + Width = 1155 + End + Begin VB.Label lblUser + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "User:" + Height = 195 + Left = 7200 + TabIndex = 15 + Top = 2235 + Width = 375 + End + Begin VB.Label lblSubDt + AutoSize = -1 'True + Caption = "Date Submitted:" + Height = 195 + Left = 6435 + TabIndex = 14 + Top = 1530 + Width = 1140 + End + Begin VB.Label lblSeq + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sequence #:" + Height = 195 + Left = 6645 + TabIndex = 13 + Top = 1875 + Width = 930 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amount: " + Height = 195 + Left = 6435 + TabIndex = 8 + Top = 825 + Width = 1140 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Bank #" + Height = 195 + Left = 6660 + TabIndex = 7 + Top = 1170 + Width = 915 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date: " + Height = 195 + Left = 6630 + TabIndex = 6 + Top = 465 + Width = 945 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Enter Check Number To Search:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 0 + Top = 180 + Width = 2775 + End +End +Attribute VB_Name = "frmPosPayC" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' If cboAPCode.ListIndex = -1 Then + strSQL = "SELECT * FROM tblPosPayCRD ORDER BY CKDate Desc " 'WHERE vendornumber = '" & strVend & "'" ' and not done" +' Else +' cboAPCode.col = 1 +' strVend = cboAPCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" +' strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" +' End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!PPID) & vbTab & Field2Str(oRS!CKNumber) & vbTab & " " & Trim(Field2Str(oRS!Name)) & vbTab & Format(Field2Str(oRS!CKDate), "MM/DD/YYYY") & vbTab + strLine = strLine & Format(Field2Str(oRS!CKAmt), "#,#.00") & vbTab & Field2Str(oRS!Acct) & vbTab & Field2Str(oRS!sequence) +' strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 +' strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + +' strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\PosPayNEWCR.rpt" +' crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form PosPayS - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdDelete.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + cmdDelete.Enabled = False + cmdADD.Enabled = True + cmdSave.Enabled = False + lstHeader.Enabled = True +End Sub + +Private Sub Form_Load() + + Call HeaderLoad +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail + txtInvDate = Field2Str(moRSHeader!CKNumber) + txtDueDate = Field2Str(moRSHeader!CKDate) + txtSalesCode = Format(Field2Str2(moRSHeader!CKAmt), "#,#,#.00") + txtItemAmt = Field2Str(moRSHeader!Acct) + txtSubDt = Field2Str(moRSHeader!SubDate) + txtSeq = Field2Str(moRSHeader!sequence) + txtUser = Field2Str(moRSHeader!User) + txtName = Field2Str(moRSHeader!Name) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +' mboolbookmark = lstEmpList.ListIndex + txtInvDate.Enabled = True + txtDueDate.Enabled = True + txtSalesCode.Enabled = True + lstHeader.Enabled = False + cmdADD.Enabled = False + cmdDelete.Enabled = False + cmdSave.Enabled = True + Call FormClear +' txtDept.SetFocus +' lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub cmdDelete_Click() +Dim strYN As String, lngBOOKMARK As Long + If moRSHeader!Submit Then + MsgBox "You Cannot Delete A Check That Has Been Submitted", vbOKOnly, "Delete Not Allowed" + cmdDelete.Enabled = False + cmdADD.Enabled = True + cmdSave.Enabled = False + Exit Sub + End If + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + lngBOOKMARK = lstHeader.ListIndex + moRSHeader.Delete + Call HeaderLoad + If lstHeader.ListCount > 0 Then + If lstHeader.ListCount > lngBOOKMARK Then + lstHeader.ListIndex = lngBOOKMARK + lngBOOKMARK = 0 + Else + lstHeader.ListIndex = lngBOOKMARK - 1 + End If + End If + cmdDelete.Enabled = False + cmdADD.Enabled = True + cmdSave.Enabled = False +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, lngID As Long + On Error GoTo Error_EH + lstHeader.col = 0 + lngID = CLng(lstHeader.ColText) + strSQL = "SELECT * FROM tblPosPayCRD WHERE PPid = " & lngID 'lstDetail.ItemData(lstDetail.ListIndex) + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PosPayC - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstHeader_Click() +' If lstDetail.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If +' End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader + .AddNew + !CKNumber = Str2Field(txtInvDate) + !Name = Str2Field(txtName) + !CKDate = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) + !Acct = "7" + !CKAmt = Format(Str2Field(txtSalesCode), "0000000.00") + !Submit = False + .Update + End With + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayC - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + txtSubDt = "" + txtSeq = "" + txtUser = "" + txtName = "" + +End Sub + +Private Sub lstHeader_DblClick() + cmdDelete.Enabled = True + cmdADD.Enabled = False +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If +' txtDueDate = UCase(txtDueDate) + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtNAME_GotFocus() + Call FieldSelect(txtName) +End Sub + +Private Sub txtNAME_LostFocus() + txtName = UCase(txtName) +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() +Dim intLEN As Integer, strMSG As String + txtSalesCode = Format((txtSalesCode), "0000000.00") + intLEN = Len(txtSalesCode) + If intLEN > 10 Then + strMSG = "Number Must 10 Digits Or Less Including The '.'" + strMSG = strMSG & vbCrLf & vbCrLf & "ReEnter as #######.##" +' msgbox (strmsg,vbOKOnly,"ReEnter The Amount") + MsgBox strMSG, vbOKOnly, "ReEnter The Amount" + txtSalesCode = "" + txtSalesCode.SetFocus + End If +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. + lstHeader.ColumnSearch = 1 + lstHeader.SearchText = txtSearch.Text + lstHeader.SearchMethod = SearchMethodGreaterOrEqual + + lstHeader.Action = ActionSearch +' lstHeader.SearchIndex = -1 + + If lstHeader.SearchIndex <> -1 Then + lstHeader.TopIndex = lstHeader.SearchIndex + lstHeader.ListIndex = lstHeader.SearchIndex + Else + lstHeader.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_LostFocus() + txtSearch = "" +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frx new file mode 100644 index 0000000..90954ab Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayC.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frm new file mode 100644 index 0000000..c2b47e7 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frm @@ -0,0 +1,780 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPosPayS + Caption = "SuperWall PosPay Info" + ClientHeight = 4215 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6990 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4215 + ScaleWidth = 6990 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4260 + TabIndex = 21 + Top = 3090 + Width = 1275 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5595 + TabIndex = 20 + Top = 2505 + Width = 1275 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 1 + Top = 15 + Width = 1200 + End + Begin VB.TextBox txtUser + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 18 + Top = 2145 + Width = 1200 + End + Begin VB.TextBox txtSeq + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 17 + Top = 1785 + Width = 1200 + End + Begin VB.TextBox txtSubDt + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 16 + Top = 1440 + Width = 1200 + End + Begin VB.TextBox txtSearch + Height = 315 + Left = 3015 + TabIndex = 12 + Top = 150 + Width = 1200 + End + Begin VB.CommandButton cmdPrint + Caption = "Print List For 1 Seq #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4260 + TabIndex = 11 + Top = 2505 + Width = 1275 + End + Begin LpLib.fpList lstHeader + Height = 3480 + Left = 180 + TabIndex = 10 + Top = 585 + Width = 4035 + _Version = 196608 + _ExtentX = 7117 + _ExtentY = 6138 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPosPayS.frx":0000 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5610 + TabIndex = 9 + Top = 3675 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5595 + TabIndex = 4 + Top = 3090 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 5 + Top = 1080 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 13 + TabIndex = 3 + Top = 735 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 2 + Top = 375 + Width = 1200 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Number: " + Height = 195 + Left = 4410 + TabIndex = 19 + Top = 90 + Width = 1155 + End + Begin VB.Label lblUser + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "User:" + Height = 195 + Left = 5190 + TabIndex = 15 + Top = 2205 + Width = 375 + End + Begin VB.Label lblSubDt + AutoSize = -1 'True + Caption = "Date Submitted:" + Height = 195 + Left = 4425 + TabIndex = 14 + Top = 1500 + Width = 1140 + End + Begin VB.Label lblSeq + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sequence #:" + Height = 195 + Left = 4635 + TabIndex = 13 + Top = 1845 + Width = 930 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amount: " + Height = 195 + Left = 4425 + TabIndex = 8 + Top = 795 + Width = 1140 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Bank #" + Height = 195 + Left = 4650 + TabIndex = 7 + Top = 1140 + Width = 915 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date: " + Height = 195 + Left = 4620 + TabIndex = 6 + Top = 435 + Width = 945 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Enter Check Number To Search:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 0 + Top = 180 + Width = 2775 + End +End +Attribute VB_Name = "frmPosPayS" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' If cboAPCode.ListIndex = -1 Then + strSQL = "SELECT * FROM tblPosPaySWI ORDER BY CKDate Desc " 'WHERE vendornumber = '" & strVend & "'" ' and not done" +' Else +' cboAPCode.col = 1 +' strVend = cboAPCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" +' strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" +' End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!PPID) & vbTab & Field2Str(oRS!CKNumber) & vbTab & Format(Field2Str(oRS!CKDate), "MM/DD/YYYY") & vbTab + strLine = strLine & Format(Field2Str(oRS!CKAmt), "#,#.00") & vbTab & Field2Str(oRS!Acct) & vbTab & Field2Str(oRS!sequence) +' strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 +' strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + +' strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\PosPayNEWSW.rpt" +' crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form PosPayS - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdDelete.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False + lstHeader.Enabled = True +End Sub + +Private Sub Form_Load() + + Call HeaderLoad +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail + txtInvDate = Field2Str(moRSHeader!CKNumber) + txtDueDate = Field2Str(moRSHeader!CKDate) + txtSalesCode = Format(Field2Str2(moRSHeader!CKAmt), "#,#,#.00") + txtItemAmt = Field2Str(moRSHeader!Acct) + txtSubDt = Field2Str(moRSHeader!SubDate) + txtSeq = Field2Str(moRSHeader!sequence) + txtUser = Field2Str(moRSHeader!User) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +' mboolbookmark = lstEmpList.ListIndex + txtInvDate.Enabled = True + txtDueDate.Enabled = True + txtSalesCode.Enabled = True + lstHeader.Enabled = False + cmdAdd.Enabled = False + cmdDelete.Enabled = False + cmdSave.Enabled = True + Call FormClear +' txtDept.SetFocus +' lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub cmdDelete_Click() +Dim strYN As String, lngBOOKMARK As Long + If moRSHeader!Submit Then + MsgBox "You Cannot Delete A Check That Has Been Submitted", vbOKOnly, "Delete Not Allowed" + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False + Exit Sub + End If + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + lngBOOKMARK = lstHeader.ListIndex + moRSHeader.Delete + Call HeaderLoad + If lstHeader.ListCount > 0 Then + If lstHeader.ListCount > lngBOOKMARK Then + lstHeader.ListIndex = lngBOOKMARK + lngBOOKMARK = 0 + Else + lstHeader.ListIndex = lngBOOKMARK - 1 + End If + End If + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, lngID As Long + On Error GoTo Error_EH + lstHeader.col = 0 + lngID = CLng(lstHeader.ColText) + strSQL = "SELECT * FROM tblPosPaySWI WHERE PPid = " & lngID 'lstDetail.ItemData(lstDetail.ListIndex) + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PosPayS - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstHeader_Click() +' If lstDetail.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If +' End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader + .AddNew + !CKNumber = Str2Field(txtInvDate) + !CKDate = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) + !Acct = "7" + !CKAmt = Format(Str2Field(txtSalesCode), "0000000.00") + !Submit = False + .Update + End With + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayS - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + txtSubDt = "" + txtSeq = "" + txtUser = "" + +End Sub + +Private Sub lstHeader_DblClick() + cmdDelete.Enabled = True + cmdAdd.Enabled = False +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If +' txtDueDate = UCase(txtDueDate) + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() +Dim intLEN As Integer, strMSG As String + txtSalesCode = Format((txtSalesCode), "0000000.00") + intLEN = Len(txtSalesCode) + If intLEN > 10 Then + strMSG = "Number Must 10 Digits Or Less Including The '.'" + strMSG = strMSG & vbCrLf & vbCrLf & "ReEnter as #######.##" +' msgbox (strmsg,vbOKOnly,"ReEnter The Amount") + MsgBox strMSG, vbOKOnly, "ReEnter The Amount" + txtSalesCode = "" + txtSalesCode.SetFocus + End If +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. + lstHeader.ColumnSearch = 1 + lstHeader.SearchText = txtSearch.Text + lstHeader.SearchMethod = SearchMethodExactMatch + + lstHeader.Action = ActionSearch +' lstHeader.SearchIndex = -1 + + If lstHeader.SearchIndex <> -1 Then + lstHeader.TopIndex = lstHeader.SearchIndex + lstHeader.ListIndex = lstHeader.SearchIndex + Else + lstHeader.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_LostFocus() + txtSearch = "" + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frx new file mode 100644 index 0000000..012c8c9 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayS.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frm new file mode 100644 index 0000000..e01c1fd --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frm @@ -0,0 +1,908 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPosPayS + Caption = "SuperWall Manufacturing PosPay Information" + ClientHeight = 5310 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5310 + ScaleWidth = 8880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrint + Caption = "Print List W/ No JC#" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6120 + TabIndex = 14 + Top = 4215 + Width = 1275 + End + Begin LpLib.fpCombo cboAPCode + Height = 315 + Left = 4830 + TabIndex = 12 + Top = 150 + Width = 4035 + _Version = 196608 + _ExtentX = 7117 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 0 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmPosPayS.frx":0000 + End + Begin LpLib.fpList lstHeader + Height = 4650 + Left = 180 + TabIndex = 11 + Top = 600 + Width = 5880 + _Version = 196608 + _ExtentX = 10372 + _ExtentY = 8202 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPosPayS.frx":03A3 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6120 + TabIndex = 10 + Top = 4755 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7590 + TabIndex = 9 + Top = 4755 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 4 + Top = 1980 + Visible = 0 'False + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 7 + TabIndex = 3 + Top = 1560 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 2 + Top = 1140 + Width = 1200 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 7665 + MaxLength = 10 + TabIndex = 1 + Top = 720 + Width = 1200 + End + Begin VB.Label lblLOAD + Alignment = 2 'Center + BackColor = &H00C0FFFF& + Caption = "Loading Invoices -- Patience" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 750 + Left = 6120 + TabIndex = 13 + Top = 3420 + Visible = 0 'False + Width = 2745 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Amount:" + Height = 195 + Left = 6390 + TabIndex = 8 + Top = 1650 + Width = 1155 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Item Amount:" + Height = 195 + Left = 6630 + TabIndex = 7 + Top = 2085 + Visible = 0 'False + Width = 930 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Job Cost Number:" + Height = 195 + Left = 6285 + TabIndex = 6 + Top = 1245 + Width = 1260 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice #:" + Height = 195 + Left = 6825 + TabIndex = 5 + Top = 810 + Width = 720 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Vendor's CMS AP Code:" + Height = 195 + Left = 2970 + TabIndex = 0 + Top = 240 + Width = 1815 + End +End +Attribute VB_Name = "frmPosPayS" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" + lblLOAD.Visible = True + DoEvents + If cboAPCode.ListIndex = -1 Then + strSQL = "SELECT * FROM APH_JobDistDetail " 'WHERE vendornumber = '" & strVend & "'" ' and not done" + Else + cboAPCode.col = 1 + strVend = cboAPCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" + strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" + End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader + strLine = Field2Str2(oRS!AP_ID) & vbTab & Field2Str(oRS!VendorNumber) & vbTab '& Field2Str(oRS!Name) & vbTab + strLine = strLine & Field2Str(oRS!InvoiceNumber) & vbTab & Field2Str(oRS!JobNumber) & vbTab + strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + lblLOAD.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboAPCode_Click() + lstHeader.Clear + Call HeaderLoad +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + cboAPCode.col = 1 + strCUST = cboAPCode.ColText + gintCOPY = 1 + strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' gstrPONUM = Field2Str(oRS!po_num) +' mstrPROJLOT = Field2Str(oRS!ProjLot) +' Call LotChange(mstrPROJLOT, "RePrint AR Invoice") + + strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\apblankJC.rpt" + crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARFix - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +' mintBOOKMARK = lstDetail.ListIndex + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK +' lstDetail.Enabled = True +' lstDetail.ListIndex = mintBOOKMARK + mintBOOKMARK = 0 +End Sub + +Private Sub Form_Load() + + Call APCodeLoad +' Call HeaderLoad +End Sub +'Private Sub ProjLoad() +'Dim strSQL As String +' On Error GoTo Error_EH + +' strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + +' Set moRSProj = New Recordset +' moRSProj.Open strSQL, goConn, _ +' adOpenForwardOnly, adLockReadOnly +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form APFix - Module ProjLoad" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +'End Sub +Private Sub APCodeLoad() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer, strLine As String +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblAPMaster" +' strSQL = "SELECT Bill_Id, Cust_no, Name FROM tblARMaster" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strLine = Field2Str2(oRS!Bill_ID) & vbTab & Field2Str(oRS!Cust_NO) & vbTab & Field2Str(oRS!Name) ' & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) & vbTab & Field2Str(oRS!Name) + cboAPCode.AddItem strLine +' cboARCode.ItemData(cboARCode.NewIndex) = Field2Long(oRS!bill_id) + oRS.MoveNext + Loop + oRS.Close +' cboAPCode.ListIndex = 0 + cboAPCode.ListIndex = -1 + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module APCodeLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail +' txtInvDate = Field2Str(!invoice_date) +' txtDueDate = Field2Str(!inv_due_date) +' txtItemAmt = Format(Field2Str2(!amount), "currency") +' txtSalesCode = Field2Str(!sales_code) +' txtTax = Field2Str(!taxcode) +' chkReady = Field2CheckBox(!ready) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + +' strSQL = "SELECT * " +' strSQL = strSQL & "FROM tblARInvoice " +' strSQL = strSQL & "WHERE trans_id = " & lstDetail.ItemData(lstDetail.ListIndex) +' Set moRSDetail = New Recordset +' moRSDetail.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + msglInvTotal = moRSHeader!non_tax_amt + mstrType = moRSHeader!inv_type +' gintPROJID = moRSHeader!proj_id +' Call ProjLoad + End If + Exit Function + +Error_EH: + gstrMODULE = "Form APFix - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstDetail_Click() +' If lstDetail.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If +' End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader +' !invoice_date = Str2Field(txtInvDate) + !JobNumber = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) +' !amount = Str2Field(txtItemAmt) +' !sales_code = Str2Field(txtSalesCode) + .Update + End With + +' strSQL = "SELECT sum(amount) as sgltotal FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID & " and not done" +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' msglInvTotal = Field2Str2(oRS!sglTOTAL) + +' strSQL = "SELECT * FROM tblARInvoice WHERE inv_type = '" & mstrType & "' and lot_id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + +' Do Until oRS.EOF +' With oRS +' !invoice_date = Str2Field(txtInvDate) +' !inv_due_date = Str2Field(txtDueDate) +' !ready = chkReady +' !non_tax_amt = msglInvTotal +' !taxcode = Str2Field(txtTax) +' If Field2Str2(moRSProj!retention) > 0 Then +' !retention_amt = Format(((msglInvTotal * Field2Str2(moRSProj!retention) / 100)), "#.00") +' Else +' !retention_amt = 0 +' End If +' .Update +' End With +' oRS.MoveNext +' Loop + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstHeader.ListCount = 0 Then +' intResponse = MsgBox("No Invoices For This Builder - Select A Different Builder.", vbExclamation + vbOKOnly, "Exit Form") +' Unload Me +' End If +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" +' chkReady = vbUnchecked +End Sub + +Private Sub lstDetail_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub lstHeader_Click() +Dim strSQL As String, oRS As Recordset +Dim strID As String + + On Error GoTo Error_EH + If lstHeader.ListIndex <> -1 Then + lstHeader.col = 0 + strID = lstHeader.ColText + strSQL = "SELECT * FROM APH_JobDistDetail WHERE ap_id = " & strID + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not moRSHeader.EOF Then + txtSalesCode = Format(Field2Str(moRSHeader!distributionamount), "#,#.00") + txtDueDate = Field2Str(moRSHeader!JobNumber) + txtInvDate = Field2Str(moRSHeader!InvoiceNumber) + Else + txtSalesCode = "" + txtDueDate = "" + txtInvDate = "" + End If + txtDueDate.SetFocus + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form APFix - Module lstHeader_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstHeader_DblClick() + cmdSave.Enabled = True + txtDueDate.SetFocus +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + +' lngPOS = InStr(1, txtDueDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtDueDate) > 0 Then +' txtDueDate = Format(txtDueDate, "00/00/####") +' If Not IsDate(txtDueDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtDueDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtDueDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtDueDate.SetFocus +' End If + txtDueDate = UCase(txtDueDate) + +End Sub + +'Private Sub txtInvDate_GotFocus() +' Call FieldSelect(txtInvDate) +'End Sub + +'Private Sub txtInvDate_LostFocus() +'Dim lngPOS As Long + +' lngPOS = InStr(1, txtInvDate, "/", 1) +' If lngPOS = 0 Then +' If Len(txtInvDate) > 0 Then +' txtInvDate = Format(txtInvDate, "00/00/####") +' If Not IsDate(txtInvDate) Then +' MsgBox "The Date You Entered is not Valid - ReEnter" +' txtInvDate.SetFocus +' End If +' End If +' ElseIf IsDate(txtInvDate) Then +' Exit Sub +' Else +' MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" +' txtInvDate.SetFocus +' End If + +'End Sub + +'Private Sub txtItemAmt_GotFocus() +' Call FieldSelect(txtItemAmt) +' msglItemAmt = Single2Field(txtItemAmt) +'End Sub + +'Private Sub txtItemAmt_LostFocus() +' If msglItemAmt < Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal + Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt > Field2Str2(txtItemAmt) Then +' msglInvTotal = msglInvTotal - Field2Str2(txtItemAmt) +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' ElseIf msglItemAmt = Field2Str(txtItemAmt) Then +' txtItemAmt = Format(txtItemAmt, "#,#.00") +' End If +'End Sub + +'Private Sub txtSalesCode_GotFocus() +' Call FieldSelect(txtSalesCode) +'End Sub + +'Private Sub txtSalesCode_LostFocus() +' txtSalesCode = UCase(txtSalesCode) +'End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frx new file mode 100644 index 0000000..5e3d315 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPaySxx.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frm new file mode 100644 index 0000000..9304d81 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frm @@ -0,0 +1,884 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmPosPayV + Caption = "Valley Wide PosPay Info" + ClientHeight = 4365 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6990 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4365 + ScaleWidth = 6990 + StartUpPosition = 3 'Windows Default + Begin MSComCtl2.DTPicker dtStart + Height = 300 + Left = 2730 + TabIndex = 23 + Top = 4065 + Width = 1230 + _ExtentX = 2170 + _ExtentY = 529 + _Version = 393216 + Format = 86507521 + CurrentDate = 43425 + End + Begin VB.CommandButton cmdPrint2 + Caption = "Print List W/ Name" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4260 + TabIndex = 22 + Top = 3675 + Width = 1275 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4260 + TabIndex = 21 + Top = 3090 + Width = 1275 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5595 + TabIndex = 20 + Top = 2505 + Width = 1275 + End + Begin VB.TextBox txtInvDate + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 1 + Top = 15 + Width = 1200 + End + Begin VB.TextBox txtUser + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 18 + Top = 2145 + Width = 1200 + End + Begin VB.TextBox txtSeq + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 17 + Top = 1785 + Width = 1200 + End + Begin VB.TextBox txtSubDt + Enabled = 0 'False + Height = 315 + Left = 5685 + TabIndex = 16 + Top = 1440 + Width = 1200 + End + Begin VB.TextBox txtSearch + Height = 315 + Left = 3015 + TabIndex = 12 + Top = 150 + Width = 1200 + End + Begin VB.CommandButton cmdPrint + Caption = "Print List For 1 Seq #" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4260 + TabIndex = 11 + Top = 2505 + Width = 1275 + End + Begin LpLib.fpList lstHeader + Height = 3480 + Left = 180 + TabIndex = 10 + Top = 585 + Width = 4035 + _Version = 196608 + _ExtentX = 7117 + _ExtentY = 6138 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 300 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmPosPayV.frx":0000 + End + Begin Crystal.CrystalReport crAR + Left = 165 + Top = 60 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5610 + TabIndex = 9 + Top = 3675 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5595 + TabIndex = 4 + Top = 3075 + Width = 1275 + End + Begin VB.TextBox txtItemAmt + Alignment = 2 'Center + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 5 + Top = 1080 + Width = 1200 + End + Begin VB.TextBox txtSalesCode + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 13 + TabIndex = 3 + Top = 735 + Width = 1200 + End + Begin VB.TextBox txtDueDate + Enabled = 0 'False + Height = 315 + Left = 5685 + MaxLength = 10 + TabIndex = 2 + Top = 375 + Width = 1200 + End + Begin VB.Label lblLOAD + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "LOADING" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 225 + Left = 90 + TabIndex = 25 + Top = 4140 + Visible = 0 'False + Width = 1275 + End + Begin VB.Label lblStart + Alignment = 1 'Right Justify + Caption = "Starting Date:" + Height = 255 + Left = 1530 + TabIndex = 24 + Top = 4110 + Width = 1155 + End + Begin VB.Label lblInvDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Number: " + Height = 195 + Left = 4410 + TabIndex = 19 + Top = 90 + Width = 1155 + End + Begin VB.Label lblUser + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "User:" + Height = 195 + Left = 5190 + TabIndex = 15 + Top = 2205 + Width = 375 + End + Begin VB.Label lblSubDt + AutoSize = -1 'True + Caption = "Date Submitted:" + Height = 195 + Left = 4425 + TabIndex = 14 + Top = 1500 + Width = 1140 + End + Begin VB.Label lblSeq + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sequence #:" + Height = 195 + Left = 4635 + TabIndex = 13 + Top = 1845 + Width = 930 + End + Begin VB.Label lblSalesCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Amount: " + Height = 195 + Left = 4425 + TabIndex = 8 + Top = 795 + Width = 1140 + End + Begin VB.Label lblItemAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Bank #" + Height = 195 + Left = 4650 + TabIndex = 7 + Top = 1140 + Width = 915 + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Check Date: " + Height = 195 + Left = 4620 + TabIndex = 6 + Top = 435 + Width = 945 + End + Begin VB.Label lblARCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Enter Check Number To Search:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 0 + Top = 180 + Width = 2775 + End +End +Attribute VB_Name = "frmPosPayV" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSHeader As Recordset +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String +Dim mstrINVNO As String, mstrPROJLOT As String +Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer +Dim msglItemAmt As Single, msglInvTotal As Single + +Private Sub HeaderLoad() +Dim oRS As Recordset +Dim strSQL As String, strVend As String +'Dim strTYPE As String +Dim strLine As String + + On Error GoTo Error_EH + lblLOAD.Visible = True + DoEvents +' strTYPE = Trim(Left(cboARCode, 7)) +' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" +' If cboAPCode.ListIndex = -1 Then + strSQL = "SELECT * FROM tblPosPayVWP WHERE CKDate >= #" & dtStart.Value & "# ORDER BY CKDate DESC " ' and not done" +' Else +' cboAPCode.col = 1 +' strVend = cboAPCode.ColText + ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" +' strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" +' End If + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstHeader.Clear +' strTYPE = oRS.RecordCount + Do Until oRS.EOF + With lstHeader +'' strLine = Field2Str2(oRS!PPID) & vbTab & Field2Str(oRS!CKNumber) & vbTab & " " & Trim(Field2Str(oRS!Name)) & vbTab & Format(Field2Str(oRS!CKDate), "MM/DD/YYYY") & vbTab +'' strLine = strLine & Format(Field2Str(oRS!CKAmt), "#,#.00") & vbTab & Field2Str(oRS!Acct) & vbTab & Field2Str(oRS!sequence) + strLine = Field2Str2(oRS!PPID) & vbTab & Field2Str(oRS!CKNumber) & vbTab & Format(Field2Str(oRS!CKDate), "MM/DD/YYYY") & vbTab + strLine = strLine & Format(Field2Str(oRS!CKAmt), "#,#.00") & vbTab & Field2Str(oRS!Acct) & vbTab & Field2Str(oRS!sequence) +' strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Trans_ID +' .ItemData(.NewIndex) = oRS!Lot_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstHeader.ListCount Then + lstHeader.ListIndex = 0 + Else + gintLOTID = 0 + lstHeader.ListIndex = -1 +' cmdPrint.Enabled = False + End If + lblLOAD.Visible = False + DoEvents + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module HeaderLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrint_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + +' strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\PosPayNEW.rpt" +' crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ARFix - Module Print" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdPrint2_Click() +Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String + + On Error GoTo Error_EH + + gintCOPY = 1 + strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + +' strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" +' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" + crAR.ReportFileName = App.Path & "\PosPayVW.rpt" +' crAR.ReplaceSelectionFormula (strSELECT) +' crAR.CopiesToPrinter = gintCOPY + crAR.CopiesToPrinter = 1 + crAR.Destination = crptToWindow +' crar.Destination = crptToPrinter + crAR.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module Print2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub dtStart_CloseUp() + Call HeaderLoad +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then +' Call DataHasChanged + End If + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + If moRSHeader.State = adStateOpen Then + moRSHeader.Close + End If + Exit Sub + +Error_EH: + If Err.Number = 91 Then + Resume Next + End If + gstrMODULE = "Form Repair - Module Form QueryUnload" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + mintBOOK = lstHeader.ListIndex + cmdExit.Enabled = True + cmdSave.Enabled = False + cmdDelete.Enabled = False + Call FormSave + lstHeader.ListIndex = mintBOOK + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False + lstHeader.Enabled = True +End Sub + +Private Sub Form_Load() +' dtStart.Value = Date - 60 + dtStart.Value = Date - 30 + Call HeaderLoad + If gbytSECURITY < 3 Then + cmdPrint2.Enabled = True + End If +End Sub + +Private Sub FormShow() + On Error GoTo Error_EH + mboolSHOW = True + +' With moRSDetail + txtInvDate = Field2Str(moRSHeader!CKNumber) + txtDueDate = Field2Str(moRSHeader!CKDate) + txtSalesCode = Format(Field2Str2(moRSHeader!CKAmt), "#,#,#.00") + txtItemAmt = Field2Str(moRSHeader!Acct) + txtSubDt = Field2Str(moRSHeader!SubDate) + txtSeq = Field2Str(moRSHeader!sequence) + txtUser = Field2Str(moRSHeader!User) +' End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() +' mboolbookmark = lstEmpList.ListIndex + txtInvDate.Enabled = True + txtDueDate.Enabled = True + txtSalesCode.Enabled = True + lstHeader.Enabled = False + cmdAdd.Enabled = False + cmdDelete.Enabled = False + cmdSave.Enabled = True + Call FormClear +' txtDept.SetFocus +' lstEmpList.ListIndex = mintBOOKMARK +End Sub + +Private Sub cmdDelete_Click() +Dim strYN As String, lngBOOKMARK As Long + If moRSHeader!Submit Then + MsgBox "You Cannot Delete A Check That Has Been Submitted", vbOKOnly, "Delete Not Allowed" + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False + Exit Sub + End If + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + lngBOOKMARK = lstHeader.ListIndex + moRSHeader.Delete + Call HeaderLoad + If lstHeader.ListCount > 0 Then + If lstHeader.ListCount > lngBOOKMARK Then + lstHeader.ListIndex = lngBOOKMARK + lngBOOKMARK = 0 + Else + lstHeader.ListIndex = lngBOOKMARK - 1 + End If + End If + cmdDelete.Enabled = False + cmdAdd.Enabled = True + cmdSave.Enabled = False +End Sub + +Private Sub FormSave() +Dim strName As String + + On Error GoTo Error_EH + + Call FieldsSave + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, lngID As Long + On Error GoTo Error_EH + lstHeader.col = 0 + lngID = CLng(lstHeader.ColText) + strSQL = "SELECT * FROM tblPosPayVWP WHERE PPid = " & lngID 'lstDetail.ItemData(lstDetail.ListIndex) + Set moRSHeader = New Recordset + moRSHeader.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSHeader.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form PosPayV - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub lstHeader_Click() +' If lstDetail.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + + End If +' End If +End Sub + +Private Sub FieldsSave() +Dim strSQL As String +Dim oRS As Recordset, sglTOTAL As Single + + On Error GoTo Error_EH + + With moRSHeader + .AddNew + !CKNumber = Str2Field(txtInvDate) + !CKDate = Str2Field(txtDueDate) +' !price = Str2Field(txtItemAmt) + !Acct = "8" + !CKAmt = Format(Str2Field(txtSalesCode), "0000000.00") + !Submit = False + .Update + End With + + Call HeaderLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form PosPayV - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtInvDate = "" + txtDueDate = "" + txtSalesCode = "" + txtItemAmt = "" + txtSubDt = "" + txtSeq = "" + txtUser = "" + +End Sub + +Private Sub lstHeader_DblClick() + cmdDelete.Enabled = True + cmdAdd.Enabled = False +End Sub + +Private Sub txtDueDate_GotFocus() + Call FieldSelect(txtDueDate) +End Sub + +Private Sub txtDueDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtDueDate, "/", 1) + If lngPOS = 0 Then + If Len(txtDueDate) > 0 Then + txtDueDate = Format(txtDueDate, "00/00/####") + If Not IsDate(txtDueDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDueDate.SetFocus + End If + End If + ElseIf IsDate(txtDueDate) Then + Exit Sub + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtDueDate.SetFocus + End If +' txtDueDate = UCase(txtDueDate) + +End Sub + +Private Sub txtInvDate_GotFocus() + Call FieldSelect(txtInvDate) +End Sub + +Private Sub txtSalesCode_GotFocus() + Call FieldSelect(txtSalesCode) +End Sub + +Private Sub txtSalesCode_LostFocus() +Dim intLEN As Integer, strMSG As String + txtSalesCode = Format((txtSalesCode), "0000000.00") + intLEN = Len(txtSalesCode) + If intLEN > 10 Then + strMSG = "Number Must 10 Digits Or Less Including The '.'" + strMSG = strMSG & vbCrLf & vbCrLf & "ReEnter as #######.##" +' msgbox (strmsg,vbOKOnly,"ReEnter The Amount") + MsgBox strMSG, vbOKOnly, "ReEnter The Amount" + txtSalesCode = "" + txtSalesCode.SetFocus + End If +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. + lstHeader.ColumnSearch = 1 + lstHeader.SearchText = txtSearch.Text + lstHeader.SearchMethod = SearchMethodExactMatch + + lstHeader.Action = ActionSearch +' lstHeader.SearchIndex = -1 + + If lstHeader.SearchIndex <> -1 Then + lstHeader.TopIndex = lstHeader.SearchIndex + lstHeader.ListIndex = lstHeader.SearchIndex + Else + lstHeader.Action = 6 ' clear + End If + +End Sub + +Private Sub txtSearch_LostFocus() + txtSearch = "" + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frx new file mode 100644 index 0000000..27af2f4 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPosPayV.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPrint.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPrint.frm new file mode 100644 index 0000000..673ad30 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmPrint.frm @@ -0,0 +1,823 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmPrint + Caption = "Print Orders" + ClientHeight = 4650 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4440 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4650 + ScaleWidth = 4440 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtJobCost + Height = 285 + Left = 3540 + TabIndex = 21 + Top = 2580 + Visible = 0 'False + Width = 495 + End + Begin VB.TextBox txtNotes + Height = 1095 + Left = 60 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 6 + Top = 2940 + Width = 4275 + End + Begin VB.TextBox txtSupplier + Height = 285 + Left = 2280 + TabIndex = 19 + Top = 2340 + Visible = 0 'False + Width = 1095 + End + Begin VB.TextBox txtCopy + Height = 315 + Left = 1200 + TabIndex = 5 + Top = 2280 + Visible = 0 'False + Width = 315 + End + Begin VB.TextBox txtHeader + Alignment = 2 'Center + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 3000 + TabIndex = 17 + Top = 1980 + Visible = 0 'False + Width = 735 + End + Begin VB.PictureBox picFoam + AutoRedraw = -1 'True + AutoSize = -1 'True + Height = 1215 + Left = 2640 + ScaleHeight = 1155 + ScaleWidth = 1095 + TabIndex = 16 + Top = 645 + Visible = 0 'False + Width = 1155 + End + Begin Crystal.CrystalReport crPrint + Left = 1215 + Top = 4155 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtDelivery + Height = 315 + Left = 1200 + TabIndex = 4 + Top = 1920 + Visible = 0 'False + Width = 1275 + End + Begin VB.CheckBox chkPreOrder + Caption = "PreOrder" + Height = 375 + Left = 1200 + TabIndex = 3 + Top = 1440 + Visible = 0 'False + Width = 1335 + End + Begin VB.TextBox txtPO + Height = 315 + Left = 3840 + TabIndex = 14 + Top = 2160 + Visible = 0 'False + Width = 495 + End + Begin VB.TextBox txtDFlag + Height = 345 + Left = 3900 + TabIndex = 13 + Top = 1740 + Visible = 0 'False + Width = 375 + End + Begin VB.TextBox txtOrderDate + Height = 315 + Left = 1200 + MaxLength = 10 + TabIndex = 1 + Top = 660 + Width = 1275 + End + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3300 + TabIndex = 8 + Top = 4140 + Width = 1035 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 7 + Top = 4125 + Width = 1035 + End + Begin VB.TextBox txtMFlag + Height = 285 + Left = 3900 + TabIndex = 12 + Top = 1320 + Visible = 0 'False + Width = 375 + End + Begin VB.TextBox txtPONum + Height = 285 + Left = 120 + TabIndex = 11 + Top = 1320 + Visible = 0 'False + Width = 375 + End + Begin VB.ComboBox cboSupplier + Height = 315 + Left = 1200 + Sorted = -1 'True + Style = 2 'Dropdown List + TabIndex = 2 + Top = 1020 + Width = 2295 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes to Print On PO:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 120 + TabIndex = 20 + Top = 2700 + Width = 1860 + End + Begin VB.Label lblCopy + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Copies:" + Height = 195 + Left = 600 + TabIndex = 18 + Top = 2340 + Visible = 0 'False + Width = 525 + End + Begin VB.Label lblDelivery + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Cut Date:" + Height = 195 + Left = 15 + TabIndex = 15 + Top = 1980 + Visible = 0 'False + Width = 1110 + End + Begin VB.Label lblTitle + Alignment = 2 'Center + Caption = "Lath Order" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 60 + TabIndex = 10 + Top = 120 + Width = 4335 + End + Begin VB.Label lblSupplier + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supplier:" + Height = 195 + Left = 510 + TabIndex = 9 + Top = 1080 + Width = 615 + End + Begin VB.Label lblOrderDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Date:" + Height = 195 + Left = 120 + TabIndex = 0 + Top = 720 + Width = 1005 + End +End +Attribute VB_Name = "frmPrint" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mboolJPG As Boolean +Dim moRSOrders As Recordset +'Dim moRS As Recordset + +Private Sub SupplierLoad() +Dim oRS As Recordset +Dim strSQL As String, strFLAG As String + On Error GoTo Error_EH +'If needed to load suppliers for Wrap, changes will need to be done here + + If gstrTYPE = "Y" Then + strFLAG = "L" + ElseIf gstrTYPE = "S" Then + strFLAG = "S" + ElseIf gstrTYPE = "A" Then + strFLAG = "A" + End If + If gstrTYPE = "Y" And strFLAG = "L" And Not gstrFLAG = "P" Then + gstrTYPE = "S" + End If + strSQL = "SELECT * FROM tblSupplier where type = '" & strFLAG & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + cboSupplier.AddItem oRS!supplier + cboSupplier.ItemData(cboSupplier.NewIndex) = Field2Long(oRS!sup_no) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Print - Module SupplierLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboSupplier_Change() + If cboSupplier.ListIndex = -1 Then + Exit Sub + End If + If gstrFLAG = "P" And (cboSupplier.ItemData(cboSupplier.ListIndex) = 16 Or cboSupplier.ItemData(cboSupplier.ListIndex) = 15) Then + chkPreOrder.Visible = True + lblDelivery.Visible = True + txtDelivery.Visible = True + End If + If cboSupplier.ItemData(cboSupplier.ListIndex) = 18 Then + chkPreOrder.Visible = True + lblDelivery.Visible = True + txtDelivery.Visible = True + End If +End Sub + +Private Sub cboSupplier_Click() + If cboSupplier.ListIndex = -1 Then + Exit Sub + End If + If gstrFLAG = "P" And (cboSupplier.ItemData(cboSupplier.ListIndex) = 16 Or cboSupplier.ItemData(cboSupplier.ListIndex) = 15) Then + chkPreOrder.Visible = True + lblDelivery.Visible = True + txtDelivery.Visible = True + Else + chkPreOrder.Visible = False + lblDelivery.Visible = False + txtDelivery.Visible = False + chkPreOrder = vbUnchecked + txtDelivery = "" + End If +' If cboSupplier.ItemData(cboSupplier.ListIndex) = 18 Then +' chkPreOrder.Visible = True +' lblDelivery.Visible = True +' txtDelivery.Visible = True +' Else +' chkPreOrder.Visible = False +' lblDelivery.Visible = False +' txtDelivery.Visible = False +' chkPreOrder = vbUnchecked +' txtDelivery = "" +' End If +End Sub + +Private Sub cboSupplier_LostFocus() + If cboSupplier.ListIndex = -1 Then + Exit Sub + End If + If gstrFLAG = "P" And (cboSupplier.ItemData(cboSupplier.ListIndex) = 16 Or cboSupplier.ItemData(cboSupplier.ListIndex) = 15) Then + chkPreOrder.Visible = True + lblDelivery.Visible = True + txtDelivery.Visible = True + Else + chkPreOrder.Visible = False + lblDelivery.Visible = False + txtDelivery.Visible = False + chkPreOrder = vbUnchecked + txtDelivery = "" + End If +End Sub + +Private Sub chkPreOrder_Click() + If chkPreOrder = vbChecked Then + lblDelivery.Visible = False + txtDelivery.Visible = False + End If +End Sub + +Private Sub chkPreOrder_LostFocus() + If chkPreOrder = vbChecked Then + lblDelivery.Visible = False + txtDelivery.Visible = False + End If +End Sub + +Private Sub cmdCancel_Click() + gboolPRINT = False + Unload Me +End Sub + +Private Sub cmdPrint_Click() + + + On Error GoTo Error_EH + If Not IsDate(txtOrderDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtOrderDate.SetFocus + Exit Sub + End If + Call FormSave + If cboSupplier.ListIndex <> -1 Then + If gstrFLAG = "P" And (cboSupplier.ItemData(cboSupplier.ListIndex) = 16 Or cboSupplier.ItemData(cboSupplier.ListIndex) = 15) Then +' If gintCOCODE = 0 Then + Call FoamPrint +' ElseIf gintCOCODE = 1 Then +' Call FoamPrint +' End If + ' moRS!y_flg = "P" + ' moRS.Update + gboolPRINT = False + Unload Me + Exit Sub + End If + If cboSupplier.ItemData(cboSupplier.ListIndex) = 18 Or cboSupplier.ItemData(cboSupplier.ListIndex) = 17 Then + Call YardPrint + ' moRS!y_flg = "P" + ' moRS.Update + gboolPRINT = False + Unload Me + Exit Sub + End If + End If + Unload Me + Exit Sub +Error_EH: + gstrMODULE = gstrMODULE & " Form Print - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" +' cmdExit.Enabled = True + Exit Sub +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + + If gstrFLAG = "A" Then + lblTitle.Caption = "SAND ORDER" + ElseIf gstrFLAG = "T" Then + lblTitle.Caption = "TEXTURE ORDER" + ElseIf gstrFLAG = "S" Then + lblTitle.Caption = "SCRATCH ORDER" + ElseIf gstrFLAG = "B" Then + lblTitle.Caption = "BROWN ORDER" + ElseIf gstrFLAG = "P" Then + lblTitle.Caption = "MATERIALS PREORDER" + ElseIf gstrFLAG = "V" Then + lblTitle.Caption = "STONE VENEER ORDER" + ElseIf gstrFLAG = "R" Then + lblTitle.Caption = "SPECIAL PURCHASE ORDER" + ElseIf gstrFLAG = "W" Then + lblTitle.Caption = "WRAP ORDER" + ElseIf gstrFLAG = "E" Then + lblTitle.Caption = "SYNTHETIC ORDER" + ElseIf gstrFLAG = "Z" Then + lblTitle.Caption = "PRE-CAST ORDER" + End If + + txtCopy = gintCOPY + Call SupplierLoad + If gstrPO <> "L" Then 'Need to decide if this needs to address W also + cboSupplier.Visible = False + lblSupplier.Visible = False + lblCopy.Visible = True + txtCopy.Visible = True + End If +End Sub + +Private Sub FormSave() +Dim strSQL As String, mdblORDAMT As Double, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset +Dim strPRICE As String, strDate As String + + On Error GoTo Error_EH + gstrPONUM = "" + If txtMFlag = "Z" Then + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and M_Type = '" & Str2Field(txtMFlag) & "'" + Else + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and M_Type = '" & Str2Field(txtMFlag) & "'" + End If + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + If Not oRSS.EOF Then + If Not cboSupplier.ListIndex = -1 Then + strSQL = "SELECT inv_no, price, sup_no FROM tblINVPrice WHERE Sup_no = " & cboSupplier.ItemData(cboSupplier.ListIndex) + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + End If + End If + oRSS.Close + + strSELECT = "SELECT SUM(qty*price) as SUMORDER FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and M_Type = '" & Str2Field(txtMFlag) & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + mdblORDAMT = Field2Str2(oRS!sumorder) + + strSQL = "SELECT * FROM tblOrders WHERE lot_id = 1" + Set moRSOrders = New Recordset + moRSOrders.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + moRSOrders.AddNew + moRSOrders!Lot_ID = gintLOTID + If gstrPO = "L" Then + moRSOrders!supplier = Str2Field(cboSupplier.List(cboSupplier.ListIndex)) + ElseIf gstrPO = "W" Then + moRSOrders!supplier = "SUPERWALL INC." + Else + moRSOrders!supplier = Field2Str(txtSupplier) + End If + moRSOrders!order_date = Str2Field(txtOrderDate) + If moRSOrders!PrintDate = "01/01/2000" Or IsNull(moRSOrders!PrintDate) Then + strDate = Date + moRSOrders!PrintDate = Date + End If + If gstrFLAG = "L" Then + moRSOrders!Print = vbChecked + End If + moRSOrders!M_Type = gstrFLAG + If gstrFLAG = "Z" Then + moRSOrders!d_flag = "Y" + Else + moRSOrders!d_flag = Str2Field(txtDFlag) + End If + moRSOrders!PO_Num = Str2Field(txtPONum) + moRSOrders!ponum = Str2Field(txtPO) + moRSOrders!orderamt = Format(Round(mdblORDAMT, 2), "#,#.00") + moRSOrders!notes = Str2Field(txtNotes) + moRSOrders!percentage = gintPERCENT + moRSOrders!jobcost = Field2Str(txtJobCost) + If chkPreOrder Then + moRSOrders!preorder = vbChecked + moRSOrders!foam = vbChecked + End If + If IsDate(txtDelivery) Then + moRSOrders!cut_date = Str2Field(txtDelivery) + End If + moRSOrders.Update + + gstrPONUM = Str2Field(txtPONum) + + strSELECT = "SELECT MAX(Order_id) as MAXORDER FROM tblOrders" ' WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and M_Type = '" & Str2Field(txtMFlag) & "'" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + glngORDERID = Field2Str2(oRS!MAXOrder) + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOrders.ActiveConnection) + Exit Sub +End Sub + +Private Sub picFoam_Change() + mboolJPG = True +End Sub + +Private Sub txtCopy_GotFocus() + Call FieldSelect(txtCopy) +End Sub + +Private Sub txtCopy_LostFocus() + gintCOPY = Field2Integer(txtCopy) +End Sub + +Private Sub txtDelivery_GotFocus() + Call FieldSelect(txtDelivery) +End Sub + +Private Sub txtDelivery_LostFocus() + If IsDate(txtDelivery) Then + Exit Sub + End If + If Len(txtDelivery) > 0 Then + txtDelivery = Format(txtDelivery, "00/##/####") + If Not IsDate(txtDelivery) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtDelivery.SetFocus + ElseIf CDate(txtDelivery) < Date Then + MsgBox "The Date You Entered is Earlier Than Today - ReEnter" + txtDelivery.SetFocus + End If + End If +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtOrderDate_GotFocus() + + Call FieldSelect(txtOrderDate) +End Sub + +Private Sub txtOrderDate_LostFocus() + If IsDate(txtOrderDate) Then + Exit Sub + End If + If Len(txtOrderDate) > 0 Then + txtOrderDate = Format(txtOrderDate, "00/##/####") + If Not IsDate(txtOrderDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtOrderDate.SetFocus + ElseIf CDate(txtOrderDate) < Date Then + MsgBox "The Date You Entered is Earlier Than Today - ReEnter" + txtOrderDate.SetFocus + End If + End If +End Sub + +Private Sub FoamPrint() +Dim strSQL As String +Dim strSELECT As String, oRSS As Recordset + + On Error GoTo Error_EH: + + If gintCOCODE = 0 Then + If txtPO = 0 Then + crPrint.ReportFileName = App.Path & "\FoamPreOrder.rpt" + strSQL = "{tblLOTMATRL.LOT_ID} = " & gintLOTID + Else + crPrint.ReportFileName = App.Path & "\FoamPreOrder2.rpt" + strSQL = "{tblPOrder.PONum} = " & CInt(txtPO) + End If + ElseIf gintCOCODE = 1 Then + If txtPO = 0 Then + crPrint.ReportFileName = App.Path & "\FoamPreOrderM.rpt" + strSQL = "{tblLOTMATRL.LOT_ID} = " & gintLOTID + Else + crPrint.ReportFileName = App.Path & "\FoamPreOrder2M.rpt" + strSQL = "{tblPOrder.PONum} = " & CInt(txtPO) + End If + End If + crPrint.ReplaceSelectionFormula (strSQL) + crPrint.CopiesToPrinter = 1 +' crPrint.Destination = crptToWindow + crPrint.Destination = crptToPrinter + If chkPreOrder Then + crPrint.Formulas(0) = "datestring = 'DATE TO CUT: '" + crPrint.Formulas(1) = "datevalue = 'PREORDER'" + crPrint.Formulas(2) = "PO = '" & gstrPONUM & "'" + crPrint.Formulas(3) = "title = 'FOAM CUT SHEET'" + Else + crPrint.Formulas(0) = "datestring = 'DATE TO CUT: '" + crPrint.Formulas(1) = "datevalue = '" & txtDelivery & "'" + crPrint.Formulas(2) = "PO = '" & gstrPONUM & "'" + crPrint.Formulas(3) = "title = 'FOAM CUT SHEET'" + End If + crPrint.Action = 1 + + crPrint.Reset + If gintCOCODE = 0 Then + If txtPO = 0 Then + crPrint.ReportFileName = App.Path & "\FoamPreOrder.rpt" + strSQL = "{tblLOTMATRL.LOT_ID} = " & gintLOTID + Else + crPrint.ReportFileName = App.Path & "\FoamPreOrder2.rpt" + strSQL = "{tblPOrder.PONum} = " & CInt(txtPO) + End If + ElseIf gintCOCODE = 1 Then + If txtPO = 0 Then + crPrint.ReportFileName = App.Path & "\FoamPreOrderM.rpt" + strSQL = "{tblLOTMATRL.LOT_ID} = " & gintLOTID + Else + crPrint.ReportFileName = App.Path & "\FoamPreOrder2M.rpt" + strSQL = "{tblPOrder.PONum} = " & CInt(txtPO) + End If + End If +' If txtPO = 0 Then +' crPrint.ReportFileName = App.Path & "\FoamPreOrder.rpt" +' Else +' crPrint.ReportFileName = App.Path & "\FoamPreOrder2.rpt" +' End If +' crPrint.ReportFileName = App.Path & "\FoamPreOrder.rpt" + crPrint.ReplaceSelectionFormula (strSQL) + crPrint.CopiesToPrinter = 1 +' crPrint.Destination = crptToWindow + crPrint.Destination = crptToPrinter + crPrint.Formulas(0) = "datestring = 'DATE TO DELIVER: '" + crPrint.Formulas(1) = "datevalue = ' '" + crPrint.Formulas(2) = "PO = '" & gstrPONUM & "'" + crPrint.Formulas(3) = "title = 'FOAM DELIVERY SHEET'" + crPrint.Action = 1 + +' PrintJPG + + If txtPO <> 0 Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & CInt(txtPO) ' & " and p_flg <> 'P'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + oRSS!p_flg = "P" + oRSS.Update + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Print - Module FoamPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub YardPrint() +Dim strSQL As String, mdblORDAMT As Double, strSELECT As String +Dim oRS As Recordset, oRSS As Recordset +Dim strPRICE As String +Dim strYARD As String + + On Error GoTo Error_EH: + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = 1" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + strYARD = "SELECT * FROM tblPOrdMat WHERE ponum = " & CInt(txtPO) + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!PO_Num = gstrPONUM + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + oRS.Close + oRSS.Close + + If gintCOCODE = 0 Then + crPrint.ReportFileName = App.Path & "\POYard.rpt" + ElseIf gintCOCODE = 1 Then + crPrint.ReportFileName = App.Path & "\POYardM.rpt" + End If + strSQL = "{tblPOrder.PONum} = " & CInt(txtPO) + crPrint.ReplaceSelectionFormula (strSQL) + crPrint.CopiesToPrinter = 1 +' crPrint.Destination = crptToWindow + crPrint.Destination = crptToPrinter + crPrint.Action = 1 + + crPrint.Reset + + If txtPO <> 0 Then + strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & CInt(txtPO) ' & " and p_flg <> 'P'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + oRSS!p_flg = "P" + oRSS.Update + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Print - Module YardPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub PrintJPG() +Dim strSQL As String, oRS As Recordset, strFile As String + +' On Error GoTo Error_EH: + +' mboolJPG = False +' If txtPO = 0 Then +' strSQL = "SELECT Inv_No, Lot_ID, d_flag, m_type FROM tblLotMatrl WHERE D_Flag = 'Y' and M_Type = 'P' and Lot_Id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' Else +' strSQL = "SELECT Inv_No, d_flag, m_type, PONum FROM tblPOrdMat where D_Flag = 'Y' and M_Type = 'P' and PONum = " & Field2Integer(txtPO) +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' End If + +' Do Until oRS.EOF +' strFile = "\pictures\" & Field2Str(oRS!inv_no) & ".JPG" +' If Not mboolJPG Then +' MsgBox "No Foam Diagram File Found", vbOKOnly, "No File" +' Exit Sub +' End If +' picFoam.Picture = LoadPicture(App.Path & strFile) +' txtHeader = "FOAM SHAPE " & Field2Str(oRS!inv_no) +' epFoam.Margin(epTop) = 1.5 +' Set epFoam.HeaderText = txtHeader +' Set epFoam.PictureSource = picFoam +' epFoam.epPrint +' oRS.MoveNext +' Loop +' Exit Sub + +'Error_EH: +' gstrMODULE = "Form Print - Module PrintJPG" +' Call ErrorHandler2 +' gstrMODULE = "" +' Exit Sub +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frm new file mode 100644 index 0000000..b407468 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frm @@ -0,0 +1,613 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmProjList + Caption = "Project List" + ClientHeight = 5250 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8460 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5250 + ScaleWidth = 8460 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtContains + Height = 315 + Left = 540 + TabIndex = 7 + Top = 4920 + Visible = 0 'False + Width = 4650 + End + Begin VB.CommandButton cmdSearch + Caption = "Search" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 3195 + TabIndex = 5 + Top = 4140 + Width = 900 + End + Begin VB.TextBox txtSearch + Height = 315 + Left = 15 + TabIndex = 4 + Top = 4920 + Width = 4890 + End + Begin VB.ComboBox cboSearch + Height = 315 + ItemData = "frmProjList.frx":0000 + Left = 855 + List = "frmProjList.frx":000D + Style = 2 'Dropdown List + TabIndex = 2 + Top = 4215 + Width = 2325 + End + Begin LpLib.fpList lstProj + Height = 3915 + Left = 60 + TabIndex = 1 + Top = 180 + Width = 8370 + _Version = 196608 + _ExtentX = 14764 + _ExtentY = 6906 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 285 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmProjList.frx":0033 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 4230 + TabIndex = 0 + TabStop = 0 'False + Top = 4140 + Width = 900 + End + Begin VB.Label lblInst + Caption = "High Light The Lot You Want And Then Double Click To Select It." + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 810 + Left = 5280 + TabIndex = 8 + Top = 4200 + Width = 3135 + End + Begin VB.Label lblLookUp + Caption = "Enter The Project Code" + Height = 255 + Left = 30 + TabIndex = 6 + Top = 4590 + Width = 5115 + End + Begin VB.Label lblSearch + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Search By: " + Height = 195 + Left = 45 + TabIndex = 3 + Top = 4230 + Width = 825 + End +End +Attribute VB_Name = "frmProjList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSORDER As Recordset + +Dim mboolAdding As Boolean, mboolPROJ As Boolean + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSearch_Click() + Call ContainLoad + mboolPROJ = True +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "formProjList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call ProjLoad + If lstProj.ListIndex <> -1 Then +' If FormFindCrew() Then +' Call FormShowCrew +' End If + cboSearch.ListIndex = 0 + + mboolPROJ = False + End If +' Call cmdTotal_Click + Exit Sub + +Error_EH: + gstrMODULE = "formProjList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Proj_ID, Proj_Code, Proj_Desc, Proj_Cont from tblPROJECT WHERE Create > #01/01/2014#" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstProj.Clear + + Do Until oRS.EOF + With lstProj + strLine = Field2Str(oRS!PROJ_ID) & vbTab & Field2Str(oRS!Proj_Code) & vbTab & Field2Str(oRS!Proj_Desc) & vbTab & Field2Str(oRS!Proj_Cont) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!order_id + End With + + oRS.MoveNext + Loop + + If lstProj.ListCount Then + lstProj.ListIndex = 0 + mboolPROJ = False + Else + lstProj.ListIndex = -1 +' Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormProjList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblorders " + strSQL = strSQL & "WHERE order_Id = " & lstProj.ItemData(lstProj.ListIndex) + + Set moRSORDER = New Recordset + + moRSORDER.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSORDER.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "formProjList - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH +' If cmdSave.Enabled Then + +' strMSG = "Crew Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call FormSave + +' Case vbNo + +' Case vbCancel +' Cancel = True +' Exit Sub +' End Select +' End If + + If moRSORDER.State = adStateOpen Then + moRSORDER.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub cboSearch_Click() +Dim intMIN As Integer + + On Error Resume Next +' mintCnt2 = mintCnt2 + 1 +' lblCount2 = mintCnt2 +' mdteBegin = Now +' cboSortOrder.ListIndex = cboSort.ListIndex +' cboSortOrder.ListIndex = 4 + + If cboSearch.ListIndex = 0 Then + If mboolPROJ Then + Call ProjLoad + End If +' If mbytSort <> cbolistindex Then +'' If mbytSort = 6 Then +' Call InventoryLoad +'' End If +'' lstProj.col = 3 +'' lstProj.ColSortSeq = -1 +'' lstProj.ColSorted = SortedNone +' lstEmpList.col = 3 +' lstEmpList.ColSortSeq = -1 +' lstEmpList.ColSorted = SortedNone + txtSearch = "" + txtSearch.Visible = True + txtContains.Visible = False + txtSearch.SetFocus + + lstProj.ListIndex = 0 + lstProj.col = 2 + lstProj.ColSortSeq = -1 + lstProj.ColSorted = SortedNone + lstProj.col = 1 + lstProj.ColSortSeq = 0 + lstProj.ColSorted = SortedAscending + lstProj.Redraw = True + lstProj.ColSortDataType = ColSortDataTypeTextNoCase + lstProj.SearchIgnoreCase = True + lstProj.ColumnSearch = 1 + + txtSearch = "" + txtSearch.SetFocus + lblLookUp.Caption = "Enter Project Code Search Info:" + ElseIf cboSearch.ListIndex = 1 Then + If mboolPROJ Then + Call ProjLoad + End If +'' If mbytSort = 6 Then +' Call InventoryLoad +'' End If +' lstProj.col = 2 +' lstProj.ColSortSeq = -1 +' lstProj.ColSorted = SortedNone + txtSearch = "" + txtSearch.Visible = True + txtContains.Visible = False + txtSearch.SetFocus + + lstProj.ListIndex = 0 + lstProj.col = 1 + lstProj.ColSortSeq = -1 + lstProj.ColSorted = SortedNone + lstProj.col = 2 + lstProj.ColSortSeq = 0 + lstProj.ColSorted = SortedAscending + lstProj.Redraw = True + + lstProj.ColSortDataType = ColSortDataTypeTextNoCase + lstProj.SearchIgnoreCase = True +' lstproj.ColumnSearch = 2 + lstProj.ColumnSearch = 2 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else + txtSearch = "" + txtSearch.SetFocus +' End If +' txtSearch = "" + lblLookUp.Caption = "Enter Description Search Information:" +' txtSearch.SetFocus + ElseIf cboSearch.ListIndex = 2 Then +'' If mbytSort = 6 Then +' Call InventoryLoad +'' End If + txtSearch = "" + txtSearch.Visible = False + txtContains.Visible = True + txtContains.SetFocus + lstProj.ListIndex = 0 + +' lstProj.col = 2 +' lstProj.ColSortSeq = 0 +' lstProj.ColSorted = SortedAscending +' lstProj.col = 1 +' lstProj.ColSortSeq = -1 +' lstProj.ColSorted = SortedNone +'' lstProj.col = 3 +'' lstProj.ColSortSeq = -1 +'' lstProj.ColSorted = SortedNone +' lstProj.Redraw = True + + lblLookUp.Caption = "Enter Search Info For Partial Description:" +'' lstProj.ColSortDataType = ColSortDataTypeTextNoCase +'' lstProj.SearchIgnoreCase = True +'' lstProj.ColumnSearch = 2 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else +'' txtSearch = "" +'' txtSearch.SetFocus +' End If +'' lbllookup.Caption = "Enter First Name Search Information:" +' txtSearch.SetFocus +' End If +'' ElseIf cboSearch.ListIndex = 3 Then +'' If mbytSort = 6 Then +' Call InventoryLoad +'' End If +'' lstProj.col = 0 +'' lstProj.ColSortSeq = -1 +'' lstProj.ColSorted = SortedNone +'' lstProj.col = 1 +'' lstProj.ColSortSeq = -1 +'' lstProj.ColSorted = SortedNone +'' lstProj.col = 6 +'' lstProj.ColSortSeq = 0 +'' lstProj.ColSorted = SortedAscending +'' lstProj.col = 2 +'' lstProj.ColSortSeq = -1 +'' lstProj.ColSorted = SortedNone +'' lstProj.Redraw = True + +'' lstProj.ColSortDataType = ColSortDataTypeTextNoCase +'' lstProj.SearchIgnoreCase = True +' lstEmpList.ColumnSearch = 2 +'' lstProj.ColumnSearch = 6 + +' If chkKEEP Then +' Call cmdSearch_Click +' txtSearch.SetFocus +' Else +'' txtSearch = "" +'' txtSearch.SetFocus +' End If +'' lbllookup.Caption = "Enter SS Number Search Information:" +' txtSearch.SetFocus + End If +'' mbytSort = cboSearch.ListIndex +' mdteEnd = Now +' intMIN = DateDiff("s", mdteBegin, mdteEnd) +' lblDteBegin = Format(mdteBegin, "HH:MM:SS") +' lbldteEnd = Format(mdteEnd, "HH:MM:SS") +' lblDiff = intMIN +End Sub + +Private Sub lstProj_DblClick() + + lstProj.col = 0 + gintPROJID = Field2Str2(lstProj.ColText) + Unload Me +End Sub + +Private Sub txtSearch_Change() +'Multiple character search code. +lstProj.SearchText = txtSearch.Text +lstProj.SearchMethod = 2 +lstProj.Action = ActionSearch +lstProj.SearchIndex = -1 +lstProj.Action = 0 + + If lstProj.SearchIndex <> -1 Then + lstProj.TopIndex = lstProj.SearchIndex + lstProj.ListIndex = lstProj.SearchIndex + Else + lstProj.Action = 6 ' clear + End If + +End Sub + +Private Sub ContainLoad() + Dim oRS As Recordset, oRSP As Recordset + Dim strSQL As String, strSELECT As String, strContain As String + Dim strSQLP As String, intYN As Integer, strADDRESS As String, strLine As String + Dim strProj_Desc As String, strProj_Cont As String, strProj_Code As String + + + lstProj.Clear + strContain = Trim$(txtContains.Text) + + strSQL = "SELECT Proj_ID, Proj_Code, Proj_Desc, Proj_Cont FROM tblPROJECT WHERE Create > #01/01/2014#" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + + If Len(oRS!Proj_Desc) = 0 Then '1 + intYN = 0 + Else + strADDRESS = Field2Str(oRS!Proj_Desc) + intYN = InStr(1, UCase(Trim(strADDRESS)), UCase(Trim(txtContains))) ', vbTextCompare) + End If + + If intYN > 0 Then + + strLine = Field2Str2(oRS!PROJ_ID) & vbTab & RTrim(Field2Str(oRS!Proj_Code)) & vbTab & RTrim(Field2Str(oRS!Proj_Desc)) & vbTab & RTrim(Field2Str(oRS!Proj_Cont)) ' & " -- " & oRS!Desc + lstProj.AddItem strLine + End If + + oRS.MoveNext +' mboolSHOW = True + Loop + oRS.Close + If lstProj.ListCount = 0 Then + MsgBox "No Project Information Found" +' Call cmdNewSearch_Click + Else + lstProj.ListIndex = 0 + End If +' End If '1 + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frx new file mode 100644 index 0000000..f7a5258 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frm new file mode 100644 index 0000000..6040fa1 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frm @@ -0,0 +1,1956 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmProjNotes + Caption = "Project Notes & Information" + ClientHeight = 9180 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10050 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 9180 + ScaleWidth = 10050 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtPE + Height = 315 + Left = 1245 + TabIndex = 88 + Top = 8160 + Width = 1095 + End + Begin VB.TextBox txtOpt + Height = 315 + Left = 4020 + TabIndex = 90 + Top = 7080 + Width = 1095 + End + Begin VB.TextBox txtPF + Height = 315 + Left = 1245 + TabIndex = 89 + Top = 8550 + Width = 1095 + End + Begin VB.TextBox txtPI + Height = 315 + Left = 1230 + TabIndex = 87 + Top = 7800 + Width = 1095 + End + Begin VB.TextBox txtStucco + Height = 315 + Left = 1230 + TabIndex = 86 + Top = 7440 + Width = 1095 + End + Begin VB.TextBox txtLath + Height = 315 + Left = 1230 + TabIndex = 85 + Top = 7080 + Width = 1095 + End + Begin VB.CheckBox chkPHXTUC + Caption = "Metro PHX" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 255 + Left = 8340 + TabIndex = 76 + Top = 6375 + Width = 1680 + End + Begin VB.TextBox txtWrapPctg + Height = 315 + Left = 7470 + TabIndex = 74 + Top = 6405 + Width = 765 + End + Begin VB.CheckBox chkWrap + Alignment = 1 'Right Justify + Caption = "Wrap Ins." + Height = 255 + Left = 5775 + TabIndex = 73 + Top = 6435 + Width = 1020 + End + Begin VB.CheckBox chkPCMNT + Caption = "Use Plstc Cement w/ 3 coat stucco" + Height = 480 + Left = 5640 + TabIndex = 72 + Top = 3150 + Width = 1665 + End + Begin VB.CheckBox chk2Dates + Caption = "2 Dates" + Height = 270 + Left = 7545 + TabIndex = 69 + Top = 4815 + Width = 900 + End + Begin VB.TextBox txtDue2 + Alignment = 2 'Center + Height = 315 + Left = 7080 + TabIndex = 68 + Top = 4800 + Width = 435 + End + Begin VB.TextBox txtSplit + Height = 315 + Left = 9345 + TabIndex = 67 + Top = 3480 + Width = 495 + End + Begin VB.TextBox txtBagSand + Height = 315 + Left = 9345 + TabIndex = 64 + Top = 2580 + Width = 495 + End + Begin VB.CheckBox chkBagSand + Caption = "Use Bag Sand" + Height = 255 + Left = 8520 + TabIndex = 63 + Top = 2940 + Width = 1485 + End + Begin VB.Frame fraRGard + Caption = " R-Guard Size " + Height = 915 + Left = 7335 + TabIndex = 60 + Top = 3255 + Width = 1860 + Begin VB.OptionButton optRGard + Caption = "Pyro Paper" + Height = 225 + Index = 2 + Left = 165 + TabIndex = 71 + Top = 645 + Width = 1440 + End + Begin VB.OptionButton optRGard + Caption = "1 in R Guard" + Height = 225 + Index = 1 + Left = 165 + TabIndex = 62 + Top = 405 + Width = 1410 + End + Begin VB.OptionButton optRGard + Caption = "1/2 in R Guard" + Height = 195 + Index = 0 + Left = 165 + TabIndex = 61 + Top = 195 + Value = -1 'True + Width = 1560 + End + End + Begin VB.CheckBox chkZMetal + Caption = "Use Z-Metal" + Height = 255 + Left = 5640 + TabIndex = 59 + Top = 2860 + Width = 1290 + End + Begin VB.CheckBox chkStone + Caption = "Stone Only" + Height = 195 + Left = 7680 + TabIndex = 14 + Top = 2400 + Width = 1215 + End + Begin VB.CheckBox chkApt + Caption = "AparTment/Commercial" + Height = 195 + Left = 5640 + TabIndex = 13 + Top = 2125 + Width = 2040 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 5535 + MaxLength = 50 + TabIndex = 29 + Top = 7605 + Width = 4485 + End + Begin VB.TextBox txtTaxCode + Height = 315 + Left = 9120 + TabIndex = 57 + Top = 6090 + Width = 915 + End + Begin VB.TextBox txtTaxAuth + Height = 315 + Left = 6600 + MaxLength = 15 + TabIndex = 54 + Top = 6090 + Width = 1425 + End + Begin VB.ComboBox cboProjType + Height = 315 + ItemData = "frmProjNotes.frx":0000 + Left = 6615 + List = "frmProjNotes.frx":0010 + Style = 2 'Dropdown List + TabIndex = 52 + Top = 4200 + Width = 3375 + End + Begin VB.TextBox txtBillDay + Alignment = 2 'Center + Height = 315 + Left = 6615 + TabIndex = 21 + Top = 5115 + Width = 435 + End + Begin VB.CommandButton cmdContractor + Caption = "Contractor Info" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7005 + TabIndex = 49 + TabStop = 0 'False + Top = 8010 + Width = 1395 + End + Begin VB.CheckBox chkPLReq + Caption = "PreLien Required:" + Height = 195 + Left = 5640 + TabIndex = 15 + Top = 2370 + Width = 1695 + End + Begin VB.CheckBox chkPreLien + Caption = "PreLien Done" + Height = 195 + Left = 7680 + TabIndex = 16 + Top = 2700 + Width = 1350 + End + Begin VB.TextBox txtSigned + Height = 315 + Left = 7500 + TabIndex = 46 + Top = 480 + Width = 1815 + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 6600 + TabIndex = 27 + Top = 5775 + Width = 3435 + End + Begin VB.TextBox txtSandZone + Height = 315 + Left = 9135 + MaxLength = 1 + TabIndex = 26 + Top = 5460 + Width = 915 + End + Begin VB.CheckBox chkSilica + Caption = "Use Silica Sand" + Height = 255 + Left = 6975 + TabIndex = 18 + Top = 2940 + Width = 1515 + End + Begin VB.CheckBox chkBB + Caption = "Use Blackboard" + Height = 195 + Left = 5640 + TabIndex = 17 + Top = 2615 + Width = 1635 + End + Begin Crystal.CrystalReport crMain + Left = 9480 + Top = 0 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CheckBox chkCondo + Caption = "Condo/Townhome" + Height = 195 + Left = 5640 + TabIndex = 11 + Top = 1880 + Width = 1695 + End + Begin VB.TextBox txtLocation + Height = 315 + Left = 5520 + TabIndex = 28 + Top = 6990 + Width = 4485 + End + Begin VB.CommandButton cmdPrintSuper + Caption = "Print Supers &Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7005 + TabIndex = 43 + TabStop = 0 'False + Top = 8610 + Width = 1395 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Status Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5505 + TabIndex = 42 + TabStop = 0 'False + Top = 8610 + Width = 1395 + End + Begin VB.TextBox txtStandards + Height = 2610 + Left = 120 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 2 + Top = 3480 + Width = 5235 + End + Begin VB.CheckBox chkOpt + Caption = "Bill Options with Stucco" + Height = 195 + Left = 7680 + TabIndex = 8 + Top = 1500 + Width = 2415 + End + Begin VB.TextBox txtRetention + Height = 315 + Left = 6600 + TabIndex = 25 + Top = 5460 + Width = 915 + End + Begin VB.TextBox txtMAS90 + Height = 315 + Left = 9135 + TabIndex = 24 + Top = 5145 + Width = 915 + End + Begin VB.TextBox txtInvoice + Height = 315 + Left = 9135 + MaxLength = 3 + TabIndex = 23 + Top = 4815 + Width = 915 + End + Begin VB.TextBox txtDue + Alignment = 2 'Center + Height = 315 + Left = 6615 + TabIndex = 22 + Top = 4800 + Width = 435 + End + Begin VB.TextBox txtYards + Height = 315 + Left = 9135 + TabIndex = 20 + Top = 4500 + Width = 915 + End + Begin VB.TextBox txtLots + Height = 315 + Left = 6615 + TabIndex = 19 + Top = 4500 + Width = 915 + End + Begin VB.CommandButton cmdDate + Caption = "&Date/Time Stamp" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 5505 + TabIndex = 32 + TabStop = 0 'False + Top = 8010 + Width = 1395 + End + Begin VB.CheckBox chkPrice + Caption = "Pricing Complete" + Height = 195 + Left = 5640 + TabIndex = 9 + Top = 1635 + Width = 1815 + End + Begin VB.CheckBox chkPlans + Caption = "Plans Completely Transfered" + Height = 195 + Left = 7680 + TabIndex = 12 + Top = 2100 + Width = 2415 + End + Begin VB.CheckBox chkSetup + Caption = "Setup of Project is Complete" + Height = 195 + Left = 7680 + TabIndex = 10 + Top = 1800 + Width = 2415 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8505 + TabIndex = 31 + TabStop = 0 'False + Top = 8610 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 8505 + TabIndex = 30 + Top = 8010 + Width = 1395 + End + Begin VB.TextBox txtNotes + Height = 2610 + Left = 120 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 1 + Top = 540 + Width = 5235 + End + Begin VB.CheckBox chkOpenings + Caption = "Use 50% Openings" + Height = 195 + Left = 5640 + TabIndex = 7 + Top = 1390 + Width = 1755 + End + Begin VB.CheckBox chkFHA + Caption = "FHA Metal" + Height = 195 + Left = 5640 + TabIndex = 5 + Top = 1145 + Width = 1755 + End + Begin VB.CheckBox chkComplete + Caption = "Contract Completed" + Height = 255 + Left = 5640 + TabIndex = 4 + Top = 840 + Width = 1815 + End + Begin VB.CheckBox chkGotBid + Caption = "Awarded Contract" + Height = 255 + Left = 5640 + TabIndex = 3 + Top = 120 + Width = 1815 + End + Begin VB.CheckBox chkCombined + Caption = "Bill Lath && Stucco Together" + Height = 195 + Left = 7680 + TabIndex = 6 + Top = 1200 + Width = 2415 + End + Begin VB.Label lblEstimator + AutoSize = -1 'True + Caption = "Estimator: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 210 + TabIndex = 94 + Top = 6120 + Width = 915 + End + Begin VB.Label lblStone + Caption = "Stone should be entered in Options with the Billing Code of STONE or WSTONE" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 780 + Left = 3150 + TabIndex = 93 + Top = 7635 + Width = 2010 + End + Begin VB.Label lblOptCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option: " + Height = 195 + Index = 1 + Left = 3315 + TabIndex = 92 + Top = 7095 + Width = 555 + End + Begin VB.Label lblPaintExt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Exterior: " + Height = 195 + Left = 135 + TabIndex = 91 + Top = 8235 + Width = 1020 + End + Begin VB.Label lblPaintFin + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Final: " + Height = 195 + Left = 330 + TabIndex = 84 + Top = 8610 + Width = 825 + End + Begin VB.Label lblPaintInt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paint Interior: " + Height = 195 + Left = 180 + TabIndex = 83 + Top = 7875 + Width = 975 + End + Begin VB.Label lblStucco + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco: " + Height = 195 + Left = 555 + TabIndex = 82 + Top = 7500 + Width = 600 + End + Begin VB.Label lblLath + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath: " + Height = 195 + Left = 750 + TabIndex = 81 + Top = 7140 + Width = 405 + End + Begin VB.Label lblOption + AutoSize = -1 'True + Caption = "Plan Option Sales Codes" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 210 + Index = 0 + Left = 3105 + TabIndex = 80 + Top = 6825 + Width = 2010 + End + Begin VB.Label lblHouse + AutoSize = -1 'True + Caption = "Main Plan Sales Codes" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 210 + Left = 465 + TabIndex = 79 + Top = 6825 + Width = 1860 + End + Begin VB.Label lblBillCodes + AutoSize = -1 'True + Caption = "Default Billing Codes For The The Billing Grid - This Project Only" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 210 + Left = 180 + TabIndex = 78 + Top = 6420 + Width = 5205 + End + Begin VB.Label lblPHXTUC + Caption = "Checked Tucson Unchecked PHX" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 8370 + TabIndex = 77 + Top = 6600 + Width = 1665 + End + Begin VB.Label lblWrapPctg + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wrap %: " + Height = 195 + Left = 6885 + TabIndex = 75 + Top = 6465 + Width = 645 + End + Begin VB.Label lblInvDue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inv Due 1&&2:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5430 + TabIndex = 70 + Top = 4845 + Width = 1125 + End + Begin VB.Label lblUnder16 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Under 16" + Height = 195 + Left = 9262 + TabIndex = 66 + Top = 3255 + Width = 660 + End + Begin VB.Label lblBagSand + AutoSize = -1 'True + Caption = "BagSand" + Height = 195 + Left = 9225 + TabIndex = 65 + Top = 2370 + Width = 660 + End + Begin VB.Label lblDesc + AutoSize = -1 'True + Caption = "Extended Description:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5550 + TabIndex = 58 + Top = 7380 + Width = 1890 + End + Begin VB.Label lblTaxCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Tax Code:" + Height = 195 + Left = 8340 + TabIndex = 56 + Top = 6150 + Width = 735 + End + Begin VB.Label lblTaxAuth + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Taxing Authority:" + Height = 195 + Left = 5355 + TabIndex = 55 + Top = 6165 + Width = 1185 + End + Begin VB.Label lblProjType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Type:" + Height = 195 + Left = 5610 + TabIndex = 53 + Top = 4275 + Width = 945 + End + Begin VB.Label lblDDone + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6600 + TabIndex = 51 + Top = 3750 + Width = 540 + End + Begin VB.Label lblLotsDone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lots Done:" + Height = 195 + Left = 5730 + TabIndex = 50 + Top = 3795 + Width = 780 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Super:" + Height = 195 + Left = 5655 + TabIndex = 48 + Top = 5835 + Width = 885 + End + Begin VB.Label lblSigned + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contract Signed:" + Height = 195 + Left = 6180 + TabIndex = 47 + Top = 540 + Width = 1185 + End + Begin VB.Label lblStreets + AutoSize = -1 'True + Caption = "Cross Streets:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5580 + TabIndex = 45 + Top = 6750 + Width = 1200 + End + Begin VB.Label lblSandZone + Caption = "Sand Zone:" + Height = 195 + Left = 8205 + TabIndex = 44 + Top = 5520 + Width = 855 + End + Begin VB.Label lblStandards + Caption = "Project Standards" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 105 + TabIndex = 41 + Top = 3225 + Width = 1575 + End + Begin VB.Label lblRetention + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Retention %:" + Height = 195 + Left = 5640 + TabIndex = 40 + Top = 5520 + Width = 900 + End + Begin VB.Label lblMAS90 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMS Customer #:" + Height = 195 + Left = 7830 + TabIndex = 39 + Top = 5205 + Width = 1245 + End + Begin VB.Label lblInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Code:" + Height = 390 + Left = 8505 + TabIndex = 38 + Top = 4770 + Width = 615 + WordWrap = -1 'True + End + Begin VB.Label lblDueDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Paymnt Due:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5415 + TabIndex = 37 + Top = 5160 + Width = 1140 + WordWrap = -1 'True + End + Begin VB.Label lblYards + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated Yardage:" + Height = 195 + Left = 7695 + TabIndex = 36 + Top = 4560 + Width = 1380 + End + Begin VB.Label lblLots + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated Lots:" + Height = 195 + Left = 5475 + TabIndex = 35 + Top = 4530 + Width = 1080 + End + Begin VB.Label lblCompleteDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7500 + TabIndex = 34 + Top = 840 + Width = 1815 + End + Begin VB.Label lblAwardDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 7500 + TabIndex = 33 + Top = 120 + Width = 1815 + End + Begin VB.Label lblProject + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 180 + TabIndex = 0 + Top = 120 + Width = 5175 + End +End +Attribute VB_Name = "frmProjNotes" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolFLAG As Boolean, mstrINVIN As String, mstrINVOUT As String +Dim mstrPROJLOT As String, mintLOTS As Integer, mboolLOADED As Boolean + +Private Sub chkApt_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkBagSand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub GetInvCode() +Dim strSQL As String, strSELECT As String, strInvCode As String +Dim oRS As Recordset, strCOUNT As String + + If mboolLOADED = True Then + strSQL = "SELECT * FROM tblPROJECT WHERE Inv = '" & txtInvoice & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRS.EOF Then + strCOUNT = oRS.RecordCount + strSELECT = txtInvoice & " Has Already Been Used As An Invoice Code " & vbCrLf + strSELECT = strSELECT & strCOUNT & " Times - Select A New Invoice Code" + MsgBox strSELECT, vbOKOnly, "Change Invoice Code" + txtInvoice = "" + txtInvoice.SetFocus + ' txtInvoice.SetFocus + End If + End If + +' mstrPROJLOT = Trim(Field2Str(moRSProj!Proj_Desc)) & " - " & Trim(Field2Str(moRS!lot_no)) +' lblProjectLot = mstrPROJLOT +' txtHName = Field2Str(moRS!Owner) +' txtHAddress = Field2Str(moRS!address) + +End Sub + +Private Sub chkBB_Click() + If chkBB = vbChecked Then + fraRGard.Enabled = False + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + optRGard(0).Value = False + optRGard(1).Value = False + optRGard(2).Value = False + ElseIf chkBB = vbUnchecked Then + fraRGard.Enabled = True + optRGard(0).Enabled = True + optRGard(1).Enabled = True + optRGard(2).Enabled = True + optRGard(0).Value = True + optRGard(1).Value = False + optRGard(2).Value = False + + Else + fraRGard.Enabled = False + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + optRGard(0).Value = False + optRGard(1).Value = False + optRGard(2).Value = False + + End If + +End Sub + +Private Sub chkBB_LostFocus() + If chkBB = vbChecked Then + fraRGard.Enabled = False + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + optRGard(0).Value = False + optRGard(1).Value = False + optRGard(2).Value = False + ElseIf chkBB = vbUnchecked Then + fraRGard.Enabled = True + optRGard(0).Enabled = True + optRGard(1).Enabled = True + optRGard(2).Enabled = False + optRGard(0).Value = True + optRGard(1).Value = False + optRGard(2).Value = False + Else + fraRGard.Enabled = False + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + optRGard(0).Value = False + optRGard(1).Value = False + optRGard(2).Value = False + End If +End Sub + +Private Sub chkBB_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkCombined_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkComplete_Click() + If chkComplete = vbChecked Then + lblCompleteDate = Date + End If + If chkComplete = vbUnchecked Then + lblCompleteDate = "" + End If +End Sub + +Private Sub chkComplete_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkCondo_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkFHA_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkGotBid_Click() + If chkGotBid = vbChecked Then + lblAwardDate = Date + End If + If chkGotBid = vbUnchecked Then + lblAwardDate = "" + End If +End Sub + +Private Sub chkGotBid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkOpenings_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkOpt_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkPHXTUC_Click() + If chkPHXTUC = vbChecked Then + chkPHXTUC.Caption = "Tucson" + ElseIf chkPHXTUC = vbUnchecked Then + chkPHXTUC.Caption = "METRO Phx" + End If +End Sub + +Private Sub chkPlans_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkPLReq_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkPreLien_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True + +End Sub + +Private Sub chkPrice_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkSetup_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub chkSilica_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + cmdSave.Enabled = True +End Sub + +Private Sub cmdContractor_Click() + gintPAYID = moRSProj!cont_id + frmContractor.Show 1 +End Sub + +Private Sub cmdDate_Click() + txtNotes = txtNotes & " " & Date & " " & gstrLOGIN & " - " + txtNotes.SetFocus +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintCOPY = 1 + + gintPRINT = 1 + frmReport.Show 1 + + strSQL = "{tblProject.Proj_id} = " & gintPROJID + crMain.ReportFileName = App.Path & "\ProjectStatus.rpt" + crMain.SelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY + +' crMain.Destination = crptToWindow + crMain.Destination = gintDEST + crMain.Action = 1 + + + + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrintSuper_Click() +Dim strSQL As String + On Error GoTo Error_EH + + gintCOPY = 1 + + gintPRINT = 1 + frmReport.Show 1 + + strSQL = "{tblProject.Proj_id} = " & gintPROJID + crMain.ReportFileName = App.Path & "\ProjectSuper.rpt" + crMain.SelectionFormula = strSQL + crMain.CopiesToPrinter = gintCOPY + +' crMain.Destination = crptToWindow + crMain.Destination = gintDEST + crMain.Action = 1 + + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module cmdPrint" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + cmdSave.Enabled = False + + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module cmdSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + Call DataHasChanged + End If + +End Sub +Private Sub DataHasChanged() + + cmdSave.Enabled = True + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) +' If mboolFLAG Then +' Exit Sub +' End If + + If KeyAscii = 13 And Not mboolFLAG Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + + mboolLOADED = False + + If gbytSECURITY < 3 Then + Else + Call FormClear3 + End If + mboolFLAG = False + If FormFind() Then + Call FormShow + Else + MsgBox "No Information Was Found For This Project", vbOKOnly, "No Information" + Unload Me + End If + + mboolLOADED = True + + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtMAS90 = "" + txtYards = 0 + txtRetention = 0 + txtLots = 0 + txtInvoice = "" + txtDue = "" + txtDue2 = "" + chk2Dates = vbUnchecked +' chkINACTIVE = vbUnchecked + txtBillDay = "" + txtNotes = "" + txtStandards = "" + txtLocation = "" + txtSandZone = 0 + txtVWPSuper = "" + txtSigned = "" + chkFHA = vbUnchecked + chkGotBid = vbUnchecked + chkComplete = vbUnchecked + chkCombined = vbUnchecked + chkPlans = vbUnchecked + chkSetup = vbUnchecked + chkPHXTUC = vbUnchecked + chkPrice = vbUnchecked + chkOpt = vbUnchecked + chkStone = vbUnchecked + chkOpenings = vbUnchecked + chkCondo = vbUnchecked + chkApt = vbUnchecked + chkPLReq = vbChecked + chkPreLien = vbUnchecked + chkZMetal = vbUnchecked + cboProjType.ListIndex = -1 + lblProject = "" + lblAwardDate = "" + lblCompleteDate = "" + txtTaxCode = "" + txtTaxAuth = "" + txtDesc = "" + txtLath = "" + txtStucco = "" + txtPI = "" + txtPE = "" + txtPF = "" + txtOpt = "" + +End Sub + +Private Sub FormClear2() +' frmProjNotes.Enabled = False + txtMAS90.Enabled = False ' = "" + txtYards.Enabled = False ' = 0 + txtRetention.Enabled = False ' = 0 + txtLots.Enabled = False ' = 0 + txtInvoice.Enabled = False ' = "" + txtDue.Enabled = False ' = "" + txtDue2.Enabled = False ' = "" + chk2Dates.Enabled = False ' = vbUnchecked +' chkINACTIVE = vbUnchecked + txtBillDay.Enabled = False ' = "" + txtNotes.Enabled = False ' = "" + txtStandards.Enabled = False ' = "" + txtLocation.Enabled = False ' = "" + txtSandZone.Enabled = False ' = 0 + txtVWPSuper.Enabled = False ' = "" + txtSigned.Enabled = False ' = "" + chkFHA.Enabled = False ' = vbUnchecked + chkGotBid.Enabled = False ' = vbUnchecked + chkComplete.Enabled = False ' = vbUnchecked + chkCombined.Enabled = False ' = vbUnchecked + chkPlans.Enabled = False ' = vbUnchecked + chkSetup.Enabled = False ' = vbUnchecked + chkPrice.Enabled = False ' = vbUnchecked + chkOpt.Enabled = False ' = vbUnchecked + chkStone.Enabled = False ' = vbUnchecked + chkOpenings.Enabled = False ' = vbUnchecked + chkCondo.Enabled = False ' = vbUnchecked + chkApt.Enabled = False ' = vbUnchecked + chkPLReq.Enabled = False ' = vbChecked + chkPreLien.Enabled = False ' = vbUnchecked + chkZMetal.Enabled = False ' = vbUnchecked + cboProjType.Enabled = False ' .ListIndex = -1 + lblProject.Enabled = False ' = "" + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + chkPCMNT.Enabled = False + lblAwardDate = "" + txtSplit.Enabled = False + txtBagSand.Enabled = False + chkBagSand.Enabled = False + chkSilica.Enabled = False + chkBB.Enabled = False + lblCompleteDate = "" + txtTaxCode.Enabled = False ' = "" + txtTaxAuth.Enabled = False ' = "" + txtDesc.Enabled = False ' = "" + cmdSave.Enabled = False + cmdContractor.Enabled = False + cmdDate.Enabled = False + cmdPrint.Enabled = False + cmdPrintSuper.Enabled = False + txtLath.Enabled = False + txtStucco.Enabled = False + txtPI.Enabled = False + txtPE.Enabled = False + txtPF.Enabled = False + txtOpt.Enabled = False + End Sub + +Private Sub FormClear3() +' frmProjNotes.Enabled = False +' txtMAS90.Enabled = False ' = "" + txtYards.Enabled = False ' = 0 + txtRetention.Enabled = False ' = 0 +' txtLots.Enabled = False ' = 0 +' txtInvoice.Enabled = False ' = "" + txtDue.Enabled = False ' = "" + txtDue2.Enabled = False ' = "" + chk2Dates.Enabled = False ' = vbUnchecked +' chkINACTIVE = vbUnchecked + txtBillDay.Enabled = False ' = "" + txtNotes.Enabled = False ' = "" + txtStandards.Enabled = False ' = "" + txtLocation.Enabled = False ' = "" + txtSandZone.Enabled = False ' = 0 +' txtVWPSuper.Enabled = False ' = "" +' txtSigned.Enabled = False ' = "" + chkFHA.Enabled = False ' = vbUnchecked + chkGotBid.Enabled = False ' = vbUnchecked + chkComplete.Enabled = False ' = vbUnchecked + chkCombined.Enabled = False ' = vbUnchecked + chkPlans.Enabled = False ' = vbUnchecked +' chkSetup.Enabled = False ' = vbUnchecked + chkPrice.Enabled = False ' = vbUnchecked +' chkOpt.Enabled = False ' = vbUnchecked + chkStone.Enabled = False ' = vbUnchecked + chkOpenings.Enabled = False ' = vbUnchecked + chkCondo.Enabled = False ' = vbUnchecked + chkApt.Enabled = False ' = vbUnchecked + chkPLReq.Enabled = False ' = vbChecked +' chkPreLien.Enabled = False ' = vbUnchecked + chkZMetal.Enabled = False ' = vbUnchecked + cboProjType.Enabled = False ' .ListIndex = -1 + lblProject.Enabled = False ' = "" + optRGard(0).Enabled = False + optRGard(1).Enabled = False + optRGard(2).Enabled = False + chkPCMNT.Enabled = False + lblAwardDate = "" + txtSplit.Enabled = False + txtBagSand.Enabled = False + chkBagSand.Enabled = False + chkSilica.Enabled = False + chkBB.Enabled = False + lblCompleteDate = "" +' txtTaxCode.Enabled = False ' = "" +' txtTaxAuth.Enabled = False ' = "" + txtDesc.Enabled = False ' = "" +' cmdSave.Enabled = False + cmdContractor.Enabled = False + cmdDate.Enabled = False + cmdPrint.Enabled = False + cmdPrintSuper.Enabled = False + End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FieldsSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblProject " + strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID + + Set moRSProj = New Recordset + + moRSProj.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSProj.EOF Then + FormFind = False + Else + Call LotCount + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ProjNotes - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSProj + lblDDone = Field2Str2(mintLOTS) + txtMAS90 = Field2Str(!ar) + txtInvoice = Field2Str(!inv) + txtLots = Field2Str(!lots) + txtYards = Field2Str(!yards) + txtRetention = Field2Str(!retention) + txtDue = Field2Str(!DueDate) + txtDue2 = Field2Str(!duedate2) + chk2Dates = Field2CheckBox(!twodates) +' chkINACTIVE = Field2CheckBox(!INACTIVE) + txtBillDay = Field2Str(!inv_due) + txtNotes = Field2Str(!notes) + txtSandZone = Field2Str(!zone) + txtVWPSuper = Field2Str(!vwp_sup) + txtSigned = Field2Str(!signed) + lblEstimator = "Estimator: " & Trim(Field2Str(!Estimator)) + chkPLReq = Field2CheckBox(!plien_req) + chkPreLien = Field2CheckBox(!plien_done) + chkOpt = Field2CheckBox(!opt) + chkStone = Field2CheckBox(!stone) + chkGotBid = Field2CheckBox(!gotbid) + chkComplete = Field2CheckBox(!complete) + chkCombined = Field2CheckBox(!bill) + chkSetup = Field2CheckBox(!setup) + chkPrice = Field2CheckBox(!price) + chkPHXTUC = Field2CheckBox(!PHX_TUS) + If chkPHXTUC = vbChecked Then + chkPHXTUC.Caption = "Tucson" + ElseIf chkPHXTUC = vbUnchecked Then + chkPHXTUC.Caption = "METRO Phx" + End If + chkFHA = Field2CheckBox(!FHA) + chkPlans = Field2CheckBox(!plans) + chkOpenings = Field2CheckBox(!use_open) + chkCondo = Field2CheckBox(!condo) + chkApt = Field2CheckBox(!Apt) + chkBB = Field2CheckBox(!bb) + chkPCMNT = Field2CheckBox(!plcmnt) + chkSilica = Field2CheckBox(!silica) + chkZMetal = Field2CheckBox(!zmetal) + chkWrap = Field2CheckBox(!Wrap) + txtWrapPctg = Format(Field2Str(!WPctg), "#0.00##") + txtStandards = Field2Str(!standards) + txtLocation = Field2Str(!Location) + txtTaxCode = Field2Str(!taxcode) + txtDesc = Field2Str(!Desc) + txtTaxAuth = Field2Str(!City) + + lblProject.Caption = Field2Str(!Proj_Code) & " - " & Field2Str(!Proj_Desc) & " - " & Field2Str(!PROJ_ID) + lblAwardDate.Caption = Field2Str(!gb_date) + lblCompleteDate.Caption = Field2Str(!cm_date) + If !p_type = "T" Then + cboProjType = "Condo/Townhome" + ElseIf !p_type = "R" Then + cboProjType = "Residential Homes" + ElseIf !p_type = "M" Then + cboProjType = "Commercial" + ElseIf !p_type = "A" Then + cboProjType = "Apartments" + End If + optRGard(0) = Field2CheckBox(!rg12) + optRGard(1) = Field2CheckBox(!rg1) + optRGard(2) = Field2CheckBox(!pyro) + chkBagSand = Field2CheckBox(!BagSand) + txtBagSand = Format(Field2Str2(!bagdollars), "###.00") + txtSplit = Format(Field2Str2(!splitcst), "###.00") + txtLath = Field2Str(!LATH) + txtStucco = Field2Str(!Stucco) + txtPI = Field2Str(!PAINTINT) + txtPE = Field2Str(!PAINTEXT) + txtPF = Field2Str(!PAINTFNL) + txtOpt = Field2Str(!Option) + End With + + If gbytSECURITY > 3 Then + chkGotBid.Enabled = False + chkComplete.Enabled = False +' txtLocation.Enabled = False + txtStandards.Enabled = False + End If + If gbytSECURITY = 1 Or gbytSECURITY = 7 Then + chkPreLien.Enabled = True + chkPLReq.Enabled = True + Else + chkPreLien.Enabled = False + chkPLReq.Enabled = False + End If + mboolSHOW = False +' If gbytSECURITY <> 1 Then + If gbytSECURITY < 3 Then + Else + Call FormClear3 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + With moRSProj + !yards = Str2Field(txtYards) + !lots = Str2Field(txtLots) + !inv = Str2Field(txtInvoice) + !twodates = chk2Dates + !DueDate = Str2Field(txtDue) + !duedate2 = Str2Field(txtDue2) + !inv_due = Str2Field(txtBillDay) + !retention = Str2Field(txtRetention) + !notes = Str2Field(txtNotes) + !ar = Str2Field(txtMAS90) + !gb_date = Str2Field(lblAwardDate) + !cm_date = Str2Field(lblCompleteDate) + !standards = Str2Field(txtStandards) + !Location = Str2Field(txtLocation) + !signed = Str2Field(txtSigned) + !vwp_sup = Str2Field(txtVWPSuper) + !plien_req = chkPLReq + !plien_done = chkPreLien + !gotbid = chkGotBid + !plans = chkPlans + !setup = chkSetup + !price = chkPrice + !Wrap = chkWrap + !PHX_TUS = chkPHXTUC + !WPctg = Str2Field(txtWrapPctg) + !zone = Integer2Field(txtSandZone) + !complete = chkComplete + !bill = chkCombined + !FHA = chkFHA + !use_open = chkOpenings + !opt = chkOpt + !Apt = chkApt + !stone = chkStone + !condo = chkCondo + !bb = chkBB + !plcmnt = chkPCMNT + !silica = chkSilica + !City = Str2Field(txtTaxAuth) + !taxcode = Str2Field(txtTaxCode) + !Desc = Str2Field(txtDesc) + !zmetal = chkZMetal + !UUser = gstrLOGIN + !Update = Date + If cboProjType = "Condo/Townhome" Then + !p_type = "T" + ElseIf cboProjType = "Residential Homes" Then + !p_type = "R" + ElseIf cboProjType = "Commercial" Then + !p_type = "M" + ElseIf cboProjType = "Apartments" Then + !p_type = "A" + End If + !rg1 = optRGard(1) + !rg12 = optRGard(0) + !pyro = optRGard(2) + !BagSand = chkBagSand + !bagdollars = txtBagSand + !splitcst = txtSplit + !LATH = Str2Field(txtLath) + !Stucco = Str2Field(txtStucco) + !PAINTINT = Str2Field(txtPI) + !PAINTEXT = Str2Field(txtPE) + !PAINTFNL = Str2Field(txtPF) + !Option = Str2Field(txtOpt) + End With + + moRSProj.Update + + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form ProjNotes - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optRGard_Click(Index As Integer) + cmdSave.Enabled = True +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc.Text = UCase(txtDesc.Text) +End Sub + +Private Sub txtDue_GotFocus() + Call FieldSelect(txtDue) +End Sub + +Private Sub txtDue2_GotFocus() + Call FieldSelect(txtDue2) +End Sub + +'Private Sub txtInvoice_Change() +'Private Sub txtInvoice_ datachanged() + +' txtInvoice = UCase(txtInvoice) +' Call GetInvCode +'End Sub + +Private Sub txtInvoice_GotFocus() + Call FieldSelect(txtInvoice) + mstrINVIN = txtInvoice +End Sub + +Private Sub txtInvoice_LostFocus() +Dim strMSG As String + txtInvoice = UCase(txtInvoice) + mstrINVOUT = txtInvoice + + If mstrINVOUT <> mstrINVIN Then + Call GetInvCode + End If +' strMSG = "Remember That Invoice Code Should Be 3 Charaters" & vbCrLf +' strMSG = strMSG & "Or Less So That The Invoice Number Will Be" & vbCrLf +' strMSG = strMSG & "10 Charcters or Less. ie (PDR3333ST2)" +' MsgBox strMSG, vbOKOnly, "Check Invoice Code Length" + +End Sub + +Private Sub txtLath_GotFocus() + Call FieldSelect(txtLath) +End Sub + +Private Sub txtLath_LostFocus() + txtLath = UCase(txtLath) +End Sub + +Private Sub txtLocation_GotFocus() + Call FieldSelect(txtLocation) +End Sub + +Private Sub txtLocation_LostFocus() + txtLocation = UCase(txtLocation) +End Sub + +Private Sub txtLots_GotFocus() + Call FieldSelect(txtLots) +End Sub + +Private Sub txtMAS90_GotFocus() + Call FieldSelect(txtMAS90) +End Sub + +Private Sub txtMAS90_LostFocus() + txtMAS90 = UCase(txtMAS90) +End Sub + +Private Sub txtNotes_GotFocus() + mboolFLAG = True + txtNotes.SelStart = 63000 +End Sub + +Private Sub txtNotes_LostFocus() + mboolFLAG = False + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtOpt_GotFocus() + Call FieldSelect(txtOpt) +End Sub + +Private Sub txtOpt_LostFocus() + txtOpt = UCase(txtOpt) +End Sub + +Private Sub txtPE_GotFocus() + Call FieldSelect(txtPE) +End Sub + +Private Sub txtPE_LostFocus() + txtPE = UCase(txtPE) +End Sub + +Private Sub txtPF_GotFocus() + Call FieldSelect(txtPF) +End Sub + +Private Sub txtPF_LostFocus() + txtPF = UCase(txtPF) +End Sub + +Private Sub txtPI_GotFocus() + Call FieldSelect(txtPI) +End Sub + +Private Sub txtPI_LostFocus() + txtPI = UCase(txtPI) +End Sub + +Private Sub txtRetention_GotFocus() + Call FieldSelect(txtRetention) +End Sub + +Private Sub txtSigned_GotFocus() + Call FieldSelect(txtSigned) +End Sub + +Private Sub txtSigned_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtSigned, "/", 1) + If Not IsDate(txtSigned) Then + If lngPOS = 0 Then + If Len(txtSigned) > 0 Then + txtSigned = Format(txtSigned, "00/00/####") + If Not IsDate(txtSigned) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtSigned.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtSigned.SetFocus + End If + End If + +End Sub + +Private Sub txtStandards_GotFocus() + mboolFLAG = True + txtStandards.SelStart = 63000 +End Sub + +Private Sub txtStandards_LostFocus() + mboolFLAG = False + txtStandards = UCase(txtStandards) +End Sub + +Private Sub txtStucco_GotFocus() + Call FieldSelect(txtStucco) +End Sub + +Private Sub txtStucco_LostFocus() + txtStucco = UCase(txtStucco) +End Sub + +Private Sub txtTaxAuth_GotFocus() + Call FieldSelect(txtTaxAuth) +End Sub + +Private Sub txtTaxAuth_LostFocus() + txtTaxAuth = UCase(txtTaxAuth) +End Sub + +Private Sub txtTaxCode_GotFocus() + Call FieldSelect(txtTaxCode) +End Sub + +Private Sub txtTaxCode_LostFocus() + txtTaxCode = UCase(txtTaxCode) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub + +Private Sub txtYards_GotFocus() + Call FieldSelect(txtYards) +End Sub + +Private Sub txtYards_LostFocus() + txtYards = UCase(txtYards) +End Sub + +Private Sub LotCount() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT Proj_id, lorder, L_Flg FROM tblLotInfo WHERE l_flg = 'P' and Proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + mintLOTS = oRS.RecordCount + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frx new file mode 100644 index 0000000..a53a908 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProjNotes.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frm new file mode 100644 index 0000000..86b39b0 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frm @@ -0,0 +1,1547 @@ +VERSION 5.00 +Begin VB.Form frmProject + Caption = "Project Information" + ClientHeight = 7950 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 12120 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 7950 + ScaleWidth = 12120 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtEstimator + Height = 315 + Left = 3660 + TabIndex = 73 + Top = 7605 + Width = 3225 + End + Begin VB.CheckBox chkRND + Caption = "No Calc In TO" + Height = 225 + Left = 7995 + TabIndex = 71 + Top = 1500 + Width = 1455 + End + Begin VB.CheckBox chkPulteSW + Caption = "Pulte Super Wall" + Height = 225 + Left = 10200 + TabIndex = 70 + Top = 1500 + Width = 1500 + End + Begin VB.CheckBox chkPaintInv + Caption = "2 Paint Invoices" + Height = 255 + Left = 10200 + TabIndex = 69 + Top = 1185 + Width = 1785 + End + Begin VB.CheckBox chkPulte + Caption = "Pulte Special Calc" + Height = 210 + Left = 10200 + TabIndex = 68 + Top = 975 + Width = 1755 + End + Begin VB.TextBox txtConId + Alignment = 1 'Right Justify + BackColor = &H80000004& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 3570 + TabIndex = 66 + Top = 1215 + Width = 570 + End + Begin VB.CheckBox chkSYN + Caption = "Full Synthetic" + Height = 285 + Left = 10200 + TabIndex = 65 + Top = 690 + Width = 1620 + End + Begin VB.TextBox txtProjId + Alignment = 1 'Right Justify + BackColor = &H80000004& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 3555 + TabIndex = 64 + Top = 840 + Width = 570 + End + Begin VB.CheckBox chkShowAll + Caption = "Show All Projects" + Height = 210 + Left = 5175 + TabIndex = 63 + Top = 6300 + Width = 1695 + End + Begin VB.CheckBox chkINACTIVE + Caption = "Inactive Project" + Height = 270 + Left = 3720 + TabIndex = 62 + Top = 6255 + Width = 1485 + End + Begin VB.CheckBox chk2Dates + Caption = "Two Dates" + Height = 345 + Left = 6990 + TabIndex = 61 + Top = 4050 + Width = 750 + End + Begin VB.TextBox txtDue2 + Alignment = 2 'Center + Height = 285 + Left = 7200 + TabIndex = 59 + Top = 4845 + Width = 555 + End + Begin VB.CheckBox chkTYPAR + Caption = "TYPAR Stucco Wrap" + Height = 255 + Left = 10200 + TabIndex = 58 + Top = 465 + Width = 1950 + End + Begin VB.CheckBox chkBag100 + Caption = "75# Bag Sand/PreMix" + Height = 300 + Left = 10200 + TabIndex = 57 + Top = 210 + Width = 2025 + End + Begin VB.ComboBox cboWire + Height = 315 + ItemData = "frmProject.frx":0000 + Left = 4200 + List = "frmProject.frx":000D + Style = 2 'Dropdown List + TabIndex = 56 + Top = 5880 + Width = 1755 + End + Begin VB.CheckBox chkCertified + Caption = "Certified Payroll" + Height = 315 + Left = 6360 + TabIndex = 54 + Top = 5940 + Width = 1395 + End + Begin VB.ComboBox cboInvType + Height = 315 + ItemData = "frmProject.frx":0034 + Left = 5040 + List = "frmProject.frx":004A + Style = 2 'Dropdown List + TabIndex = 53 + Top = 5520 + Width = 2715 + End + Begin VB.ComboBox cboCompany + Height = 315 + ItemData = "frmProject.frx":009E + Left = 5040 + List = "frmProject.frx":00A8 + Style = 2 'Dropdown List + TabIndex = 51 + Top = 5160 + Width = 2715 + End + Begin VB.TextBox txtBidDue + Height = 315 + Left = 5040 + TabIndex = 9 + Top = 2220 + Width = 2655 + End + Begin VB.TextBox txtDue + Alignment = 2 'Center + Height = 285 + Left = 6600 + TabIndex = 20 + Top = 4845 + Width = 555 + End + Begin VB.TextBox txtInv + Height = 315 + Left = 9360 + MaxLength = 3 + TabIndex = 22 + Top = 420 + Width = 555 + End + Begin VB.TextBox txtRetention + Alignment = 1 'Right Justify + Height = 315 + Left = 7200 + MaxLength = 2 + TabIndex = 21 + Top = 420 + Width = 975 + End + Begin VB.TextBox txtSyn_O2 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 14 + Top = 3240 + Width = 975 + End + Begin VB.CheckBox chkOpen + Caption = "Use 50% Openings" + Height = 255 + Left = 10200 + TabIndex = 25 + Top = 15 + Width = 1755 + End + Begin VB.TextBox txtSYN_O + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 13 + Top = 2940 + Width = 975 + End + Begin VB.TextBox txtSYN_T + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5040 + TabIndex = 12 + Top = 2940 + Width = 975 + End + Begin VB.CheckBox chkBill + Caption = "Bill Lath && Stucco Combined" + Height = 255 + Left = 7560 + TabIndex = 24 + Top = 120 + Value = 1 'Checked + Width = 2355 + End + Begin VB.TextBox txtMAS90JC + Height = 315 + Left = 5040 + MaxLength = 4 + TabIndex = 19 + Top = 4800 + Width = 1080 + End + Begin VB.TextBox txtMAS90AR + Height = 315 + Left = 5040 + MaxLength = 7 + TabIndex = 18 + Top = 4500 + Width = 1080 + End + Begin VB.TextBox txtSWOrder + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "0;(0)" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 11 + Top = 2580 + Width = 975 + End + Begin VB.CheckBox chkFHA + Caption = "FHA Metal" + Height = 255 + Left = 6480 + TabIndex = 23 + Top = 120 + Width = 1155 + End + Begin VB.CheckBox chkComplete + Caption = "Project Completed" + Height = 255 + Left = 4800 + TabIndex = 37 + TabStop = 0 'False + Top = 120 + Width = 1695 + End + Begin VB.CheckBox chkGotBid + Caption = "Got Bid" + Height = 255 + Left = 3900 + TabIndex = 36 + TabStop = 0 'False + Top = 120 + Width = 855 + End + Begin VB.ListBox lstContractor + Height = 5520 + Left = 7800 + Sorted = -1 'True + TabIndex = 35 + TabStop = 0 'False + Top = 2235 + Visible = 0 'False + Width = 4275 + End + Begin VB.ComboBox cboStype + Height = 315 + ItemData = "frmProject.frx":00C7 + Left = 5040 + List = "frmProject.frx":00E0 + Style = 2 'Dropdown List + TabIndex = 17 + Top = 4200 + Width = 1935 + End + Begin VB.ComboBox cboFType + Height = 315 + ItemData = "frmProject.frx":0144 + Left = 5040 + List = "frmProject.frx":0151 + Style = 2 'Dropdown List + TabIndex = 16 + Top = 3900 + Width = 1935 + End + Begin VB.ComboBox cboBP + Height = 315 + ItemData = "frmProject.frx":0178 + Left = 5040 + List = "frmProject.frx":017A + Style = 2 'Dropdown List + TabIndex = 15 + Top = 3600 + Width = 4995 + End + Begin VB.TextBox txtSWAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5040 + MaxLength = 4 + TabIndex = 10 + Top = 2580 + Width = 975 + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 5040 + MaxLength = 15 + TabIndex = 8 + Top = 1860 + Width = 2655 + End + Begin VB.TextBox txtConSuper + Height = 315 + Left = 5040 + MaxLength = 15 + TabIndex = 7 + Top = 1500 + Width = 2655 + End + Begin VB.TextBox txtContractor + Height = 315 + Left = 5040 + MaxLength = 30 + TabIndex = 6 + Top = 1140 + Width = 5115 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 5040 + MaxLength = 30 + TabIndex = 5 + Top = 780 + Width = 5115 + End + Begin VB.TextBox txtCode + Height = 315 + Left = 5040 + MaxLength = 7 + TabIndex = 4 + Top = 420 + Width = 975 + End + Begin VB.ListBox lstProject + Height = 7665 + Left = 60 + Sorted = -1 'True + TabIndex = 1 + Top = 240 + Width = 3495 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 360 + Left = 3660 + TabIndex = 3 + TabStop = 0 'False + Top = 6930 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 360 + Left = 5100 + TabIndex = 2 + TabStop = 0 'False + Top = 6540 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + Height = 360 + Left = 5100 + TabIndex = 0 + TabStop = 0 'False + Top = 6930 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + Height = 360 + Left = 3660 + TabIndex = 26 + Top = 6540 + Width = 1395 + End + Begin VB.Label lblEstimate + AutoSize = -1 'True + Caption = "Estimator/s for this tract" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3690 + TabIndex = 74 + Top = 7365 + Width = 2070 + End + Begin VB.Label lblRND + Caption = "Will not increase calculations by 0.99 for second finish TO Only" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 7890 + TabIndex = 72 + Top = 1785 + Width = 2865 + End + Begin VB.Label lblContractor + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor:" + Height = 195 + Left = 4185 + TabIndex = 67 + Top = 1200 + Width = 780 + End + Begin VB.Label Label1 + Caption = "1 2" + Height = 165 + Left = 6810 + TabIndex = 60 + Top = 4665 + Width = 750 + End + Begin VB.Label lblWire + AutoSize = -1 'True + Caption = "Wire:" + Height = 195 + Left = 3720 + TabIndex = 55 + Top = 5940 + Width = 375 + End + Begin VB.Label lblInvType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory Type:" + Height = 195 + Left = 3855 + TabIndex = 52 + Top = 5520 + Width = 1110 + End + Begin VB.Label lblComp + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Company:" + Height = 195 + Left = 4260 + TabIndex = 50 + Top = 5160 + Width = 705 + End + Begin VB.Label lblBidDue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bid Due Date:" + Height = 195 + Left = 3960 + TabIndex = 49 + Top = 2280 + Width = 1005 + End + Begin VB.Label lblUDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6945 + TabIndex = 48 + Top = 7455 + Width = 3795 + End + Begin VB.Label lblUpdate + AutoSize = -1 'True + Caption = "Last Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6945 + TabIndex = 47 + Top = 7215 + Width = 1215 + End + Begin VB.Label lblCDate + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6945 + TabIndex = 46 + Top = 6795 + Width = 3795 + End + Begin VB.Label lblCreate + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6945 + TabIndex = 45 + Top = 6555 + Width = 735 + End + Begin VB.Label lblDue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Day of Month Due:" + Height = 195 + Left = 6435 + TabIndex = 44 + Top = 4500 + Width = 1350 + End + Begin VB.Label lblInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Code:" + Height = 195 + Left = 8280 + TabIndex = 43 + Top = 480 + Width = 990 + End + Begin VB.Label lblRetention + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Retention %:" + Height = 195 + Left = 6240 + TabIndex = 42 + Top = 480 + Width = 900 + End + Begin VB.Label lblSynOpen2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Adjust PopOuts:" + Height = 195 + Left = 4260 + TabIndex = 41 + Top = 3360 + Width = 1845 + End + Begin VB.Label lblSynAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Syn. Adjust T/O:" + Height = 195 + Left = 3780 + TabIndex = 40 + Top = 3000 + Width = 1185 + End + Begin VB.Label lblMAS90JC + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Job Cost Code:" + Height = 195 + Left = 3885 + TabIndex = 39 + Top = 4860 + Width = 1080 + End + Begin VB.Label lblMas90AR + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "MAS90 AR Code:" + Height = 195 + Left = 3705 + TabIndex = 38 + Top = 4560 + Width = 1260 + End + Begin VB.Label lblStuccoType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 4005 + TabIndex = 34 + Top = 4260 + Width = 960 + End + Begin VB.Label lblFoamType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Type:" + Height = 195 + Left = 4125 + TabIndex = 33 + Top = 3960 + Width = 840 + End + Begin VB.Label lblBPType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Black Paper Type:" + Height = 195 + Left = 3645 + TabIndex = 32 + Top = 3660 + Width = 1320 + End + Begin VB.Label lblSWAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 Kote Adjust T/O:" + Height = 195 + Left = 3630 + TabIndex = 31 + Top = 2640 + Width = 1335 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Super:" + Height = 195 + Left = 4080 + TabIndex = 30 + Top = 1920 + Width = 885 + End + Begin VB.Label lblConSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor Super:" + Height = 195 + Left = 3720 + TabIndex = 29 + Top = 1560 + Width = 1245 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Code:" + Height = 195 + Left = 4005 + TabIndex = 28 + Top = 480 + Width = 960 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 4500 + TabIndex = 27 + Top = 840 + Width = 465 + End +End +Attribute VB_Name = "frmProject" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolDelete As Boolean + +Private Sub cboWire_GotFocus() + If cboStype.Text <> "Three Coat" Then + cboWire.Text = "One Inch" + End If +End Sub + +Private Sub cboWire_LostFocus() + If cboWire.Text = "Paperback" Or cboWire.Text = "Self Furring" Then + If cboStype.Text <> "Three Coat" Then + MsgBox "Paperback and Self Furring are only valid for Three Coat - Select Again", vbOKOnly, "Wrong Wire Type" + cboWire.SetFocus + Exit Sub + End If + End If +End Sub + +Private Sub chkComplete_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub chkFHA_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub +Private Sub chkGotBid_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub chkINACTIVE_Click() +' If cmdSave.Enabled = True Then +' cmdSave.Enabled = False +' ElseIf cmdSave.Enabled = False Then +' cmdSave.Enabled = True +' End If + +End Sub + +Private Sub chkRND_Click() + If chkRND Then + lblRND.ForeColor = &HFF& + lblRND.Caption = "Will not increase calculations by 0.99 for second finish TO Only" + Else + lblRND.ForeColor = &H12& + lblRND.Caption = "Will increase calculations by 0.99 for second finish TO Only" + End If +End Sub + +Private Sub chkShowAll_Click() + Call ProjectLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False +' cmdDelete.Enabled = False + cmdExit.Enabled = False +' cmdFindCont.Visible = True + mboolAdding = True + lstProject.Enabled = False + Call FormClear +End Sub + +Private Sub cmdDelete_Click() + mboolDelete = False + Call CheckLots + If mboolDelete = True Then + moRSProj.Delete + End If + Call ProjectLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFindCont_Click() + Call ContractorLoad + lstContractor.Visible = True +End Sub + +Private Sub cmdSave_Click() + If Len(txtCode) = 0 Then + MsgBox "A Project Code is required to save" + txtCode.SetFocus + Else + lstProject.Enabled = True + ' cmdDelete.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + cmdExit.Enabled = True + lstContractor.Visible = False + Call FormSave + lstProject.SetFocus + End If +End Sub + +Private Sub Form_Load() + Call ProjectLoad + Call BPLoad + If gbytSECURITY < 3 Then + txtSWAdj.Enabled = True + txtSWOrder.Enabled = True + End If +End Sub + +Private Sub ProjectLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + If chkShowAll Then + strSQL = "SELECT Proj_id, Proj_code, Proj_Desc from tblProject" ' WHERE NOT InActive" + Else + strSQL = "SELECT Proj_id, Proj_code, Proj_Desc from tblProject WHERE NOT InActive" + End If + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstProject.Clear + + Do Until oRS.EOF + With lstProject + + strLine = oRS!Proj_Code & vbTab & oRS!Proj_Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!PROJ_ID + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstProject.ListCount Then + lstProject.ListIndex = -1 + End If + +End Sub + +Private Sub FormSave() +Dim intBOOKMARK As Integer + + On Error GoTo Error_EH + + If mboolAdding Then + moRSProj.AddNew + moRSProj!CUser = gstrLOGIN + moRSProj!pomax = 20 + Else + intBOOKMARK = lstProject.ListIndex + End If + + Call FieldsSave + + moRSProj.Update + + + If mboolAdding Then + mboolAdding = False + intBOOKMARK = 0 + End If + + Call ProjectLoad + + lstProject.ListIndex = intBOOKMARK + intBOOKMARK = 0 + Exit Sub + +Error_EH: + Call ErrorHandler(moRSProj.ActiveConnection) + Exit Sub +End Sub + +Private Sub BPLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT BP_Type, Desc from tblBPType" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + cboBP.Clear + + Do Until oRS.EOF + With cboBP + + strLine = oRS!bp_type & " " & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstProject.ListCount Then + lstProject.ListIndex = 0 + End If + +End Sub + +Private Sub ContractorLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT cont_id, CONTRCR from tblConInfo WHERE NOT INACTIVE" +' strSQL = "SELECT cont_id, CONTRCR from tblConInfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstContractor.Clear + + Do Until oRS.EOF + With lstContractor + .AddItem oRS!contrcr + .ItemData(.NewIndex) = oRS!cont_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstContractor.ListCount Then + lstContractor.Visible = True + lstContractor.ListIndex = 0 + lstContractor.SetFocus + Else + lstContractor.ListIndex = -1 + End If + +End Sub + +Private Sub FormClear() + txtCode = "" + txtDesc = "" + txtContractor = "" + txtConSuper = "" + txtVWPSuper = "" + txtSWAdj = 0 + txtSWOrder = 0 + txtSYN_T = 0 + txtSYN_O = 0 + txtSyn_O2 = 0 + chkSYN = vbUnchecked + txtProjId = "" + txtConId = "" + txtRetention = 0 + txtMAS90AR = "" + txtMAS90JC = "" + txtINV = "" + txtDue = 1 + txtDue2 = 1 + chk2Dates = vbUnchecked + chkINACTIVE = vbUnchecked + chkGotBid = vbUnchecked + chkComplete = vbUnchecked + chkFHA = vbUnchecked + chkBill = vbChecked + chkOpen = vbChecked + chkBag100 = vbUnchecked + chkTYPAR = vbUnchecked + chkPulte = vbUnchecked + chkPulteSW = vbUnchecked + chkPaintInv = vbUnchecked + cboBP.ListIndex = -1 + cboStype.ListIndex = -1 + cboFType.ListIndex = -1 + cboWire.ListIndex = -1 + txtEstimator = "" +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblproject " + strSQL = strSQL & "WHERE proj_id = " & gintPROJID + + Set moRSProj = New Recordset + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + + moRSProj.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSProj.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub FieldsSave() + + With moRSProj + !Proj_Code = Str2Field(txtCode) + !Proj_Desc = Str2Field(txtDesc) + !Proj_Cont = Str2Field(txtContractor) + !cont_sup = Str2Field(txtConSuper) + !vwp_sup = Str2Field(txtVWPSuper) + !cont_id = Str2Field(txtConId) + !sw_adj = Integer2Field(txtSWAdj) + !sw_order = Double2Field(txtSWOrder) + !gotbid = chkGotBid + !complete = chkComplete + !FHA = chkFHA + !ar = Str2Field(txtMAS90AR) + !biddate = Str2Field(txtBidDue) + !jccode = Str2Field(txtMAS90JC) + !bill = chkBill + !syn_t = Integer2Field(txtSYN_T) + !syn_o = Double2Field(txtSYN_O) + !syn_o2 = Double2Field(txtSyn_O2) + !SYNTHETIC = chkSYN + !use_open = chkOpen + !bag100 = chkBag100 + !TYPAR = chkTYPAR + !ftype = Field2Str(Left(cboFType.Text, 1)) + !retention = Integer2Field(txtRetention) + !inv = Str2Field(txtINV) + !DueDate = Integer2Field(txtDue) + !duedate2 = Integer2Field(txtDue2) + !inactive = Field2CheckBox(chkINACTIVE) + !twodates = Field2CheckBox(chk2Dates) + !Pulte = Field2CheckBox(chkPulte) + !P_SW = Field2CheckBox(chkPulteSW) + !Paint2 = Field2CheckBox(chkPaintInv) + !UUser = gstrLOGIN + !certpr = chkCertified + !Update = Now() + !NoCalc = chkRND + !Estimator = Field2Str(txtEstimator) +' !NoCalc = Field2CheckBox(chkRND) + + If cboStype.Text = "Superwall" Then + !stype = "S" + ElseIf cboStype.Text = "Pre-Mix Stucco" Then + !stype = "M" + ElseIf cboStype.Text = "Three Coat" Then + !stype = "T" + ElseIf cboStype.Text = "Synthetic" Then + !stype = "C" + ElseIf cboStype.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboStype.Text = "San Man" Then + !stype = "N" + ElseIf cboStype.Text = "Western 1 Kote" Then + !stype = "W" + End If + + If cboWire.Text = "Paperback" Then + !wire = "P" + ElseIf cboWire.Text = "Self Furring" Then + !wire = "F" + ElseIf cboWire.Text = "One Inch" Then + !wire = "O" + End If + + !bp_type = Left(Str2Field(cboBP.Text), 2) + + !cocode = cboCompany.ListIndex + !inv_type = cboInvType.ListIndex + End With + + moRSProj.Update + + +End Sub + +Private Sub lstContractor_DblClick() + txtContractor = lstContractor.List(lstContractor.ListIndex) + txtConId = lstContractor.ItemData(lstContractor.ListIndex) + lstContractor.Visible = False +' cmdFindCont.Visible = False + If Len(txtCode) = 0 Then + txtCode.SetFocus + Else + txtConSuper.SetFocus + End If +End Sub + +Private Sub lstProject_Click() + If lstProject.ListIndex <> -1 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + If FormFind() Then + Call FormShow +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + + End If + End If + +End Sub + +Private Sub FormShow() + mboolSHOW = True + gintPROJID = moRSProj!PROJ_ID + + With moRSProj + txtCode = Field2Str(!Proj_Code) + txtDesc = Field2Str(!Proj_Desc) + txtContractor = Field2Str(!Proj_Cont) + txtConSuper = Field2Str(!cont_sup) + txtVWPSuper = Field2Str(!vwp_sup) + txtSWAdj = Field2Str2(!sw_adj) + txtSWOrder = Format(Field2Str2(!sw_order), "##.00") + txtProjId = Field2Str(!PROJ_ID) + txtConId = Field2Str(!cont_id) + txtSYN_T = Field2Str(!syn_t) + txtSYN_O = Field2Double(!syn_o) + txtSyn_O2 = Field2Double(!syn_o2) + txtBidDue = Field2Str(!biddate) + chkSYN = Field2CheckBox(!SYNTHETIC) + chkGotBid = Field2CheckBox(!gotbid) + chkComplete = Field2CheckBox(!complete) + chkFHA = Field2CheckBox(!FHA) + chkBill = Field2CheckBox(!bill) + chkOpen = Field2CheckBox(!use_open) + chkRND = Field2CheckBox(!NoCalc) + If chkRND Then + lblRND.ForeColor = &HFF& + lblRND.Caption = "Will not increase calculations by 0.99 for second finish TO Only" + Else + lblRND.ForeColor = &H12& + lblRND.Caption = "Will increase calculations by 0.99 for second finish TO Only" + End If + txtMAS90AR = Field2Str(!ar) + txtMAS90JC = Field2Str(!jccode) + txtRetention = Field2Str2(!retention) + txtINV = Field2Str(!inv) + txtDue = Field2Str(!DueDate) + txtDue2 = Field2Str(!duedate2) + chk2Dates = Field2CheckBox(!twodates) + chkINACTIVE = Field2CheckBox(!inactive) + chkPulte = Field2CheckBox(!Pulte) + chkPulteSW = Field2CheckBox(!P_SW) + chkPaintInv = Field2CheckBox(!Paint2) + lblCDate = Field2Str(!Create) + lblCDate = lblCDate & " - " & Field2Str(!CUser) + lblUDate = Field2Str(!Update) + lblUDate = lblUDate & " - " & Field2Str(!UUser) + chkCertified = Field2CheckBox(!certpr) + chkBag100 = Field2CheckBox(!bag100) + chkTYPAR = Field2CheckBox(!TYPAR) + txtEstimator = Field2Str(!Estimator) + If !wire = "O" Then + cboWire.Text = "One Inch" + ElseIf !wire = "P" Then + cboWire.Text = "Paperback" + ElseIf !wire = "F" Then + cboWire.Text = "Self Furring" + End If + + If !ftype = "O" Then + cboFType.Text = "One Inch" + ElseIf !ftype = "T" Then + cboFType.Text = "One Inch" + ElseIf !ftype = "D" Then + cboFType.Text = "Dow Foam" + ElseIf !ftype = "U" Then + cboFType.Text = "Urethane Foam" + End If + + If !stype = "S" Then + cboStype.Text = "Superwall" + ElseIf !stype = "M" Then + cboStype.Text = "Pre-Mix Stucco" + ElseIf !stype = "T" Then + cboStype.Text = "Three Coat" + ElseIf !stype = "C" Then + cboStype.Text = "Synthetic" + ElseIf !stype = "B" Then + cboStype.Text = "Synthetic w/ 1 Kote" + ElseIf !stype = "W" Then + cboStype.Text = "Western 1 Kote" + ElseIf !stype = "N" Then + cboStype.Text = "San Man" + End If + cboCompany.ListIndex = Field2Str2(!cocode) + cboInvType.ListIndex = Field2Str2(!inv_type) + Call CBFindString3(cboBP, Field2Str(!bp_type)) + + End With + mboolSHOW = False +End Sub + +Private Sub CheckLots() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSQL As String, intResponse As Integer, strMSG As String +Dim strSELECT As String, strGET As String, intID As Integer + + strSQL = "SELECT Lot_no FROM tblLotInfo where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strMSG = "There have been Lots processed for this Subdivision." + strMSG = strMSG & vbCrLf & "You cannot delete this Project" + intResponse = MsgBox(strMSG, vbCritical & vbOKOnly, "Delete Error") + Exit Sub + End If + oRS.Close + + strSQL = "SELECT est_id FROM tblplans where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Plans in the database for this subdivision" + strMSG = strMSG & vbCrLf & "Do you want to Delete These Plans Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Plans Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!est_id + strGET = "SELECT optid FROM tblPOptions where estid = " & intID + Set oRSS = New Recordset + oRSS.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + If oRSS.RecordCount > 0 Then + Do Until oRSS.EOF + strGET = "DELETE * FROM tblPOMatrl where optid = " & oRSS!OPTID + goConn.Execute strGET + oRSS.MoveNext + Loop + End If + strGET = "DELETE * FROM tblPOptions where est_id = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblplanmat where est_id = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblPlans where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close + Exit Sub + End If + End If + + + strSQL = "SELECT toid FROM tbltake where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Takeoffs in the database for this subdivision" + strMSG = strMSG & vbCrLf & "Do you want to Delete These Takeoffs Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Takeoff Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!toid + strGET = "DELETE * FROM tbloption WHERE toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblOptMatrl where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblMeasure where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblTOMatrl where toid = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblTake where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close + Exit Sub + End If + End If + mboolDelete = True +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strSQL As String + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + + If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown Then + Call cmdFindCont_Click +' gintPROJID = lstProject.ItemData(lstProject.ListIndex) +' gintLOTID = lstLots.ItemData(lstLots.ListIndex) +' frmPaySheet.Show 1 + End If + Exit Sub + End If + +End Sub + +Private Sub lstProject_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub txtCode_GotFocus() + Call FieldSelect(txtCode) +End Sub + +Private Sub txtCode_LostFocus() + txtCode = UCase(txtCode) +End Sub + +Private Sub txtConSuper_GotFocus() + Call FieldSelect(txtConSuper) +End Sub + +Private Sub txtConSuper_LostFocus() + txtConSuper = UCase(txtConSuper) +End Sub + +Private Sub txtContractor_GotFocus() + Call FieldSelect(txtContractor) +End Sub + +Private Sub txtContractor_LostFocus() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + If txtConId = "" Then + txtContractor = UCase(txtContractor) + + strSQL = "SELECT cont_id, CONTRCR, AR from tblConInfo WHERE contrcr = '" & Field2Str(txtContractor) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + Call ContractorLoad + lstContractor.Visible = True + Else + ' txtContractor = lstContractor.List(lstContractor.ListIndex) + txtConId = Field2Str(oRS!cont_id) + txtMAS90AR = Field2Str(oRS!ar) + End If + End If +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtEstimator_GotFocus() + Call FieldSelect(txtEstimator) +End Sub + +Private Sub txtEstimator_LostFocus() + txtEstimator = UCase(txtEstimator) +End Sub + +Private Sub txtInv_GotFocus() + Call FieldSelect(txtINV) +End Sub + +Private Sub txtInv_LostFocus() + txtINV = UCase(txtINV) +End Sub + +Private Sub txtMAS90AR_GotFocus() + Call FieldSelect(txtMAS90AR) +End Sub + +Private Sub txtMAS90AR_LostFocus() + txtMAS90AR = UCase(txtMAS90AR) +End Sub + +Private Sub txtMAS90JC_GotFocus() + Call FieldSelect(txtMAS90JC) +End Sub + +Private Sub txtMAS90JC_LostFocus() + txtMAS90JC = UCase(txtMAS90JC) +End Sub + +Private Sub txtSWAdj_GotFocus() + Call FieldSelect(txtSWAdj) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub +Private Sub txtBidDue_GotFocus() + Call FieldSelect(txtBidDue) +End Sub + +Private Sub txtBidDue_LostFocus() + If Len(txtBidDue) > 0 Then + txtBidDue = Format(txtBidDue, "00/00/####") + If Not IsDate(txtBidDue) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBidDue.SetFocus + End If + End If +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frx new file mode 100644 index 0000000..5a59f15 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frm new file mode 100644 index 0000000..b81dd34 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frm @@ -0,0 +1,1108 @@ +VERSION 5.00 +Begin VB.Form frmProject2 + Caption = "Project Information" + ClientHeight = 6495 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 12120 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6495 + ScaleWidth = 12120 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtDue + Height = 315 + Left = 6600 + TabIndex = 19 + Top = 4800 + Width = 555 + End + Begin VB.TextBox txtInv + Height = 315 + Left = 9360 + MaxLength = 2 + TabIndex = 21 + Top = 480 + Width = 555 + End + Begin VB.TextBox txtRetention + Alignment = 1 'Right Justify + Height = 315 + Left = 7200 + MaxLength = 2 + TabIndex = 20 + Top = 480 + Width = 975 + End + Begin VB.TextBox txtSyn_O2 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 13 + Top = 3000 + Width = 975 + End + Begin VB.CheckBox chkOpen + Caption = "Use 50% Openings" + Height = 255 + Left = 9960 + TabIndex = 24 + Top = 120 + Width = 1755 + End + Begin VB.TextBox txtSYN_O + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 12 + Top = 2640 + Width = 975 + End + Begin VB.TextBox txtSYN_T + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5040 + TabIndex = 11 + Top = 2640 + Width = 975 + End + Begin VB.CheckBox chkBill + Caption = "Bill Lath && Stucco Combined" + Height = 255 + Left = 7560 + TabIndex = 23 + Top = 120 + Value = 1 'Checked + Width = 2355 + End + Begin VB.TextBox txtMAS90JC + Height = 315 + Left = 5040 + MaxLength = 4 + TabIndex = 18 + Top = 4800 + Width = 1080 + End + Begin VB.TextBox txtMAS90AR + Height = 315 + Left = 5040 + MaxLength = 7 + TabIndex = 17 + Top = 4440 + Width = 1080 + End + Begin VB.TextBox txtSWOrder + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 10 + Top = 2280 + Width = 975 + End + Begin VB.CheckBox chkFHA + Caption = "FHA Metal" + Height = 255 + Left = 6480 + TabIndex = 22 + Top = 120 + Width = 1155 + End + Begin VB.CheckBox chkComplete + Caption = "Project Completed" + Height = 255 + Left = 4800 + TabIndex = 39 + TabStop = 0 'False + Top = 120 + Width = 1695 + End + Begin VB.CheckBox chkGotBid + Caption = "Got Bid" + Height = 255 + Left = 3900 + TabIndex = 38 + TabStop = 0 'False + Top = 120 + Width = 855 + End + Begin VB.TextBox txtProjId + BackColor = &H80000004& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 10740 + TabIndex = 37 + Top = 480 + Width = 975 + End + Begin VB.TextBox txtConId + BackColor = &H80000004& + BorderStyle = 0 'None + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 10740 + TabIndex = 36 + Top = 840 + Width = 975 + End + Begin VB.ListBox lstContractor + Height = 4740 + Left = 7800 + Sorted = -1 'True + TabIndex = 35 + TabStop = 0 'False + Top = 1620 + Visible = 0 'False + Width = 4215 + End + Begin VB.ComboBox cboStype + Height = 315 + ItemData = "frmProject2.frx":0000 + Left = 5040 + List = "frmProject2.frx":0019 + Style = 2 'Dropdown List + TabIndex = 16 + Top = 4080 + Width = 1935 + End + Begin VB.ComboBox cboFType + Height = 315 + ItemData = "frmProject2.frx":0079 + Left = 5040 + List = "frmProject2.frx":0086 + Style = 2 'Dropdown List + TabIndex = 15 + Top = 3720 + Width = 1935 + End + Begin VB.ComboBox cboBP + Height = 315 + ItemData = "frmProject2.frx":00AD + Left = 5040 + List = "frmProject2.frx":00AF + Style = 2 'Dropdown List + TabIndex = 14 + Top = 3360 + Width = 4995 + End + Begin VB.TextBox txtSWAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5040 + MaxLength = 4 + TabIndex = 9 + Top = 2280 + Width = 975 + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 5040 + MaxLength = 15 + TabIndex = 8 + Top = 1920 + Width = 2655 + End + Begin VB.TextBox txtConSuper + Height = 315 + Left = 5040 + MaxLength = 15 + TabIndex = 7 + Top = 1560 + Width = 2655 + End + Begin VB.TextBox txtContractor + Height = 315 + Left = 5040 + MaxLength = 30 + TabIndex = 6 + Top = 1200 + Width = 5115 + End + Begin VB.TextBox txtDesc + Height = 315 + Left = 5040 + MaxLength = 30 + TabIndex = 5 + Top = 840 + Width = 5115 + End + Begin VB.TextBox txtCode + Height = 315 + Left = 5040 + MaxLength = 6 + TabIndex = 4 + Top = 480 + Width = 975 + End + Begin VB.ListBox lstProject + Height = 6300 + Left = 300 + Sorted = -1 'True + TabIndex = 1 + Top = 60 + Width = 3255 + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 3600 + TabIndex = 3 + TabStop = 0 'False + Top = 5880 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5040 + TabIndex = 2 + TabStop = 0 'False + Top = 5220 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Enabled = 0 'False + Height = 555 + Left = 5040 + TabIndex = 0 + TabStop = 0 'False + Top = 5880 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Enabled = 0 'False + Height = 555 + Left = 3600 + TabIndex = 25 + Top = 5220 + Width = 1395 + End + Begin VB.Label lblDue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Day of Month Due:" + Height = 195 + Left = 6240 + TabIndex = 46 + Top = 4500 + Width = 1350 + End + Begin VB.Label lblInv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Code:" + Height = 195 + Left = 8280 + TabIndex = 45 + Top = 540 + Width = 990 + End + Begin VB.Label lblRetention + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Retention %:" + Height = 195 + Left = 6240 + TabIndex = 44 + Top = 540 + Width = 900 + End + Begin VB.Label lblSynOpen2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Synthetic Adjust PopOuts:" + Height = 195 + Left = 4260 + TabIndex = 43 + Top = 3060 + Width = 1845 + End + Begin VB.Label lblSynAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Syn. Adjust T/O:" + Height = 195 + Left = 3780 + TabIndex = 42 + Top = 2700 + Width = 1185 + End + Begin VB.Label lblMAS90JC + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Job Cost Code:" + Height = 195 + Left = 3885 + TabIndex = 41 + Top = 4860 + Width = 1080 + End + Begin VB.Label lblMas90AR + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "MAS90 AR Code:" + Height = 195 + Left = 3705 + TabIndex = 40 + Top = 4500 + Width = 1260 + End + Begin VB.Label lblStuccoType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 4005 + TabIndex = 34 + Top = 4140 + Width = 960 + End + Begin VB.Label lblFoamType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Type:" + Height = 195 + Left = 4125 + TabIndex = 33 + Top = 3780 + Width = 840 + End + Begin VB.Label lblBPType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Black Paper Type:" + Height = 195 + Left = 3645 + TabIndex = 32 + Top = 3420 + Width = 1320 + End + Begin VB.Label lblSWAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1 Kote Adjust T/O:" + Height = 195 + Left = 3630 + TabIndex = 31 + Top = 2340 + Width = 1335 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Super:" + Height = 195 + Left = 4080 + TabIndex = 30 + Top = 1980 + Width = 885 + End + Begin VB.Label lblConSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor Super:" + Height = 195 + Left = 3720 + TabIndex = 29 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblContractor + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contractor:" + Height = 195 + Left = 4185 + TabIndex = 28 + Top = 1260 + Width = 780 + End + Begin VB.Label lblCode + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project Code:" + Height = 195 + Left = 4005 + TabIndex = 27 + Top = 540 + Width = 960 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 4500 + TabIndex = 26 + Top = 900 + Width = 465 + End +End +Attribute VB_Name = "frmProject2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSProj As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolDelete As Boolean + +Private Sub chkComplete_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub chkFHA_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub +Private Sub chkGotBid_Click() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False +' cmdDelete.Enabled = False + cmdExit.Enabled = False +' cmdFindCont.Visible = True + mboolAdding = True + lstProject.Enabled = False + Call FormClear +End Sub + +Private Sub cmdDelete_Click() + mboolDelete = False + Call CheckLots + If mboolDelete = True Then + moRSProj.Delete + End If + Call ProjectLoad +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFindCont_Click() + Call ContractorLoad + lstContractor.Visible = True +End Sub + +Private Sub cmdSave_Click() + If Len(txtCode) = 0 Then + MsgBox "A Project Code is required to save" + txtCode.SetFocus + Else + lstProject.Enabled = True + ' cmdDelete.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + cmdExit.Enabled = True + lstContractor.Visible = False + Call FormSave + lstProject.SetFocus + End If +End Sub + +Private Sub Form_Load() + Call ProjectLoad + Call BPLoad + If gbytSECURITY < 3 Then + txtSWAdj.Enabled = True + txtSWOrder.Enabled = True + End If +End Sub + +Private Sub ProjectLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT Proj_id, Proj_code, Proj_Desc from tblProject" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstProject.Clear + + Do Until oRS.EOF + With lstProject + + strLine = oRS!proj_code & vbTab & oRS!proj_desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!proj_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstProject.ListCount Then + lstProject.ListIndex = -1 + End If + +End Sub + +Private Sub FormSave() +Dim intBookmark As Integer + + On Error GoTo Error_EH + + If mboolAdding Then + moRSProj.AddNew + moRSProj!CUser = gstrLOGIN + Else + intBookmark = lstProject.ListIndex + End If + + Call FieldsSave + + moRSProj.Update + + + If mboolAdding Then + mboolAdding = False + intBookmark = 0 + End If + + Call ProjectLoad + + lstProject.ListIndex = intBookmark + Exit Sub + +Error_EH: + Call ErrorHandler(moRSProj.ActiveConnection) + Exit Sub +End Sub + +Private Sub BPLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT BP_Type, Desc from tblBPType" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + cboBP.Clear + + Do Until oRS.EOF + With cboBP + + strLine = oRS!bp_type & " " & oRS!Desc + .AddItem strLine + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstProject.ListCount Then + lstProject.ListIndex = 0 + End If + +End Sub + +Private Sub ContractorLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT cont_id, CONTRCR from tblConInfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstContractor.Clear + + Do Until oRS.EOF + With lstContractor + .AddItem oRS!contrcr + .ItemData(.NewIndex) = oRS!cont_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstContractor.ListCount Then + lstContractor.Visible = True + lstContractor.ListIndex = 0 + lstContractor.SetFocus + Else + lstContractor.ListIndex = -1 + End If + +End Sub + +Private Sub FormClear() + txtCode = "" + txtDesc = "" + txtContractor = "" + txtConSuper = "" + txtVWPSuper = "" + txtSWAdj = 0 + txtSWOrder = 0 + txtSYN_T = 0 + txtSYN_O = 0 + txtSyn_O2 = 0 + txtProjId = "" + txtConId = "" + txtRetention = 0 + txtMAS90AR = "" + txtMAS90JC = "" + txtInv = "" + txtDue = 1 + chkGotBid = vbUnchecked + chkComplete = vbUnchecked + chkFHA = vbUnchecked + chkBill = vbChecked + chkOpen = vbChecked + cboBP.ListIndex = -1 + cboStype.ListIndex = -1 + cboFType.ListIndex = -1 +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblproject " + strSQL = strSQL & "WHERE proj_id = " & gintPROJID + + Set moRSProj = New Recordset + + If moRSProj.State = adStateOpen Then + moRSProj.Close + End If + + moRSProj.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSProj.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub FieldsSave() + + With moRSProj + !proj_code = Str2Field(txtCode) + !proj_desc = Str2Field(txtDesc) + !proj_cont = Str2Field(txtContractor) + !cont_sup = Str2Field(txtConSuper) + !vwp_sup = Str2Field(txtVWPSuper) + !cont_id = Str2Field(txtConId) + !sw_adj = Integer2Field(txtSWAdj) + !sw_order = Integer2Field(txtSWOrder) + !gotbid = chkGotBid + !complete = chkComplete + !FHA = chkFHA + !ar = Str2Field(txtMAS90AR) + !jccode = Str2Field(txtMAS90JC) + !bill = chkBill + !syn_t = Integer2Field(txtSYN_T) + !syn_o = Integer2Field(txtSYN_O) + !syn_o2 = Integer2Field(txtSyn_O2) + !use_open = chkOpen + !ftype = Field2Str(Left(cboFType.Text, 1)) + !retention = Integer2Field(txtRetention) + !inv = Str2Field(txtInv) + !duedate = Integer2Field(txtDue) + !UUser = gstrLOGIN + !Update = Date + + If cboStype.Text = "Superwall" Then + !stype = "S" + ElseIf cboStype.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboStype.Text = "Three Coat" Then + !stype = "T" + ElseIf cboStype.Text = "Synthetic" Then + !stype = "C" + ElseIf cboStype.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboStype.Text = "San Man" Then + !stype = "N" + ElseIf cboStype.Text = "Western 1 Kote" Then + !stype = "W" + End If + + !bp_type = Left(Str2Field(cboBP.Text), 2) + + End With + + moRSProj.Update + + +End Sub + +Private Sub lstContractor_DblClick() + txtContractor = lstContractor.List(lstContractor.ListIndex) + txtConId = lstContractor.ItemData(lstContractor.ListIndex) + lstContractor.Visible = False +' cmdFindCont.Visible = False + If Len(txtCode) = 0 Then + txtCode.SetFocus + Else + txtConSuper.SetFocus + End If +End Sub + +Private Sub lstProject_Click() + If lstProject.ListIndex <> -1 Then + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + If FormFind() Then + Call FormShow +' Call MatLoad +' Call OptLoad +' Call OptMatLoad + + End If + End If + +End Sub + +Private Sub FormShow() + mboolSHOW = True + gintPROJID = moRSProj!proj_id + + With moRSProj + txtCode = Field2Str(!proj_code) + txtDesc = Field2Str(!proj_desc) + txtContractor = Field2Str(!proj_cont) + txtConSuper = Field2Str(!cont_sup) + txtVWPSuper = Field2Str(!vwp_sup) + txtSWAdj = Field2Str2(!sw_adj) + txtSWOrder = Field2Str2(!sw_order) + txtProjId = Field2Str(!proj_id) + txtConId = Field2Str(!cont_id) + txtSYN_T = Field2Str(!syn_t) + txtSYN_O = Field2Str(!syn_o) + txtSyn_O2 = Field2Str(!syn_o2) + chkGotBid = Field2CheckBox(!gotbid) + chkComplete = Field2CheckBox(!complete) + chkFHA = Field2CheckBox(!FHA) + chkBill = Field2CheckBox(!bill) + chkOpen = Field2CheckBox(!use_open) + txtMAS90AR = Field2Str(!ar) + txtMAS90JC = Field2Str(!jccode) + txtRetention = Field2Str2(!retention) + txtInv = Field2Str(!inv) + txtDue = Field2Str(!duedate) + + If !ftype = "O" Then + cboFType.Text = "One Inch" + ElseIf !ftype = "T" Then + cboFType.Text = "One Inch" + ElseIf !ftype = "D" Then + cboFType.Text = "Dow Foam" + ElseIf !ftype = "U" Then + cboFType.Text = "Urethane Foam" + End If + + If !stype = "S" Then + cboStype.Text = "Superwall" + ElseIf !stype = "M" Then + cboStype.Text = "Magna Wall" + ElseIf !stype = "T" Then + cboStype.Text = "Three Coat" + ElseIf !stype = "C" Then + cboStype.Text = "Synthetic" + ElseIf !stype = "B" Then + cboStype.Text = "Synthetic w/ 1 Kote" + ElseIf !stype = "W" Then + cboStype.Text = "Western 1 Kote" + ElseIf !stype = "N" Then + cboStype.Text = "San Man" + End If + + Call CBFindString3(cboBP, Field2Str(!bp_type)) + + End With + mboolSHOW = False +End Sub + +Private Sub CheckLots() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset +Dim strSQL As String, intResponse As Integer, strMSG As String +Dim strSELECT As String, strGET As String, intID As Integer + + strSQL = "SELECT Lot_no FROM tblLotInfo where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + strMSG = "There have been Lots processed for this Subdivision." + strMSG = strMSG & vbCrLf & "You cannot delete this Project" + intResponse = MsgBox(strMSG, vbCritical & vbOKOnly, "Delete Error") + Exit Sub + End If + oRS.Close + + strSQL = "SELECT est_id FROM tblplans where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Plans in the database for this subdivision" + strMSG = strMSG & vbCrLf & "Do you want to Delete These Plans Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Plans Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!est_id + strGET = "SELECT optid FROM tblPOptions where estid = " & intID + Set oRSS = New Recordset + oRSS.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic + If oRSS.RecordCount > 0 Then + Do Until oRSS.EOF + strGET = "DELETE * FROM tblPOMatrl where optid = " & oRSS!OPTID + goConn.Execute strGET + oRSS.MoveNext + Loop + End If + strGET = "DELETE * FROM tblPOptions where est_id = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblplanmat where est_id = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblPlans where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close + Exit Sub + End If + End If + + + strSQL = "SELECT toid FROM tbltake where proj_id = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If oRS.RecordCount > 0 Then + strMSG = "There are Takeoffs in the database for this subdivision" + strMSG = strMSG & vbCrLf & "Do you want to Delete These Takeoffs Also?" + intResponse = MsgBox(strMSG, vbQuestion & vbYesNo, "Project Takeoff Delete Error") + If intResponse = vbYes Then + Do Until oRS.EOF + intID = oRS!toid + strGET = "DELETE * FROM tbloption WHERE toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblOptMatrl where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblMeasure where toid = " & intID + goConn.Execute strGET + strGET = "DELETE * FROM tblTOMatrl where toid = " & intID + goConn.Execute strGET + oRS.MoveNext + Loop + oRS.Close + strGET = "DELETE * FROM tblTake where proj_id = " & gintPROJID + goConn.Execute strGET + ElseIf intResponse = vbNo Then + oRS.Close + Exit Sub + End If + End If + mboolDelete = True +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub txtCode_GotFocus() + Call FieldSelect(txtCode) +End Sub + +Private Sub txtCode_LostFocus() + txtCode = UCase(txtCode) +End Sub + +Private Sub txtConSuper_GotFocus() + Call FieldSelect(txtConSuper) +End Sub + +Private Sub txtConSuper_LostFocus() + txtConSuper = UCase(txtConSuper) +End Sub + +Private Sub txtContractor_GotFocus() + Call FieldSelect(txtContractor) +End Sub + +Private Sub txtContractor_LostFocus() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + If txtConId = "" Then + txtContractor = UCase(txtContractor) + + strSQL = "SELECT cont_id, CONTRCR, AR from tblConInfo WHERE contrcr = '" & Field2Str(txtContractor) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.EOF Then + Call ContractorLoad + lstContractor.Visible = True + Else + ' txtContractor = lstContractor.List(lstContractor.ListIndex) + txtConId = Field2Str(oRS!cont_id) + txtMAS90AR = Field2Str(oRS!ar) + End If + End If +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInv_GotFocus() + Call FieldSelect(txtInv) +End Sub + +Private Sub txtInv_LostFocus() + txtInv = UCase(txtInv) +End Sub + +Private Sub txtMAS90AR_GotFocus() + Call FieldSelect(txtMAS90AR) +End Sub + +Private Sub txtMAS90AR_LostFocus() + txtMAS90AR = UCase(txtMAS90AR) +End Sub + +Private Sub txtMAS90JC_GotFocus() + Call FieldSelect(txtMAS90JC) +End Sub + +Private Sub txtMAS90JC_LostFocus() + txtMAS90JC = UCase(txtMAS90JC) +End Sub + +Private Sub txtSWAdj_GotFocus() + Call FieldSelect(txtSWAdj) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frx new file mode 100644 index 0000000..dfa81af Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmProject2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frm new file mode 100644 index 0000000..81a92ea --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frm @@ -0,0 +1,310 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmRCrew + Caption = "Repair Crew" + ClientHeight = 6420 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 9615 + LinkTopic = "Form1" + ScaleHeight = 6420 + ScaleWidth = 9615 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 7860 + TabIndex = 8 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5700 + TabIndex = 7 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 2580 + TabIndex = 6 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 420 + TabIndex = 5 + Top = 5760 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 4140 + Picture = "frmRCrew.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4500 + Picture = "frmRCrew.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4845 + Picture = "frmRCrew.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 5205 + Picture = "frmRCrew.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 5880 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5535 + Left = 60 + TabIndex = 0 + Top = 120 + Width = 9480 + _ExtentX = 16722 + _ExtentY = 9763 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Repair Person" + Columns(0).DataField= "Name" + Columns(0).DataWidth= 25 + Columns(0).EditMask= ">@@@@@@@@@@@@@@@@@@@@@@@@@" + Columns(0).EditMaskUpdate= -1 'True + Columns(0).ConvertEmptyCell= 1 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Cell Phone #" + Columns(1).DataField= "cPhone" + Columns(1).DataWidth= 12 + Columns(1).NumberFormat= "Edit Mask" + Columns(1).EditMask= "(###) ###-####" + Columns(1).EditMaskUpdate= -1 'True + Columns(1).ConvertEmptyCell= 1 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Home Phone #" + Columns(2).DataField= "hphone" + Columns(2).DataWidth= 14 + Columns(2).NumberFormat= "Fixed" + Columns(2).EditMask= "(###) ###-####" + Columns(2).EditMaskUpdate= -1 'True + Columns(2).ConvertEmptyCell= 1 + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Radio ID" + Columns(3).DataField= "Radio" + Columns(3).DataWidth= 10 + Columns(3).EditMask= ">@@@@@@@@@@" + Columns(3).EditMaskUpdate= -1 'True + Columns(3).ConvertEmptyCell= 1 + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 4 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=4" + Splits(0)._ColumnProps(1)= "Column(0).Width=6509" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=6429" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=2963" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=2884" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=2937" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=2858" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=3387" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=3307" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + TabAction = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=50,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=47,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=48,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=49,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=46,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=43,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=44,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=45,.parent=17" + _StyleDefs(46) = "Named:id=33:Normal" + _StyleDefs(47) = ":id=33,.parent=0" + _StyleDefs(48) = "Named:id=34:Heading" + _StyleDefs(49) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(50) = ":id=34,.wraptext=-1,.bold=-1,.fontsize=975,.italic=0,.underline=0" + _StyleDefs(51) = ":id=34,.strikethrough=0,.charset=0" + _StyleDefs(52) = ":id=34,.fontname=MS Sans Serif" + _StyleDefs(53) = "Named:id=35:Footing" + _StyleDefs(54) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(55) = "Named:id=36:Selected" + _StyleDefs(56) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(57) = "Named:id=37:Caption" + _StyleDefs(58) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(59) = "Named:id=38:HighlightRow" + _StyleDefs(60) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(61) = "Named:id=39:EvenRow" + _StyleDefs(62) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(63) = "Named:id=40:OddRow" + _StyleDefs(64) = ":id=40,.parent=33" + _StyleDefs(65) = "Named:id=41:RecordSelector" + _StyleDefs(66) = ":id=41,.parent=34" + _StyleDefs(67) = "Named:id=42:FilterBar" + _StyleDefs(68) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmRCrew" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblRCrew ORDER by RC_ID" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRCrew.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepList.frm new file mode 100644 index 0000000..42fce94 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepList.frm @@ -0,0 +1,582 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmRepList + Caption = "Report List" + ClientHeight = 5085 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8115 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5085 + ScaleWidth = 8115 + StartUpPosition = 3 'Windows Default + Begin MSComDlg.CommonDialog CMDialog1 + Left = 7575 + Top = 2445 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.CommandButton cmdPrnSetup + Caption = "Printer Set&up" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5475 + TabIndex = 16 + TabStop = 0 'False + Top = 4485 + Width = 1275 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5475 + TabIndex = 15 + TabStop = 0 'False + Top = 3765 + Width = 1275 + End + Begin Crystal.CrystalReport crRepList + Left = 6855 + Top = 2505 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.TextBox txtCopy + Alignment = 1 'Right Justify + Height = 285 + Left = 6075 + TabIndex = 13 + Top = 2685 + Width = 375 + End + Begin VB.Frame fraDestination + Caption = "Destination " + Height = 1080 + Left = 5400 + TabIndex = 10 + Top = 1560 + Width = 1335 + Begin VB.OptionButton optDest + Caption = "Excell" + Height = 225 + Index = 2 + Left = 180 + TabIndex = 17 + Top = 795 + Width = 1065 + End + Begin VB.OptionButton optDest + Caption = "Printer" + Height = 195 + Index = 1 + Left = 180 + TabIndex = 12 + Top = 517 + Width = 975 + End + Begin VB.OptionButton optDest + Caption = "Window" + Height = 195 + Index = 0 + Left = 180 + TabIndex = 11 + Top = 240 + Value = -1 'True + Width = 1095 + End + End + Begin VB.TextBox txtDesc + Height = 615 + Left = 5400 + MultiLine = -1 'True + TabIndex = 6 + Top = 900 + Width = 2655 + End + Begin VB.TextBox txtFile + Height = 315 + Left = 5400 + TabIndex = 5 + Top = 300 + Width = 2655 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 6795 + TabIndex = 4 + TabStop = 0 'False + Top = 3765 + Width = 1275 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 6795 + TabIndex = 3 + TabStop = 0 'False + Top = 4485 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 6795 + TabIndex = 7 + Top = 3045 + Width = 1275 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add Report" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 5475 + TabIndex = 2 + Top = 3045 + Width = 1275 + End + Begin VB.ListBox lstReports + Height = 4545 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 300 + Width = 5295 + End + Begin VB.Label lblCopy + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Copies:" + Height = 195 + Left = 5475 + TabIndex = 14 + Top = 2745 + Width = 525 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Report Description:" + Height = 195 + Left = 5400 + TabIndex = 9 + Top = 660 + Width = 1365 + End + Begin VB.Label lblFile + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "File Name:" + Height = 195 + Left = 5400 + TabIndex = 8 + Top = 60 + Width = 750 + End + Begin VB.Label lblRepList + AutoSize = -1 'True + Caption = "Reports" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 1 + Top = 0 + Width = 840 + End +End +Attribute VB_Name = "frmRepList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSREPORT As Recordset + +Dim mintREPORTID As Integer, mboolAdding As Boolean +Dim mintBOOKMARK As Integer, mintTYPE As Integer, mstrFILE As String + +Private Sub optDest_Click(Index As Integer) + If optDest(0) Then + gintDEST = crptToWindow + End If + If optDest(1) Then + gintDEST = crptToPrinter + End If + If optDest(2) Then + gintDEST = crptToFile + mintTYPE = crptExcel50 +' mstrFILE = "C:\123\CrewProj.XLS" + End If +End Sub + +Private Sub cmdAdd_Click() + mboolAdding = True + Call FormClear + cmdExit.Enabled = True + cmdSave.Enabled = True + cmdAdd.Enabled = False + lstReports.Enabled = False + +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + strSQL = "DELETE * FROM tblRepList WHERE Rep_id = " & lstReports.ItemData(lstReports.ListIndex) + goConn.Execute strSQL + Call ReportLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module cmdDelete" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strFile As String + + On Error GoTo Error_EH + + gintCOPY = Integer2Field(txtCopy) + + strFile = "\" & Trim(moRSREPORT!FileName) & ".RPT" + crRepList.ReportFileName = App.Path & strFile +' crRepair.SelectionFormula = strSQL +' crRepair.Destination = crptToWindow + crRepList.CopiesToPrinter = gintCOPY + crRepList.Destination = gintDEST + If optDest(2) Then + crRepList.PrintFileType = crptExcel50 +' crRepList.PrintFileName = mstrFILE + End If + crRepList.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstReports.ListIndex + Call FormSave + lstReports.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + If mintBOOKMARK <> 0 Then + lstReports.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub ReportLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strTYPE As String, strTYPE2 As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblRepList" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lstReports.Clear + + Do Until oRS.EOF + With lstReports + .AddItem Field2Str(oRS!rep_desc) + .ItemData(.NewIndex) = Field2Long(oRS!rep_id) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstReports.ListCount Then + lstReports.ListIndex = 0 + mintREPORTID = lstReports.ItemData(lstReports.ListIndex) + Else + mintREPORTID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module ReportLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdPrnSetup_Click() + CMDialog1.Flags = &H40 + CMDialog1.Action = 5 +End Sub + +Private Sub Form_Activate() + + 'Set Default Copies + txtCopy = 1 + gintCOPY = 1 + gintDEST = 0 + +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + If mboolAdding Then + moRSREPORT.AddNew + moRSREPORT!C_USER = gstrLOGIN + End If + + + With moRSREPORT + !U_USER = gstrLOGIN + !Update = Date + !FileName = Str2Field(txtFile) + !rep_desc = Str2Field(txtDesc) + End With + + moRSREPORT.Update + + If mboolAdding Then + Call ReportLoad +' Call PlanMatLoad +' Call POptLoad + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtFile = "" + txtDesc = "" + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + moRSREPORT.Update + + If mboolAdding Then + mboolAdding = False + End If + + Call ReportLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSREPORT.State = adStateOpen Then + moRSREPORT.Close + End If + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblRepList " + strSQL = strSQL & "WHERE Rep_ID = " & mintREPORTID + + Set moRSREPORT = New Recordset + + moRSREPORT.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSREPORT.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form RepList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSREPORT + txtFile = Field2Str(!FileName) + txtDesc = Field2Str(!rep_desc) + End With + + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Call ReportLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstReports_Click() + On Error GoTo Error_EH + + If lstReports.ListIndex <> -1 Then + mintREPORTID = lstReports.ItemData(lstReports.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form RepList - Module lstReports_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frm new file mode 100644 index 0000000..e2d7a54 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frm @@ -0,0 +1,1602 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Begin VB.Form frmRepair + Caption = "Repair Schedule" + ClientHeight = 8850 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11850 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8850 + ScaleWidth = 11850 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtSeq + Alignment = 1 'Right Justify + Height = 315 + Left = 1020 + TabIndex = 68 + Top = 8220 + Width = 615 + End + Begin VB.TextBox txtWorkers + Height = 315 + Left = 6300 + TabIndex = 20 + Top = 4980 + Width = 1095 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Repair" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 63 + Top = 3480 + Width = 1200 + End + Begin Crystal.CrystalReport crRepair + Left = 2640 + Top = 7800 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Daily Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 62 + Top = 3480 + Width = 1275 + End + Begin VB.CommandButton cmdGetLot + Caption = "&Get Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 61 + Top = 3480 + Width = 1275 + End + Begin VB.ListBox lstProject + Height = 2595 + Left = 7080 + Sorted = -1 'True + TabIndex = 60 + Top = 600 + Visible = 0 'False + Width = 4695 + End + Begin VB.ListBox lstLot + Height = 2790 + Left = 7080 + Sorted = -1 'True + TabIndex = 59 + Top = 600 + Visible = 0 'False + Width = 4695 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 58 + Top = 3480 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 57 + Top = 3480 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 56 + Top = 3480 + Width = 1275 + End + Begin VB.ComboBox cboDArea + Height = 315 + ItemData = "frmRepair.frx":0000 + Left = 1020 + List = "frmRepair.frx":0022 + Style = 2 'Dropdown List + TabIndex = 14 + Top = 7860 + Width = 1215 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 4080 + MultiLine = -1 'True + TabIndex = 31 + Top = 7380 + Width = 7635 + End + Begin VB.TextBox txtDesc + Height = 1035 + Left = 4080 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 30 + Top = 6180 + Width = 5595 + End + Begin VB.TextBox txtBPhone + Height = 315 + Left = 960 + MaxLength = 14 + TabIndex = 11 + Top = 5700 + Width = 1215 + End + Begin VB.TextBox txtEstTime + Alignment = 1 'Right Justify + Height = 315 + Left = 8400 + MaxLength = 3 + TabIndex = 22 + Top = 5340 + Width = 1215 + End + Begin VB.TextBox txtStory + Alignment = 1 'Right Justify + Height = 315 + Left = 8400 + MaxLength = 1 + TabIndex = 21 + Top = 4980 + Width = 1215 + End + Begin VB.TextBox txtBCWho + Height = 315 + Left = 6120 + MaxLength = 20 + TabIndex = 23 + Top = 5700 + Width = 3495 + End + Begin VB.Frame frmRepair + Caption = "Work Type" + Height = 2295 + Left = 9840 + TabIndex = 36 + Top = 4260 + Width = 1875 + Begin VB.CheckBox chkBC + Caption = "Back Charge:" + Height = 375 + Left = 300 + TabIndex = 29 + Top = 1800 + Width = 1400 + End + Begin VB.CheckBox chkWarrenty + Caption = "Warranty:" + Height = 315 + Left = 300 + TabIndex = 28 + Top = 1500 + Width = 1400 + End + Begin VB.CheckBox chkWO + Caption = "WorkOrder:" + Height = 315 + Left = 300 + TabIndex = 27 + Top = 1200 + Width = 1400 + End + Begin VB.CheckBox chkYr2 + Caption = "2nd Year End:" + Height = 375 + Left = 300 + TabIndex = 26 + Top = 840 + Width = 1400 + End + Begin VB.CheckBox chkYr1 + Caption = "1st Year End:" + Height = 315 + Left = 300 + TabIndex = 25 + Top = 540 + Width = 1400 + End + Begin VB.CheckBox chkPunch + Caption = "Punch:" + Height = 255 + Left = 300 + TabIndex = 24 + Top = 240 + Width = 1400 + End + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 8400 + MaxLength = 14 + TabIndex = 18 + Top = 4260 + Width = 1215 + End + Begin VB.TextBox txtHPhone + Height = 315 + Left = 3300 + MaxLength = 14 + TabIndex = 17 + Top = 4980 + Width = 1215 + End + Begin VB.TextBox txtHAddress + Height = 315 + Left = 3300 + MaxLength = 30 + TabIndex = 16 + Top = 4620 + Width = 3315 + End + Begin VB.TextBox txtHName + Height = 315 + Left = 3300 + MaxLength = 20 + TabIndex = 15 + Top = 4260 + Width = 3315 + End + Begin VB.TextBox txtBillAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 34 + Top = 7500 + Width = 1215 + End + Begin VB.TextBox txtBillDate + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 33 + Top = 7140 + Width = 1215 + End + Begin VB.CheckBox chkBilled + Alignment = 1 'Right Justify + Caption = "Billed:" + Height = 195 + Left = 420 + TabIndex = 32 + Top = 6840 + Width = 1035 + End + Begin VB.TextBox txtBPOAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 13 + Top = 6420 + Width = 1215 + End + Begin VB.TextBox txtBPO + Height = 315 + Left = 960 + MaxLength = 15 + TabIndex = 12 + Top = 6060 + Width = 1215 + End + Begin VB.TextBox txtBContact + Height = 315 + Left = 960 + MaxLength = 20 + TabIndex = 10 + Top = 5340 + Width = 2175 + End + Begin VB.TextBox txtCompleted + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 9 + Top = 4620 + Width = 1215 + End + Begin VB.TextBox txtScheduled + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 8 + Top = 4260 + Width = 1215 + End + Begin VB.ComboBox cboArea + Height = 315 + ItemData = "frmRepair.frx":0073 + Left = 4260 + List = "frmRepair.frx":0095 + Style = 2 'Dropdown List + TabIndex = 5 + TabStop = 0 'False + Top = 120 + Width = 1155 + End + Begin VB.ListBox lstRepair + Height = 2790 + Left = 180 + TabIndex = 3 + TabStop = 0 'False + Top = 600 + Width = 6795 + End + Begin VB.ComboBox cboRCrew + Height = 315 + Left = 7200 + Style = 2 'Dropdown List + TabIndex = 19 + Top = 4620 + Width = 2415 + End + Begin MSComCtl2.DTPicker dtpRepairs + Height = 315 + Left = 1020 + TabIndex = 0 + TabStop = 0 'False + Top = 120 + Width = 1515 + _ExtentX = 2672 + _ExtentY = 556 + _Version = 393216 + Format = 94961665 + CurrentDate = 40544 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label Label2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sequence:" + Height = 195 + Left = 60 + TabIndex = 67 + Top = 8280 + Width = 780 + End + Begin VB.Label lblWorkers + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Workers:" + Height = 195 + Left = 5160 + TabIndex = 66 + Top = 5040 + Width = 975 + End + Begin VB.Label lblLot + BackStyle = 0 'Transparent + Height = 255 + Left = 2880 + TabIndex = 65 + Top = 3840 + Width = 675 + End + Begin VB.Label lblProject + Height = 255 + Left = 180 + TabIndex = 64 + Top = 3840 + Width = 2535 + End + Begin VB.Label Label1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 465 + TabIndex = 55 + Top = 7980 + Width = 375 + End + Begin VB.Label lblAreaDef + Caption = "Nothing in the 'List Area' will display all repairs for the selected Date:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 5520 + TabIndex = 54 + Top = 60 + Width = 4335 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3360 + TabIndex = 53 + Top = 7440 + Width = 690 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description of Work:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2280 + TabIndex = 52 + Top = 6240 + Width = 1770 + End + Begin VB.Label lblBPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone:" + Height = 195 + Left = 330 + TabIndex = 51 + Top = 5760 + Width = 510 + End + Begin VB.Label lblEstTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Minutes to Complete Repair:" + Height = 195 + Left = 6060 + TabIndex = 50 + Top = 5400 + Width = 2325 + End + Begin VB.Label lblStory + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Stories:" + Height = 195 + Left = 7530 + TabIndex = 49 + Top = 5100 + Width = 855 + End + Begin VB.Label lblBCWho + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Back Charge Who:" + Height = 195 + Left = 4680 + TabIndex = 48 + Top = 5820 + Width = 1365 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Superintendent:" + Height = 195 + Left = 6840 + TabIndex = 47 + Top = 4380 + Width = 1545 + End + Begin VB.Label lblHPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Telephone:" + Height = 195 + Left = 2385 + TabIndex = 46 + Top = 5100 + Width = 810 + End + Begin VB.Label lblHAddress + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address:" + Height = 195 + Left = 2580 + TabIndex = 45 + Top = 4740 + Width = 615 + End + Begin VB.Label lblHName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 2730 + TabIndex = 44 + Top = 4380 + Width = 465 + End + Begin VB.Label lblBillDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Date:" + Height = 195 + Left = 30 + TabIndex = 43 + Top = 7260 + Width = 810 + End + Begin VB.Label lblBillAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Amt:" + Height = 195 + Left = 105 + TabIndex = 42 + Top = 7620 + Width = 735 + End + Begin VB.Label lblHOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Homeowner Information:" + Height = 195 + Left = 3360 + TabIndex = 41 + Top = 4020 + Width = 1725 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amount:" + Height = 195 + Left = 255 + TabIndex = 40 + Top = 6540 + Width = 585 + End + Begin VB.Label lblBPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O.:" + Height = 195 + Left = 480 + TabIndex = 39 + Top = 6180 + Width = 360 + End + Begin VB.Label lblBContact + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contact:" + Height = 195 + Left = 240 + TabIndex = 38 + Top = 5460 + Width = 600 + End + Begin VB.Label lblBuilderInfo + AutoSize = -1 'True + Caption = "Builder Information:" + Height = 195 + Left = 840 + TabIndex = 37 + Top = 5040 + Width = 1350 + End + Begin VB.Label lblCompleted + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Completed:" + Height = 195 + Left = 135 + TabIndex = 35 + Top = 4740 + Width = 795 + End + Begin VB.Label lblScheduled + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scheduled:" + Height = 195 + Left = 120 + TabIndex = 7 + Top = 4380 + Width = 810 + End + Begin VB.Label lblProjectLot + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 180 + TabIndex = 6 + Top = 3480 + Width = 3735 + End + Begin VB.Label lblArea + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "List Area:" + Height = 195 + Left = 3435 + TabIndex = 4 + Top = 180 + Width = 660 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 6720 + TabIndex = 2 + Top = 4740 + Width = 405 + End + Begin VB.Label lblRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Repair Date:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 180 + Width = 900 + End +End +Attribute VB_Name = "frmRepair" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSRepair As Recordset +Dim moRS As Recordset, moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mlngREPAIRID As Long, mintBOOKMARK As Integer +Dim mstrPROJLOT As String + +Private Sub RepairLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + If cboArea.ListIndex = -1 Then + strSQL = "SELECT repair_ID, sequence, proj_lot, lot_id, area, punch, yrend1, yrend2, wo, repair from tblRepair WHERE scheduled = #" & CDate(dtpRepairs.Value) & "# ORDER BY Area, sequence" + Else + strSQL = "SELECT Repair_ID, sequence, proj_lot, lot_id, area, punch, yrend1, yrend2, wo, repair from tblRepair WHERE scheduled = #" & CDate(dtpRepairs.Value) & "# and Area = '" & Left(cboArea.Text, 1) & "' ORDER BY sequence" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstRepair.Clear + + Do Until oRS.EOF + With lstRepair + gintLOTID = Field2Str2(oRS!Lot_id) + 'Call GetLotInfo + If oRS!punch Then + strTYPE = "PUNCH " + ElseIf oRS!yrend1 Then + strTYPE = "1 YEAR END" + ElseIf oRS!yrend2 Then + strTYPE = "2 YEAR END" + ElseIf oRS!wo Then + strTYPE = "PO WORK " + ElseIf oRS!repair Then + strTYPE = "REPAIR " + End If + strLine = "" + strLine = Field2Str(oRS!Area) & " " & Field2Str(oRS!sequence) & vbTab + strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & Format(oRS!builder_phone, "???????????") & vbTab & oRS!builder_contact & vbTab & mstrPROJLOT +' strline = str +' strLine = oRS!lot_id '& vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!repair_id + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstRepair.ListCount Then + lstRepair.ListIndex = 0 + mlngREPAIRID = lstRepair.ItemData(lstRepair.ListIndex) + Else + mlngREPAIRID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module RepairLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT RC_ID, Name FROM tblRCrew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Do Until oRSRCrew.EOF + cboRCrew.AddItem oRSRCrew("Name") + cboRCrew.ItemData(cboRCrew.NewIndex) = Field2Long(oRSRCrew("RC_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close +' cboRCrew.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboArea_Click() + Call RepairLoad +End Sub + +Private Sub cboArea_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboArea.ListIndex = -1 + End If + +End Sub + +Private Sub cmdAdd_Click() + mboolAdding = True + Call FormClear + Call ProjectSelect + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdSave.Enabled = True + lstRepair.Enabled = False + lstProject.SetFocus + +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + If Len(txtCompleted) <> 0 Then + MsgBox "This Repair Can Not Be Deleted", vbOKOnly, "NO DELETE ALLOWED" + Exit Sub + End If + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblrepair WHERE repair_id = " & lstRepair.ItemData(lstRepair.ListIndex) + goConn.Execute strSQL +' strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID +' goConn.Execute strSQL +' moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Repair") + Call RepairLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module cmdDelete" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdGetLot_Click() + Call GetLotInfo + Call cmdSave_Click +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String + + On Error GoTo Error_EH + If Len(cboArea.Text) = 0 Then + MsgBox "You Must Select A Value In The 'List Area' Field", vbOKOnly, "No Area Of Town Selected" + Exit Sub + End If + strMONTH = Format(Month(dtpRepairs.Value), "00") + strDAY = Format(Day(dtpRepairs.Value), "00") + strYEAR = Year(dtpRepairs.Value) + gintPRINT = 1 + frmReport.Show 1 + strSQL = "{tblREPAIR.scheduled} = date(" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblrepair.area} = '" & Left(cboArea.Text, 1) & "'" + crREPAIR.ReportFileName = App.Path & "\DailyRepairs.rpt" + crREPAIR.SelectionFormula = strSQL +' crRepair.Destination = crptToWindow + crREPAIR.CopiesToPrinter = gintCOPY + crREPAIR.Destination = gintDEST + crREPAIR.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstRepair.ListIndex + If Len(cboDArea.Text) = 0 Then + MsgBox "You Must Enter The Area Of Town Before Saving", vbOKOnly, "Select An Area" + cboDArea.SetFocus + Exit Sub + End If + Call FormSave + cmdSave.Enabled = False + cmdAdd.Enabled = True + lstRepair.Enabled = True + If lstRepair.ListIndex > 0 Then + lstRepair.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub dtpRepairs_Change() + Call RepairLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + +' mboolSETUP = False +' mboolENTER = False + +' If gintLOTID = 0 Then +' intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") +' If intResponse = vbYes Then +' txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc +' strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" +' Set moRS = New Recordset +' moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' Call cmdAddLot_Click +' Else +' Unload Me +' End If +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +' If Field2Str(moRS!l_flg) <> "P" Then +' If Not cmdSaveLotInfo.Enabled Then +' Call DataHasChanged +' End If +' End If +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Set moRSRepair = New Recordset + dtpRepairs.Value = Date + + Call CrewLoad + Call RepairLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblRepair " + strSQL = strSQL & "WHERE Repair_ID = " & mlngREPAIRID + + + If moRSRepair.State = adStateOpen Then + moRSRepair.Close + End If + Set moRSRepair = New Recordset + + moRSRepair.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSRepair.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSRepair!Lot_id) + gintPROJID = Field2Str2(moRSRepair!Proj_ID) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Repair - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + lblProject.Caption = "" + lblLot.Caption = "" + + mboolSHOW = True + strSQL = "Select Proj_Desc FROM tblProject WHERE proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + lblProject.Caption = Field2Str(oRS!Proj_Desc) + + strSQL = "Select Lot_no FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + lblLot.Caption = Field2Str(oRS!lot_no) + With moRSRepair + txtScheduled = Field2Str(!scheduled) + txtCompleted = Field2Str(!completed) + txtBContact = Field2Str(!builder_contact) + txtBPhone = Field2Str(!builder_phone) + txtBPO = Field2Str(!builder_PO) + txtBPOAmt = Field2Str(!PO_Amt) + txtBillDate = Field2Str(!bill_date) + txtBillAmt = Field2Str(!bill_amt) + txtHName = Field2Str(!Owner_Name) + txtHAddress = Field2Str(!Owner_address) + txtSeq = Field2Str2(!sequence) + txtHPhone = Field2Str(!Owner_phone) + txtVWPSuper = Field2Str(!VWP_Super) + txtStory = Field2Str(!storys) + txtEstTime = Field2Str(!est_time) + txtBCWho = Field2Str(!bc_who) + txtDesc = Field2Str(!Desc) + txtNotes = Field2Str(!notes) + txtWorkers = Field2Str(!crewsize) + mstrAREA = Field2Str(!Area) + If mstrAREA = "W" Then + cboDArea.Text = "West" + ElseIf mstrAREA = "N" Then + cboDArea.Text = "North" + ElseIf mstrAREA = "S" Then + cboDArea.Text = "South" + ElseIf mstrAREA = "X" Then + cboDArea.Text = "Xtra" + ElseIf mstrAREA = "2" Then + cboDArea.Text = "2-North" + ElseIf mstrAREA = "3" Then + cboDArea.Text = "3-North" + ElseIf mstrAREA = "4" Then + cboDArea.Text = "4-South" + ElseIf mstrAREA = "5" Then + cboDArea.Text = "5-West" + ElseIf mstrAREA = "6" Then + cboDArea.Text = "6-Stone" + ElseIf mstrAREA = "P" Then + cboDArea.Text = "Paint" + End If + + chkBilled = Field2CheckBox(!billed) + chkPunch = Field2CheckBox(!punch) + chkYr1 = Field2CheckBox(!yrend1) + chkYr2 = Field2CheckBox(!yrend2) + chkWO = Field2CheckBox(!wo) + chkWarrenty = Field2CheckBox(!repair) + chkBC = Field2CheckBox(!backcharge) + cboRCrew.ListIndex = Field2Integer(!repair_crew) - 1 + lblProjectLot.Caption = Field2Str(!proj_lot) +' cboRCrew.ListIndex = Field2Long(!repair_crew) + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + If Err = 3021 Then + MsgBox "No Project Was Found = Be Sure To Click The Get Lot Button", vbOKOnly, "No Project" + Resume Next + End If + gstrMODULE = "Form Repair - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + If mboolAdding Then + moRSRepair.AddNew + moRSRepair!createuser = gstrLOGIN + moRSRepair!Proj_ID = gintPROJID + moRSRepair!Lot_id = gintLOTID + moRSRepair!proj_lot = Field2Str(lblProjectLot.Caption) + End If + + + With moRSRepair + !scheduled = Str2Field(txtScheduled) + !completed = Str2Field(txtCompleted) + !builder_contact = Str2Field(txtBContact) + !builder_phone = Str2Field(txtBPhone) + !builder_PO = Str2Field(txtBPO) + !PO_Amt = Str2Field(txtBPOAmt) + !bill_date = Str2Field(txtBillDate) + !bill_amt = Str2Field(txtBillAmt) + !Owner_Name = Str2Field(txtHName) + !Owner_address = Str2Field(txtHAddress) + !Owner_phone = Str2Field(txtHPhone) + !VWP_Super = Str2Field(txtVWPSuper) + !storys = Str2Field(txtStory) + !est_time = Str2Field(txtEstTime) + !bc_who = Str2Field(txtBCWho) + !Desc = Str2Field(txtDesc) + !crewsize = Str2Field(txtWorkers) + !notes = Str2Field(txtNotes) + !sequence = Str2Field(txtSeq) + !Area = Left((cboDArea.Text), 1) + !billed = chkBilled + !punch = chkPunch + !yrend1 = chkYr1 + !yrend2 = chkYr2 + !wo = chkWO + !repair = chkWarrenty + !backcharge = chkBC + !repair_crew = (cboRCrew.ListIndex + 1) + !UpdateUser = gstrLOGIN + !Updated = Date + !proj_lot = lblProjectLot.Caption + !Proj_ID = gintPROJID + End With + + moRSRepair.Update + + If mboolAdding Then + Call RepairLoad +' Call PlanMatLoad +' Call POptLoad + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") +' If Len(strLOT) > 0 Then +' moRS!lot_no = Field2Str(strLOT) +' moRS.Update +' txtLotNo = Field2Str(strLOT) +' End If + Resume Next + End If + gstrMODULE = "Form Repair - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtScheduled = "" + txtBContact = "" + txtBPhone = "" + txtBPO = "" + txtBPOAmt = 0 + txtBillDate = "" + txtBillAmt = 0 + txtHName = "" + txtHAddress = "" + txtHPhone = "" + txtVWPSuper = "" + txtBCWho = "" + txtDesc = "" + txtNotes = "" + cboDArea.ListIndex = -1 + chkBilled = vbUnchecked + chkWO = vbUnchecked + chkWarrenty = vbUnchecked + chkBC = vbUnchecked + cboRCrew.ListIndex = -1 + lblProjectLot = "" + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSRepair.AddNew +' moRSRepair!proj_id = gintPROJID +' moRSRepair!lot_id = gintLOTID +' moRSRepair!proj_lot = mstrPROJLOT +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRSRepair.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call RepairLoad + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSRepair.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSRepair.State = adStateOpen Then + moRSRepair.Close + End If + +End Sub + +Private Sub lstLot_DblClick() +Dim lngPOS As Long, strSQL As String +Dim oRS As Recordset + + lngPOS = InStr(1, lstLot.Text, vbTab, 1) + gintLOTID = lstLot.ItemData(lstLot.ListIndex) + mstrPROJLOT = mstrPROJLOT & " - " & Left(lstLot.Text, lngPOS - 1) + lblProjectLot = mstrPROJLOT + strSQL = "SELECT owner, address, lot_id FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' moRS.MovePrevious + txtHName = Field2Str(oRS!Owner) + txtHAddress = Field2Str(oRS!address) + lstLot.Visible = False +End Sub + +Private Sub lstProject_DblClick() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + mstrPROJLOT = lstProject.Text + lstProject.Visible = False + Call LotSelect + lstLot.SetFocus +End Sub + +Private Sub lstRepair_Click() + On Error GoTo Error_EH + + If lstRepair.ListIndex <> -1 Then + mlngREPAIRID = lstRepair.ItemData(lstRepair.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module lstRepair_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstRepair_DblClick() + cmdAdd.Enabled = False + cmdSave.Enabled = True +End Sub + +Private Sub txtBContact_GotFocus() + Call FieldSelect(txtBContact) +End Sub + +Private Sub txtBContact_LostFocus() + txtBContact = UCase(txtBContact) +End Sub + +Private Sub txtBCWho_GotFocus() + Call FieldSelect(txtBCWho) +End Sub + +Private Sub txtBCWho_LostFocus() + txtBCWho = UCase(txtBCWho) +End Sub + +Private Sub txtBillAmt_GotFocus() + Call FieldSelect(txtBillAmt) +End Sub + +Private Sub txtBillDate_GotFocus() + Call FieldSelect(txtBillDate) +End Sub + +Private Sub txtBillDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBillDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBillDate) > 0 Then + txtBillDate = Format(txtBillDate, "00/00/####") + If Not IsDate(txtBillDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBillDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBillDate.SetFocus + End If + +End Sub + +Private Sub txtBPhone_GotFocus() + Call FieldSelect(txtBPhone) +End Sub + +Private Sub txtBPO_GotFocus() + Call FieldSelect(txtBPO) +End Sub + +Private Sub txtBPOAmt_GotFocus() + Call FieldSelect(txtBPOAmt) +End Sub + +Private Sub txtCompleted_GotFocus() + Call FieldSelect(txtCompleted) +End Sub + +Private Sub txtCompleted_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtCompleted, "/", 1) + If lngPOS = 0 Then + If Len(txtCompleted) > 0 Then + txtCompleted = Format(txtCompleted, "00/00/####") + If Not IsDate(txtCompleted) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtCompleted.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtCompleted.SetFocus + End If + +End Sub + +Private Sub txtDesc_GotFocus() +' Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtEstTime_GotFocus() + Call FieldSelect(txtEstTime) +End Sub + +Private Sub txtHAddress_GotFocus() + Call FieldSelect(txtHAddress) +End Sub + +Private Sub txtHAddress_LostFocus() + txtHAddress = UCase(txtHAddress) +End Sub + +Private Sub txtHName_GotFocus() + Call FieldSelect(txtHName) +End Sub + +Private Sub txtHName_LostFocus() + txtHName = UCase(txtHName) +End Sub + +Private Sub txtHPhone_GotFocus() + Call FieldSelect(txtHPhone) +End Sub + +Private Sub txtNotes_GotFocus() +' txtNotes.MaxLength = Len(txtNotes) +' Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtScheduled_GotFocus() + Call FieldSelect(txtScheduled) +End Sub + +Private Sub txtScheduled_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtScheduled, "/", 1) + If lngPOS = 0 Then + If Len(txtScheduled) > 0 Then + txtScheduled = Format(txtScheduled, "00/00/####") + If Not IsDate(txtScheduled) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScheduled.SetFocus + End If + End If + Else + If Not IsDate(txtScheduled) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScheduled.SetFocus + Else + Exit Sub + End If + End If + +End Sub + +Private Sub txtStory_GotFocus() + Call FieldSelect(txtStory) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!Proj_ID) +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + Set moRSProj = New Recordset + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + gintPROJID = moRSProj!Proj_ID + mstrPROJLOT = Trim(Field2Str(moRSProj!Proj_Desc)) & " - " & Trim(Field2Str(moRS!lot_no)) + lblProjectLot = mstrPROJLOT + If moRS!TWOSTORY = True Then + txtStory = 2 + Else + txtStory = 1 + End If +End Sub + +Private Sub LotSelect() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_no, address, owner, lot_id FROM tblLotInfo WHERE proj_id = " & gintPROJID + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstLot.Visible = True + lstLot.Clear + + Do Until moRS.EOF + strLine = "" + strLine = Field2Str(moRS!lot_no) & vbTab & Field2Str(moRS!address) + lstLot.AddItem strLine + lstLot.ItemData(lstLot.NewIndex) = Field2Long(moRS!Lot_id) + moRS.MoveNext + Loop +' cboRCrew.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module LotSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ProjectSelect() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Proj_id, Proj_Desc FROM tblProject" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstProject.Visible = True + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem oRS!Proj_Desc + lstProject.ItemData(lstProject.NewIndex) = Field2Long(oRS!Proj_ID) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Repair - Module ProjectSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +'Public Sub LotChange(strProjLot As String, strAction As String) +' +' Load frmChange +' frmChange.lblProjLot = strProjLot +' frmChange.lblAction = strAction +' +' frmChange.Show 1 +' +'End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frx new file mode 100644 index 0000000..cd680fc Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepair.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frm new file mode 100644 index 0000000..373bb0b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frm @@ -0,0 +1,834 @@ +VERSION 5.00 +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Begin VB.Form frmRepairLot + Caption = "Repair Schedule" + ClientHeight = 5430 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11850 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5430 + ScaleWidth = 11850 + StartUpPosition = 3 'Windows Default + Begin MSComCtl2.DTPicker dtpRepair + Height = 315 + Left = 960 + TabIndex = 1 + Top = 840 + Width = 1215 + _ExtentX = 2143 + _ExtentY = 556 + _Version = 393216 + Format = 94306305 + CurrentDate = 40575 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1500 + TabIndex = 27 + Top = 4800 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 180 + TabIndex = 26 + Top = 4800 + Width = 1275 + End + Begin VB.ComboBox cboDArea + Height = 315 + ItemData = "frmRepairLot.frx":0000 + Left = 960 + List = "frmRepairLot.frx":0022 + Style = 2 'Dropdown List + TabIndex = 2 + Top = 1200 + Width = 1215 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 4080 + TabIndex = 25 + Top = 3960 + Width = 7635 + End + Begin VB.TextBox txtDesc + Height = 1035 + Left = 4080 + MaxLength = 250 + TabIndex = 24 + Top = 2760 + Width = 5595 + End + Begin VB.TextBox txtBPhone + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 14 + TabIndex = 4 + Top = 2280 + Width = 1215 + End + Begin VB.TextBox txtEstTime + Alignment = 1 'Right Justify + Height = 315 + Left = 8400 + MaxLength = 3 + TabIndex = 16 + Top = 1920 + Width = 1215 + End + Begin VB.TextBox txtStory + Alignment = 1 'Right Justify + Height = 315 + Left = 8400 + MaxLength = 1 + TabIndex = 15 + Top = 1560 + Width = 1215 + End + Begin VB.TextBox txtBCWho + Height = 315 + Left = 6120 + MaxLength = 20 + TabIndex = 17 + Top = 2280 + Width = 3495 + End + Begin VB.Frame frmRepair + Caption = "Work Type" + Height = 2295 + Left = 9840 + TabIndex = 30 + Top = 840 + Width = 1875 + Begin VB.CheckBox chkBC + Caption = "Back Charge:" + Height = 375 + Left = 300 + TabIndex = 23 + Top = 1800 + Width = 1400 + End + Begin VB.CheckBox chkWarrenty + Caption = "Warranty:" + Height = 315 + Left = 300 + TabIndex = 22 + Top = 1500 + Width = 1400 + End + Begin VB.CheckBox chkWO + Caption = "WorkOrder:" + Height = 315 + Left = 300 + TabIndex = 21 + Top = 1200 + Width = 1400 + End + Begin VB.CheckBox chkYr2 + Caption = "2nd Year End:" + Height = 375 + Left = 300 + TabIndex = 20 + Top = 840 + Width = 1400 + End + Begin VB.CheckBox chkYr1 + Caption = "1st Year End:" + Height = 315 + Left = 300 + TabIndex = 19 + Top = 540 + Width = 1400 + End + Begin VB.CheckBox chkPunch + Caption = "Punch:" + Height = 255 + Left = 300 + TabIndex = 18 + Top = 240 + Width = 1400 + End + End + Begin VB.TextBox txtVWPSuper + Height = 315 + Left = 8400 + MaxLength = 14 + TabIndex = 13 + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtHPhone + Alignment = 1 'Right Justify + Height = 315 + Left = 3300 + MaxLength = 14 + TabIndex = 12 + Top = 1560 + Width = 1215 + End + Begin VB.TextBox txtHAddress + Height = 315 + Left = 3300 + MaxLength = 30 + TabIndex = 11 + Top = 1200 + Width = 3315 + End + Begin VB.TextBox txtHName + Height = 315 + Left = 3300 + MaxLength = 20 + TabIndex = 10 + Top = 840 + Width = 3315 + End + Begin VB.TextBox txtBillAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 9 + Top = 4080 + Width = 1215 + End + Begin VB.TextBox txtBillDate + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 8 + Top = 3720 + Width = 1215 + End + Begin VB.CheckBox chkBilled + Alignment = 1 'Right Justify + Caption = "Billed:" + Height = 195 + Left = 420 + TabIndex = 7 + Top = 3420 + Width = 1035 + End + Begin VB.TextBox txtBPOAmt + Alignment = 1 'Right Justify + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 6 + Top = 3000 + Width = 1215 + End + Begin VB.TextBox txtBPO + Height = 315 + Left = 960 + MaxLength = 15 + TabIndex = 5 + Top = 2640 + Width = 1215 + End + Begin VB.TextBox txtBContact + Height = 315 + Left = 960 + MaxLength = 20 + TabIndex = 3 + Top = 1920 + Width = 2175 + End + Begin VB.ComboBox cboRCrew + Height = 315 + Left = 7200 + Style = 2 'Dropdown List + TabIndex = 14 + Top = 1200 + Width = 2415 + End + Begin VB.Label Label1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 465 + TabIndex = 48 + Top = 1320 + Width = 375 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3360 + TabIndex = 47 + Top = 4020 + Width = 690 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description of Work:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2280 + TabIndex = 46 + Top = 2820 + Width = 1770 + End + Begin VB.Label lblBPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone:" + Height = 195 + Left = 330 + TabIndex = 45 + Top = 2340 + Width = 510 + End + Begin VB.Label lblEstTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated # of Minutes to Complete Repair:" + Height = 195 + Left = 5325 + TabIndex = 44 + Top = 1980 + Width = 3060 + End + Begin VB.Label lblStory + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Stories:" + Height = 195 + Left = 7530 + TabIndex = 43 + Top = 1680 + Width = 855 + End + Begin VB.Label lblBCWho + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Back Charge Who:" + Height = 195 + Left = 4680 + TabIndex = 42 + Top = 2400 + Width = 1365 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Superintendent:" + Height = 195 + Left = 6840 + TabIndex = 41 + Top = 960 + Width = 1545 + End + Begin VB.Label lblHPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Telephone:" + Height = 195 + Left = 2385 + TabIndex = 40 + Top = 1680 + Width = 810 + End + Begin VB.Label lblHAddress + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address:" + Height = 195 + Left = 2580 + TabIndex = 39 + Top = 1320 + Width = 615 + End + Begin VB.Label lblHName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 2730 + TabIndex = 38 + Top = 960 + Width = 465 + End + Begin VB.Label lblBillDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Date:" + Height = 195 + Left = 30 + TabIndex = 37 + Top = 3840 + Width = 810 + End + Begin VB.Label lblBillAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Amt:" + Height = 195 + Left = 105 + TabIndex = 36 + Top = 4200 + Width = 735 + End + Begin VB.Label lblHOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Homeowner Information:" + Height = 195 + Left = 3360 + TabIndex = 35 + Top = 600 + Width = 1725 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amount:" + Height = 195 + Left = 255 + TabIndex = 34 + Top = 3120 + Width = 585 + End + Begin VB.Label lblBPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O.:" + Height = 195 + Left = 480 + TabIndex = 33 + Top = 2760 + Width = 360 + End + Begin VB.Label lblBContact + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contact:" + Height = 195 + Left = 240 + TabIndex = 32 + Top = 2040 + Width = 600 + End + Begin VB.Label lblBuilderInfo + AutoSize = -1 'True + Caption = "Builder Information:" + Height = 195 + Left = 840 + TabIndex = 31 + Top = 1620 + Width = 1350 + End + Begin VB.Label lblScheduled + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scheduled:" + Height = 195 + Left = 120 + TabIndex = 29 + Top = 960 + Width = 810 + End + Begin VB.Label lblProjectLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3300 + TabIndex = 28 + Top = 120 + Width = 5055 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 6720 + TabIndex = 0 + Top = 1320 + Width = 405 + End +End +Attribute VB_Name = "frmRepairLot" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSRepair As Recordset +Dim moRS As Recordset, moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mintREPAIRID As Integer +Dim mstrPROJLOT As String + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT RC_ID, Name FROM tblRCrew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSRCrew.MoveLast + oRSRCrew.MoveFirst + intRows = oRSRCrew.RecordCount + Do Until oRSRCrew.EOF + cboRCrew.AddItem oRSRCrew("Name") + cboRCrew.ItemData(cboRCrew.NewIndex) = Field2Long(oRSRCrew("RC_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepairLot - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + If Len(cboDArea.Text) = 0 Then + MsgBox "You Must Enter The Area Of Town Before Saving", vbOKOnly, "Select An Area" + cboDArea.SetFocus + Exit Sub + End If + Call FormSave + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + dtpRepair.Value = Date + Call CrewLoad + Call FormClear + Call GetLotInfo + + Exit Sub + +Error_EH: + gstrMODULE = "Form RepairLot - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + moRSRepair.AddNew + + With moRSRepair + !scheduled = dtpRepair.Value + !builder_contact = Str2Field(txtBContact) + !builder_phone = Str2Field(txtBPhone) + !builder_PO = Str2Field(txtBPO) + !PO_Amt = Str2Field(txtBPOAmt) + !bill_date = Str2Field(txtBillDate) + !bill_amt = Str2Field(txtBillAmt) + !Owner_Name = Str2Field(txtHName) + !Owner_address = Str2Field(txtHAddress) + !Owner_phone = Str2Field(txtHPhone) + !VWP_Super = Str2Field(txtVWPSuper) + !storys = Str2Field(txtStory) + !est_time = Str2Field(txtEstTime) + !bc_who = Str2Field(txtBCWho) + !Desc = Str2Field(txtDesc) + !notes = Str2Field(txtNotes) + !Area = Left((cboDArea.Text), 1) + !billed = chkBilled + !punch = chkPunch + !yrend1 = chkYr1 + !yrend2 = chkYr2 + !wo = chkWO + !repair = chkWarrenty + !backcharge = chkBC + !repair_crew = cboRCrew.ListIndex + 1 + !UpdateUser = gstrLOGIN + !Updated = Date + !proj_lot = lblProjectLot.Caption + !createuser = gstrLOGIN + !Proj_ID = gintPROJID + !Lot_id = gintLOTID + End With + + moRSRepair.Update + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + Resume Next + End If + gstrMODULE = "Form RepairLot - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtBContact = "" + txtBPhone = "" + txtBPO = "" + txtBPOAmt = 0 + txtBillDate = "" + txtBillAmt = 0 + txtHName = "" + txtHAddress = "" + txtHPhone = "" + txtVWPSuper = "" + txtStory = "" + txtEstTime = 0 + txtBCWho = "" + txtDesc = "" + txtNotes = "" + cboDArea.ListIndex = -1 + chkBilled = vbUnchecked + chkPunch = vbUnchecked + chkYr1 = vbUnchecked + chkYr2 = vbUnchecked + chkWO = vbUnchecked + chkWarrenty = vbUnchecked + chkBC = vbUnchecked + cboRCrew.ListIndex = -1 + lblProjectLot = "" + +End Sub + +Private Sub FormSave() + + On Error GoTo Error_EH + + ' Store the controls to the recordset + Call FieldsSave + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSRepair.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSRepair.State = adStateOpen Then + moRSRepair.Close + End If + +End Sub + +Private Sub txtBContact_GotFocus() + Call FieldSelect(txtBContact) +End Sub + +Private Sub txtBContact_LostFocus() + txtBContact = UCase(txtBContact) +End Sub + +Private Sub txtBCWho_GotFocus() + Call FieldSelect(txtBCWho) +End Sub + +Private Sub txtBCWho_LostFocus() + txtBCWho = UCase(txtBCWho) +End Sub + +Private Sub txtBillAmt_GotFocus() + Call FieldSelect(txtBillAmt) +End Sub + +Private Sub txtBillDate_GotFocus() + Call FieldSelect(txtBillDate) +End Sub + +Private Sub txtBillDate_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtBillDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBillDate) > 0 Then + txtBillDate = Format(txtBillDate, "00/00/####") + If Not IsDate(txtBillDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBillDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBillDate.SetFocus + End If + +End Sub + +Private Sub txtBPhone_GotFocus() + Call FieldSelect(txtBPhone) +End Sub + +Private Sub txtBPO_GotFocus() + Call FieldSelect(txtBPO) +End Sub + +Private Sub txtBPOAmt_GotFocus() + Call FieldSelect(txtBPOAmt) +End Sub + +Private Sub txtDesc_GotFocus() +' Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtEstTime_GotFocus() + Call FieldSelect(txtEstTime) +End Sub + +Private Sub txtHAddress_GotFocus() + Call FieldSelect(txtHAddress) +End Sub + +Private Sub txtHAddress_LostFocus() + txtHAddress = UCase(txtHAddress) +End Sub + +Private Sub txtHName_GotFocus() + Call FieldSelect(txtHName) +End Sub + +Private Sub txtHName_LostFocus() + txtHName = UCase(txtHName) +End Sub + +Private Sub txtHPhone_GotFocus() + Call FieldSelect(txtHPhone) +End Sub + +Private Sub txtNotes_GotFocus() +' txtNotes.MaxLength = Len(txtNotes) +' Call FieldSelect(txtNotes) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub txtStory_GotFocus() + Call FieldSelect(txtStory) +End Sub + +Private Sub txtVWPSuper_GotFocus() + Call FieldSelect(txtVWPSuper) +End Sub + +Private Sub txtVWPSuper_LostFocus() + txtVWPSuper = UCase(txtVWPSuper) +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String, strREPAIR As String + + strREPAIR = "SELECT * FROM tblRepair WHERE Repair_id = 1" + + Set moRSRepair = New Recordset + + moRSRepair.Open strREPAIR, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!Proj_ID) +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + + Set moRSProj = New Recordset + + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + mstrPROJLOT = Trim(Field2Str(moRSProj!Proj_Desc)) & " - " & Trim(Field2Str(moRS!lot_no)) + lblProjectLot = mstrPROJLOT + txtHName = Field2Str(moRS!Owner) + txtHAddress = Field2Str(moRS!address) + If moRS!TWOSTORY = True Then + txtStory = 2 + Else + txtStory = 1 + End If + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frx new file mode 100644 index 0000000..28e46f6 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmRepairLot.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReport.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReport.frm new file mode 100644 index 0000000..63a215b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReport.frm @@ -0,0 +1,334 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" +Begin VB.Form frmReport + Caption = "Print Report" + ClientHeight = 2580 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6420 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 2580 + ScaleWidth = 6420 + StartUpPosition = 2 'CenterScreen + Begin VB.TextBox txtEndDate + Height = 330 + Left = 2600 + TabIndex = 2 + Top = 660 + Width = 1695 + End + Begin VB.TextBox txtBegDate + Height = 330 + Left = 2600 + TabIndex = 1 + Top = 180 + Width = 1695 + End + Begin VB.Frame fraInstructions + Height = 735 + Left = 120 + TabIndex = 15 + Top = 1740 + Visible = 0 'False + Width = 4815 + Begin VB.Label lblInstructions + Caption = "What do I do?" + Height = 555 + Left = 120 + TabIndex = 16 + Top = 120 + Width = 4575 + WordWrap = -1 'True + End + End + Begin VB.TextBox txtField + Height = 330 + Left = 3840 + TabIndex = 14 + TabStop = 0 'False + Top = 1560 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdOK + Caption = "&OK" + Height = 330 + Left = 5100 + TabIndex = 6 + Top = 240 + Width = 1200 + End + Begin MSComDlg.CommonDialog CMDialog1 + Left = 5940 + Top = 0 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.TextBox txtCopies + Height = 330 + Left = 2600 + TabIndex = 3 + Text = "1" + Top = 1140 + Width = 600 + End + Begin VB.TextBox txtWindowTitle + Height = 315 + Left = 5640 + TabIndex = 10 + TabStop = 0 'False + Top = 1200 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtReportName + Height = 315 + Left = 5280 + TabIndex = 9 + TabStop = 0 'False + Top = 1080 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + Height = 330 + Left = 5100 + TabIndex = 8 + Top = 1560 + Width = 1200 + End + Begin VB.CommandButton cmdPrnSetup + Caption = "Printer &Setup" + Height = 330 + Left = 5100 + TabIndex = 7 + Top = 720 + Width = 1200 + End + Begin VB.Frame fraDestination + Caption = "Destination" + Height = 1515 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 1200 + Begin VB.OptionButton optDest + Caption = "Printer" + Height = 330 + Index = 1 + Left = 120 + TabIndex = 5 + Top = 900 + Width = 1000 + End + Begin VB.OptionButton optDest + Caption = "Window" + Height = 330 + Index = 0 + Left = 120 + TabIndex = 4 + Top = 360 + Value = -1 'True + Width = 1000 + End + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + Caption = "Ending Date:" + Height = 330 + Left = 1560 + TabIndex = 13 + Top = 780 + Width = 1005 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + Caption = "Beginning Date:" + Height = 330 + Left = 1420 + TabIndex = 12 + Top = 290 + Width = 1155 + End + Begin VB.Label lblCopies + Alignment = 1 'Right Justify + Caption = "Copies:" + Height = 330 + Left = 1950 + TabIndex = 11 + Top = 1200 + Width = 600 + End +End +Attribute VB_Name = "frmReport" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim strReportName As String, strField As String + +Private Sub cmdExit_Click() + frmReport.txtBegDate.Visible = False + frmReport.txtEndDate.Visible = False + frmReport.lblBegDate.Visible = False + frmReport.lblEndDate.Visible = False + gintPRINT = 0 + + Unload Me + +End Sub + +Private Sub cmdOK_Click() +Dim intOK As Integer, intVldErr As Integer +Dim strMSG As String, strTitle As String, strSelection As String +Dim dteBegDate As Date, dteEndDate As Date +Dim strBYear As String, strBMonth As String, strBDay As String +Dim strEYear As String, strEMonth As String, strEDay As String +'({tblLOTINFO.SORDER} >= {?BegDate} and {tblLOTINFO.SORDER} <= {?EndDate}) or ({tblLOTINFO.SORDER} >= {?BegDate} and {tblLOTINFO.SORDER} <= {?EndDate}) + +' If gintPRINT = 9 Then +' If txtBegDate <> "" Then +' If IsDate(txtBegDate) Then +' dteBegDate = DateValue(txtBegDate) +' dteEndDate = DateValue(txtEndDate) +' End If +' Else +' dteBegDate = DateValue("01/01/1980") +' dteEndDate = DateValue("12/31/2099") +' End If +' End If +' strBYear = Year(dteBegDate) +' strBMonth = Format(Month(dteBegDate), "00") +' strBDay = Format(Day(dteBegDate), "00") +' strEYear = Year(dteEndDate) +' strEMonth = Format(Month(dteEndDate), "00") +' strEDay = Format(Day(dteEndDate), "00") +' gintDEST = "" + gstrBEGDATE = Field2Str(txtBegDate) + gstrENDDATE = Field2Str(txtEndDate) + gintCOPY = Integer2Field(txtCopies) + gboolPRINT = True + Unload Me + +End Sub + +Private Sub cmdPrnSetup_Click() + CMDialog1.Flags = &H40 + CMDialog1.Action = 5 +End Sub + +Private Sub Form_Activate() + + + If gintPRINT = 1 Then + txtBegDate.Visible = False + txtEndDate.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + End If + + If gintPRINT = 8 Then + txtEndDate.Visible = False + lblEndDate.Visible = False + End If + + If gintPRINT = 9 Then + txtBegDate.Visible = False + txtEndDate.Visible = False + lblBegDate.Visible = False + lblEndDate.Visible = False + End If + + 'Set Default Copies + txtCopies = 1 + gintCOPY = 1 + gintDEST = 0 + gboolPRINT = False + +End Sub + +Private Sub optDest_Click(Index As Integer) + If optDest(0) Then + gintDEST = crptToWindow + End If + If optDest(1) Then + gintDEST = crptToPrinter + End If +End Sub + + +Private Sub txtBegDate_LostFocus() +Dim lngPOS As Long + + If gintPRINT = 9 Or gintPRINT = 8 Then + lngPOS = InStr(1, txtBegDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBegDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBegDate.SetFocus + Exit Sub + End If + If txtBegDate = "" Then + Exit Sub + End If + If Not IsDate(txtBegDate) Then + MsgBox "A Valid Date is Required", 0, "Invalid Beginning Date" + txtBegDate.SetFocus + End If + End If + +End Sub + +Private Sub txtCopies_GotFocus() + Call FieldSelect(txtCopies) +End Sub + +Private Sub txtEndDate_LostFocus() +Dim lngPOS As Long + + If gintPRINT = 9 Then + lngPOS = InStr(1, txtEndDate, "/", 1) + If lngPOS = 0 Then + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtEndDate.SetFocus + Exit Sub + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtEndDate.SetFocus + Exit Sub + End If + If txtEndDate = "" Then + Exit Sub + End If + If Not IsDate(txtEndDate) Then + MsgBox "A Valid Date is Required", 0, "Invalid Beginning Date" + txtEndDate.SetFocus + End If + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReportbak.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReportbak.frm new file mode 100644 index 0000000..23e5cd2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmReportbak.frm @@ -0,0 +1,345 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "CRYSTL32.OCX" +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" +Begin VB.Form frmReport + Caption = "Print Report" + ClientHeight = 2580 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6420 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 2580 + ScaleWidth = 6420 + StartUpPosition = 2 'CenterScreen + Begin VB.TextBox txtEndDate + Height = 330 + Left = 2600 + TabIndex = 16 + Top = 720 + Width = 2220 + End + Begin VB.TextBox txtBegDate + Height = 330 + Left = 2600 + TabIndex = 15 + Top = 240 + Width = 2220 + End + Begin VB.Frame fraInstructions + Height = 735 + Left = 120 + TabIndex = 13 + Top = 1740 + Visible = 0 'False + Width = 4815 + Begin VB.Label lblInstructions + Caption = "What do I do?" + Height = 555 + Left = 120 + TabIndex = 14 + Top = 120 + Width = 4575 + WordWrap = -1 'True + End + End + Begin VB.TextBox txtField + Height = 330 + Left = 3840 + TabIndex = 12 + Top = 1560 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdOK + Caption = "&OK" + Height = 330 + Left = 5100 + TabIndex = 4 + Top = 240 + Width = 1200 + End + Begin MSComDlg.CommonDialog CMDialog1 + Left = 5940 + Top = 0 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.TextBox txtCopies + Height = 330 + Left = 2600 + TabIndex = 1 + Text = "1" + Top = 1140 + Width = 600 + End + Begin VB.TextBox txtWindowTitle + Height = 315 + Left = 5640 + TabIndex = 8 + Top = 1200 + Visible = 0 'False + Width = 735 + End + Begin VB.TextBox txtReportName + Height = 315 + Left = 5280 + TabIndex = 7 + Top = 1080 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + Height = 330 + Left = 5100 + TabIndex = 6 + Top = 1560 + Width = 1200 + End + Begin VB.CommandButton cmdPrnSetup + Caption = "Printer &Setup" + Height = 330 + Left = 5100 + TabIndex = 5 + Top = 720 + Width = 1200 + End + Begin VB.Frame fraDestination + Caption = "Destination" + Height = 1515 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 1200 + Begin VB.OptionButton optDest + Caption = "Printer" + Height = 330 + Index = 1 + Left = 120 + TabIndex = 3 + Top = 900 + Width = 1000 + End + Begin VB.OptionButton optDest + Caption = "Window" + Height = 330 + Index = 0 + Left = 120 + TabIndex = 2 + Top = 360 + Value = -1 'True + Width = 1000 + End + End + Begin Crystal.CrystalReport rptPrint + Left = 5460 + Top = 0 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + DiscardSavedData= -1 'True + WindowState = 2 + PrintFileLinesPerPage= 60 + End + Begin VB.Label lblEndDate + Alignment = 1 'Right Justify + Caption = "Ending Date:" + Height = 330 + Left = 1560 + TabIndex = 11 + Top = 780 + Visible = 0 'False + Width = 1005 + End + Begin VB.Label lblBegDate + Alignment = 1 'Right Justify + Caption = "Beginning Date:" + Height = 330 + Left = 1420 + TabIndex = 10 + Top = 290 + Visible = 0 'False + Width = 1155 + End + Begin VB.Label lblCopies + Alignment = 1 'Right Justify + Caption = "Copies:" + Height = 330 + Left = 1950 + TabIndex = 9 + Top = 1200 + Width = 600 + End +End +Attribute VB_Name = "frmReport" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim strReportName As String, strField As String + +Private Sub cmdExit_Click() + frmReport.txtBegDate.Visible = False + frmReport.txtEndDate.Visible = False + frmReport.lblBegDate.Visible = False + frmReport.lblEndDate.Visible = False +' gintFlag = 0 + + Unload Me + +End Sub + +Private Sub cmdOK_Click() + Dim intOK As Integer, intVldErr As Integer + Dim strMsg As String, strTitle As String, strSelection As String + Dim dteBegDate As Date, dteEndDate As Date + Dim strBYear As String, strBMonth As String, strBDay As String + Dim strEYear As String, strEMonth As String, strEDay As String + + +' If gintFlag = 9 Then + If txtBegDate <> "" Then + If IsDate(txtBegDate) Then + dteBegDate = DateValue(txtBegDate) + dteEndDate = DateValue(txtEndDate) + End If + Else + dteBegDate = DateValue("01/01/1980") + dteEndDate = DateValue("12/31/2099") + End If +' End If + strBYear = Year(dteBegDate) + strBMonth = Format(Month(dteBegDate), "00") + strBDay = Format(Day(dteBegDate), "00") + strEYear = Year(dteEndDate) + strEMonth = Format(Month(dteEndDate), "00") + strEDay = Format(Day(dteEndDate), "00") + + rptPrint.WindowTitle = txtWindowTitle + rptPrint.ReportFileName = txtReportName + rptPrint.CopiesToPrinter = txtCopies + + strSelection = txtField + strSelection = strSelection + " in Date (" + strSelection = strSelection + strBYear + "," + strBMonth + "," + strBDay + ")" + strSelection = strSelection + " to Date (" + strEYear + "," + strEMonth + "," + strEDay + ")" + rptPrint.SelectionFormula = strSelection + + On Error GoTo ReportErr + rptPrint.Action = 1 + On Error GoTo 0 + GoTo OKExit + +ReportErr: + If Err <> 53 Then + + 'see if error is from CRW + If rptPrint.LastErrorNumber <> 0 Then + strMsg = Str(rptPrint.LastErrorNumber) + strMsg = strMsg + ":" + rptPrint.LastErrorString + strTitle = "Crystal Reports Pro Error" + Else + 'error was from VB + strMsg = Str(Err) + ":" + Error$(Err) + strTitle = "Visual Basic Error" + End If + 'show error # and text + MsgBox strMsg, 0, strTitle + End If + Resume Next + +'end of this procedure +OKExit: +End Sub + +Private Sub cmdPrnSetup_Click() + CMDialog1.Flags = &H40 + CMDialog1.Action = 5 +End Sub + +Private Sub Form_Activate() + + 'fix up form caption + If Len(Trim(Me.txtWindowTitle)) = 0 Then + Me.txtWindowTitle = "Print Report" + End If + Me.Caption = Me.txtWindowTitle + txtReportName = "test" + + 'check for passed report name + If Len(Trim(Me.txtReportName)) = 0 Then + MsgBox "Missing Report Name!", vbCritical + vbOKOnly + Unload Me + End If + + 'set default copies + txtCopies = 1 + +End Sub + +Private Sub optDest_Click(Index As Integer) + If optDest(0) = True Then + rptPrint.Destination = crptToWindow + End If + If optDest(1) = True Then + rptPrint.Destination = crptToPrinter + End If +End Sub + + +Private Sub txtBegDate_LostFocus() +Dim lngPOS As Long + + If IsDate(txtBegDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtBegDate, "/", 1) + If lngPOS = 0 Then + If Len(txtBegDate) > 0 Then + txtBegDate = Format(txtBegDate, "00/00/####") + If Not IsDate(txtBegDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtBegDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtBegDate.SetFocus + End If + +End Sub + +Private Sub txtEndDate_LostFocus() +Dim lngPOS As Long + + If IsDate(txtEndDate) Then + Exit Sub + End If + lngPOS = InStr(1, txtEndDate, "/", 1) + If lngPOS = 0 Then + If Len(txtEndDate) > 0 Then + txtEndDate = Format(txtEndDate, "00/00/####") + If Not IsDate(txtEndDate) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtEndDate.SetFocus + End If + End If + Else + MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" + txtEndDate.SetFocus + End If +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrew.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrew.frm new file mode 100644 index 0000000..9d76356 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrew.frm @@ -0,0 +1,437 @@ +VERSION 5.00 +Begin VB.Form frmSCrew + Caption = "Scaffolding Crews" + ClientHeight = 2460 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8940 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 2460 + ScaleWidth = 8940 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtPRCrew + Height = 315 + Left = 7440 + TabIndex = 10 + Top = 180 + Width = 1395 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 7440 + TabIndex = 7 + TabStop = 0 'False + Top = 1080 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + Height = 555 + Left = 5820 + TabIndex = 5 + Top = 1080 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 555 + Left = 4260 + TabIndex = 6 + TabStop = 0 'False + Top = 1080 + Width = 1395 + End + Begin VB.TextBox txtCrewBoss + Height = 315 + Left = 5400 + MaxLength = 30 + TabIndex = 4 + Top = 600 + Width = 3435 + End + Begin VB.ListBox lstCrew + Height = 2205 + Left = 60 + Sorted = -1 'True + TabIndex = 0 + Top = 120 + Width = 3735 + End + Begin VB.Label lblPRCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PR Crew #:" + Height = 195 + Left = 6540 + TabIndex = 9 + Top = 240 + Width = 825 + End + Begin VB.Label lblInstructions + Caption = "Double Click On A Scaffold Driver to Update." + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4140 + TabIndex = 8 + Top = 1860 + Width = 4695 + End + Begin VB.Label lblCrewId + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 3 + Top = 180 + Width = 975 + End + Begin VB.Label lblName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffold Driver:" + Height = 195 + Left = 4245 + TabIndex = 2 + Top = 660 + Width = 1095 + End + Begin VB.Label lblCrewNum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffold Crew #:" + Height = 195 + Left = 4155 + TabIndex = 1 + Top = 240 + Width = 1185 + End +End +Attribute VB_Name = "frmSCrew" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSCREW As Recordset + +Dim mboolAdding As Boolean + +Private Sub cboType_Change() + Call CrewLoad +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + lstCrew.Enabled = False + mboolAdding = True + Call FormClear + txtCrewBoss.SetFocus +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + cmdAdd.Enabled = True + cmdSave.Enabled = False + lstCrew.Enabled = True + Call FormSave +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + Exit Sub + +Error_EH: + gstrMODULE = "FormSCrew - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormSCrew - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT crew_id, name from tblSC_Crew" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstCrew.Clear + + Do Until oRS.EOF + With lstCrew + .AddItem Field2Str(oRS!Name) + .ItemData(.NewIndex) = oRS!crew_id + End With + + oRS.MoveNext + Loop + + If lstCrew.ListCount Then + lstCrew.ListIndex = 0 + Else + lstCrew.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormSCrew - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblSC_crew " + strSQL = strSQL & "WHERE crew_Id = " & lstCrew.ItemData(lstCrew.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic +' adOpenKeyset , adLockOptimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormSCrew - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + lblCrewId.Caption = Field2Str(!crew_id) + txtCrewBoss = Field2Str(!Name) + txtPRCrew = Field2Str2(!prcrew) + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormSCrew - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + lblCrewId.Caption = "" + txtCrewBoss = "" +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo 0 + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !Update = Date + !Name = Str2Field(txtCrewBoss) + !prcrew = Integer2Field(txtPRCrew) + End With + moRSCREW.Update + + Call CrewLoad + + If mboolAdding Then + Call CrewLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormSCrew - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Scaffold Crew Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, "Drivers") + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstCrew_Click() + On Error GoTo Error_EH + + If lstCrew.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstCrew.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstCrew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstCrew_DblClick() + If gbytSECURITY = 1 Then + cmdAdd.Enabled = False + cmdSave.Enabled = True + txtCrewBoss.SetFocus + End If +End Sub + +Private Sub txtCrewBoss_GotFocus() + Call FieldSelect(txtCrewBoss) +End Sub + +Private Sub txtCrewBoss_LostFocus() + txtCrewBoss = UCase(txtCrewBoss) +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frm new file mode 100644 index 0000000..32649bc --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frm @@ -0,0 +1,245 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmSCrewOld + Caption = "Scaffold Driver" + ClientHeight = 5055 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4515 + LinkTopic = "Form1" + ScaleHeight = 5055 + ScaleWidth = 4515 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 1500 + TabIndex = 7 + Top = 4080 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 2940 + TabIndex = 6 + Top = 4080 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 4080 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 1500 + Picture = "frmSCrewOLD.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 4680 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 1860 + Picture = "frmSCrewOLD.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 4680 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 2205 + Picture = "frmSCrewOLD.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 4680 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 2565 + Picture = "frmSCrewOLD.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 4680 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 3915 + Left = 60 + TabIndex = 0 + Top = 120 + Width = 4380 + _ExtentX = 7726 + _ExtentY = 6906 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Scaffolding Driver" + Columns(0).DataField= "Name" + Columns(0).DataWidth= 25 + Columns(0).ConvertEmptyCell= 1 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 1 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=1" + Splits(0)._ColumnProps(1)= "Column(0).Width=6826" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=6747" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowAddNew = -1 'True + AllowUpdate = 0 'False + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + TabAction = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4,.alignment=2" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13,.alignment=3,.bold=0,.fontsize=825" + _StyleDefs(31) = ":id=28,.italic=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(32) = ":id=28,.fontname=MS Sans Serif" + _StyleDefs(33) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(34) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(35) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(36) = "Named:id=33:Normal" + _StyleDefs(37) = ":id=33,.parent=0" + _StyleDefs(38) = "Named:id=34:Heading" + _StyleDefs(39) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(40) = ":id=34,.wraptext=-1,.bold=-1,.fontsize=975,.italic=0,.underline=0" + _StyleDefs(41) = ":id=34,.strikethrough=0,.charset=0" + _StyleDefs(42) = ":id=34,.fontname=MS Sans Serif" + _StyleDefs(43) = "Named:id=35:Footing" + _StyleDefs(44) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(45) = "Named:id=36:Selected" + _StyleDefs(46) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(47) = "Named:id=37:Caption" + _StyleDefs(48) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(49) = "Named:id=38:HighlightRow" + _StyleDefs(50) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(51) = "Named:id=39:EvenRow" + _StyleDefs(52) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(53) = "Named:id=40:OddRow" + _StyleDefs(54) = ":id=40,.parent=33" + _StyleDefs(55) = "Named:id=41:RecordSelector" + _StyleDefs(56) = ":id=41,.parent=34" + _StyleDefs(57) = "Named:id=42:FilterBar" + _StyleDefs(58) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmSCrewOld" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblSC_Crew ORDER by Crew_ID" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSCrewOLD.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSand.FRM b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSand.FRM new file mode 100644 index 0000000..531dc7e --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSand.FRM @@ -0,0 +1,290 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmSand + Caption = "Sand Zone Information" + ClientHeight = 3660 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 4665 + LinkTopic = "Form1" + ScaleHeight = 3660 + ScaleWidth = 4665 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 555 + Left = 1260 + TabIndex = 8 + Top = 2670 + Width = 1065 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + Height = 555 + Left = 3420 + TabIndex = 7 + Top = 2670 + Width = 1065 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 555 + Left = 2340 + TabIndex = 6 + Top = 2670 + Width = 1065 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Height = 555 + Left = 180 + TabIndex = 5 + Top = 2670 + Width = 1065 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 1605 + Picture = "frmSand.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 3345 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 1965 + Picture = "frmSand.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 3345 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 2310 + Picture = "frmSand.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 3345 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 2670 + Picture = "frmSand.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 3345 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 2535 + Left = 180 + TabIndex = 0 + Top = 60 + Width = 4320 + _ExtentX = 7620 + _ExtentY = 4471 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Sand Zone" + Columns(0).DataField= "zone" + Columns(0).DataWidth= 1 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 25 + Columns(1).DefaultValue= "0" + Columns(1).DefaultValue.vt= 8 + Columns(1).NumberFormat= "Fixed" + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Sand Price" + Columns(2).DataField= "price" + Columns(2).DataWidth= 6 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2).NumberFormat= "Fixed" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 3 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=3" + Splits(0)._ColumnProps(1)= "Column(0).Width=1905" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1826" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=3016" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=2937" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1667" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1588" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Named:id=33:Normal" + _StyleDefs(43) = ":id=33,.parent=0" + _StyleDefs(44) = "Named:id=34:Heading" + _StyleDefs(45) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(46) = ":id=34,.wraptext=-1" + _StyleDefs(47) = "Named:id=35:Footing" + _StyleDefs(48) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(49) = "Named:id=36:Selected" + _StyleDefs(50) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(51) = "Named:id=37:Caption" + _StyleDefs(52) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(53) = "Named:id=38:HighlightRow" + _StyleDefs(54) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(55) = "Named:id=39:EvenRow" + _StyleDefs(56) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(57) = "Named:id=40:OddRow" + _StyleDefs(58) = ":id=40,.parent=33" + _StyleDefs(59) = "Named:id=41:RecordSelector" + _StyleDefs(60) = ":id=41,.parent=34" + _StyleDefs(61) = "Named:id=42:FilterBar" + _StyleDefs(62) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmSand" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdCancel_Click() + moRS.CancelUpdate +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update + TDBGLabor.ReBind +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblSZone" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frm new file mode 100644 index 0000000..b84225d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frm @@ -0,0 +1,1283 @@ +VERSION 5.00 +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" +Begin VB.Form frmScafList + Caption = "Scaffold List" + ClientHeight = 6345 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11850 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6345 + ScaleWidth = 11850 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txt108 + Height = 315 + Left = 7620 + TabIndex = 42 + Top = 4800 + Width = 435 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 6360 + TabIndex = 41 + Top = 4800 + Width = 435 + End + Begin VB.TextBox txtHrs + Alignment = 1 'Right Justify + Height = 315 + Left = 7020 + MaxLength = 2 + TabIndex = 11 + Top = 4200 + Width = 435 + End + Begin VB.TextBox txtMin + Alignment = 1 'Right Justify + Height = 315 + Left = 7620 + MaxLength = 2 + TabIndex = 12 + Top = 4200 + Width = 435 + End + Begin VB.ComboBox cboSCrew + Height = 315 + Left = 960 + Style = 2 'Dropdown List + TabIndex = 8 + Top = 4620 + Width = 2535 + End + Begin VB.Frame fraUPDown + Caption = "Scaffold Action" + Height = 855 + Left = 8520 + TabIndex = 19 + Top = 4140 + Width = 1515 + Begin VB.OptionButton optScaffold + Caption = "Put Up" + Height = 375 + Index = 0 + Left = 180 + TabIndex = 13 + Top = 180 + Width = 1095 + End + Begin VB.OptionButton optScaffold + Caption = "Take Down" + Height = 315 + Index = 1 + Left = 180 + TabIndex = 14 + Top = 480 + Width = 1155 + End + End + Begin VB.Frame fraStory + Caption = "House Size" + Height = 855 + Left = 10200 + TabIndex = 20 + Top = 4140 + Width = 1515 + Begin VB.OptionButton optStory + Caption = "Two Story" + Height = 195 + Index = 0 + Left = 180 + TabIndex = 15 + Top = 240 + Width = 1095 + End + Begin VB.OptionButton optStory + Caption = "Single Story" + Height = 255 + Index = 1 + Left = 180 + TabIndex = 16 + Top = 480 + Width = 1155 + End + End + Begin VB.TextBox txtSeq + Alignment = 1 'Right Justify + Height = 315 + Left = 4560 + MaxLength = 2 + TabIndex = 10 + Top = 4620 + Width = 615 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete Scaffold" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 28 + TabStop = 0 'False + Top = 3480 + Width = 1200 + End + Begin Crystal.CrystalReport crRepair + Left = 10200 + Top = 120 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + WindowControlBox= -1 'True + WindowMaxButton = -1 'True + WindowMinButton = -1 'True + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrint + Caption = "&Print Daily Sheet" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 27 + TabStop = 0 'False + Top = 3480 + Width = 1275 + End + Begin VB.CommandButton cmdGetLot + Caption = "&Get Lot" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 26 + TabStop = 0 'False + Top = 3480 + Width = 1275 + End + Begin VB.ListBox lstProject + Height = 2595 + Left = 7080 + Sorted = -1 'True + TabIndex = 25 + Top = 600 + Visible = 0 'False + Width = 4695 + End + Begin VB.ListBox lstLot + Height = 2790 + Left = 7080 + Sorted = -1 'True + TabIndex = 24 + Top = 600 + Visible = 0 'False + Width = 4695 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 23 + TabStop = 0 'False + Top = 3480 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 18 + Top = 3480 + Width = 1275 + End + Begin VB.ComboBox cboDArea + Height = 315 + ItemData = "frmScafList.frx":0000 + Left = 4560 + List = "frmScafList.frx":001C + Style = 2 'Dropdown List + TabIndex = 9 + Top = 4260 + Width = 1215 + End + Begin VB.TextBox txtNotes + Height = 975 + Left = 960 + MultiLine = -1 'True + TabIndex = 17 + Top = 5220 + Width = 10755 + End + Begin VB.TextBox txtScheduled + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 7 + Top = 4260 + Width = 1215 + End + Begin VB.ComboBox cboArea + Height = 315 + ItemData = "frmScafList.frx":005D + Left = 4260 + List = "frmScafList.frx":0079 + Style = 2 'Dropdown List + TabIndex = 4 + TabStop = 0 'False + Top = 120 + Width = 1155 + End + Begin VB.ListBox lstScaffold + Height = 2790 + Left = 180 + TabIndex = 2 + TabStop = 0 'False + Top = 600 + Width = 6795 + End + Begin MSComCtl2.DTPicker dtpScaffold + Height = 315 + Left = 1320 + TabIndex = 0 + TabStop = 0 'False + Top = 120 + Width = 1515 + _ExtentX = 2672 + _ExtentY = 556 + _Version = 393216 + Format = 48234497 + CurrentDate = 36892 + MaxDate = 55153 + MinDate = 36892 + End + Begin VB.Label lblL10 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 8100 + TabIndex = 44 + Top = 4860 + Width = 315 + End + Begin VB.Label lblL6 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 6840 + TabIndex = 43 + Top = 4860 + Width = 315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"":" + Height = 195 + Left = 7200 + TabIndex = 40 + Top = 4860 + Width = 420 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"":" + Height = 195 + Left = 6000 + TabIndex = 39 + Top = 4860 + Width = 330 + End + Begin VB.Label lblFrames + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Frames Used" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6660 + TabIndex = 38 + Top = 4560 + Width = 1110 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 180 + TabIndex = 37 + Top = 5220 + Width = 690 + End + Begin VB.Label lblTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Time:" + Height = 195 + Left = 6540 + TabIndex = 36 + Top = 4260 + Width = 390 + End + Begin VB.Label lblHrs + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Hrs" + Height = 195 + Left = 7140 + TabIndex = 35 + Top = 4020 + Width = 240 + End + Begin VB.Label lblMin + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Min" + Height = 195 + Left = 7740 + TabIndex = 34 + Top = 4020 + Width = 255 + End + Begin VB.Label lblColon + Caption = ":" + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7500 + TabIndex = 33 + Top = 4080 + Width = 135 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 420 + TabIndex = 32 + Top = 4680 + Width = 405 + End + Begin VB.Label lblSequence + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sequence:" + Height = 195 + Left = 3600 + TabIndex = 31 + Top = 4680 + Width = 780 + End + Begin VB.Label lblLot + Height = 255 + Left = 3240 + TabIndex = 30 + Top = 3840 + Width = 675 + End + Begin VB.Label lblProject + Height = 255 + Left = 180 + TabIndex = 29 + Top = 3840 + Width = 2835 + End + Begin VB.Label lblDArea + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 4005 + TabIndex = 22 + Top = 4380 + Width = 375 + End + Begin VB.Label lblAreaDef + Caption = "Nothing in the 'List Area' will display all Scaffolding for the selected Date. Press the Delete Key to Clear." + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 5520 + TabIndex = 21 + Top = 60 + Width = 4635 + End + Begin VB.Label lblScheduled + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scheduled:" + Height = 195 + Left = 120 + TabIndex = 6 + Top = 4380 + Width = 810 + End + Begin VB.Label lblProjectLot + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 180 + TabIndex = 5 + Top = 3480 + Width = 3735 + End + Begin VB.Label lblArea + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "List Area:" + Height = 195 + Left = 3435 + TabIndex = 3 + Top = 180 + Width = 660 + End + Begin VB.Label lblRDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scaffold Date:" + Height = 195 + Left = 240 + TabIndex = 1 + Top = 180 + Width = 1020 + End +End +Attribute VB_Name = "frmScafList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSScaffold As Recordset +Dim moRS As Recordset, moRSProj As Recordset +Dim mintPRCREW As Integer +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mintSCAFFOLDID As Integer, mintBOOKMARK As Integer +Dim mstrPROJLOT As String + +Private Sub ScaffoldLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strTYPE As String, strTYPE2 As String +Dim strLine As String + On Error GoTo Error_EH + + If cboArea.ListIndex = -1 Then + strSQL = "SELECT Scaf_ID, seq, proj_id, lot_id, area, up, down, single, double, Proj_lot from tblscaffold WHERE Scaf_date = #" & CDate(dtpScaffold.Value) & "# ORDER BY Area, seq" + Else + strSQL = "SELECT Scaf_ID, seq, proj_id, lot_id, area, up, down, single, double, Proj_lot from tblScaffold WHERE Scaf_Date = #" & CDate(dtpScaffold.Value) & "# and Area = '" & Left(cboArea.Text, 1) & "' ORDER BY seq" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstScaffold.Clear + + Do Until oRS.EOF + With lstScaffold + gintLOTID = Field2Str2(oRS!Lot_id) +' Call GetLotInfo + If oRS!up Then + strTYPE = "UP " + ElseIf oRS!down Then + strTYPE = "DOWN " + End If + If oRS!Single Then + strTYPE2 = "SINGLE " + ElseIf oRS!Double Then + strTYPE2 = "DOUBLE " + Else + strTYPE2 = "UNKNOWN" + End If + strLine = "" + strLine = Field2Str(oRS!Area) & " " & strTYPE & " " '& vbTab 'Field2Str(oRS!seq) & vbTab + strLine = strLine & strTYPE2 & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE2 & vbTab & mstrPROJLOT 'Field2Str(oRS!proj_lot) + .AddItem strLine + .ItemData(.NewIndex) = Field2Long(oRS!scaf_id) + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstScaffold.ListCount Then + lstScaffold.ListIndex = 0 + mintSCAFFOLDID = lstScaffold.ItemData(lstScaffold.ListIndex) + Else + mintSCAFFOLDID = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module ScaffoldLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Crew_ID, Name FROM tblSC_Crew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSRCrew.MoveLast + oRSRCrew.MoveFirst + intRows = oRSRCrew.RecordCount + Do Until oRSRCrew.EOF + cboSCrew.AddItem Field2Str(oRSRCrew!Name) + cboSCrew.ItemData(cboSCrew.NewIndex) = Field2Long(oRSRCrew("CREW_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboArea_Click() + Call ScaffoldLoad +End Sub + +Private Sub cboArea_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboArea.ListIndex = -1 + End If + +End Sub + +Private Sub cboSCrew_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboSCrew.ListIndex = -1 + End If +End Sub + +Private Sub cmdAdd_Click() + mboolAdding = True + Call FormClear + Call ProjectSelect + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdSave.Enabled = True +' cmdAdd.Enabled = False + lstScaffold.Enabled = False + lstProject.SetFocus + +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + gconACTION = 3 + strSQL = "DELETE * FROM tblScaffold WHERE scaf_id = " & lstScaffold.ItemData(lstScaffold.ListIndex) + goConn.Execute strSQL +' strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID +' goConn.Execute strSQL +' moRS.Delete + gstrFLAG = "D" + Call LotChange(mstrPROJLOT, "Delete Repair") + Call ScaffoldLoad + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module cmdDelete" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdGetLot_Click() + Call GetLotInfo + Call cmdSave_Click +End Sub + +Private Sub cmdPrint_Click() +Dim strSQL As String, strMONTH As String, strYEAR As String, strDAY As String + + On Error GoTo Error_EH + If Len(cboArea.Text) = 0 Then + MsgBox "You Must Select A Value In The 'List Area' Field", vbOKOnly, "No Area Of Town Selected" + Exit Sub + End If + strMONTH = Format(Month(dtpScaffold.Value), "00") + strDAY = Format(Day(dtpScaffold.Value), "00") + strYEAR = Year(dtpScaffold.Value) + gintPRINT = 1 + frmReport.Show 1 + strSQL = "{tblScaffold.scaf_date} = date(" & strYEAR & "," & strMONTH & "," & strDAY & ") and {tblScaffold.area} = '" & Left(cboArea.Text, 1) & "'" + crRepair.ReportFileName = App.Path & "\DailyScaffold.rpt" + crRepair.SelectionFormula = strSQL +' crRepair.Destination = crptToWindow + crRepair.CopiesToPrinter = gintCOPY + crRepair.Destination = gintDEST + crRepair.Action = 1 + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module cmdPrint_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdSave_Click() + + mintBOOKMARK = lstScaffold.ListIndex + If Len(cboDArea.Text) = 0 Then + MsgBox "You Must Enter The Area Of Town Before Saving", vbOKOnly, "Select An Area" + cboDArea.SetFocus + Exit Sub + End If + Call FormSave + lstScaffold.Enabled = True + cmdSave.Enabled = False +' cmdAdd.Enabled = True + If mintBOOKMARK <> 0 Then + lstScaffold.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub dtpScaffold_Change() + Call ScaffoldLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + +' If lstScaffold.ListCount = 0 Then +' intResponse = MsgBox("No Scaffold schedule, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") +' If intResponse = vbYes Then +' strSQL = "SELECT * FROM tblScaffold WHERE Scaf_id = 1" +' Set moRSScaffold = New Recordset +' moRSScaffold.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' Call cmdAdd_Click +' Else +' Unload Me +' End If +' End If + Exit Sub +Error_EH: + gstrMODULE = "Form ScafList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + Set moRSScaffold = New Recordset + dtpScaffold.Value = Date + + Call CrewLoad + Call ScaffoldLoad + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblScaffold " + strSQL = strSQL & "WHERE Scaf_ID = " & mintSCAFFOLDID + + +' If moRSScaffold.State = adStateOpen Then +' moRSScaffold.Close +' End If + Set moRSScaffold = New Recordset + + moRSScaffold.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSScaffold.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSScaffold!Lot_id) + gintPROJID = Field2Str2(moRSScaffold!proj_id) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ScafList - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + lblProject.Caption = "" + lblLot.Caption = "" + + mboolSHOW = True + strSQL = "Select Proj_Desc FROM tblProject WHERE proj_id = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + lblProject.Caption = Field2Str(oRS!proj_desc) + + strSQL = "Select Lot_no, scaf6, scaf10 FROM tblLotInfo WHERE Lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + lblLot.Caption = Field2Str(oRS!lot_no) + lblL6 = Field2Str2(oRS!Scaf6) + lblL10 = Field2Str2(oRS!scaf10) + With moRSScaffold + txtScheduled = Field2Str(!scaf_date) + txtSeq = Field2Str2(!seq) + txtNotes = Field2Str(!notes) + txt68 = Field2Str2(!frame6) + txt108 = Field2Str2(!frame10) + mstrAREA = Field2Str(!Area) + If mstrAREA = "W" Then + cboDArea.Text = "West" + ElseIf mstrAREA = "N" Then + cboDArea.Text = "North" + ElseIf mstrAREA = "S" Then + cboDArea.Text = "South" + ElseIf mstrAREA = "X" Then + cboDArea.Text = "Xtra" + ElseIf mstrAREA = "2" Then + cboDArea.Text = "2-North" + ElseIf mstrAREA = "3" Then + cboDArea.Text = "3-North" + ElseIf mstrAREA = "4" Then + cboDArea.Text = "4-South" + ElseIf mstrAREA = "5" Then + cboDArea.Text = "5-West" + Else + cboDArea.ListIndex = -1 + End If + If !up Then + optScaffold(0).Value = True + ElseIf !down Then + optScaffold(1).Value = True + Else + optScaffold(0).Value = False + optScaffold(1).Value = False + End If + If !Single Then + optStory(1).Value = True + ElseIf !Double Then + optStory(0).Value = True + Else + optStory(0).Value = False + optStory(1).Value = False + End If + cboSCrew.ListIndex = Field2Integer(!crew) - 1 + lblProjectLot.Caption = Field2Str(!proj_lot) + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + If Err = 3021 Then + MsgBox "No Project Was Found = Be Sure To Click The Get Lot Button", vbOKOnly, "No Project" + Resume Next + End If + gstrMODULE = "Form ScafList - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim strLOT As String + On Error GoTo Error_EH + + If mboolAdding Then + moRSScaffold.AddNew + moRSScaffold!C_USER = gstrLOGIN + moRSScaffold!proj_id = gintPROJID + moRSScaffold!Lot_id = gintLOTID + moRSScaffold!proj_lot = Field2Str(lblProjectLot.Caption) + End If + + + With moRSScaffold + !U_USER = gstrLOGIN + !U_date = Date + If cboSCrew.ListIndex = -1 Then + !crew = 0 + mintPRCREW = 0 + Else + !crew = cboSCrew.ItemData(cboSCrew.ListIndex) + Call GetCrew + End If + !prcrew = mintPRCREW + !scaf_date = Str2Field(txtScheduled) + !hrs = Str2Field(txtHrs) + !Min = Str2Field(txtMin) + !notes = Str2Field(txtNotes) + !up = Field2CheckBox(optScaffold(0)) + !down = Field2CheckBox(optScaffold(1)) + !Single = Field2CheckBox(optStory(1)) + !Double = Field2CheckBox(optStory(0)) + !Area = Left((cboDArea.Text), 1) + !seq = Field2Str2(txtSeq) + !frame6 = Field2Str2(txt68) + !frame10 = Field2Str2(txt108) + !proj_lot = lblProjectLot.Caption + !proj_id = gintPROJID + End With + + moRSScaffold.Update + + If mboolAdding Then + Call ScaffoldLoad +' Call PlanMatLoad +' Call POptLoad + If FormFind() Then + Call FormShow 'xxxxxxxxxxxxxxxxxx + Else + Call FormClear + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then +' MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" +' strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") +' If Len(strLOT) > 0 Then +' moRS!lot_no = Field2Str(strLOT) +' moRS.Update +' txtLotNo = Field2Str(strLOT) +' End If + Call ErrorHandler(moRSScaffold.ActiveConnection) +'' Resume Next\ + Exit Sub + End If + gstrMODULE = "Form ScafList - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + cboSCrew.ListIndex = -1 + txtNotes = "" + txtHrs = 0 + txtMin = 0 + txtSeq = 0 + txtScheduled = "" + optStory(0).Value = False + optStory(1).Value = False + optScaffold(0).Value = False + optScaffold(1).Value = False + cboDArea.ListIndex = -1 + lblProjectLot = "" + lblProject = "" + lblLot = "" + +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + +' If mboolAdding Then +' moRSScaffold.AddNew +' moRSScaffold!proj_id = gintPROJID +' moRSScaffold!lot_id = gintLOTID +' moRSScaffold!proj_lot = mstrPROJLOT +' End If + + ' Store the controls to the recordset + Call FieldsSave + + moRSScaffold.Update + + If mboolAdding Then + mboolAdding = False + + End If + + Call ScaffoldLoad + + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSScaffold.State = adStateOpen Then + moRSScaffold.Close + End If + +End Sub + +Private Sub lstLot_DblClick() +Dim lngPOS As Long, strSQL As String +Dim oRS As Recordset + + lngPOS = InStr(1, lstLot.Text, vbTab, 1) + gintLOTID = lstLot.ItemData(lstLot.ListIndex) + mstrPROJLOT = mstrPROJLOT & " - " & Left(lstLot.Text, lngPOS - 1) + lblProjectLot = mstrPROJLOT +' strSQL = "SELECT owner, address, lot_id FROM tblLotInfo WHERE lot_id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' moRS.MovePrevious +' txtHName = Field2Str(oRS!Owner) +' txtHAddress = Field2Str(oRS!address) + lstLot.Visible = False +End Sub + +Private Sub lstProject_DblClick() + gintPROJID = lstProject.ItemData(lstProject.ListIndex) + mstrPROJLOT = lstProject.Text + lstProject.Visible = False + Call LotSelect + lstLot.SetFocus +End Sub + +Private Sub lstScaffold_Click() + On Error GoTo Error_EH + + If lstScaffold.ListIndex <> -1 Then + mintSCAFFOLDID = lstScaffold.ItemData(lstScaffold.ListIndex) + If FormFind() Then + Call FormShow + Else + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module lstScaffold_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub lstScaffold_DblClick() +' cmdAdd.Enabled = False + cmdSave.Enabled = True +End Sub + +Private Sub txtHrs_GotFocus() + Call FieldSelect(txtHrs) +End Sub + +Private Sub txtMin_GotFocus() + Call FieldSelect(txtMin) +End Sub + +Private Sub txtScheduled_GotFocus() + Call FieldSelect(txtScheduled) +End Sub + +Private Sub txtScheduled_LostFocus() +Dim lngPOS As Long + + lngPOS = InStr(1, txtScheduled, "/", 1) + If lngPOS = 0 Then + If Len(txtScheduled) > 0 Then + txtScheduled = Format(txtScheduled, "00/00/####") + If Not IsDate(txtScheduled) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScheduled.SetFocus + End If + End If + Else + If Not IsDate(txtScheduled) Then + MsgBox "The Date You Entered is not Valid - ReEnter" + txtScheduled.SetFocus + Else + Exit Sub + End If + End If + +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!proj_id) + + Set moRSProj = New Recordset + + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + gintPROJID = moRSProj!proj_id + mstrPROJLOT = Trim(Field2Str(moRSProj!proj_desc)) & " - " & Trim(Field2Str(moRS!lot_no)) + lblProjectLot = mstrPROJLOT +End Sub + +Private Sub LotSelect() +Dim strSQL As String, strLine As String + + On Error GoTo Error_EH + + strSQL = "SELECT Lot_no, address, owner, lot_id FROM tblLotInfo WHERE proj_id = " & gintPROJID + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstLot.Visible = True + lstLot.Clear + + Do Until moRS.EOF + strLine = "" + strLine = Field2Str(moRS!lot_no) & vbTab & Field2Str(moRS!address) + lstLot.AddItem strLine + lstLot.ItemData(lstLot.NewIndex) = Field2Long(moRS!Lot_id) + moRS.MoveNext + Loop +' cboRCrew.ListIndex = 0 + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module LotSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub ProjectSelect() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT Proj_id, Proj_Desc FROM tblProject" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + lstProject.Visible = True + lstProject.Clear + + Do Until oRS.EOF + lstProject.AddItem oRS!proj_desc + lstProject.ItemData(lstProject.NewIndex) = Field2Long(oRS!proj_id) + oRS.MoveNext + Loop + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module ProjectSelect" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub txtSeq_GotFocus() + Call FieldSelect(txtSeq) +End Sub +Private Sub GetCrew() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Crew_ID, PRCREW FROM tblSC_Crew WHERE Crew_ID =" & cboSCrew.ItemData(cboSCrew.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + mintPRCREW = Field2Str2(oRS!prcrew) + Else + mintPRCREW = 0 + End If +' Do Until oRSRCrew.EOF +' cboSCrew.AddItem oRSRCrew("Name") +' cboSCrew.ItemData(cboSCrew.NewIndex) = Field2Long(oRSRCrew("CREW_ID")) +' oRSRCrew.MoveNext +' Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form ScafList - Module GETCREW" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frx new file mode 100644 index 0000000..dcfecf5 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frm new file mode 100644 index 0000000..4eb3aa6 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frm @@ -0,0 +1,1048 @@ +VERSION 5.00 +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" +Begin VB.Form frmScafPay + Caption = "Scaffolding Information" + ClientHeight = 4260 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8700 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4260 + ScaleWidth = 8700 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtCrewID + Enabled = 0 'False + Height = 315 + Left = 4680 + TabIndex = 38 + Top = 2520 + Visible = 0 'False + Width = 555 + End + Begin VB.ComboBox cboSCrew + Height = 315 + Left = 3240 + Style = 2 'Dropdown List + TabIndex = 37 + Top = 2520 + Visible = 0 'False + Width = 1275 + End + Begin VB.TextBox txtPayAmt + Height = 315 + Left = 6720 + TabIndex = 35 + Top = 2040 + Width = 855 + End + Begin VB.TextBox txtPrimRate + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 285 + Left = 1020 + MaxLength = 7 + TabIndex = 34 + Top = 2520 + Width = 615 + End + Begin VB.TextBox txtFin2Rate + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 285 + Left = 2340 + MaxLength = 7 + TabIndex = 33 + Top = 2520 + Width = 615 + End + Begin VB.TextBox txtCrewNo + Alignment = 1 'Right Justify + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 255 + Left = 5835 + MaxLength = 4 + TabIndex = 31 + Top = 1140 + Width = 675 + End + Begin VB.TextBox txtCrewName + BackColor = &H00C0FFFF& + Enabled = 0 'False + Height = 255 + Left = 5820 + TabIndex = 30 + Top = 1440 + Width = 2835 + End + Begin VB.TextBox txtPercentDone + Alignment = 1 'Right Justify + Height = 285 + Left = 6735 + MaxLength = 3 + TabIndex = 28 + Top = 1740 + Width = 675 + End + Begin VB.TextBox txtCrew + Height = 315 + Left = 7500 + TabIndex = 27 + Top = 480 + Visible = 0 'False + Width = 1095 + End + Begin VB.CheckBox chkPaid + Caption = "Paid" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7020 + TabIndex = 26 + Top = 120 + Width = 855 + End + Begin VB.TextBox txt108 + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 21 + Top = 3000 + Width = 435 + End + Begin VB.TextBox txt68 + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6180 + TabIndex = 20 + Top = 2640 + Width = 435 + End + Begin VB.ComboBox cboArea + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + ItemData = "frmScafPay.frx":0000 + Left = 5820 + List = "frmScafPay.frx":001C + Style = 2 'Dropdown List + TabIndex = 17 + Top = 840 + Width = 1275 + End + Begin MSComCtl2.DTPicker dtpScaffold + Height = 315 + Left = 5820 + TabIndex = 16 + Top = 480 + Width = 1455 + _ExtentX = 2566 + _ExtentY = 556 + _Version = 393216 + Enabled = 0 'False + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Format = 92667905 + CurrentDate = 37103 + End + Begin VB.Frame fraStory + Caption = "House Size" + Enabled = 0 'False + Height = 855 + Left = 6900 + TabIndex = 13 + Top = 3360 + Width = 1515 + Begin VB.OptionButton optStory + Caption = "Single Story" + Height = 255 + Index = 1 + Left = 180 + TabIndex = 15 + Top = 480 + Width = 1155 + End + Begin VB.OptionButton optStory + Caption = "Two Story" + Height = 195 + Index = 0 + Left = 180 + TabIndex = 14 + Top = 240 + Width = 1095 + End + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 180 + TabIndex = 7 + Top = 2820 + Width = 5115 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7320 + TabIndex = 10 + TabStop = 0 'False + Top = 2820 + Width = 1035 + End + Begin VB.CommandButton cmdSave + Caption = "&Save Pay Info" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7320 + TabIndex = 9 + TabStop = 0 'False + Top = 2340 + Width = 1035 + End + Begin VB.Frame fraUPDown + Caption = "Scaffold Action" + Enabled = 0 'False + Height = 855 + Left = 5460 + TabIndex = 4 + Top = 3360 + Width = 1395 + Begin VB.OptionButton optScaffold + Caption = "Take Down" + Height = 255 + Index = 1 + Left = 180 + TabIndex = 6 + Top = 480 + Width = 1155 + End + Begin VB.OptionButton optScaffold + Caption = "Put Up" + Height = 315 + Index = 0 + Left = 180 + TabIndex = 5 + Top = 180 + Width = 1095 + End + End + Begin VB.ListBox lstScaffold + Height = 2010 + Left = 180 + TabIndex = 0 + TabStop = 0 'False + Top = 480 + Width = 5055 + End + Begin VB.Label lblDown + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Down" + Height = 195 + Left = 1815 + TabIndex = 40 + Top = 2520 + Width = 420 + End + Begin VB.Label lblUP + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Up" + Height = 195 + Left = 765 + TabIndex = 39 + Top = 2520 + Width = 210 + End + Begin VB.Label lblPayAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Pay Amount:" + Height = 195 + Left = 5760 + TabIndex = 36 + Top = 2100 + Width = 900 + End + Begin VB.Label lblCrew1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 5340 + TabIndex = 32 + Top = 1140 + Width = 405 + End + Begin VB.Label lblPercent + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage Done:" + Height = 195 + Left = 5355 + TabIndex = 29 + Top = 1800 + Width = 1305 + End + Begin VB.Label lblL108 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 6720 + TabIndex = 25 + Top = 3060 + Width = 360 + End + Begin VB.Label lblL68 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 6720 + TabIndex = 24 + Top = 2700 + Width = 360 + End + Begin VB.Label lblFrames + Caption = "Frame Count" + Height = 195 + Left = 5760 + TabIndex = 23 + Top = 2400 + Width = 1035 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"":" + Height = 195 + Left = 5730 + TabIndex = 22 + Top = 3060 + Width = 420 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"":" + Height = 195 + Left = 5820 + TabIndex = 19 + Top = 2700 + Width = 330 + End + Begin VB.Label lblArea + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 5355 + TabIndex = 18 + Top = 900 + Width = 375 + End + Begin VB.Label lblYards + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5460 + TabIndex = 12 + Top = 60 + Width = 1275 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes" + Height = 195 + Left = 180 + TabIndex = 11 + Top = 2580 + Width = 420 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 180 + TabIndex = 8 + Top = 60 + Width = 1095 + End + Begin VB.Label lblLotNo + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 315 + Left = 3780 + TabIndex = 3 + Top = 60 + Width = 1635 + End + Begin VB.Label lblProject + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 315 + Left = 1320 + TabIndex = 2 + Top = 60 + Width = 2415 + End + Begin VB.Label lblDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date:" + Height = 195 + Left = 5340 + TabIndex = 1 + Top = 540 + Width = 390 + End +End +Attribute VB_Name = "frmScafPay" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSProj As Recordset +Dim moRSCREW As Recordset +Dim moRSTIME As Recordset +Dim moRSSCAF As Recordset +Dim mintPRCREW As Integer + +Dim mboolAdding As Boolean, mstrAREA As String, mboolUP As Boolean, mintFRAMES As Integer +Dim mstrWTYPE As String, mstrWDone As String + +Private Sub cmdAdd_Click() +' cmdAdd.Enabled = False + cmdSave.Enabled = True +' cmdDelete.Enabled = False + mboolAdding = True + Call FormClear +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + moRSCREW.Delete + Call ScaffoldLoad +' cmdAdd.Enabled = True + cmdSave.Enabled = False +' cmdDelete.Enabled = False + + Exit Sub +Error_EH: + gstrMODULE = "Form Scaffold - Module cmdDelete" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() +Dim dblPRAMT As Double, intFRAMES As Integer ', dblPRAMT As Double + + If txtPayAmt = "" Or txtPayAmt = "0" Then + If optScaffold(0) Then + intFRAMES = CInt(txt68) + CInt(txt108) + dblPRAMT = intFRAMES * Field2Str2(txtPrimRate) + txtPayAmt = dblPRAMT + txtPercentDone = "100" + mboolUP = True + mintFRAMES = intFRAMES + ElseIf optScaffold(1) Then + intFRAMES = CInt(txt68) + CInt(txt108) + dblPRAMT = intFRAMES * Field2Str2(txtFin2Rate) + txtPayAmt = dblPRAMT + txtPercentDone = "100" + mboolUP = False + mintFRAMES = intFRAMES + End If + End If +' cmdAdd.Enabled = True + cmdSave.Enabled = False +' cmdDelete.Enabled = False + Call FormSave + Call cmdExit_Click +End Sub + +Private Sub MarkPaid() +Dim intBOOKMARK As Integer + + intBOOKMARK = lstScaffold.ListIndex + moRSCREW!pdamt = 0 + moRSCREW!paid = vbChecked + moRSCREW.Update + Call ScaffoldLoad + lstScaffold.ListIndex = intBOOKMARK + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + mintPRCREW = Field2Str2(txtCrewNo) + mboolAdding = True + + Call CrewLoad + Call ScaffoldLoad + Call ProjLoad + + If lstScaffold.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + If lstScaffold.ListCount = 0 Then + intResponse = MsgBox("No Scaffolding Information, You Cannot Pay?", vbOKOnly + vbQuestion, "No Records") + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyP Then ' Display key combinations. + If CtrlDown Then + Call MarkPaid + End If + Exit Sub + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH +' mintPRCREW = Field2Str2(txtCrewNo) + +' Call CrewLoad +' Call ScaffoldLoad +' Call ProjLoad + + If lstScaffold.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ScaffoldLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, strCREW As String +Dim strPAID As String, strAMT As String + On Error GoTo Error_EH + +' strSQL = "SELECT crew, scaf_date, Scaf_id, up, down from tblScaffold WHERE Lot_id = " & gintLOTID & " ORDER BY Scaf_date" + strSQL = "SELECT * from tblScaffold WHERE Lot_id = " & gintLOTID & " AND PRCREW = " & gintCREWID & " ORDER BY Scaf_date" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstScaffold.Clear + + Do Until oRS.EOF + With lstScaffold + cboSCrew.ListIndex = oRS!crew - 1 + If oRS!paid Then + strPAID = "PD" + Else + strPAID = " " + End If + strAMT = Format(Field2Str2(oRS!pdamt), "#,#") + If oRS!up Then + strLine = Field2Str(oRS!scaf_date) & " " & "UP " & " " & cboSCrew.Text & vbTab & strPAID & vbTab & strAMT + ElseIf oRS!down Then + strLine = Field2Str(oRS!scaf_date) & " " & "DOWN" & " " & cboSCrew.Text & vbTab & strPAID & vbTab & strAMT + Else + strLine = "INVALID SCAFFOLD ENTRY - FIX" + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!scaf_id + End With + + oRS.MoveNext + Loop + + If lstScaffold.ListCount Then + lstScaffold.ListIndex = 0 + Else + lstScaffold.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Scaffold - Module ScaffoldLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblScaffold " + strSQL = strSQL & "WHERE Scaf_Id = " & lstScaffold.ItemData(lstScaffold.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormScaffold - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + Call GetCrew + + With moRSCREW + cboSCrew.ListIndex = Field2Integer(!crew) - 1 + dtpScaffold.Value = Field2Str(!scaf_date) + txtNotes = Field2Str(!notes) +' txtHrs = Field2Str(!hrs) +' txtMin = Field2Str(!Min) + txt68 = Field2Str2(!frame6) + txt108 = Field2Str2(!frame10) + mstrAREA = Field2Str(!Area) + If !paid Then + chkPaid = vbChecked + chkPaid.BackColor = &HFFFF& + Else + chkPaid = vbUnchecked + chkPaid.BackColor = &H8000000F + End If + + If mstrAREA = "W" Then + cboArea.Text = "West" + ElseIf mstrAREA = "N" Then + cboArea.Text = "North" + ElseIf mstrAREA = "S" Then + cboArea.Text = "South" + ElseIf mstrAREA = "X" Then + cboArea.Text = "Xtra" + ElseIf mstrAREA = "2" Then + cboArea.Text = "2-North" + ElseIf mstrAREA = "3" Then + cboArea.Text = "3-North" + ElseIf mstrAREA = "4" Then + cboArea.Text = "4-South" + ElseIf mstrAREA = "5" Then + cboArea.Text = "5-West" + Else + cboArea.ListIndex = -1 + End If + If !up Then + optScaffold(0).Value = True + ElseIf !down Then + optScaffold(1).Value = True + Else + optScaffold(0).Value = False + optScaffold(1).Value = False + End If + If !Single Then + optStory(1).Value = True + ElseIf !Double Then + optStory(0).Value = True + Else + optStory(0).Value = False + optStory(1).Value = False + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + dtpScaffold.Value = Date + cboSCrew.ListIndex = -1 + txtNotes = "" +' txtHrs = 0 +' txtMin = 0 + cboArea.ListIndex = -1 + optStory(0).Value = False + optStory(1).Value = False + optScaffold(0).Value = False + optScaffold(1).Value = False +End Sub + +Private Sub FieldsSave() +'Dim strLOT As String, test As String + On Error GoTo Error_EH + + With moRSTIME + !PROJ_ID = gintPROJID + !Lot_ID = gintLOTID + !lot_no = Str2Field(moRS!lot_no) + !paydt = Date + !C_USER = gstrLOGIN + !pct_done = Integer2Field(txtPercentDone) + !pay_id = gintPAYID + !proj_lot = Trim(Str2Field(lblProjCode)) & " " & Trim(Str2Field(lblLotNo)) + !yd_rate = Double2Field(txtPrimRate) + !fin2_Rate = Double2Field(txtFin2Rate) + !mtl_Rate = 0 + !ponum = 0 + !scafid = moRSCREW!scaf_id + !up = mboolUP + !frames = mintFRAMES + !crew = Integer2Field(txtCrewNo) + !pay_amt = Str2Field(txtPayAmt) +' !notes = Str2Field(txtNotes) + !pay_type = "C" + If optScaffold(0) Then + !WorkDone = "Y" + ElseIf optScaffold(1) Then + !WorkDone = "Z" + End If + + + !U_USER = gstrLOGIN + !Update = Date + End With + moRSTIME.Update + moRSCREW!pdamt = Str2Field(txtPayAmt) + moRSCREW!paid = vbChecked + moRSCREW.Update + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormScaffold - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTIME WHERE idnum = 1" + Set moRSTIME = New Recordset + moRSTIME.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If mboolAdding Then + moRSTIME.AddNew + End If + + ' Store the controls to the recordset + Call FieldsSave + +' moRSMemo!payroll = Str2Field(txtLotNotes) +' moRSMemo.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSTIME.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Scaffold Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstScaffold_Click() + On Error GoTo Error_EH + + If lstScaffold.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstScaffold.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstScaffold_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstScaffold_DblClick() + If chkPaid Then + MsgBox "This Lot Has Already Been Paid", vbOKOnly, "Already Paid" + Exit Sub + End If +' cmdAdd.Enabled = False + cmdSave.Enabled = True +' cmdDelete.Enabled = True +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "SELECT Lot_no, Lot_id, Sq_Yd, Scaf6, Scaf10 FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lblProjCode = Field2Str(moRSProj!Proj_Code) + lblProject = Field2Str(moRSProj!Proj_Desc) + lblLotNo = Field2Str(moRS!lot_no) + lblYards = Field2Str(moRS!sq_yd) + lblL68 = Field2Str2(moRS!Scaf6) + lblL108 = Field2Str2(moRS!scaf10) + +End Sub + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Crew_ID, Name FROM tblSC_Crew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSRCrew.MoveLast + oRSRCrew.MoveFirst + intRows = oRSRCrew.RecordCount + Do Until oRSRCrew.EOF + cboSCrew.AddItem oRSRCrew("Name") + cboSCrew.ItemData(cboSCrew.NewIndex) = Field2Long(oRSRCrew("CREW_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Scaffold - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetCrew() + + Dim oRS As Recordset + Dim strSQL As String, lngFind As Long + +' strSQL = "SELECT * from tblcrew WHERE crew_id = " & mintPRCREW + + strSQL = "SELECT * from tblcrewrate WHERE Proj_ID = 99999 and crew_id = " & mintPRCREW + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + txtCrewName = oRS!Crew_Boss + txtPrimRate = Field2Str2(oRS!lath_skip) + txtFin2Rate = Field2Str2(oRS!sand) + End If + + oRS.Close + +End Sub + + +Private Sub txtPercentDone_GotFocus() + If txtPercentDone = "" Then + txtPercentDone = "100" + End If + Call FieldSelect(txtPercentDone) +End Sub + +Private Sub txtPercentDone_LostFocus() +Dim dblPRAMT As Double, intFRAMES As Integer ', dblPRAMT As Double + + If optScaffold(0) Then + intFRAMES = CInt(txt68) + CInt(txt108) + dblPRAMT = intFRAMES * Field2Str2(txtPrimRate) + txtPayAmt = dblPRAMT +' txtPercentDone = "100" + mboolUP = True + mintFRAMES = intFRAMES + ElseIf optScaffold(1) Then + intFRAMES = CInt(txt68) + CInt(txt108) + dblPRAMT = intFRAMES * Field2Str2(txtFin2Rate) + txtPayAmt = dblPRAMT +' txtPercentDone = "100" + mboolUP = False + mintFRAMES = intFRAMES + End If +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frx new file mode 100644 index 0000000..72e24ee Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScafPay.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frm new file mode 100644 index 0000000..686f497 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frm @@ -0,0 +1,925 @@ +VERSION 5.00 +Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" +Begin VB.Form frmScaffold + Caption = "Scaffolding Information" + ClientHeight = 4260 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8760 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4260 + ScaleWidth = 8760 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkPaid + Caption = "Paid" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 7080 + TabIndex = 36 + Top = 60 + Width = 855 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 6180 + TabIndex = 31 + Top = 3000 + Width = 435 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 6180 + TabIndex = 30 + Top = 2640 + Width = 435 + End + Begin VB.ComboBox cboArea + Height = 315 + ItemData = "frmScaffold.frx":0000 + Left = 5820 + List = "frmScaffold.frx":001C + Style = 2 'Dropdown List + TabIndex = 27 + Top = 1380 + Width = 1275 + End + Begin MSComCtl2.DTPicker dtpScaffold + Height = 315 + Left = 5820 + TabIndex = 26 + Top = 960 + Width = 1275 + _ExtentX = 2249 + _ExtentY = 556 + _Version = 393216 + Format = 20381697 + CurrentDate = 37103 + End + Begin VB.ComboBox cboSCrew + Height = 315 + Left = 5820 + Style = 2 'Dropdown List + TabIndex = 25 + Top = 540 + Width = 2535 + End + Begin VB.Frame fraStory + Caption = "House Size" + Height = 855 + Left = 6900 + TabIndex = 22 + Top = 3360 + Width = 1515 + Begin VB.OptionButton optStory + Caption = "Single Story" + Height = 255 + Index = 1 + Left = 180 + TabIndex = 24 + Top = 480 + Width = 1155 + End + Begin VB.OptionButton optStory + Caption = "Two Story" + Height = 195 + Index = 0 + Left = 180 + TabIndex = 23 + Top = 240 + Width = 1095 + End + End + Begin VB.TextBox txtMin + Alignment = 1 'Right Justify + Height = 315 + Left = 6420 + TabIndex = 18 + Top = 2040 + Width = 435 + End + Begin VB.TextBox txtHrs + Alignment = 1 'Right Justify + Height = 315 + Left = 5820 + TabIndex = 17 + Top = 2040 + Width = 435 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7320 + TabIndex = 14 + TabStop = 0 'False + Top = 2100 + Width = 1035 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 180 + TabIndex = 7 + Top = 2820 + Width = 5115 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7320 + TabIndex = 12 + TabStop = 0 'False + Top = 2700 + Width = 1035 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7320 + TabIndex = 11 + TabStop = 0 'False + Top = 1500 + Width = 1035 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 7320 + TabIndex = 10 + TabStop = 0 'False + Top = 900 + Width = 1035 + End + Begin VB.Frame fraUPDown + Caption = "Scaffold Action" + Height = 855 + Left = 5460 + TabIndex = 4 + Top = 3360 + Width = 1395 + Begin VB.OptionButton optScaffold + Caption = "Take Down" + Height = 255 + Index = 1 + Left = 180 + TabIndex = 6 + Top = 480 + Width = 1155 + End + Begin VB.OptionButton optScaffold + Caption = "Put Up" + Height = 315 + Index = 0 + Left = 180 + TabIndex = 5 + Top = 180 + Width = 1095 + End + End + Begin VB.ListBox lstScaffold + Height = 2010 + Left = 180 + TabIndex = 0 + TabStop = 0 'False + Top = 480 + Width = 5055 + End + Begin VB.Label lblL108 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 6720 + TabIndex = 35 + Top = 3060 + Width = 360 + End + Begin VB.Label lblL68 + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 195 + Left = 6720 + TabIndex = 34 + Top = 2700 + Width = 360 + End + Begin VB.Label lblFrames + Caption = "Frame Count" + Height = 195 + Left = 5760 + TabIndex = 33 + Top = 2400 + Width = 1035 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8"":" + Height = 195 + Left = 5730 + TabIndex = 32 + Top = 3060 + Width = 420 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8"":" + Height = 195 + Left = 5820 + TabIndex = 29 + Top = 2700 + Width = 330 + End + Begin VB.Label lblArea + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 5355 + TabIndex = 28 + Top = 1440 + Width = 375 + End + Begin VB.Label lblColon + Caption = ":" + BeginProperty Font + Name = "MS Sans Serif" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 6300 + TabIndex = 21 + Top = 1920 + Width = 135 + End + Begin VB.Label lblMin + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Min" + Height = 195 + Left = 6540 + TabIndex = 20 + Top = 1800 + Width = 255 + End + Begin VB.Label lblHrs + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Hrs" + Height = 195 + Left = 5940 + TabIndex = 19 + Top = 1800 + Width = 240 + End + Begin VB.Label lblTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Time:" + Height = 195 + Left = 5340 + TabIndex = 16 + Top = 2100 + Width = 390 + End + Begin VB.Label lblYards + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 5460 + TabIndex = 15 + Top = 60 + Width = 1275 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes" + Height = 195 + Left = 180 + TabIndex = 13 + Top = 2580 + Width = 420 + End + Begin VB.Label lblProjCode + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 180 + TabIndex = 9 + Top = 60 + Width = 1095 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 5325 + TabIndex = 8 + Top = 600 + Width = 405 + End + Begin VB.Label lblLotNo + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 315 + Left = 3780 + TabIndex = 3 + Top = 60 + Width = 1635 + End + Begin VB.Label lblProject + BorderStyle = 1 'Fixed Single + Caption = " " + Height = 315 + Left = 1320 + TabIndex = 2 + Top = 60 + Width = 2415 + End + Begin VB.Label lblDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date:" + Height = 195 + Left = 5340 + TabIndex = 1 + Top = 1020 + Width = 390 + End +End +Attribute VB_Name = "frmScaffold" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSProj As Recordset +Dim moRSCREW As Recordset +Dim mintPRCREW As Integer + +Dim mboolAdding As Boolean, mstrAREA As String + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + cmdDelete.Enabled = False + mboolAdding = True + Call FormClear +End Sub + +Private Sub cmdDelete_Click() +Dim strSQL As String, strYN As String + On Error GoTo Error_EH + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + moRSCREW.Delete + Call ScaffoldLoad + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdDelete.Enabled = False + + Exit Sub +Error_EH: + gstrMODULE = "Form Scaffold - Module cmdDelete" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + cmdAdd.Enabled = True + cmdSave.Enabled = False + cmdDelete.Enabled = False + Call FormSave +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String + + On Error GoTo Error_EH + + If lstScaffold.ListCount = 0 Then + intResponse = MsgBox("No Scaffolding Information, do you wish to add some?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tblscaffold WHERE Lot_Id = 1" + Set moRSCREW = New Recordset + moRSCREW.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + Call cmdAdd_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call CrewLoad + Call ScaffoldLoad + Call ProjLoad + + If lstScaffold.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ScaffoldLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, strCREW As String +Dim strPAID As String, strAMT As String + On Error GoTo Error_EH + +' strSQL = "SELECT crew, scaf_date, Scaf_id, up, down from tblScaffold WHERE Lot_id = " & gintLOTID & " ORDER BY Scaf_date" + strSQL = "SELECT * from tblScaffold WHERE Lot_id = " & gintLOTID & " ORDER BY Scaf_date" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstScaffold.Clear + + Do Until oRS.EOF + With lstScaffold + cboSCrew.ListIndex = oRS!crew - 1 + If oRS!paid Then + strPAID = "PD" + Else + strPAID = " " + End If + strAMT = Format(Field2Str2(oRS!pdamt), "#,#") + If oRS!up Then + strLine = Field2Str(oRS!scaf_date) & " " & "UP " & " " & cboSCrew.Text & vbTab & strPAID & vbTab & strAMT + ElseIf oRS!down Then + strLine = Field2Str(oRS!scaf_date) & " " & "DOWN" & " " & cboSCrew.Text & vbTab & strPAID & vbTab & strAMT + Else + strLine = "INVALID SCAFFOLD ENTRY - FIX" + End If + .AddItem strLine + .ItemData(.NewIndex) = oRS!scaf_id + End With + + oRS.MoveNext + Loop + + If lstScaffold.ListCount Then + lstScaffold.ListIndex = 0 + Else + lstScaffold.ListIndex = -1 + Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Scaffold - Module ScaffoldLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblScaffold " + strSQL = strSQL & "WHERE Scaf_Id = " & lstScaffold.ItemData(lstScaffold.ListIndex) + + Set moRSCREW = New Recordset + + moRSCREW.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If moRSCREW.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "FormScaffold - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShowCrew() +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRSCREW + cboSCrew.ListIndex = Field2Integer(!crew) - 1 + dtpScaffold.Value = Field2Str(!scaf_date) + txtNotes = Field2Str(!notes) + txtHrs = Field2Str(!hrs) + txtMin = Field2Str(!Min) + txt68 = Field2Str2(!frame6) + txt108 = Field2Str2(!frame10) + mstrAREA = Field2Str(!Area) + If !paid Then + chkPaid = vbChecked + chkPaid.BackColor = &HFFFF& + Else + chkPaid = vbUnchecked + chkPaid.BackColor = &H8000000F + End If + + If mstrAREA = "W" Then + cboArea.Text = "West" + ElseIf mstrAREA = "N" Then + cboArea.Text = "North" + ElseIf mstrAREA = "S" Then + cboArea.Text = "South" + ElseIf mstrAREA = "X" Then + cboArea.Text = "Xtra" + ElseIf mstrAREA = "2" Then + cboArea.Text = "2-North" + ElseIf mstrAREA = "3" Then + cboArea.Text = "3-North" + ElseIf mstrAREA = "4" Then + cboArea.Text = "4-South" + ElseIf mstrAREA = "5" Then + cboArea.Text = "5-West" + Else + cboArea.ListIndex = -1 + End If + If !up Then + optScaffold(0).Value = True + ElseIf !down Then + optScaffold(1).Value = True + Else + optScaffold(0).Value = False + optScaffold(1).Value = False + End If + If !Single Then + optStory(1).Value = True + ElseIf !Double Then + optStory(0).Value = True + Else + optStory(0).Value = False + optStory(1).Value = False + End If + End With + + Exit Sub + +Error_EH: + gstrMODULE = "FormScaffold - Module FormShowCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + dtpScaffold.Value = Date + cboSCrew.ListIndex = -1 + txtNotes = "" + txtHrs = 0 + txtMin = 0 + cboArea.ListIndex = -1 + optStory(0).Value = False + optStory(1).Value = False + optScaffold(0).Value = False + optScaffold(1).Value = False +End Sub + +Private Sub FieldsSave() +Dim strLOT As String, test As String + On Error GoTo Error_EH + + With moRSCREW + !U_USER = gstrLOGIN + !U_date = Date + If cboSCrew.ListIndex = -1 Then + !crew = 0 + mintPRCREW = 0 + Else + !crew = cboSCrew.ItemData(cboSCrew.ListIndex) + Call GetCrew + End If + !prcrew = mintPRCREW + !scaf_date = dtpScaffold.Value + !hrs = Str2Field(txtHrs) + !Min = Str2Field(txtMin) + !Area = Left((cboArea.Text), 1) + !notes = Str2Field(txtNotes) + !proj_lot = Str2Field(Trim(lblProject) & " " & lblLotNo) + !up = Field2CheckBox(optScaffold(0)) + !down = Field2CheckBox(optScaffold(1)) + !Single = Field2CheckBox(optStory(1)) + !Double = Field2CheckBox(optStory(0)) + !frame6 = Str2Field(txt68) + !frame10 = Str2Field(txt108) + End With + moRSCREW.Update + + Call ScaffoldLoad + + If mboolAdding Then + Call ScaffoldLoad + If FormFindCrew() Then + Call FormShowCrew + End If + End If + + Exit Sub + +Error_EH: + If Err.Number = -2147467259 Then + MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" + Resume Next + End If + gstrMODULE = "FormScaffold - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() + Dim strName As String + + On Error GoTo Error_EH + + If mboolAdding Then + moRSCREW.AddNew + moRSCREW!C_USER = gstrLOGIN + moRSCREW!Lot_id = gintLOTID + moRSCREW!proj_id = gintPROJID + End If + + ' Store the controls to the recordset + Call FieldsSave + + + If mboolAdding Then + mboolAdding = False + End If + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSCREW.ActiveConnection) + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + If cmdSave.Enabled Then + + strMSG = "Scaffold Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRSCREW.State = adStateOpen Then + moRSCREW.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstScaffold_Click() + On Error GoTo Error_EH + + If lstScaffold.ListIndex <> -1 Then + If FormFindCrew() Then + Call FormShowCrew + Else + lstScaffold.Clear + Call FormClear + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Crews - Module lstScaffold_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub lstScaffold_DblClick() + cmdAdd.Enabled = False + cmdSave.Enabled = True + cmdDelete.Enabled = True +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +End Sub + +Private Sub ProjLoad() + Dim strSQL As String + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + Set moRSProj = New Recordset + moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + strSQL = "SELECT Lot_no, Lot_id, Sq_Yd, Scaf6, Scaf10 FROM tblLotInfo WHERE lot_id = " & gintLOTID + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lblProjCode = Field2Str(moRSProj!proj_code) + lblProject = Field2Str(moRSProj!proj_desc) + lblLotNo = Field2Str(moRS!lot_no) + lblYards = Field2Str(moRS!sq_yd) + lblL68 = Field2Str2(moRS!Scaf6) + lblL108 = Field2Str2(moRS!scaf10) + +End Sub + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Crew_ID, Name FROM tblSC_Crew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSRCrew.MoveLast + oRSRCrew.MoveFirst + intRows = oRSRCrew.RecordCount + Do Until oRSRCrew.EOF + cboSCrew.AddItem oRSRCrew("Name") + cboSCrew.ItemData(cboSCrew.NewIndex) = Field2Long(oRSRCrew("CREW_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Scaffold - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub GetCrew() +Dim oRS As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT Crew_ID, PRCREW FROM tblSC_Crew WHERE Crew_ID =" & cboSCrew.ItemData(cboSCrew.ListIndex) + + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + If Not oRS.EOF Then + mintPRCREW = Field2Str2(oRS!prcrew) + Else + mintPRCREW = 0 + End If +' Do Until oRSRCrew.EOF +' cboSCrew.AddItem oRSRCrew("Name") +' cboSCrew.ItemData(cboSCrew.NewIndex) = Field2Long(oRSRCrew("CREW_ID")) +' oRSRCrew.MoveNext +' Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Scaffold - Module GETCREW" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frx new file mode 100644 index 0000000..72e24ee Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold1.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold1.frm new file mode 100644 index 0000000..29ae1aa --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmScaffold1.frm @@ -0,0 +1,261 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmScaffold1 + Caption = "Labor Rates" + ClientHeight = 6720 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 6720 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 6900 + TabIndex = 8 + Top = 5940 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5220 + TabIndex = 7 + Top = 5940 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3540 + TabIndex = 6 + Top = 5940 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 1860 + TabIndex = 5 + Top = 5940 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 120 + Picture = "frmScaffold1.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 475 + Picture = "frmScaffold1.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 830 + Picture = "frmScaffold1.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 1185 + Picture = "frmScaffold1.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5535 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 11700 + _ExtentX = 20638 + _ExtentY = 9763 + _LayoutType = 0 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).DataField= "" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).DataField= "" + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 2 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=2" + Splits(0)._ColumnProps(1)= "Column(0).Width=2725" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=2646" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=2725" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=2646" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Named:id=33:Normal" + _StyleDefs(39) = ":id=33,.parent=0" + _StyleDefs(40) = "Named:id=34:Heading" + _StyleDefs(41) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(42) = ":id=34,.wraptext=-1" + _StyleDefs(43) = "Named:id=35:Footing" + _StyleDefs(44) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(45) = "Named:id=36:Selected" + _StyleDefs(46) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(47) = "Named:id=37:Caption" + _StyleDefs(48) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(49) = "Named:id=38:HighlightRow" + _StyleDefs(50) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(51) = "Named:id=39:EvenRow" + _StyleDefs(52) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(53) = "Named:id=40:OddRow" + _StyleDefs(54) = ":id=40,.parent=33" + _StyleDefs(55) = "Named:id=41:RecordSelector" + _StyleDefs(56) = ":id=41,.parent=34" + _StyleDefs(57) = "Named:id=42:FilterBar" + _StyleDefs(58) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmScaffold1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblInvtry" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frm new file mode 100644 index 0000000..03aa85f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frm @@ -0,0 +1,264 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmShowOrderMat + Caption = "Order Materials" + ClientHeight = 4620 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6060 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 4620 + ScaleWidth = 6060 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtPreOrder + Height = 315 + Left = 2370 + TabIndex = 7 + Top = 0 + Visible = 0 'False + Width = 540 + End + Begin LpLib.fpList lstMaterials + Height = 3765 + Left = 60 + TabIndex = 6 + Top = 345 + Width = 5940 + _Version = 196608 + _ExtentX = 10477 + _ExtentY = 6641 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmShowOrderMat.frx":0000 + End + Begin VB.Label lblAQty + AutoSize = -1 'True + Caption = "Qty Delivered:" + Height = 195 + Left = 4935 + TabIndex = 5 + Top = 120 + Width = 1005 + End + Begin VB.Label lblOQty + AutoSize = -1 'True + Caption = "Qty Ordered:" + Height = 195 + Left = 3885 + TabIndex = 4 + Top = 120 + Width = 900 + End + Begin VB.Label lblDesc + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 1155 + TabIndex = 3 + Top = 120 + Width = 840 + End + Begin VB.Label lblInv + AutoSize = -1 'True + Caption = "Inv #:" + Height = 195 + Left = 120 + TabIndex = 2 + Top = 120 + Width = 420 + End + Begin VB.Label lblInvTotal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Invoice Total:" + Height = 195 + Left = 120 + TabIndex = 1 + Top = 4320 + Width = 975 + End + Begin VB.Label lblTotal + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1200 + TabIndex = 0 + Top = 4260 + Width = 1755 + End +End +Attribute VB_Name = "frmShowOrderMat" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mdblTOTAL As Double + + +Private Sub OrderMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(2) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + +' aTabs(0) = 40 +' aTabs(1) = 180 +' aTabs(2) = 230 +' aTabs(3) = 110 +' aTabs(4) = 130 + + mdblTOTAL = 0 + + If txtPreOrder = "Z" Then + strSQL = "SELECT * from tblLotMatrl WHERE Lot_id = " & gintLOTID & "And (M_Type = 'Z') Order By Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + ElseIf txtPreOrder = "P" Then + strSQL = "SELECT * from tblLotMatrl WHERE Lot_id = " & gintLOTID & "And (M_Type = 'P') Order By Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Else + strSQL = "SELECT * from tblOrdMatrl WHERE Order_id = " & glngORDERID & " Order By Inv_No" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + End If + +' lngRET = SendMessage(lstMaterials.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) + + lstMaterials.Clear + + Do Until oRS.EOF + With lstMaterials + If txtPreOrder = "Z" Or txtPreOrder = "P" Then +' strLine = Field2Str2(oRS!Item_ID) & vbTab & Field2Str(oRS!inv_no) & vbTab & oRS!Desc & vbTab & oRS!o_qty + strLine = vbTab & Field2Str(oRS!inv_no) & vbTab & oRS!Desc & vbTab & oRS!o_qty +' strLine = strLine & vbTab & oRS!a_qty + .AddItem strLine + Else + strLine = Field2Str2(oRS!Item_ID) & vbTab & Field2Str(oRS!inv_no) & vbTab & oRS!Desc & vbTab & oRS!o_qty + strLine = strLine & vbTab & oRS!a_qty + .AddItem strLine + dblSUM = (Field2Str2(oRS!a_qty) * Field2Str2(oRS!price)) + End If + End With +' dblSUM = (Field2Str2(oRS!a_qty) * Field2Str2(oRS!price)) + mdblTOTAL = mdblTOTAL + dblSUM + oRS.MoveNext + Loop + oRS.Close + + lblTotal = Format(mdblTOTAL, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowOrderMat - Module OrderMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + txtPreOrder = frmLotList.txtPreOrder + Call OrderMatLoad +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frx new file mode 100644 index 0000000..6df27a0 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowOrderMat.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frm new file mode 100644 index 0000000..b31f685 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frm @@ -0,0 +1,486 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmShowPO + Caption = "Show PO Information:" + ClientHeight = 5805 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 5190 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5805 + ScaleWidth = 5190 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstPOMaterial + Height = 1065 + Left = 420 + TabIndex = 18 + Top = 3165 + Width = 4515 + _Version = 196608 + _ExtentX = 7964 + _ExtentY = 1879 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmShowPO.frx":0000 + End + Begin VB.TextBox txtPONum + Enabled = 0 'False + Height = 315 + Left = 1020 + TabIndex = 9 + Top = 120 + Width = 855 + End + Begin VB.TextBox txtPODate + Enabled = 0 'False + Height = 315 + Left = 2880 + TabIndex = 8 + Top = 120 + Width = 1455 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 960 + TabIndex = 3 + Top = 5220 + Width = 1275 + End + Begin VB.TextBox txtPONotes + Enabled = 0 'False + Height = 1215 + Left = 1020 + MaxLength = 250 + MultiLine = -1 'True + TabIndex = 2 + Top = 1560 + Width = 3915 + End + Begin VB.TextBox txtPODesc + Enabled = 0 'False + Height = 315 + Left = 1020 + MaxLength = 30 + TabIndex = 1 + Top = 840 + Width = 3315 + End + Begin VB.TextBox txtIssueTo + Enabled = 0 'False + Height = 315 + Left = 1020 + MaxLength = 20 + TabIndex = 0 + Top = 480 + Width = 3315 + End + Begin VB.Label lblCUser + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 1020 + TabIndex = 17 + Top = 4500 + Width = 555 + End + Begin VB.Label lblUDate + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 1680 + TabIndex = 16 + Top = 4800 + Width = 3255 + End + Begin VB.Label lblUUser + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 1020 + TabIndex = 15 + Top = 4800 + Width = 555 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + Height = 195 + Left = 255 + TabIndex = 14 + Top = 4860 + Width = 660 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + Height = 195 + Left = 315 + TabIndex = 13 + Top = 4560 + Width = 600 + End + Begin VB.Label lblCDate + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 1680 + TabIndex = 12 + Top = 4500 + Width = 3255 + End + Begin VB.Label lblPOMaterial + AutoSize = -1 'True + Caption = "P.O. Materials:" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1080 + TabIndex = 11 + Top = 2880 + Width = 1275 + End + Begin VB.Label lblPODate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Date:" + Enabled = 0 'False + Height = 195 + Left = 2100 + TabIndex = 10 + Top = 180 + Width = 660 + End + Begin VB.Label lblPONotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O. Notes:" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 1080 + TabIndex = 7 + Top = 1260 + Width = 1005 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Enabled = 0 'False + Height = 195 + Left = 75 + TabIndex = 6 + Top = 960 + Width = 840 + End + Begin VB.Label lblIssue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Issued To:" + Enabled = 0 'False + Height = 195 + Left = 165 + TabIndex = 5 + Top = 600 + Width = 750 + End + Begin VB.Label lblPONum + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO Number:" + Enabled = 0 'False + Height = 195 + Left = 120 + TabIndex = 4 + Top = 240 + Width = 870 + End +End +Attribute VB_Name = "frmShowPO" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mintPOID As Integer + +Dim moRS As Recordset + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH +' Call CrewLoad +' Call FormClear +' Call GetLotInfo + If FormFind() Then + Call FormShow + Else + MsgBox "No Information Was Found For This Repair", vbOKOnly, "No Information" + Unload Me + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowPO - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblPOrder " + strSQL = strSQL & "WHERE ponum = " & glngORDERID +' strSQL = strSQL & "WHERE ponum = " & gintPONUM + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ShowPO - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + + With moRS + txtPONum = Field2Str(!ponum) + txtPODate = Field2Str(!Date) + txtIssueTo = Field2Str(!towhom) + txtPODesc = Field2Str(!Desc) + txtPONotes = Field2Str(!notes) + lblCUser.Caption = Field2Str(!User) + lblCDate.Caption = Field2Str(!Create) + lblUUser.Caption = Field2Str(!Up_User) + lblUDate.Caption = Field2Str(!Update) + Call POMatLoad + End With + + Exit Sub + +Error_EH: + If Err = 3021 Then + MsgBox "No Project Was Found = Be Sure To Click The Get Lot Button", vbOKOnly, "No Project" + Resume Next + End If + gstrMODULE = "Form ShowPO - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub POMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & glngORDERID & " ORDER BY Inv_No" +' strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & gintPONUM & " ORDER BY Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstPOMaterial.Clear + + Do Until oRS.EOF + With lstPOMaterial + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") +' strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + +' If lstPOMaterial.ListCount Then +' lstPOMaterial.ListIndex = 0 +' Else +' txtPOInvNo = "0" +' txtPOMatDesc = "" +' txtPOQty = "0" +' cboPODFlag.ListIndex = -1 +' cboPOMType.ListIndex = -1 +' End If + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowPO - Module POMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frx new file mode 100644 index 0000000..02c9a15 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowPO.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frm new file mode 100644 index 0000000..e0abcbc --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frm @@ -0,0 +1,889 @@ +VERSION 5.00 +Begin VB.Form frmShowRepair + Caption = "Repair Schedule" + ClientHeight = 5430 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11850 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5430 + ScaleWidth = 11850 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtScheduled + Enabled = 0 'False + Height = 315 + Left = 960 + TabIndex = 48 + Top = 480 + Width = 1215 + End + Begin VB.TextBox txtCompleted + Enabled = 0 'False + Height = 315 + Left = 960 + TabIndex = 47 + Top = 840 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1500 + TabIndex = 25 + Top = 4800 + Width = 1275 + End + Begin VB.ComboBox cboDArea + Enabled = 0 'False + Height = 315 + ItemData = "frmShowRepair.frx":0000 + Left = 960 + List = "frmShowRepair.frx":0010 + Style = 2 'Dropdown List + TabIndex = 1 + Top = 1200 + Width = 1215 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 1335 + Left = 4080 + TabIndex = 24 + Top = 3960 + Width = 7635 + End + Begin VB.TextBox txtDesc + Enabled = 0 'False + Height = 1035 + Left = 4080 + MaxLength = 250 + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 23 + Top = 2760 + Width = 5595 + End + Begin VB.TextBox txtBPhone + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 14 + TabIndex = 3 + Top = 2280 + Width = 1215 + End + Begin VB.TextBox txtEstTime + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 8400 + MaxLength = 3 + TabIndex = 15 + Top = 1920 + Width = 1215 + End + Begin VB.TextBox txtStory + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 8400 + MaxLength = 1 + TabIndex = 14 + Top = 1560 + Width = 1215 + End + Begin VB.TextBox txtBCWho + Enabled = 0 'False + Height = 315 + Left = 6120 + MaxLength = 20 + TabIndex = 16 + Top = 2280 + Width = 3495 + End + Begin VB.Frame frmRepair + Caption = "Work Type" + Height = 2295 + Left = 9840 + TabIndex = 28 + Top = 840 + Width = 1875 + Begin VB.CheckBox chkBC + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1440 + TabIndex = 22 + Top = 1800 + Width = 255 + End + Begin VB.CheckBox chkWarrenty + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1440 + TabIndex = 21 + Top = 1500 + Width = 255 + End + Begin VB.CheckBox chkWO + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1440 + TabIndex = 20 + Top = 1140 + Width = 255 + End + Begin VB.CheckBox chkYr2 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 1440 + TabIndex = 19 + Top = 780 + Width = 255 + End + Begin VB.CheckBox chkYr1 + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1440 + TabIndex = 18 + Top = 480 + Width = 255 + End + Begin VB.CheckBox chkPunch + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 1440 + TabIndex = 17 + Top = 240 + Width = 255 + End + Begin VB.Label lblBC + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Back Charge:" + Height = 195 + Left = 420 + TabIndex = 55 + Top = 1860 + Width = 975 + End + Begin VB.Label lblRepair + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Warrenty:" + Height = 195 + Left = 705 + TabIndex = 54 + Top = 1548 + Width = 690 + End + Begin VB.Label lblWO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Work Order:" + Height = 195 + Left = 525 + TabIndex = 53 + Top = 1236 + Width = 870 + End + Begin VB.Label lbl2Yr + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2nd Year End:" + Height = 195 + Left = 375 + TabIndex = 52 + Top = 924 + Width = 1020 + End + Begin VB.Label lbl1Yr + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "1st Year End:" + Height = 195 + Left = 435 + TabIndex = 51 + Top = 612 + Width = 960 + End + Begin VB.Label lblPunch + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Punch:" + Height = 195 + Left = 885 + TabIndex = 50 + Top = 300 + Width = 510 + End + End + Begin VB.TextBox txtVWPSuper + Enabled = 0 'False + Height = 315 + Left = 8400 + MaxLength = 3 + TabIndex = 12 + Top = 840 + Width = 1215 + End + Begin VB.TextBox txtHPhone + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3300 + MaxLength = 14 + TabIndex = 11 + Top = 1560 + Width = 1215 + End + Begin VB.TextBox txtHAddress + Enabled = 0 'False + Height = 315 + Left = 3300 + MaxLength = 30 + TabIndex = 10 + Top = 1200 + Width = 3315 + End + Begin VB.TextBox txtHName + Enabled = 0 'False + Height = 315 + Left = 3300 + MaxLength = 20 + TabIndex = 9 + Top = 840 + Width = 3315 + End + Begin VB.TextBox txtBillAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 8 + Top = 4080 + Width = 1215 + End + Begin VB.TextBox txtBillDate + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 7 + Top = 3720 + Width = 1215 + End + Begin VB.CheckBox chkBilled + Alignment = 1 'Right Justify + Caption = "Billed:" + Enabled = 0 'False + Height = 195 + Left = 420 + TabIndex = 6 + Top = 3420 + Width = 1035 + End + Begin VB.TextBox txtBPOAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 10 + TabIndex = 5 + Top = 3000 + Width = 1215 + End + Begin VB.TextBox txtBPO + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 15 + TabIndex = 4 + Top = 2640 + Width = 1215 + End + Begin VB.TextBox txtBContact + Enabled = 0 'False + Height = 315 + Left = 960 + MaxLength = 20 + TabIndex = 2 + Top = 1920 + Width = 2175 + End + Begin VB.ComboBox cboRCrew + Enabled = 0 'False + Height = 315 + Left = 7200 + Style = 2 'Dropdown List + TabIndex = 13 + Top = 1200 + Width = 2415 + End + Begin VB.Label lblCompleted + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Completed:" + Height = 195 + Left = 135 + TabIndex = 49 + Top = 960 + Width = 795 + End + Begin VB.Label Label1 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Area:" + Height = 195 + Left = 465 + TabIndex = 46 + Top = 1320 + Width = 375 + End + Begin VB.Label lblNotes + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3360 + TabIndex = 45 + Top = 4020 + Width = 690 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description of Work:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2280 + TabIndex = 44 + Top = 2820 + Width = 1770 + End + Begin VB.Label lblBPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Phone:" + Height = 195 + Left = 330 + TabIndex = 43 + Top = 2340 + Width = 510 + End + Begin VB.Label lblEstTime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Estimated # of Minutes to Complete Repair:" + Height = 195 + Left = 5325 + TabIndex = 42 + Top = 1980 + Width = 3060 + End + Begin VB.Label lblStory + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "# of Stories:" + Height = 195 + Left = 7530 + TabIndex = 41 + Top = 1680 + Width = 855 + End + Begin VB.Label lblBCWho + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Back Charge Who:" + Height = 195 + Left = 4680 + TabIndex = 40 + Top = 2400 + Width = 1365 + End + Begin VB.Label lblVWPSuper + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "VWP Superintendent:" + Height = 195 + Left = 6840 + TabIndex = 39 + Top = 960 + Width = 1545 + End + Begin VB.Label lblHPhone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Telephone:" + Height = 195 + Left = 2385 + TabIndex = 38 + Top = 1680 + Width = 810 + End + Begin VB.Label lblHAddress + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Address:" + Height = 195 + Left = 2580 + TabIndex = 37 + Top = 1320 + Width = 615 + End + Begin VB.Label lblHName + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Name:" + Height = 195 + Left = 2730 + TabIndex = 36 + Top = 960 + Width = 465 + End + Begin VB.Label lblBillDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Date:" + Height = 195 + Left = 30 + TabIndex = 35 + Top = 3840 + Width = 810 + End + Begin VB.Label lblBillAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Billed Amt:" + Height = 195 + Left = 105 + TabIndex = 34 + Top = 4200 + Width = 735 + End + Begin VB.Label lblHOInfo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Homeowner Information:" + Height = 195 + Left = 3360 + TabIndex = 33 + Top = 600 + Width = 1725 + End + Begin VB.Label lblBAmt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Amount:" + Height = 195 + Left = 255 + TabIndex = 32 + Top = 3120 + Width = 585 + End + Begin VB.Label lblBPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "P.O.:" + Height = 195 + Left = 480 + TabIndex = 31 + Top = 2760 + Width = 360 + End + Begin VB.Label lblBContact + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Contact:" + Height = 195 + Left = 240 + TabIndex = 30 + Top = 2040 + Width = 600 + End + Begin VB.Label lblBuilderInfo + AutoSize = -1 'True + Caption = "Builder Information:" + Height = 195 + Left = 840 + TabIndex = 29 + Top = 1620 + Width = 1350 + End + Begin VB.Label lblScheduled + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Scheduled:" + Height = 195 + Left = 120 + TabIndex = 27 + Top = 600 + Width = 810 + End + Begin VB.Label lblProjectLot + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 3300 + TabIndex = 26 + Top = 120 + Width = 5055 + End + Begin VB.Label lblCrew + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Crew:" + Height = 195 + Left = 6720 + TabIndex = 0 + Top = 1320 + Width = 405 + End +End +Attribute VB_Name = "frmShowRepair" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim moRSRepair As Recordset +Dim moRS As Recordset, moRSProj As Recordset + +Dim mboolSHOW As Boolean, mboolAdding As Boolean +Dim mintREPAIRID As Integer +Dim mstrPROJLOT As String + +Private Sub CrewLoad() +Dim oRSRCrew As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT RC_ID, Name FROM tblRCrew" + + Set oRSRCrew = New Recordset + oRSRCrew.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSRCrew.MoveLast + oRSRCrew.MoveFirst + intRows = oRSRCrew.RecordCount + Do Until oRSRCrew.EOF + cboRCrew.AddItem oRSRCrew("Name") + cboRCrew.ItemData(cboRCrew.NewIndex) = Field2Long(oRSRCrew("RC_ID")) + oRSRCrew.MoveNext + Loop + oRSRCrew.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowRepair - Module CrewLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + +End Sub +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + On Error GoTo Error_EH + Call CrewLoad +' Call FormClear +' Call GetLotInfo + If FormFind() Then + Call FormShow + Else + MsgBox "No Information Was Found For This Repair", vbOKOnly, "No Information" + Unload Me + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowRepair - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormClear() + txtBContact = "" + txtBPhone = "" + txtBPO = "" + txtBPOAmt = 0 + txtBillDate = "" + txtBillAmt = 0 + txtHName = "" + txtHAddress = "" + txtHPhone = "" + txtVWPSuper = "" + txtStory = "" + txtEstTime = 0 + txtBCWho = "" + txtDesc = "" + txtNotes = "" + cboDArea.ListIndex = -1 + chkBilled = vbUnchecked + chkPunch = vbUnchecked + chkYr1 = vbUnchecked + chkYr2 = vbUnchecked + chkWO = vbUnchecked + chkWarrenty = vbUnchecked + chkBC = vbUnchecked + cboRCrew.ListIndex = -1 + lblProjectLot = "" + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + + If moRSRepair.State = adStateOpen Then + moRSRepair.Close + End If + +End Sub + +Private Sub GetLotInfo() +Dim strSQL As String, strSELECT As String, strREPAIR As String + + strREPAIR = "SELECT * FROM tblRepair WHERE Repair_id = 1" + + Set moRSRepair = New Recordset + + moRSRepair.Open strREPAIR, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblLotInfo WHERE lot_id = " & gintLOTID + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRS.EOF Then + strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Long(moRS!proj_id) +' strSELECT = "SELECT * FROM tblProject WHERE proj_id = " & Field2Integer(moRS!proj_id) + + Set moRSProj = New Recordset + + moRSProj.Open strSELECT, goConn, adOpenForwardOnly, adLockOptimistic + + End If + + mstrPROJLOT = Trim(Field2Str(moRSProj!proj_desc)) & " - " & Trim(Field2Str(moRS!lot_no)) + lblProjectLot = mstrPROJLOT + txtHName = Field2Str(moRS!Owner) + txtHAddress = Field2Str(moRS!address) + +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strPlan As String, strMEMO As String + + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblRepair " + strSQL = strSQL & "WHERE Repair_ID = " & gintREPAIRID + +' If moRSRepair.State = adStateOpen Then +' moRSRepair.Close +' End If + Set moRSRepair = New Recordset + + moRSRepair.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSRepair.EOF Then + FormFind = False + Else + FormFind = True + gintLOTID = Field2Str2(moRSRepair!Lot_id) + gintPROJID = Field2Str2(moRSRepair!proj_id) + End If + Exit Function + +Error_EH: + gstrMODULE = "Form ShowRepair - Module FormFind" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub FormShow() +Dim mstrAREA As String +Dim strSQL As String +Dim oRS As Recordset + + On Error GoTo Error_EH + +' strSQL = "Select Proj_Desc FROM tblProject WHERE proj_id = " & gintPROJID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' lblProject.Caption = Field2Str(oRS!proj_desc) + +' strSQL = "Select Lot_no FROM tblLotInfo WHERE Lot_id = " & gintLOTID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' lblLot.Caption = Field2Str(oRS!lot_no) + With moRSRepair + txtScheduled = Field2Str(!scheduled) + txtCompleted = Field2Str(!completed) + txtBContact = Field2Str(!builder_contact) + txtBPhone = Field2Str(!builder_phone) + txtBPO = Field2Str(!builder_PO) + txtBPOAmt = Field2Str(!PO_Amt) + txtBillDate = Field2Str(!bill_date) + txtBillAmt = Field2Str(!bill_amt) + txtHName = Field2Str(!Owner_Name) + txtHAddress = Field2Str(!Owner_address) + txtHPhone = Field2Str(!Owner_phone) + txtVWPSuper = Field2Str(!VWP_Super) + txtStory = Field2Str(!storys) + txtEstTime = Field2Str(!est_time) + txtBCWho = Field2Str(!bc_who) + txtDesc = Field2Str(!Desc) + txtNotes = Field2Str(!notes) + mstrAREA = Field2Str(!Area) + If mstrAREA = "W" Then + cboDArea.Text = "West" + ElseIf mstrAREA = "N" Then + cboDArea.Text = "North" + ElseIf mstrAREA = "S" Then + cboDArea.Text = "South" + ElseIf mstrAREA = "X" Then + cboDArea.Text = "Xtra" + End If + chkBilled = Field2CheckBox(!billed) + chkPunch = Field2CheckBox(!punch) + chkYr1 = Field2CheckBox(!yrend1) + chkYr2 = Field2CheckBox(!yrend2) + chkWO = Field2CheckBox(!wo) + chkWarrenty = Field2CheckBox(!repair) + chkBC = Field2CheckBox(!backcharge) + cboRCrew.ListIndex = Field2Integer(!repair_crew) - 1 + lblProjectLot.Caption = Field2Str(!proj_lot) +' cboRCrew.ListIndex = Field2Long(!repair_crew) + End With + +' Call GetLotInfo + + mboolSHOW = False + Exit Sub + +Error_EH: + If Err = 3021 Then + MsgBox "No Project Was Found = Be Sure To Click The Get Lot Button", vbOKOnly, "No Project" + Resume Next + End If + gstrMODULE = "Form ShowRepair - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frx new file mode 100644 index 0000000..5abe4dd Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowRepair.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frm new file mode 100644 index 0000000..ad3a126 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frm @@ -0,0 +1,249 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmShowYardMat + Caption = "Yard Materials" + ClientHeight = 4620 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7260 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 4620 + ScaleWidth = 7260 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstMaterials + Height = 3570 + Left = 60 + TabIndex = 7 + Top = 435 + Width = 7095 + _Version = 196608 + _ExtentX = 12515 + _ExtentY = 6297 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmShowYardMat.frx":0000 + End + Begin VB.Label lblIssue + AutoSize = -1 'True + Caption = "Date Issued:" + Height = 195 + Left = 6120 + TabIndex = 6 + Top = 120 + Width = 900 + End + Begin VB.Label lblAQty + AutoSize = -1 'True + Caption = "Qty Issued:" + Height = 195 + Left = 4680 + TabIndex = 5 + Top = 120 + Width = 795 + End + Begin VB.Label lblOQty + AutoSize = -1 'True + Caption = "Qty Ordered:" + Height = 195 + Left = 3360 + TabIndex = 4 + Top = 120 + Width = 900 + End + Begin VB.Label lblDesc + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = 960 + TabIndex = 3 + Top = 120 + Width = 840 + End + Begin VB.Label lblInv + AutoSize = -1 'True + Caption = "Inv #:" + Height = 195 + Left = 120 + TabIndex = 2 + Top = 120 + Width = 420 + End + Begin VB.Label lblInvTotal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yard Materials Total:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 4320 + Width = 1455 + End + Begin VB.Label lblTotal + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1620 + TabIndex = 0 + Top = 4260 + Width = 1755 + End +End +Attribute VB_Name = "frmShowYardMat" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim mdblTOTAL As Double + + +Private Sub OrderMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(3) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + +' aTabs(0) = 40 +' aTabs(1) = 180 +' aTabs(2) = 230 +' aTabs(3) = 270 +' aTabs(4) = 130 + + mdblTOTAL = 0 + strSQL = "SELECT * from tblYardOrder WHERE Lot_id = " & gintLOTID & " Order By Inv_No" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' lngRET = SendMessage(lstMaterials.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) + + lstMaterials.Clear + + Do Until oRS.EOF + With lstMaterials + + strLine = Field2Str2(oRS!Yard_id) & vbTab & Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!Desc) & vbTab & Field2Str2(oRS!qty) + strLine = strLine & vbTab & Field2Str(oRS!qtyIssue) & vbTab & Field2Str(oRS!issued) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!Yard_ID + End With + dblSUM = (Field2Str2(oRS!qtyIssue) * Field2Str2(oRS!price)) + mdblTOTAL = mdblTOTAL + dblSUM + oRS.MoveNext + Loop + oRS.Close + + lblTotal = Format(mdblTOTAL, "#,#.00") + Exit Sub + +Error_EH: + gstrMODULE = "Form ShowYardMat - Module OrderMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + + Call OrderMatLoad +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frx new file mode 100644 index 0000000..a039afa Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmShowYardMat.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSplash.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSplash.frm new file mode 100644 index 0000000..e898208 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSplash.frm @@ -0,0 +1,190 @@ +VERSION 5.00 +Begin VB.Form frmSplash + BorderStyle = 3 'Fixed Dialog + ClientHeight = 4245 + ClientLeft = 255 + ClientTop = 1410 + ClientWidth = 7380 + ClipControls = 0 'False + ControlBox = 0 'False + Icon = "frmSplash.frx":0000 + KeyPreview = -1 'True + LinkTopic = "Form2" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 4245 + ScaleWidth = 7380 + ShowInTaskbar = 0 'False + StartUpPosition = 2 'CenterScreen + Begin VB.Frame Frame1 + Height = 4050 + Left = 150 + TabIndex = 0 + Top = 60 + Width = 7080 + Begin VB.Label lblVersion + Caption = "Version" + BeginProperty Font + Name = "Arial" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 4560 + TabIndex = 7 + Top = 2640 + Width = 2235 + End + Begin VB.Image imgLogo + Height = 1380 + Left = 345 + Picture = "frmSplash.frx":000C + Stretch = -1 'True + Top = 1890 + Width = 2595 + End + Begin VB.Label lblCopyright + Caption = "Copyright 2000" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 4560 + TabIndex = 4 + Top = 3060 + Width = 2415 + End + Begin VB.Label lblCompany + Caption = "Valley Wide Plastering" + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 4560 + TabIndex = 3 + Top = 3270 + Width = 2415 + End + Begin VB.Label lblWarning + Caption = "Warning: Unauthorized use of this Software is Prohibited." + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 150 + TabIndex = 2 + Top = 3660 + Width = 6855 + End + Begin VB.Label lblProductName + AutoSize = -1 'True + Caption = "Takeoff && Orders" + BeginProperty Font + Name = "Arial" + Size = 27.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 660 + Left = 2400 + TabIndex = 6 + Top = 1140 + Width = 4530 + End + Begin VB.Label lblLicenseTo + Alignment = 1 'Right Justify + Caption = "Licensed To Valley Wide Plastering, Inc." + BeginProperty Font + Name = "Arial" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 120 + TabIndex = 1 + Top = 240 + Width = 6855 + End + Begin VB.Label lblCompanyProduct + AutoSize = -1 'True + Caption = "Valley Wide Plastering" + BeginProperty Font + Name = "Arial" + Size = 18 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 2355 + TabIndex = 5 + Top = 705 + Width = 3855 + End + End +End +Attribute VB_Name = "frmSplash" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False + +Option Explicit + +Private Sub Form_Activate() + Call Delay + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + Unload Me +End Sub + +Private Sub Form_Load() + lblVersion.Caption = "Version: " & App.Major & "." & App.Minor & "." & App.Revision +' lblProductName.Caption = App.Title +End Sub + +Private Sub Frame1_Click() + Unload Me +End Sub + +Private Sub Delay() +Dim start + start = Timer ' Set start time. + Do While Timer < start + 1 + DoEvents ' Yield to other processes. + Loop + Unload Me +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frm new file mode 100644 index 0000000..014ef47 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frm @@ -0,0 +1,378 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmSupplier + Caption = "Supplier Information" + ClientHeight = 5055 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10155 + LinkTopic = "Form1" + ScaleHeight = 5055 + ScaleWidth = 10155 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 8640 + TabIndex = 8 + Top = 3885 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5780 + TabIndex = 7 + Top = 3900 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 2920 + TabIndex = 6 + Top = 3900 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 3900 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 4335 + Picture = "frmSupplier.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 4620 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4695 + Picture = "frmSupplier.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 4620 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5040 + Picture = "frmSupplier.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 4620 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 5400 + Picture = "frmSupplier.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 4620 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 3735 + Left = 75 + TabIndex = 0 + Top = 15 + Width = 9945 + _ExtentX = 17542 + _ExtentY = 6588 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Supplier Name" + Columns(0).DataField= "supplier" + Columns(0).DataWidth= 20 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 16 + Columns(1)._MaxComboItems= 5 + Columns(1).ValueItems(0)._DefaultItem= 0 + Columns(1).ValueItems(0).Value= "L" + Columns(1).ValueItems(0).Value.vt= 8 + Columns(1).ValueItems(0).DisplayValue= "Lath" + Columns(1).ValueItems(0).DisplayValue.vt= 8 + Columns(1).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(1).ValueItems(1)._DefaultItem= 0 + Columns(1).ValueItems(1).Value= "S" + Columns(1).ValueItems(1).Value.vt= 8 + Columns(1).ValueItems(1).DisplayValue= "Stucco" + Columns(1).ValueItems(1).DisplayValue.vt= 8 + Columns(1).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(1).ValueItems(2)._DefaultItem= 0 + Columns(1).ValueItems(2).Value= "A" + Columns(1).ValueItems(2).Value.vt= 8 + Columns(1).ValueItems(2).DisplayValue= "Sand" + Columns(1).ValueItems(2).DisplayValue.vt= 8 + Columns(1).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(1).ValueItems.Count= 3 + Columns(1).Caption= "Supplier Type" + Columns(1).DataField= "type" + Columns(1).DataWidth= 1 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "MAS90 Number" + Columns(2).DataField= "VENDOR_NO" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Terms" + Columns(3).DataField= "Terms" + Columns(3).DataWidth= 2 + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "Disc %" + Columns(4).DataField= "disc" + Columns(4).DataWidth= 2 + Columns(4).NumberFormat= "Fixed" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 5 + Splits(0)._UserFlags= 0 + Splits(0).AllowSizing= -1 'True + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=5" + Splits(0)._ColumnProps(1)= "Column(0).Width=7064" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=6985" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=1984" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=1905" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=2275" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=2196" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=2381" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=2302" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=2725" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=2646" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=50,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=47,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=48,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=49,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=54,.parent=13" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=51,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=52,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=53,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=58,.parent=13" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=55,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=56,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=57,.parent=17" + _StyleDefs(50) = "Named:id=33:Normal" + _StyleDefs(51) = ":id=33,.parent=0" + _StyleDefs(52) = "Named:id=34:Heading" + _StyleDefs(53) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(54) = ":id=34,.wraptext=-1" + _StyleDefs(55) = "Named:id=35:Footing" + _StyleDefs(56) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(57) = "Named:id=36:Selected" + _StyleDefs(58) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(59) = "Named:id=37:Caption" + _StyleDefs(60) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(61) = "Named:id=38:HighlightRow" + _StyleDefs(62) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(63) = "Named:id=39:EvenRow" + _StyleDefs(64) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(65) = "Named:id=40:OddRow" + _StyleDefs(66) = ":id=40,.parent=33" + _StyleDefs(67) = "Named:id=41:RecordSelector" + _StyleDefs(68) = ":id=41,.parent=34" + _StyleDefs(69) = "Named:id=42:FilterBar" + _StyleDefs(70) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmSupplier" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.AddNew + TDBGLabor.Text = "aa" + moRS.Update + TDBGLabor.SetFocus + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Delete + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Update + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub Form_Load() + Err.Clear + On Error GoTo Error_EH + + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + Exit Sub + + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblSupplier" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier1.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier1.frm new file mode 100644 index 0000000..209323d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmSupplier1.frm @@ -0,0 +1,42 @@ +VERSION 5.00 +Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" +Begin VB.Form frmSupplier1 + Caption = "Supplier Information" + ClientHeight = 4320 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6210 + LinkTopic = "Form1" + ScaleHeight = 4320 + ScaleWidth = 6210 + StartUpPosition = 3 'Windows Default + Begin MSFlexGridLib.MSFlexGrid grdSupplier + Height = 3855 + Left = 240 + TabIndex = 0 + Top = 180 + Width = 5715 + _ExtentX = 10081 + _ExtentY = 6800 + _Version = 393216 + Cols = 3 + FixedCols = 0 + FormatString = "Supplier ID|Description|Type" + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + End +End +Attribute VB_Name = "frmSupplier1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frm new file mode 100644 index 0000000..abe9813 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frm @@ -0,0 +1,446 @@ +VERSION 5.00 +Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" +Begin VB.Form frmTLABOR + Caption = "Texture Labor Information" + ClientHeight = 4245 + ClientLeft = 1110 + ClientTop = 345 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4245 + ScaleWidth = 11880 + Begin VB.PictureBox picButtons + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 11880 + TabIndex = 7 + Top = 3645 + Width = 11880 + Begin VB.CommandButton cmdCancel + Caption = "&Cancel" + Height = 300 + Left = 1675 + TabIndex = 13 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdUpdate + Caption = "&Update" + Height = 300 + Left = 290 + TabIndex = 12 + Top = 0 + Visible = 0 'False + Width = 1095 + End + Begin VB.CommandButton cmdClose + Caption = "&Close" + Height = 300 + Left = 4445 + TabIndex = 11 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdDelete + Caption = "&Delete" + Height = 300 + Left = 3060 + TabIndex = 10 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdEdit + Caption = "&Edit" + Height = 300 + Left = 1675 + TabIndex = 9 + Top = 0 + Width = 1095 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 300 + Left = 290 + TabIndex = 8 + Top = 0 + Width = 1095 + End + End + Begin VB.PictureBox picStatBox + Align = 2 'Align Bottom + Appearance = 0 'Flat + BorderStyle = 0 'None + ForeColor = &H80000008& + Height = 300 + Left = 0 + ScaleHeight = 300 + ScaleWidth = 11880 + TabIndex = 1 + Top = 3945 + Width = 11880 + Begin VB.CommandButton cmdLast + Height = 300 + Left = 4545 + Picture = "frmTLABOR.frx":0000 + Style = 1 'Graphical + TabIndex = 5 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 4200 + Picture = "frmTLABOR.frx":0342 + Style = 1 'Graphical + TabIndex = 4 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 345 + Picture = "frmTLABOR.frx":0684 + Style = 1 'Graphical + TabIndex = 3 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 0 + Picture = "frmTLABOR.frx":09C6 + Style = 1 'Graphical + TabIndex = 2 + Top = 0 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.Label lblStatus + BackColor = &H00FFFFFF& + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 690 + TabIndex = 6 + Top = 0 + Width = 3360 + End + End + Begin MSDataGridLib.DataGrid grdDataGrid + Align = 1 'Align Top + Height = 3495 + Left = 0 + TabIndex = 0 + Top = 0 + Width = 11880 + _ExtentX = 20955 + _ExtentY = 6165 + _Version = 393216 + AllowUpdate = -1 'True + HeadLines = 1 + RowHeight = 15 + AllowAddNew = -1 'True + AllowDelete = -1 'True + BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ColumnCount = 2 + BeginProperty Column00 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + BeginProperty Column01 + DataField = "" + Caption = "" + BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} + Type = 0 + Format = "" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 0 + EndProperty + EndProperty + SplitCount = 1 + BeginProperty Split0 + BeginProperty Column00 + EndProperty + BeginProperty Column01 + EndProperty + EndProperty + End +End +Attribute VB_Name = "frmTLABOR" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim WithEvents adoPrimaryRS As Recordset +Attribute adoPrimaryRS.VB_VarHelpID = -1 +Dim mbChangedByCode As Boolean +Dim mvBookMark As Variant +Dim mbEditFlag As Boolean +Dim mbAddNewFlag As Boolean +Dim mbDataChanged As Boolean + +Private Sub Form_Load() + Dim db As Connection + Set db = New Connection + db.CursorLocation = adUseClient + db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\VWP\VWP.mdb;" + + Set adoPrimaryRS = New Recordset + adoPrimaryRS.Open "select TEXTURE,L_RATE,S_RATE,M_RATE,CMU,CLADJ,MATMU,MU,OHP,SCR,TP from T_LABOR Order by TEXTURE", db, adOpenStatic, adLockOptimistic + + Set grdDataGrid.DataSource = adoPrimaryRS + + + mbDataChanged = False +End Sub + +Private Sub Form_Resize() + On Error Resume Next + 'This will resize the grid when the form is resized + grdDataGrid.Height = Me.ScaleHeight - 30 - picButtons.Height - picStatBox.Height + lblStatus.Width = Me.Width - 1500 + cmdNext.Left = lblStatus.Width + 700 + cmdLast.Left = cmdNext.Left + 340 +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + If mbEditFlag Or mbAddNewFlag Then Exit Sub + + Select Case KeyCode + Case vbKeyEscape + cmdClose_Click + Case vbKeyEnd + cmdLast_Click + Case vbKeyHome + cmdFirst_Click + Case vbKeyUp, vbKeyPageUp + If Shift = vbCtrlMask Then + cmdFirst_Click + Else + cmdPrevious_Click + End If + Case vbKeyDown, vbKeyPageDown + If Shift = vbCtrlMask Then + cmdLast_Click + Else + cmdNext_Click + End If + End Select +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Screen.MousePointer = vbDefault +End Sub + +Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This will display the current record position for this recordset + lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition) +End Sub + +Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) + 'This is where you put validation code + 'This event gets called when the following actions occur + Dim bCancel As Boolean + + Select Case adReason + Case adRsnAddNew + Case adRsnClose + Case adRsnDelete + Case adRsnFirstChange + Case adRsnMove + Case adRsnRequery + Case adRsnResynch + Case adRsnUndoAddNew + Case adRsnUndoDelete + Case adRsnUndoUpdate + Case adRsnUpdate + End Select + + If bCancel Then adStatus = adStatusCancel +End Sub + +Private Sub cmdAdd_Click() + On Error GoTo AddErr + adoPrimaryRS.MoveLast + adoPrimaryRS.AddNew + grdDataGrid.SetFocus + + Exit Sub +AddErr: + MsgBox Err.Description +End Sub + +Private Sub cmdDelete_Click() + On Error GoTo DeleteErr + With adoPrimaryRS + .Delete + .MoveNext + If .EOF Then .MoveLast + End With + Exit Sub +DeleteErr: + MsgBox Err.Description +End Sub + +Private Sub cmdEdit_Click() + On Error GoTo EditErr + + lblStatus.Caption = "Edit record" + mbEditFlag = True + SetButtons False + Exit Sub + +EditErr: + MsgBox Err.Description +End Sub +Private Sub cmdCancel_Click() + On Error Resume Next + + SetButtons True + mbEditFlag = False + mbAddNewFlag = False + adoPrimaryRS.CancelUpdate + If mvBookMark > 0 Then + adoPrimaryRS.Bookmark = mvBookMark + Else + adoPrimaryRS.MoveFirst + End If + mbDataChanged = False + +End Sub + +Private Sub cmdUpdate_Click() + On Error GoTo UpdateErr + + adoPrimaryRS.UpdateBatch adAffectAll + + If mbAddNewFlag Then + adoPrimaryRS.MoveLast 'move to the new record + End If + + mbEditFlag = False + mbAddNewFlag = False + SetButtons True + mbDataChanged = False + + Exit Sub +UpdateErr: + MsgBox Err.Description +End Sub + +Private Sub cmdClose_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + On Error GoTo GoFirstError + + adoPrimaryRS.MoveFirst + mbDataChanged = False + + Exit Sub + +GoFirstError: + MsgBox Err.Description +End Sub + +Private Sub cmdLast_Click() + On Error GoTo GoLastError + + adoPrimaryRS.MoveLast + mbDataChanged = False + + Exit Sub + +GoLastError: + MsgBox Err.Description +End Sub + +Private Sub cmdNext_Click() + On Error GoTo GoNextError + + If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext + If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveLast + End If + 'show the current record + mbDataChanged = False + + Exit Sub +GoNextError: + MsgBox Err.Description +End Sub + +Private Sub cmdPrevious_Click() + On Error GoTo GoPrevError + + If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious + If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then + Beep + 'moved off the end so go back + adoPrimaryRS.MoveFirst + End If + 'show the current record + mbDataChanged = False + + Exit Sub + +GoPrevError: + MsgBox Err.Description +End Sub + +Private Sub SetButtons(bVal As Boolean) + cmdAdd.Visible = bVal + cmdEdit.Visible = bVal + cmdUpdate.Visible = Not bVal + cmdCancel.Visible = Not bVal + cmdDelete.Visible = bVal + cmdClose.Visible = bVal + cmdNext.Enabled = bVal + cmdFirst.Enabled = bVal + cmdLast.Enabled = bVal + cmdPrevious.Enabled = bVal +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frx new file mode 100644 index 0000000..cd06a6e Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTLABOR.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frm new file mode 100644 index 0000000..aa8f34d --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frm @@ -0,0 +1,10254 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmTake + Caption = "Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 285 + Left = 375 + TabIndex = 253 + Top = 1125 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 251 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 248 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 247 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 240 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 237 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 235 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 420 + TabIndex = 230 + Top = 0 + Width = 3195 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 218 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 213 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10605 + TabIndex = 202 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 193 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 192 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 189 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 188 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 187 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 147 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 144 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 143 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 142 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 141 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 140 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTake.frx":0000 + Left = 8520 + List = "frmTake.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 2 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTake.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTake.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblInvno" + Tab(1).Control(1)= "lblMatQty" + Tab(1).Control(2)= "lblMatPrice" + Tab(1).Control(3)= "lblDFlag" + Tab(1).Control(4)= "lblMType" + Tab(1).Control(5)= "lblMetal" + Tab(1).Control(6)= "lblMetLength" + Tab(1).Control(7)= "lblMatDesc" + Tab(1).Control(8)= "cmdDelMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cmdSaveMat" + Tab(1).Control(10)= "txtMatInvNo" + Tab(1).Control(11)= "txtMatDesc" + Tab(1).Control(12)= "txtMatQty" + Tab(1).Control(13)= "txtMatPrice" + Tab(1).Control(14)= "txtMetLength" + Tab(1).Control(15)= "cboDFlag" + Tab(1).Control(16)= "cboMType" + Tab(1).Control(17)= "cboMetal" + Tab(1).Control(18)= "cmdAddMat" + Tab(1).Control(18).Enabled= 0 'False + Tab(1).Control(19)= "cmdFindMat" + Tab(1).Control(20)= "chkTransfer" + Tab(1).Control(20).Enabled= 0 'False + Tab(1).Control(21)= "cmdSetup" + Tab(1).Control(21).Enabled= 0 'False + Tab(1).Control(22)= "chkCalc" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "cmdDel1900" + Tab(1).Control(24)= "fraMaterials" + Tab(1).Control(25)= "cmdUpdate" + Tab(1).Control(26)= "lstTOMatrl" + Tab(1).Control(27)= "lstMInventory" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTake.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lstOptMatrl" + Tab(2).Control(0).Enabled= 0 'False + Tab(2).Control(1)= "txtNote" + Tab(2).Control(2)= "lstInventory" + Tab(2).Control(3)= "txtO108" + Tab(2).Control(4)= "txtO68" + Tab(2).Control(5)= "chkNoInvoice" + Tab(2).Control(6)= "chkST_Others" + Tab(2).Control(7)= "txtOST_SqFt" + Tab(2).Control(8)= "chkOStone" + Tab(2).Control(9)= "cmdCopyOpt" + Tab(2).Control(9).Enabled= 0 'False + Tab(2).Control(10)= "cmdSaveOptMat" + Tab(2).Control(11)= "cmdSaveOpt" + Tab(2).Control(12)= "cmdFindOptMat" + Tab(2).Control(13)= "cboOMMetal" + Tab(2).Control(14)= "cboOMType" + Tab(2).Control(15)= "cboOMDFlag" + Tab(2).Control(16)= "txtOMMetL" + Tab(2).Control(17)= "txtOMPrice" + Tab(2).Control(18)= "txtOMQty" + Tab(2).Control(19)= "txtOMDesc" + Tab(2).Control(20)= "txtOMInvNo" + Tab(2).Control(21)= "cmdDelOptMat" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdAddOptMat" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdDelOpt" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "cmdAddOpt" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "txtOFAdj" + Tab(2).Control(26)= "txtOFin2" + Tab(2).Control(27)= "cboOFinish" + Tab(2).Control(28)= "txtOBAmt" + Tab(2).Control(29)= "txtOYdge" + Tab(2).Control(30)= "txtODesc" + Tab(2).Control(31)= "lstOptions" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "lblOptNum" + Tab(2).Control(33)= "lblScaf10" + Tab(2).Control(34)= "Scaf6" + Tab(2).Control(35)= "lblOScaffold" + Tab(2).Control(36)= "lblOStone" + Tab(2).Control(37)= "lblOMMLength" + Tab(2).Control(38)= "lblOMCFlag" + Tab(2).Control(39)= "lblOMMType" + Tab(2).Control(40)= "lblOMDFlag" + Tab(2).Control(41)= "lblOMPrice" + Tab(2).Control(42)= "lblOMQty" + Tab(2).Control(43)= "lblOMDesc" + Tab(2).Control(44)= "lblOMInvNo" + Tab(2).Control(45)= "lblOFadj" + Tab(2).Control(46)= "lblOFin2" + Tab(2).Control(47)= "lblOTexture" + Tab(2).Control(48)= "lblBAmt" + Tab(2).Control(49)= "lblYrdge" + Tab(2).ControlCount= 50 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTake.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin LpLib.fpList lstMInventory + Height = 2040 + Left = -66930 + TabIndex = 260 + Top = 1320 + Visible = 0 'False + Width = 3270 + _Version = 196608 + _ExtentX = 5768 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake.frx":0074 + End + Begin LpLib.fpList lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 259 + Top = 3720 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1482 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake.frx":046D + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 258 + Top = 2700 + Width = 5475 + End + Begin LpLib.fpList lstInventory + Height = 1815 + Left = -74760 + TabIndex = 257 + Top = 645 + Visible = 0 'False + Width = 3195 + _Version = 196608 + _ExtentX = 5636 + _ExtentY = 3201 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake.frx":0952 + End + Begin LpLib.fpList lstTOMatrl + Height = 3960 + Left = -74880 + TabIndex = 256 + Top = 600 + Width = 5355 + _Version = 196608 + _ExtentX = 9446 + _ExtentY = 6985 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake.frx":0D4B + End + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 245 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 244 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 234 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 222 + Top = 3900 + Width = 1155 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 217 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 375 + Left = -66780 + TabIndex = 214 + Top = 3300 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 216 + Top = 120 + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 215 + Top = 120 + Value = -1 'True + Width = 1215 + End + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 212 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 208 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 270 + Left = -64815 + TabIndex = 203 + TabStop = 0 'False + Top = 375 + Width = 1200 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 194 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 191 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 190 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65100 + TabIndex = 45 + Top = 2640 + Width = 1500 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 285 + Left = -64815 + TabIndex = 177 + TabStop = 0 'False + Top = 675 + Width = 1170 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -65595 + Picture = "frmTake.frx":122C + Style = 1 'Graphical + TabIndex = 37 + Top = 2715 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -65400 + Picture = "frmTake.frx":166E + Style = 1 'Graphical + TabIndex = 168 + Top = 510 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTake.frx":1AB0 + Left = -65400 + List = "frmTake.frx":1ABA + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTake.frx":1ACB + Left = -65400 + List = "frmTake.frx":1ACD + Style = 2 'Dropdown List + TabIndex = 42 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTake.frx":1ACF + Left = -68160 + List = "frmTake.frx":1AD9 + Style = 2 'Dropdown List + TabIndex = 41 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 44 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 40 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 39 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 38 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Height = 315 + Left = -68160 + MaxLength = 18 + TabIndex = 36 + Top = 2760 + Width = 2550 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 178 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTake.frx":1AED + Left = -68100 + List = "frmTake.frx":1AF7 + Style = 2 'Dropdown List + TabIndex = 174 + Top = 2730 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTake.frx":1B08 + Left = -68100 + List = "frmTake.frx":1B0A + Style = 2 'Dropdown List + TabIndex = 173 + Top = 2370 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTake.frx":1B0C + Left = -68100 + List = "frmTake.frx":1B16 + Style = 2 'Dropdown List + TabIndex = 172 + Top = 2010 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 175 + Top = 3075 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 171 + Top = 1650 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 170 + Top = 1290 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 169 + Top = 960 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68085 + MaxLength = 5 + TabIndex = 167 + Top = 630 + Width = 2625 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 156 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTake.frx":1B2A + Left = -69720 + List = "frmTake.frx":1B2C + Style = 2 'Dropdown List + TabIndex = 155 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 154 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 153 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 148 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 146 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 157 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 139 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 158 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 138 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 176 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 134 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 133 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 132 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 128 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 127 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 126 + TabStop = 0 'False + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 3735 + Left = 8760 + TabIndex = 119 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 233 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 221 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 211 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 137 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 135 + TabIndex = 125 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 122 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 121 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 120 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 3735 + Left = 7980 + TabIndex = 110 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Height = 255 + Index = 11 + Left = 150 + TabIndex = 231 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 255 + Index = 10 + Left = 150 + TabIndex = 219 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 209 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 207 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 206 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 136 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 117 + TabStop = 0 'False + Top = 2190 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 114 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 113 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 112 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 103 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 62 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 101 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 61 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 63 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 100 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 99 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 97 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 96 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 86 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 60 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 83 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 80 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 79 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 73 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 72 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 65 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 59 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 57 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65100 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1500 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65100 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1500 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 53 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 52 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTake.frx":1B2E + Left = -70305 + List = "frmTake.frx":1B30 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 40 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 195 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtStoneAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + TabIndex = 255 + Top = 1965 + Width = 795 + End + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 225 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 223 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + Caption = "Finish 2 Yardage: Stone Ded Ydge:" + Height = 675 + Left = 2610 + TabIndex = 201 + Top = 1620 + Width = 1260 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 200 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 199 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 198 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 197 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 196 + Top = 780 + Width = 870 + End + End + Begin VB.Label lblOptNum + Height = 270 + Left = -74745 + TabIndex = 254 + Top = 390 + Width = 2400 + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 246 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 243 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 242 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 241 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 232 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 224 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 220 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 210 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 205 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 204 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 186 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 185 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 184 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 183 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 182 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 181 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 180 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 179 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 166 + Top = 990 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 165 + Top = 3150 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 164 + Top = 2790 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 163 + Top = 2430 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 162 + Top = 2070 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 161 + Top = 1710 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 160 + Top = 1350 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 159 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 152 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 151 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 150 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 149 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 135 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 118 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 111 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Sand/River Finish:" + Height = 195 + Left = 6570 + TabIndex = 109 + Top = 3060 + Width = 1320 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 108 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 107 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 106 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 105 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 104 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 102 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 95 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 94 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 93 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 92 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 91 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 90 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 89 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 87 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 85 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 84 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 71 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 70 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 69 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 68 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 67 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 66 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 64 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 58 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 465 + TabIndex = 56 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 51 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 50 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 49 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 48 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 47 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 46 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 252 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 250 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 249 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 239 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 238 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 236 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 229 + Top = 1380 + Width = 795 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 945 + Left = 8625 + TabIndex = 228 + Top = 1005 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 227 + Top = 1200 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 226 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 145 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 21 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long, mboolBAD As Boolean, mdblBrnLab As Double, mdblTexLab As Double +Dim mboolSHOW As Boolean, mboolCALC As Boolean, mstrWIRE As String, mboolNOCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String +Dim mboo1570 As Boolean, mbool1130 As Boolean + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" +' Else +' txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S4' and toid = " & gintTOID +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBOOKMARK As Integer + intBOOKMARK = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If +' If moRS!finish = "DW" Then +' +' Else + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If +' End If + If mboolBAD Then + MsgBox "Takeoff Calculation Was Not Completed - Wire Error" + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + Exit Sub + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double, strSELECT2 As String +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double, strSQLX As String +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset, oRX As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double, dblPYRO As Double, intOpenPR + + On Error GoTo Error_EH + mboolBAD = False + mboolCALC = False + + If mstrWIRE = "P" Or mstrWIRE = "F" Then + MsgBox "The Wire Type selected in projects is not correct for OneCoat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = Field2Str2(moRSProj!bagdollars) ' + 1 + Call UpTexture +' dblpoly=int(field2integer(txt + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) +' dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(oRS!t_s20) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS20 = dblBatch * (Field2Integer(oRS!t_s20)) +' dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS20 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolNOCALC Then + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds))) ' + 0.99) + Else + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + End If + +' dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16))) +' dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_s20) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS20 = dblS20 + (dblBatch * Field2Integer(oRS!t_s20)) +' dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblLime * Field2Str2(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + End If + + If dblS20 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2320' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS20 = Int((dblS20) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2320' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS20 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS20 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2370' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS20 = Int((dblS20) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2370' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS20 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS20 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close +'****** move to after One Coat calculation +' If dblRS > 0 Then +' dblRS = Int((dblRS) + 0.99) +' txtSandTons = dblRS +' End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + strSQLX = "SELECT * FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRX = New Recordset + oRX.Open strSQLX, goConn, adOpenDynamic, adLockOptimistic + + If Not oRX.EOF Then + oRX.MoveFirst + strSELECT2 = "inv_no = '1310'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1315'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1317'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1805'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + End If + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1310' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1310' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + Else + If moRSProj!rg12 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1315' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1315' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!rg1 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1317' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1317' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!pyro Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1805' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1805' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 50) + 0.99) 'Added 11/3/17 for Pyro Paper + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + End If + End If +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + + dblLC = Int(((Field2Long(txtLathYds) / 25) * 2) + 0.99) + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1820' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1820' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLC + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1330' and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1330' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + +'Calculate Foam + dblFOAM = Field2Long(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1210' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + ' ** Changed back to 1.77 6/27/2012 per JR because of Shea Homes + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1210' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1260' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1250' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Long(txtLathYds) / 30)) + 0.99) + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1815' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1815' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = dblBP + moRSCMat.Update +' oRC!qty = dblBP +' oRC.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1816' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1816' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B6" Then '60 minute black paper + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1811' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1811' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If +' End If + + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID '1 ply BP + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 45) + 0.99) '***** Wire changed to 45 yds per Jesse on 3/24/10 + ' moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 + ' moRSCMat!qty = Int((dblWire / 50) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2210' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2250' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2260' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + + lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = '1610'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1710'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1720'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Long(txtTTLYds) * Field2Str2(txtTPRate)) + 0.99) + txtOH = Int((Field2Long(txtTTLYds) * Field2Str2(txtOHRate)) + 0.99) +' txtStucLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + mdblTexLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj) - Field2Integer(txtStoneAdj)) * (Field2Str(txtSLRate) / 2)) + 0.99) + mdblBrnLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * (Field2Str(txtSLRate) / 2)) + 0.99) + txtStucLab = Int((mdblBrnLab + mdblTexLab) + 0.99) + txtLathLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str2(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str2(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'LABOR BURDEN RATES HERE + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + + If mstrWIRE = "O" Then + MsgBox "The Wire Type selected in projects is not correct for Three Coat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = 0 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolNOCALC Then + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds))) ' + 0.99) + Else + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + End If + +' dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If moRSProj!plcmnt Then + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2414' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2414' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2416' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2416' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2415' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2415' And Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + Else + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2412' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2412' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2411' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2411' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2432' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2432' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2431' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2431' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + End If + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + +' If dblRS > 0 Then +' txtSandTons = dblRS +' End If + + lngSandBatch = dblKote1 + dblCMNT + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + + +'Calculate Black paper +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + 'Changed from 1.5 to 2 layers per Jesse 03/24/2010 + If moRSProj!bp_type <> "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + If mstrWIRE = "P" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1450' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1450' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 27) + 0.99) 'For bid purposes - use 33 for production purposes + ' moRSCMat!qty = Int((dblWire / 33) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + If mstrWIRE = "F" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1417' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1417' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) ' For bid purposes - use 45 for production + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1616'" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Long(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1705'" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1820'" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL +' If Field2Integer(txtSandTons) < 16 Then +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + 30 +' Else +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' End If + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +' txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + mdblTexLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj) - Field2Integer(txtStoneAdj)) * (Field2Str(txtSLRate) / 2)) + 0.99) + mdblBrnLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * (Field2Str(txtSLRate) / 2)) + 0.99) + txtStucLab = Int((mdblBrnLab + mdblTexLab) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > '1899' and Inv_no < '2000' and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + ElseIf !d_flag = "Y" Then + cboDFlag.Text = "Yard" + Else + cboDFlag.Text = "" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!PROJ_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintIncrease_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String, intYN As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str(txtMatInvNo) <> "" Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Str(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Str2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Str2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "S4" +' ElseIf optPTex(7) Then +' mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset, strINVNO As String, strTINVNO As String +Dim strSQL As String, strTYPE As String, strMINVNO As String + On Error GoTo Error_EH + + lstMInventory.col = 0 + strMINVNO = lstInventory.ColText + + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + + lstMInventory.col = 0 + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = '" & strMINVNO & "'" +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = '" & strMINVNO & "' and estimator = '" & gstrLOGIN & "'" +' strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtOMInvNo.Text & "' AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = '" & txtOMInvNo.Text & "' AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = '" & strINVNO & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Long(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 + If moRSProj!BagSand Then + lblSand = "Sand Bags:" + Else + lblSand = "Sand Tons:" + End If +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S4" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "QU" Then +' chkQU = vbChecked +' txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + mstrWIRE = Field2Str(moRSProj!wire) + gbytINV_TYPE = Field2Str(moRSProj!inv_type) + + If moRSProj!NoCalc Then + mboolNOCALC = True + Else + mboolNOCALC = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String +Dim dblSplitCost As Double + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If + If mboolNOCALC Then + lblSupercede.Caption = "Special Calculation Enabled" + lblSupercede.Visible = True +' lblCALC.Visible = True +' mboolNOCALC = True + Else +' lblCALC.Visible = False + lblSupercede.Caption = "Plan has been Superceded, Press CTRL-R to View" + lblSupercede.Visible = False +' mboolNOCALC = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + With moRS + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) +' If Field2Integer(!lath_yds) = 0 Then + If Field2Long(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtStoneAdj = Field2Integer(!st_adj) + txtWireAdj = Field2Integer(!w_adj) + mdblBrnLab = Field2Str2(!brn_lab) + mdblTexLab = Field2Str2(!tex_lab) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!TWOSTORY) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtCreated = txtCreated & " " & Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtCreated = txtCreated & " " & Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Not moRSProj!BagSand Then + If Field2Integer(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "S4" Then + txtFinish.Text = "Sand - River" + optPTex(7).Value = True +' ElseIf !finish = "QU" Then +' txtFinish.Text = "Quernavaca" +' optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type + If txtInvType = "0" Then + lblInvType = "Original" + ElseIf txtInvType = "1" Then + lblInvType = "Tract Homes" + ElseIf txtInvType = "2" Then + lblInvType = "Custom Homes" + ElseIf txtInvType = "3" Then + lblInvType = "Multi Family" + ElseIf txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!M_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + lblOptNum = "Option Number " & Trim(Field2Str(!OPTID)) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True 'is this causing problems when moving + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Long(oRS!toid) +' gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Str(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblOption" ' where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Str(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + + lstOptMatrl.col = 4 + strINVNO = lstOptMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstTOMatrl.col = 4 + strINVNO = lstTOMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String, strSQLX As String +Dim oRSX As Recordset + + On Error GoTo Error_EH + +' strSQLX = "SELECT INV_NO from tblTOMatrl WHERE TOID = " & gintTOID & " INV_NO = '1130'" +' Set oRSX = New Recordset +' oRSX.Open strSQLX, goConn, adOpenForwardOnly, adLockReadOnly +' If oRSX.EOF Then +' mbool1130 = False +' Else +' mbool1130 = True +' End If +' oRSX.Close + +' strSQLX = "SELECT INV_NO from tblTOMatrl WHERE TOID = " & gintTOID & " INV_NO = '1570'" +' Set oRSX = New Recordset +' oRSX.Open strSQLX, goConn, adOpenForwardOnly, adLockReadOnly +' If oRSX.EOF Then +' mbool1570 = False +' Else +' mbool1570 = True +' End If + + strSQL = "SELECT * FROM tblTOMatrl WHERE TOID = " & gintTOID + Set moRSCMat = New Recordset + moRSCMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If IsNull(!origTOID) Or !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !st_adj = Integer2Field(txtStoneAdj) + !w_adj = Integer2Field(txtWireAdj) + !tex_lab = mdblTexLab + !brn_lab = mdblBrnLab + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !TWOSTORY = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "S4" +' ElseIf optPTex(7) Then +' !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !M_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" +' txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtStoneAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!M_Rate), "##.00") + moRSLAB!M_Rate = Field2Str(oRS!M_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "S4" + txtFinish.Text = "SAND - RIVER" + moRS!finish = mstrFINISH +' Case 7 +' mstrFINISH = "QU" +' txtFinish.Text = "QUERNAVACA" +' moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatInvNo_LostFocus() + txtMatInvNo = UCase(txtMatInvNo) +End Sub + +Private Sub txtOMInvNo_LostFocus() + txtOMInvNo = UCase(txtOMInvNo) +End Sub + +Private Sub txtStoneAdj_GotFocus() + Call FieldSelect(txtStoneAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "S4" +' ElseIf optPTex(7) Then +' mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!NEWTOID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frx new file mode 100644 index 0000000..b494647 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frm new file mode 100644 index 0000000..115649b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frm @@ -0,0 +1,9533 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmTake + Caption = "Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 258 + Top = 1050 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 256 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 253 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 252 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 245 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 242 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 240 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 420 + TabIndex = 235 + Top = 0 + Width = 3195 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 223 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 218 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 207 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 198 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 197 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 192 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 191 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 190 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 149 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 146 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 145 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 144 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 143 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 142 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTake.frx":0000 + Left = 8520 + List = "frmTake.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 2 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTake.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "lblMeDesc" + Tab(0).Control(0).Enabled= 0 'False + Tab(0).Control(1)= "lblMeSqFt" + Tab(0).Control(1).Enabled= 0 'False + Tab(0).Control(2)= "lblMeLocate" + Tab(0).Control(2).Enabled= 0 'False + Tab(0).Control(3)= "lblMeType" + Tab(0).Control(3).Enabled= 0 'False + Tab(0).Control(4)= "fraYardage" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdAddMeas" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdDelMeas" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "cmdSaveMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdUpMeasCalc" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lstMeasure" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtMeDesc" + Tab(0).Control(10).Enabled= 0 'False + Tab(0).Control(11)= "txtMeSqFt" + Tab(0).Control(11).Enabled= 0 'False + Tab(0).Control(12)= "cboMeLocate" + Tab(0).Control(12).Enabled= 0 'False + Tab(0).Control(13)= "txtMeType" + Tab(0).Control(13).Enabled= 0 'False + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTake.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lstMInventory" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "chkTransfer" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "cmdFindMat" + Tab(1).Control(8)= "cmdAddMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cboMetal" + Tab(1).Control(10)= "cboMType" + Tab(1).Control(11)= "cboDFlag" + Tab(1).Control(12)= "txtMetLength" + Tab(1).Control(13)= "txtMatPrice" + Tab(1).Control(14)= "txtMatQty" + Tab(1).Control(15)= "txtMatDesc" + Tab(1).Control(16)= "txtMatInvNo" + Tab(1).Control(17)= "lstTOMatrl" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdSaveMat" + Tab(1).Control(19)= "cmdDelMat" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTake.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblYrdge" + Tab(2).Control(1)= "lblBAmt" + Tab(2).Control(2)= "lblOTexture" + Tab(2).Control(3)= "lblOFin2" + Tab(2).Control(4)= "lblOFadj" + Tab(2).Control(5)= "lblOMInvNo" + Tab(2).Control(6)= "lblOMDesc" + Tab(2).Control(7)= "lblOMQty" + Tab(2).Control(8)= "lblOMPrice" + Tab(2).Control(9)= "lblOMDFlag" + Tab(2).Control(10)= "lblOMMType" + Tab(2).Control(11)= "lblOMCFlag" + Tab(2).Control(12)= "lblOMMLength" + Tab(2).Control(13)= "lblOStone" + Tab(2).Control(14)= "lblOScaffold" + Tab(2).Control(15)= "Scaf6" + Tab(2).Control(16)= "lblScaf10" + Tab(2).Control(17)= "lstOptions" + Tab(2).Control(17).Enabled= 0 'False + Tab(2).Control(18)= "txtODesc" + Tab(2).Control(19)= "txtOYdge" + Tab(2).Control(20)= "txtOBAmt" + Tab(2).Control(21)= "cboOFinish" + Tab(2).Control(22)= "txtOFin2" + Tab(2).Control(23)= "txtOFAdj" + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "cmdAddOpt" + Tab(2).Control(25).Enabled= 0 'False + Tab(2).Control(26)= "cmdDelOpt" + Tab(2).Control(26).Enabled= 0 'False + Tab(2).Control(27)= "cmdAddOptMat" + Tab(2).Control(27).Enabled= 0 'False + Tab(2).Control(28)= "cmdDelOptMat" + Tab(2).Control(28).Enabled= 0 'False + Tab(2).Control(29)= "txtOMInvNo" + Tab(2).Control(30)= "txtOMDesc" + Tab(2).Control(31)= "txtOMQty" + Tab(2).Control(32)= "txtOMPrice" + Tab(2).Control(33)= "txtOMMetL" + Tab(2).Control(34)= "cboOMDFlag" + Tab(2).Control(35)= "cboOMType" + Tab(2).Control(36)= "cboOMMetal" + Tab(2).Control(37)= "cmdFindOptMat" + Tab(2).Control(38)= "lstInventory" + Tab(2).Control(38).Enabled= 0 'False + Tab(2).Control(39)= "cmdSaveOpt" + Tab(2).Control(40)= "cmdSaveOptMat" + Tab(2).Control(41)= "cmdCopyOpt" + Tab(2).Control(41).Enabled= 0 'False + Tab(2).Control(42)= "txtNote" + Tab(2).Control(43)= "chkOStone" + Tab(2).Control(44)= "txtOST_SqFt" + Tab(2).Control(45)= "chkST_Others" + Tab(2).Control(46)= "chkNoInvoice" + Tab(2).Control(47)= "txtO68" + Tab(2).Control(48)= "txtO108" + Tab(2).ControlCount= 49 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTake.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 250 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 249 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 239 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 227 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 222 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 219 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 221 + Top = 120 + Value = -1 'True + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 220 + Top = 120 + Width = 1215 + End + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 217 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 213 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 315 + Left = -64980 + TabIndex = 208 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 199 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 196 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 195 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 194 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.ListBox lstMInventory + Height = 2010 + Left = -66840 + Sorted = -1 'True + TabIndex = 193 + TabStop = 0 'False + Top = 1260 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 315 + Left = -66360 + TabIndex = 180 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTake.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmTake.frx":04B6 + Style = 1 'Graphical + TabIndex = 171 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTake.frx":08F8 + Left = -65400 + List = "frmTake.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTake.frx":0913 + Left = -65400 + List = "frmTake.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTake.frx":0917 + Left = -68160 + List = "frmTake.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 37 + Top = 2760 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 181 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTake.frx":0935 + Left = -68100 + List = "frmTake.frx":093F + Style = 2 'Dropdown List + TabIndex = 177 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTake.frx":0950 + Left = -68100 + List = "frmTake.frx":0952 + Style = 2 'Dropdown List + TabIndex = 176 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTake.frx":0954 + Left = -68100 + List = "frmTake.frx":095E + Style = 2 'Dropdown List + TabIndex = 175 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 178 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 174 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 173 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 172 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 170 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 160 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 158 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTake.frx":0972 + Left = -69720 + List = "frmTake.frx":0974 + Style = 2 'Dropdown List + TabIndex = 157 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 156 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 155 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 150 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 148 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 159 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 141 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 161 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 140 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 179 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 136 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 134 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 128 + TabStop = 0 'False + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 3735 + Left = 8760 + TabIndex = 121 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 238 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 226 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 216 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 122 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 3735 + Left = 7980 + TabIndex = 112 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 236 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 224 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 214 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 212 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 211 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 138 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 118 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 150 + TabIndex = 117 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 114 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 105 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 64 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 63 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 65 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 99 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 90 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 62 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 83 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 67 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 61 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 59 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTake.frx":0976 + Left = -70305 + List = "frmTake.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 200 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 230 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 228 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 206 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 205 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 204 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 203 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 202 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 201 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 251 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 248 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 247 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 246 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 237 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 229 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 225 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 215 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 210 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 209 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 189 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 188 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 187 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 186 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 185 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 184 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 183 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 182 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 169 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 168 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 167 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 166 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 165 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 164 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 163 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 162 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 154 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 153 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 152 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 151 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 137 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 120 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 113 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 111 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 110 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 109 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 108 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 107 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 106 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 104 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 97 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 96 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 95 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 94 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 93 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 92 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 91 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 89 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 87 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 86 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 73 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 72 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 71 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 70 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 69 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 68 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 66 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 60 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 465 + TabIndex = 58 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 257 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 255 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 254 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 244 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 243 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 241 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 234 + Top = 1380 + Width = 795 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 945 + Left = 8625 + TabIndex = 233 + Top = 1005 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 232 + Top = 1200 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 231 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 147 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 21 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long, mboolBAD As Boolean +Dim mboolSHOW As Boolean, mboolCALC As Boolean, mstrWIRE As String +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If +' If moRS!finish = "DW" Then +' +' Else + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If +' End If + If mboolBAD Then + MsgBox "Takeoff Calculation Was Not Completed - Wire Error" + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + Exit Sub + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + +' On Error GoTo Error_EH + mboolBAD = False + mboolCALC = False + + If mstrWIRE = "P" Or mstrWIRE = "F" Then + MsgBox "The Wire Type selected in projects is not correct for OneCoat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = Field2Str2(moRSProj!bagdollars) ' + 1 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close +'****** move to after One Coat calculation +' If dblRS > 0 Then +' dblRS = Int((dblRS) + 0.99) +' txtSandTons = dblRS +' End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + Else + If moRSProj!rg12 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!rg1 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1317 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1317 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + End If + End If +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + + dblLC = Int(((Field2Integer(txtLathYds) / 25) * 2) + 0.99) + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1820 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1820 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLC + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + ' ** Changed back to 1.77 6/27/2012 per JR because of Shea Homes + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Integer(txtLathYds) / 20) * 1.5) + 0.99) +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Integer(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1809 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1809 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If +' End If + + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 45) + 0.99) '***** Wire changed to 45 yds per Jesse on 3/24/10 + ' moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 + ' moRSCMat!qty = Int((dblWire / 50) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + + lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + + If mstrWIRE = "O" Then + MsgBox "The Wire Type selected in projects is not correct for Three Coat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + End If + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + +' If dblRS > 0 Then +' txtSandTons = dblRS +' End If + + lngSandBatch = dblKote1 + dblCMNT + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + + +'Calculate Black paper +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + 'Changed from 1.5 to 2 layers per Jesse 03/24/2010 + If moRSProj!bp_type <> "B6" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Integer(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1809 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1809 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + If mstrWIRE = "P" Then + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 27) + 0.99) 'For bid purposes - use 33 for production purposes + ' moRSCMat!qty = Int((dblWire / 33) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + If mstrWIRE = "F" Then + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1417 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1417 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) ' For bid purposes - use 45 for production + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL +' If Field2Integer(txtSandTons) < 16 Then +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + 30 +' Else +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' End If + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!proj_id + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!proj_id + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 + If moRSProj!BagSand Then + lblSand = "Sand Bags:" + Else + lblSand = "Sand Tons:" + End If +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + mstrWIRE = Field2Str(moRSProj!wire) + gbytINV_TYPE = Field2Str(moRSProj!inv_type) + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String +Dim dblSplitCost As Double + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc + With moRS + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtCreated = txtCreated & " " & Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtCreated = txtCreated & " " & Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Not moRSProj!BagSand Then + If Field2Integer(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type + If txtInvType = "0" Then + lblInvType = "Original" + ElseIf txtInvType = "1" Then + lblInvType = "Tract Homes" + ElseIf txtInvType = "2" Then + lblInvType = "Custom Homes" + ElseIf txtInvType = "3" Then + lblInvType = "Multi Family" + ElseIf txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' If IsNull(moRS!origTOID) Then +' moRS!origTOID = oRSMAX!maxtoid +' moRS.Update +' End If +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If IsNull(!origTOID) Or !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" +' txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!newtoid = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake12.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frm new file mode 100644 index 0000000..c6edc3f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frm @@ -0,0 +1,11957 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmTake5 + Caption = "Takeoff Information" + ClientHeight = 8520 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8520 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkP_RL + Alignment = 1 'Right Justify + Caption = "Pulte Special Calculation (RL)" + Height = 195 + Left = 3870 + TabIndex = 247 + Top = 0 + Width = 2400 + End + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 213 + Top = 1050 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 211 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 208 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 207 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 200 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 197 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 195 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 420 + TabIndex = 194 + Top = 0 + Width = 3195 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 186 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 181 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 178 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 10200 + Top = -30 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 169 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 168 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 165 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 164 + TabStop = 0 'False + Top = 570 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 163 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 123 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 120 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 119 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 118 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 117 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 116 + TabStop = 0 'False + Top = 1965 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTake5.frx":0000 + Left = 8520 + List = "frmTake5.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4845 + Left = 195 + TabIndex = 2 + TabStop = 0 'False + Top = 3630 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8546 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTake5.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "lblMeDesc" + Tab(0).Control(1)= "lblMeSqFt" + Tab(0).Control(2)= "lblMeLocate" + Tab(0).Control(3)= "lblMeType" + Tab(0).Control(4)= "fraYardage" + Tab(0).Control(5)= "cmdAddMeas" + Tab(0).Control(6)= "cmdDelMeas" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "cmdSaveMeas" + Tab(0).Control(8)= "cmdUpMeasCalc" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lstMeasure" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtMeDesc" + Tab(0).Control(11)= "txtMeSqFt" + Tab(0).Control(12)= "cboMeLocate" + Tab(0).Control(13)= "txtMeType" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTake5.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "chkTransfer" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "cmdFindMat" + Tab(1).Control(7)= "cmdAddMat" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "cboMetal" + Tab(1).Control(9)= "cboMType" + Tab(1).Control(10)= "cboDFlag" + Tab(1).Control(11)= "txtMetLength" + Tab(1).Control(12)= "txtMatPrice" + Tab(1).Control(13)= "txtMatQty" + Tab(1).Control(14)= "txtMatDesc" + Tab(1).Control(15)= "txtMatInvNo" + Tab(1).Control(16)= "cmdSaveMat" + Tab(1).Control(17)= "cmdDelMat" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "lstMInventory" + Tab(1).Control(19)= "lstTOMatrl" + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTake5.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lstInventory" + Tab(2).Control(0).Enabled= 0 'False + Tab(2).Control(1)= "txtO108" + Tab(2).Control(1).Enabled= 0 'False + Tab(2).Control(2)= "txtO68" + Tab(2).Control(2).Enabled= 0 'False + Tab(2).Control(3)= "chkNoInvoice" + Tab(2).Control(3).Enabled= 0 'False + Tab(2).Control(4)= "chkST_Others" + Tab(2).Control(4).Enabled= 0 'False + Tab(2).Control(5)= "txtOST_SqFt" + Tab(2).Control(5).Enabled= 0 'False + Tab(2).Control(6)= "chkOStone" + Tab(2).Control(6).Enabled= 0 'False + Tab(2).Control(7)= "txtNote" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "cmdCopyOpt" + Tab(2).Control(8).Enabled= 0 'False + Tab(2).Control(9)= "cmdSaveOptMat" + Tab(2).Control(9).Enabled= 0 'False + Tab(2).Control(10)= "cmdSaveOpt" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "cmdFindOptMat" + Tab(2).Control(11).Enabled= 0 'False + Tab(2).Control(12)= "cboOMMetal" + Tab(2).Control(12).Enabled= 0 'False + Tab(2).Control(13)= "cboOMType" + Tab(2).Control(13).Enabled= 0 'False + Tab(2).Control(14)= "cboOMDFlag" + Tab(2).Control(14).Enabled= 0 'False + Tab(2).Control(15)= "txtOMMetL" + Tab(2).Control(15).Enabled= 0 'False + Tab(2).Control(16)= "txtOMPrice" + Tab(2).Control(16).Enabled= 0 'False + Tab(2).Control(17)= "txtOMQty" + Tab(2).Control(17).Enabled= 0 'False + Tab(2).Control(18)= "txtOMDesc" + Tab(2).Control(18).Enabled= 0 'False + Tab(2).Control(19)= "txtOMInvNo" + Tab(2).Control(19).Enabled= 0 'False + Tab(2).Control(20)= "cmdDelOptMat" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdAddOptMat" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdDelOpt" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdAddOpt" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "txtOFAdj" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "txtOFin2" + Tab(2).Control(25).Enabled= 0 'False + Tab(2).Control(26)= "cboOFinish" + Tab(2).Control(26).Enabled= 0 'False + Tab(2).Control(27)= "txtOBAmt" + Tab(2).Control(27).Enabled= 0 'False + Tab(2).Control(28)= "txtOYdge" + Tab(2).Control(28).Enabled= 0 'False + Tab(2).Control(29)= "txtODesc" + Tab(2).Control(29).Enabled= 0 'False + Tab(2).Control(30)= "lstOptions" + Tab(2).Control(30).Enabled= 0 'False + Tab(2).Control(31)= "lstOptMatrl" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "lblOptNum" + Tab(2).Control(32).Enabled= 0 'False + Tab(2).Control(33)= "lblScaf10" + Tab(2).Control(33).Enabled= 0 'False + Tab(2).Control(34)= "Scaf6" + Tab(2).Control(34).Enabled= 0 'False + Tab(2).Control(35)= "lblOScaffold" + Tab(2).Control(35).Enabled= 0 'False + Tab(2).Control(36)= "lblOStone" + Tab(2).Control(36).Enabled= 0 'False + Tab(2).Control(37)= "lblOMMLength" + Tab(2).Control(37).Enabled= 0 'False + Tab(2).Control(38)= "lblOMCFlag" + Tab(2).Control(38).Enabled= 0 'False + Tab(2).Control(39)= "lblOMMType" + Tab(2).Control(39).Enabled= 0 'False + Tab(2).Control(40)= "lblOMDFlag" + Tab(2).Control(40).Enabled= 0 'False + Tab(2).Control(41)= "lblOMPrice" + Tab(2).Control(41).Enabled= 0 'False + Tab(2).Control(42)= "lblOMQty" + Tab(2).Control(42).Enabled= 0 'False + Tab(2).Control(43)= "lblOMDesc" + Tab(2).Control(43).Enabled= 0 'False + Tab(2).Control(44)= "lblOMInvNo" + Tab(2).Control(44).Enabled= 0 'False + Tab(2).Control(45)= "lblOFadj" + Tab(2).Control(45).Enabled= 0 'False + Tab(2).Control(46)= "lblOFin2" + Tab(2).Control(46).Enabled= 0 'False + Tab(2).Control(47)= "lblOTexture" + Tab(2).Control(47).Enabled= 0 'False + Tab(2).Control(48)= "lblBAmt" + Tab(2).Control(48).Enabled= 0 'False + Tab(2).Control(49)= "lblYrdge" + Tab(2).Control(49).Enabled= 0 'False + Tab(2).ControlCount= 50 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTake5.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblPrimary" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblOptTextures" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lbl2S" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblNumber" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblPrice" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblTex1" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblTex2" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblTex3" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblTex4" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFDesc1" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFDesc2" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblFDesc3" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblFDesc4" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblT1" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lblT2" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "lblT3" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "lblT4" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "lblBagSand" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "lblCALC" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtSandTons" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtSandPrice" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtSandAmt" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtSLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtStucLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtLLRate" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtLathLab" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtMLRate" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtMetLab" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtMetalFt" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtSGRate" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtScafGas" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtTPRate" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtTape" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlMat" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMisc" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtMatMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtLabBur" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtTtlCost" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtMURate" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtTtlMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtOH" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtOHRate" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtBidPrice" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "txtBidPrwCMU" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "txtCMURate" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtCMUPrice" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtPrSQYD" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtBidPr1" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtBidPr2" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtBidPr3" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtBidPr4" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtMatMURate" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "cboFinish" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "fraOptional" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "fraPrimary" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "cmdSelectTex1" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).Control(82)= "cmdSelectTex2" + Tab(3).Control(82).Enabled= 0 'False + Tab(3).Control(83)= "cmdSelectTex3" + Tab(3).Control(83).Enabled= 0 'False + Tab(3).Control(84)= "cmdSelectTex4" + Tab(3).Control(84).Enabled= 0 'False + Tab(3).ControlCount= 85 + Begin LpLib.fpList lstInventory + Height = 1815 + Left = -74760 + TabIndex = 250 + Top = 660 + Visible = 0 'False + Width = 3195 + _Version = 196608 + _ExtentX = 5636 + _ExtentY = 3201 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake5.frx":0074 + End + Begin VB.CommandButton cmdSelectTex4 + Caption = "Texture 4" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9570 + TabIndex = 238 + Top = 3795 + Width = 1785 + End + Begin VB.CommandButton cmdSelectTex3 + Caption = "Texture 3" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9570 + TabIndex = 237 + Top = 3435 + Width = 1785 + End + Begin VB.CommandButton cmdSelectTex2 + Caption = "Texture 2" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9570 + TabIndex = 236 + Top = 3090 + Width = 1785 + End + Begin VB.CommandButton cmdSelectTex1 + Caption = "Texture 1" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9570 + TabIndex = 231 + Top = 2745 + Width = 1785 + End + Begin VB.Frame fraPrimary + Height = 1365 + Left = 9165 + TabIndex = 226 + Top = 1350 + Width = 435 + Begin VB.OptionButton optPTex + Caption = "Option4" + Height = 225 + Index = 3 + Left = 105 + TabIndex = 230 + Top = 1080 + Width = 285 + End + Begin VB.OptionButton optPTex + Caption = "Option3" + Height = 225 + Index = 2 + Left = 105 + TabIndex = 229 + Top = 765 + Width = 285 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 225 + Index = 1 + Left = 105 + TabIndex = 228 + Top = 450 + Width = 285 + End + Begin VB.OptionButton optPTex + Height = 225 + Index = 0 + Left = 75 + TabIndex = 227 + Top = 180 + Value = -1 'True + Width = 285 + End + End + Begin VB.Frame fraOptional + Height = 1365 + Left = 9630 + TabIndex = 221 + Top = 1350 + Width = 435 + Begin VB.CheckBox chkOpt + Caption = "Check3" + Height = 225 + Index = 3 + Left = 105 + TabIndex = 225 + Top = 1080 + Width = 240 + End + Begin VB.CheckBox chkOpt + Caption = "Check2" + Height = 225 + Index = 2 + Left = 105 + TabIndex = 224 + Top = 770 + Width = 240 + End + Begin VB.CheckBox chkOpt + Caption = "Check1" + Height = 225 + Index = 1 + Left = 105 + TabIndex = 223 + Top = 460 + Width = 240 + End + Begin VB.CheckBox chkOpt + Caption = "Check5" + Height = 225 + Index = 0 + Left = 105 + TabIndex = 222 + Top = 150 + Width = 240 + End + End + Begin LpLib.fpCombo cboFinish + Height = 315 + Left = 6690 + TabIndex = 214 + Top = 2745 + Width = 2640 + _Version = 196608 + _ExtentX = 4657 + _ExtentY = 556 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Text = "" + Columns = 3 + Sorted = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = 1 + ColumnWidthScale= 2 + RowHeight = -1 + WrapList = 0 'False + WrapWidth = 0 + AutoSearch = 2 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + DataFieldList = "" + ColumnEdit = -1 + ColumnBound = -1 + Style = 2 + MaxDrop = 8 + ListWidth = -1 + EditHeight = -1 + GrayAreaColor = -2147483633 + ListLeftOffset = 0 + ComboGap = -2 + MaxEditLen = 150 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + EnableClickEvent= -1 'True + ListPosition = 0 + ButtonThreeDAppearance= 0 + OLEDragMode = 0 + OLEDropMode = 0 + Redraw = -1 'True + AutoSearchFill = 0 'False + AutoSearchFillDelay= 500 + EditMarginLeft = 1 + EditMarginTop = 1 + EditMarginRight = 0 + EditMarginBottom= 3 + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + AutoMenu = -1 'True + EditAlignH = 0 + EditAlignV = 0 + ColDesigner = "frmTake5.frx":030B + End + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 205 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 204 + Top = 1860 + Width = 675 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 35 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 34 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 285 + Left = -64665 + TabIndex = 32 + Top = 1260 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 33 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 37 + Top = 2670 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67245 + TabIndex = 185 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 182 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 184 + Top = 120 + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 183 + Top = 120 + Value = -1 'True + Width = 1215 + End + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 180 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 255 + Left = -64905 + TabIndex = 179 + TabStop = 0 'False + Top = 345 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 170 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 167 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 166 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65025 + TabIndex = 47 + Top = 2640 + Width = 1455 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 36 + Top = 1575 + Width = 1695 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 255 + Left = -64905 + TabIndex = 153 + TabStop = 0 'False + Top = 600 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -65535 + Picture = "frmTake5.frx":063E + Style = 1 'Graphical + TabIndex = 39 + Top = 2715 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -65400 + Picture = "frmTake5.frx":0A80 + Style = 1 'Graphical + TabIndex = 144 + Top = 390 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTake5.frx":0EC2 + Left = -65400 + List = "frmTake5.frx":0ECC + Style = 2 'Dropdown List + TabIndex = 45 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTake5.frx":0EDD + Left = -65400 + List = "frmTake5.frx":0EDF + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTake5.frx":0EE1 + Left = -68160 + List = "frmTake5.frx":0EEB + Style = 2 'Dropdown List + TabIndex = 43 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 46 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 42 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 41 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 40 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Height = 315 + Left = -68160 + MaxLength = 18 + TabIndex = 38 + Top = 2760 + Width = 2610 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 154 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTake5.frx":0EFF + Left = -68100 + List = "frmTake5.frx":0F09 + Style = 2 'Dropdown List + TabIndex = 150 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTake5.frx":0F1A + Left = -68100 + List = "frmTake5.frx":0F1C + Style = 2 'Dropdown List + TabIndex = 149 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTake5.frx":0F1E + Left = -68100 + List = "frmTake5.frx":0F28 + Style = 2 'Dropdown List + TabIndex = 148 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 151 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 147 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 146 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 145 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 143 + Top = 480 + Width = 2625 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 132 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTake5.frx":0F3C + Left = -69720 + List = "frmTake5.frx":0F3E + Style = 2 'Dropdown List + TabIndex = 131 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 130 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 129 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 124 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 122 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 133 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 115 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 134 + Top = 2940 + Width = 2115 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 152 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 114 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 113 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 112 + TabStop = 0 'False + Top = 4005 + Width = 1215 + End + Begin VB.TextBox txtBidPr4 + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 10215 + TabIndex = 111 + TabStop = 0 'False + Top = 2385 + Width = 1155 + End + Begin VB.TextBox txtBidPr3 + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 10215 + TabIndex = 110 + TabStop = 0 'False + Top = 2070 + Width = 1155 + End + Begin VB.TextBox txtBidPr2 + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 10215 + TabIndex = 109 + TabStop = 0 'False + Top = 1755 + Width = 1155 + End + Begin VB.TextBox txtBidPr1 + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 10215 + TabIndex = 108 + TabStop = 0 'False + Top = 1425 + Width = 1155 + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 105 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 64 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 63 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 65 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 99 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 90 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 62 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 83 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 67 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 61 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 59 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65025 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1455 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65025 + TabIndex = 56 + TabStop = 0 'False + Top = 1605 + Width = 1455 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 285 + Left = -64665 + MaxLength = 4 + TabIndex = 31 + Top = 870 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 30 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTake5.frx":0F40 + Left = -70305 + List = "frmTake5.frx":0F42 + Style = 2 'Dropdown List + TabIndex = 29 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 285 + Left = -64665 + MaxLength = 6 + TabIndex = 28 + Top = 525 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 40 + TabIndex = 26 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 25 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68715 + TabIndex = 171 + Top = 2190 + Width = 4995 + Begin VB.TextBox txtSLabAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 21 + Top = 1980 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblSLabAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "S. Labor Adj. Ydge:" + Height = 195 + Left = 2505 + TabIndex = 248 + Top = 1200 + Width = 1380 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2745 + TabIndex = 189 + Top = 1620 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 187 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2625 + TabIndex = 177 + Top = 2040 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "L. Labor Adj. Ydge:" + Height = 195 + Left = 2520 + TabIndex = 176 + Top = 780 + Width = 1365 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 175 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 174 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 173 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 172 + Top = 780 + Width = 870 + End + End + Begin LpLib.fpList lstOptMatrl + Height = 900 + Left = -74760 + TabIndex = 249 + Top = 3720 + Width = 5475 + _Version = 196608 + _ExtentX = 9657 + _ExtentY = 1587 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake5.frx":0F44 + End + Begin LpLib.fpList lstMInventory + Height = 2040 + Left = -66840 + TabIndex = 251 + Top = 1230 + Visible = 0 'False + Width = 3270 + _Version = 196608 + _ExtentX = 5768 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake5.frx":12C7 + End + Begin LpLib.fpList lstTOMatrl + Height = 3960 + Left = -74895 + TabIndex = 252 + Top = 480 + Width = 5355 + _Version = 196608 + _ExtentX = 9446 + _ExtentY = 6985 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTake5.frx":155E + End + Begin VB.Label lblCALC + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Special Calculation Enabled" + BeginProperty Font + Name = "Arial" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 270 + Left = 6660 + TabIndex = 253 + Top = 4470 + Visible = 0 'False + Width = 3435 + End + Begin VB.Label lblOptNum + Height = 270 + Left = -74760 + TabIndex = 246 + Top = 375 + Width = 2400 + End + Begin VB.Label lblBagSand + AutoSize = -1 'True + Caption = "Bag Sand/PreMix Stucco Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 6690 + TabIndex = 244 + Top = 480 + Width = 3975 + End + Begin VB.Label lblT4 + Height = 285 + Left = 6405 + TabIndex = 243 + Top = 2385 + Width = 315 + End + Begin VB.Label lblT3 + Height = 285 + Left = 6405 + TabIndex = 242 + Top = 2085 + Width = 315 + End + Begin VB.Label lblT2 + Height = 285 + Left = 6405 + TabIndex = 241 + Top = 1770 + Width = 315 + End + Begin VB.Label lblT1 + Height = 285 + Left = 6405 + TabIndex = 240 + Top = 1455 + Width = 315 + End + Begin VB.Label lblFDesc4 + Alignment = 1 'Right Justify + Height = 240 + Left = 6765 + TabIndex = 235 + Top = 2430 + Width = 2340 + End + Begin VB.Label lblFDesc3 + Alignment = 1 'Right Justify + Height = 240 + Left = 6765 + TabIndex = 234 + Top = 2130 + Width = 2340 + End + Begin VB.Label lblFDesc2 + Alignment = 1 'Right Justify + Height = 240 + Left = 6765 + TabIndex = 233 + Top = 1815 + Width = 2340 + End + Begin VB.Label lblFDesc1 + Alignment = 1 'Right Justify + Height = 240 + Left = 6780 + TabIndex = 232 + Top = 1500 + Width = 2340 + End + Begin VB.Label lblTex4 + Alignment = 1 'Right Justify + Height = 270 + Left = 6600 + TabIndex = 220 + Top = 2430 + Width = 2490 + End + Begin VB.Label lblTex3 + Alignment = 1 'Right Justify + Height = 270 + Left = 6600 + TabIndex = 219 + Top = 2130 + Width = 2490 + End + Begin VB.Label lblTex2 + Alignment = 1 'Right Justify + Height = 270 + Left = 6600 + TabIndex = 218 + Top = 1830 + Width = 2490 + End + Begin VB.Label lblTex1 + Alignment = 1 'Right Justify + Height = 270 + Left = 6990 + TabIndex = 217 + Top = 1530 + Width = 2100 + End + Begin VB.Label lblPrice + Alignment = 2 'Center + Caption = "Price" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 10350 + TabIndex = 216 + Top = 1095 + Width = 990 + End + Begin VB.Label lblNumber + Caption = "1 2 3 4" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 1185 + Left = 10050 + TabIndex = 215 + Top = 1455 + Width = 195 + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 206 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 203 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 202 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 201 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 188 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 162 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 161 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 160 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 159 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 158 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 157 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 156 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 155 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 142 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 141 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 140 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 139 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 138 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 137 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 136 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 135 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 128 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 127 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 126 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 125 + Top = 660 + Width = 840 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 9585 + TabIndex = 107 + Top = 975 + Width = 825 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8850 + TabIndex = 106 + Top = 975 + Width = 735 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6375 + Y1 = 360 + Y2 = 5205 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 104 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 97 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 96 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 95 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 94 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 93 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 92 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 91 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 89 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 87 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 86 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 73 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 72 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 71 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 70 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 69 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 68 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 66 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 60 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 465 + TabIndex = 58 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 53 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 52 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 51 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 50 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 49 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 48 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblFixLbr + Alignment = 2 'Center + Caption = "Fix Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 450 + Left = 2850 + TabIndex = 245 + Top = 660 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblTexCode + Height = 315 + Left = 6765 + TabIndex = 239 + Top = 600 + Width = 435 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 212 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 210 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 209 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 199 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 198 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 196 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 193 + Top = 1380 + Width = 795 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 945 + Left = 8625 + TabIndex = 192 + Top = 1005 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 191 + Top = 1200 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 190 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 121 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 24 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 23 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 22 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTake5" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset, moRSTMAT As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset, mboolBAG100 As Boolean, mboolSilica As Boolean +Dim mintOLDTOID As Long, mboolBAD As Boolean, mboolPSW As Boolean +Dim mboolSHOW As Boolean, mboolCALC As Boolean, mstrWIRE As String, mboolNOCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer, mintBOOKMARK12 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long, mintTexNum As Integer +Dim mintNTOID As Long, mintNOPTID As Long ', mintPROJID As Long, mintTexNum As Integer +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub TextureLoad2() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboFinish.AddItem oRSFinish("Desc") + cboFinish.ItemData(cboFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Plans - Module TextureLoad2" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cboFinish_Click() + cboFinish.SearchText = "" +End Sub + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkOpt(0) = vbUnchecked And Not optPTex(0) Then + txtBidPr1 = "" + If Not IsNull(lblT1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT1 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + ' Exit Sub + End If + End If + End If + If chkOpt(1) = vbUnchecked And Not optPTex(1) Then + txtBidPr2 = "" + If Not lblT2 = "" Then +' If Not IsNull(lblT2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT2 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + ' Exit Sub + End If + End If + End If + If chkOpt(2) = vbUnchecked And Not optPTex(2) Then + txtBidPr3 = "" + If Not lblT3 = "" Then +' If Not IsNull(lblT3) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT3 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + ' Exit Sub + End If + End If + End If + If chkOpt(3) = vbUnchecked And Not optPTex(3) Then + txtBidPr4 = "" + If Not lblT4 = "" Then +' If Not IsNull(lblT4) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT4 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + ' Exit Sub + End If + End If + End If +' If chkMonterrey = vbUnchecked And Not optPTex(6) Then +' txtMonterreyPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkQU = vbUnchecked And Not optPTex(7) Then +' txtQUPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(0) Then +' txtBidPr1 = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(1) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If Not chkSand = vbUnchecked And optPTex(2) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSB = vbUnchecked And Not optPTex(9) Then +' txtSBPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSkip = vbUnchecked And Not optPTex(3) Then +' txtBidPr2 = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkSmooth = vbUnchecked And Not optPTex(5) Then +' txtBidPr4 = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBOOKMARK As Integer + intBOOKMARK = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If +' If moRS!finish = "DW" Then +' +' Else + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If +' End If + If mboolBAD Then + MsgBox "Takeoff Calculation Was Not Completed - Wire Error" + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + Exit Sub + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset, oRX As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String, strSQLX As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double, strSELECT2 As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double, dblTYPAR As Double, intTP9 As Integer, intTP45 As Integer +Dim dbl12F As Double, dblPYRO As Double, dblRL8 As Double +Dim dblTP4, dblTP6, dblTP9, dblTPNail, dblTPCTape As Double + +' ****** If errors are reported where quantities are being changed in material +' ****** when not wanted look at this -- oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + On Error GoTo Error_EH + + dblRL8 = 0 + mboolBAD = False + mboolCALC = False + mboolSilica = False + + If mstrWIRE = "P" Or mstrWIRE = "F" Then + MsgBox "The Wire Type selected in projects is not correct for OneCoat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + +'**************Cement, Lime, Silica, 1Kote + dblBagBatch = Field2Str2(moRSProj!bagdollars) ' + 1 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If +' If moRS!stype = "M" Then 'Magna Wall 1 Kote +' If Field2Str2(moRSProj!sw_adj) > 0 Then +' dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) +' Else +' dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) +' End If +' End If + If moRS!stype = "M" Then 'Pre-Mix 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = ((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj))) + dblKote1 = Int((dblKote1 * 1) + 0.99) +' dblKote1 = Int((dblKote1 * 4) + 0.99) +' dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = (Field2Str(txtLathYds) / 10) + dblKote1 = Int((dblKote1 * 1) + 0.99) 'Changed 7/3/2019 to make amount look wrong +' dblKote1 = Int((dblKote1 * 4) + 0.99) +' dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If +' If moRS!stype = "P" Then 'Pre-Mix 1 Kote +' If Field2Str2(moRSProj!sw_adj) > 0 Then +' dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) +' Else +' dblKote1 = Int((Field2Str(txtLathYds) / 2.5) + 0.99) +' End If +' End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then +' dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + dblS16 = dblBatch * (Field2Integer(oRS!t_s16)) + mboolSilica = True + Else + dblS16 = 0 + mboolSilica = False + End If + + If Field2Str(oRS!t_s20) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then +' dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + dblS20 = dblBatch * (Field2Integer(oRS!t_s20)) + mboolSilica = True + Else + dblS20 = 0 + mboolSilica = False + End If + + + If Field2Str(oRS!t_brs) > 0 Then + If mboolBAG100 Then + dblRS = 0 +' dblRS = ((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) +' dblS16 = (dblRS) + Else + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + End If + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolNOCALC Then + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds))) ' + 0.99) + Else + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then +' dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16))) + End If + + If Field2Str(oRS!t_s20) > 0 Then +' If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS20 = dblS20 + (dblBatch * (Field2Integer(oRS!t_s20))) +' dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + '****************HOLD +' If mboolBAG100 Then +' dblBAGSAND = Int(((dblCMNT2 + dblKote1) * dblCalcBAGSAND) + 0.99) +' End If + + If mboolBAG100 And Not mboolSilica Then + If dblS16 = 0 Then + dblS16 = dblRS + End If +' If dblS16 = 0 Then '************** May need to change this to dblS20 +' dblS16 = dblRS +' End If + End If + + If mboolPSW Then +' lngSandBatch = dblCMNT '******** complete this + lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + dblSandBag = dblSandBag - dblS16 + ElseIf mboolBAG100 And Not mboolSilica Then + lngSandBatch = dblCMNT '******** complete this + ' lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + dblSandBag = dblSandBag - dblS16 +' dblS16 = dblSandBag + End If +' If mboolBAG100 Then +' lngSandBatch = dblCMNT '******** complete this + ' lngSandBatch = dblKote1 + dblCMNT '******** complete this +' dblSandBag = lngSandBatch * dblBagBatch +' dblS16 = dblSandBag +' End If + + If dblS16 > 0 And mboolSilica Then +' If mboolSilica Then +' If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblS20 > 0 And mboolSilica Then +' If mboolSilica Then +' If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2320' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblS20 = Int((dblS20) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2320' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS20 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS20 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSandBag > 0 Then +' ElseIf mboolBAG100 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2350' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2350' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSandBag +' moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + If dblS16 > 0 Then + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + ElseIf dblS20 > 0 Then + moRS!silica = Int((dblS20 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + End If +' ElseIf Not mboolSilica Then + If Not mboolSilica And dblS16 > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If Not mboolSilica And dblS20 > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + dblS20 = Int((dblS20) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS20 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS20 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If +' End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close +'****** move to after One Coat calculation +' If dblRS > 0 Then +' dblRS = Int((dblRS) + 0.99) +' txtSandTons = dblRS +' End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + strSQLX = "SELECT * FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRX = New Recordset + oRX.Open strSQLX, goConn, adOpenDynamic, adLockOptimistic + + If Not oRX.EOF Then + oRX.MoveFirst + strSELECT2 = "inv_no = '1310'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1315'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1317'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + oRX.MoveFirst + strSELECT2 = "inv_no = '1805'" + oRX.Find strSELECT2 + If Not oRX.EOF Then + oRX.Delete + End If + End If + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1310' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1310' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + Else + If moRSProj!rg12 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1315' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1315' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!rg1 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1317' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1317' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!pyro Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1805' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1805' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 50) + 0.99) 'Added 11/3/17 for Pyro Paper + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + End If + End If + +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + + dblLC = Int(((Field2Long(txtLathYds) / 25) * 2) + 0.99) + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1820' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1820' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLC + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1330' and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1330' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + +'Calculate Foam + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1230' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + + If Not oRC.EOF Then + dbl12F = Field2Str2(oRC!qty) + oRC.Close + End If + + dblFOAM = Field2Long(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1211' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1211' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) +' moRSCMat!QTY = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!qty = Int(((dblFOAM - (dbl12F * 1.77) - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + ' ** Changed back to 1.77 6/27/2012 per JR because of Shea Homes + ' ** Changed to subtract 1/2in foam because of Ryland & Typar + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1211' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1211' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1260' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1250' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Typar Stucco Wrap + If moRSProj!TYPAR Then +' dblTYPAR = Int((Field2Integer(txtTTLYds) / 90) + 0.99) +' dblTYPAR = Int((Field2Long(txtTTLYds) / 90) + 0.99) 'Changed 7/22/2015 after discussion with BBart/JR + dblTYPAR = Int((Field2Long(txtTTLYds) / 70) + 0.79) 'Changed 11/14/2018 By Jesse - Material from Lot s/b 80 +' dblTYPAR = Int((Field2Long(txtTTLYds) / 70) + 0.99) 'Changed 12/06/2019 By Jesse - Material adjust by .79 not .99 +' intTP45 = 1 'combined all typar into 1 calcuation + intTP9 = dblTYPAR '- intTP45 **************************** + + dblTP4 = Int((Field2Long(txtTTLYds) / 100) + 0.99) +' dblTP6 = Int((Field2Long(txtTTLYds) / 100) + 0.99) + dblTP9 = Int((Field2Long(txtTTLYds) / 500) + 0.99) + dblTPNail = Int((Field2Long(txtTTLYds) / 500) + 0.99) + dblTPCTape = intTP9 + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3300' and toid = " & gintTOID ' To Delete + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + + Else + oRC.Delete + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3310' and toid = " & gintTOID 'Typar 9ft X 100ft +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 3300 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3310' and Inv_Type = " & gbytINV_TYPE +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3300 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = intTP9 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = intTP9 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3324' and toid = " & gintTOID 'Typar 4 IN ACRYLIC FLASHING TAPE + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3324' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) +' moRSCMat!qty = (dblTP4 * 2) + moRSCMat!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = (dblTP4 * 2) + oRC!qty = (dblTP4 * 4) ' Changed 11/14/17 per JR so Supers do not need to request more 4" + oRC.Update + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3326' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If Not oRC.EOF Then + oRC.Delete + End If + + 'Removed on 02/03/2017 because Pulte changed requirements +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 3326 and toid = " & gintTOID +' Set oRC = New Recordset +' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' If oRC.EOF Then +' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 3326 and Inv_Type = " & gbytINV_TYPE +' Set oRSS = New Recordset +' oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +' If Not oRSS.EOF Then +' moRSCMat.AddNew +' moRSCMat!toid = gintTOID +' moRSCMat!inv_no = Field2Str(oRSS!inv_no) +' moRSCMat!Desc = Field2Str(oRSS!Desc) +' moRSCMat!qty = dblTP6 +' moRSCMat!price = Field2Str(oRSS!tprice) +' moRSCMat!d_flag = Field2Str(oRSS!d_flag) +' moRSCMat!m_type = Field2Str(oRSS!m_type) +' moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) +' moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) +' moRSCMat!cflag = vbChecked +' moRSCMat!trnsflag = vbChecked +' moRSCMat.Update +' End If +' Else +' oRC!qty = dblTP6 +' oRC.Update +' End If + +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 3329 and toid = " & gintTOID +' Set oRC = New Recordset +' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic +' +' If Not oRC.EOF Then +' oRC.Delete +' End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3329' and toid = " & gintTOID 'TYPAR 9 IN ACRYLIC FLASHING TAPE + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3329' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = 1 +' moRSCMat!qty = dblTP9 ' changed because only using a part of a roll + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else +' oRC!qty = dblTP9 ' changed because only using a part of a roll + oRC!qty = 1 + oRC.Update + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1831' and toid = " & gintTOID 'PLASTIC CAP NAILS + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1831' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblTPNail + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPNail + oRC.Update + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '3320' and toid = " & gintTOID '2 IN (1 7/8) CONSTRUCTION TAPE + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '3320' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblTPCTape + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblTPCTape + oRC.Update + End If + + End If + + + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Long(txtLathYds) / 30)) + 0.99) + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + ElseIf moRSProj!bp_type = "BP" Then + dblBP = Int(((Field2Long(txtLathYds) / 70)) + 0.99) 'Added per Jesse 04/02/2020 + ElseIf moRSProj!bp_type = "BR" Then + dblBP = Int(((Field2Integer(dbl12F * 1.77) / 20)) + 0.99) + Else + dblBP = Int(((Field2Long(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1815' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1815' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1816' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1816' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenDynamic, adLockOptimistic +' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If +' End If + ElseIf moRSProj!bp_type = "BP" Then + dblBP = Int(((Field2Long(txtLathYds) / 70)) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + oRC!qty = dblBP + oRC.Update + End If +' End If + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1811' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1811' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!bp_type = "BR" Then + dblBP = Int(((Field2Integer(dbl12F * 1.77) / 20)) + 0.99) ' Changed to match what is being sent out in orders + If dblBP = 0 Then + dblBP = 1 + End If +' dblBP = Int(((Field2Integer(dbl12F * 1.77) / 20)) + 0.99) +' dblBP = Int(((Field2Integer(txtLathYds) / 20)) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF And dblBP > 0 Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update +' Else +' moRSCMat!qty = dblBP +' moRSCMat.Update + End If + txtNotes = txtNotes & "CHECK 60 MIN BP CALCULATION" + End If + + + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + +'Calculate Stucco Wire + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 45) + 0.99) '***** Wire changed to 45 yds per Jesse on 3/24/10 + ' moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 + ' moRSCMat!qty = Int((dblWire / 50) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2210' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2250' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockOptimistic + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2260' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +' If Not mboolBAG100 Then + If mboolBAG100 Then + lngSandBatch = dblCMNT '******** complete this + ' lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + End If + +' If moRSProj!BagSand Then + If mboolBAG100 Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + Else + txtSandTons = dblRS + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + Else + txtSandTons = dblRS + End If + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = '1610'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1710'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1720'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Long(txtTTLYds) * Field2Str2(txtTPRate)) + 0.99) + txtOH = Int((Field2Long(txtTTLYds) * Field2Str2(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtSLabAdj)) * Field2Str2(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str2(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str2(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str2(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'LABOR BURDEN RATES HERE + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take5 - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + + If mstrWIRE = "O" Then + MsgBox "The Wire Type selected in projects is not correct for Three Coat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If mboolNOCALC Then + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds))) ' + 0.99) + Else + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + End If +' dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2412' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2412' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2411' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2411' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2432' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2432' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2431' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2431' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + End If + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + +' If dblRS > 0 Then +' txtSandTons = dblRS +' End If + + lngSandBatch = dblKote1 + dblCMNT + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + + +'Calculate Black paper +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + 'Changed from 1.5 to 2 layers per Jesse 03/24/2010 + If moRSProj!bp_type <> "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + If mstrWIRE = "P" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1450' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1450' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 27) + 0.99) 'For bid purposes - use 33 for production purposes + ' moRSCMat!qty = Int((dblWire / 33) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + If mstrWIRE = "F" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1417' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1417' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) ' For bid purposes - use 45 for production + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1616'" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Long(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1705'" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1820'" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL +' If Field2Integer(txtSandTons) < 16 Then +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + 30 +' Else +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' End If + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > '1899' and Inv_no < '2000' and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strSQLMS As String, strSQLMAT As String, strSQLLAB As String, strSQLOPT As String, strSQLOPTM As String +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim strSQLTO As String, strSQLMEAS As String, strSQLTMAT As String +Dim oRS As Recordset, oRSMEAS As Recordset, oRSMAT As Recordset, oRSOPT As Recordset, oRSOPTMAT As Recordset +Dim oRSS As Recordset, oRSTO As Recordset, oRSLAB As Recordset +Dim strNewElv As String +Dim oRSMAX As Recordset, strSQLMAX As String + + On Error GoTo Error_EH + mintBOOKMARK12 = lstMod_Elv.ListIndex + + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + strNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else 'Need To Add The Takeoff,Measurements, Materials, Labor, Options and Option Material all in this proceedure + mintPROJID = oRS!PROJ_ID + mboolMove = True + + strSQLTO = "SELECT * FROM tblTAKE" + Set oRSTO = New Recordset + oRSTO.Open strSQLTO, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSTO.EOF Then + + oRSTO.AddNew + oRSTO!PROJ_ID = mintPROJID + oRSTO!pln_elv = moRS!pln_elv + oRSTO!finish = moRS!finish + oRSTO!BIDC = moRS!BIDC + oRSTO!bidp = moRS!bidp + oRSTO!opening = moRS!opening + oRSTO!openpr = moRS!openpr + oRSTO!lath_yds = moRS!lath_yds + oRSTO!TTL_Yds = moRS!TTL_Yds + oRSTO!CMUYDS = moRS!CMUYDS + oRSTO!MATCOST = moRS!MATCOST + oRSTO!MISC = moRS!MISC + oRSTO!SAND_TONS = moRS!SAND_TONS + oRSTO!sand = moRS!sand + oRSTO!stype = moRS!stype + oRSTO!KOTE1 = moRS!KOTE1 + oRSTO!SW = moRS!SW + oRSTO!pl = moRS!pl + oRSTO!ll = moRS!ll + oRSTO!METAL = moRS!METAL + oRSTO!mlab = moRS!mlab + oRSTO!cmulab = moRS!cmulab + oRSTO!SL_TG = moRS!SL_TG + oRSTO!tp = moRS!tp + oRSTO!TPE = moRS!TPE + oRSTO!c_l = moRS!c_l + oRSTO!silica = moRS!silica + oRSTO!OH = moRS!OH + oRSTO!mu = moRS!mu + oRSTO!LR = moRS!LR + oRSTO!SR = moRS!SR + oRSTO!MR = moRS!MR + oRSTO!CR = moRS!CR + oRSTO!scr = moRS!scr + oRSTO!BRDN = moRS!BRDN + oRSTO!MTMU = moRS!MTMU + oRSTO!MATMUPR = moRS!MATMUPR + oRSTO!ohp = moRS!ohp + oRSTO!OHPR = moRS!OHPR + oRSTO!LIME2 = moRS!LIME2 + oRSTO!fin2 = moRS!fin2 + oRSTO!f_adj = moRS!f_adj + oRSTO!l_adj = moRS!l_adj + oRSTO!cladj = moRS!cladj +' oRSTO!Create = moRS!Create +' oRSTO!LSave = moRS!LSave +' oRSTO!LSUser = moRS!LSUser + oRSTO!createuser = gstrLOGIN + oRSTO!notes = moRS!notes + oRSTO!stone = moRS!stone + oRSTO!ST_SQFT = moRS!ST_SQFT + oRSTO!w_adj = moRS!w_adj +' oRSTO!Update = moRS!Update +' oRSTO!LUUser = moRS!LUUser + oRSTO!openflg = moRS!openflg + oRSTO!P_RL = moRS!P_RL + oRSTO!TWOSTORY = moRS!TWOSTORY + oRSTO!Scaf6 = moRS!Scaf6 + oRSTO!scaf10 = moRS!scaf10 + oRSTO!Supersede = moRS!Supersede + oRSTO!NEWTOID = moRS!NEWTOID + oRSTO!superdate = moRS!superdate + oRSTO.Update + + strSQLMAX = "SELECT Max(TOID) as MAXTOID from tblTAKE" + Set oRSMAX = New Recordset + oRSMAX.Open strSQLMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintNTOID = oRSMAX!MAXToid + oRSMAX.Close + strSQLTO = "SELECT * FROM tblTAKE WHERE TOID = " & mintNTOID + Set oRSTO = New Recordset + oRSTO.Open strSQLTO, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSTO.EOF Then + oRSTO!origTOID = mintNTOID + oRSTO.Update + End If + End If + oRSTO.Close + End If + + strSQL = "SELECT * FROM tblMEASURE WHERE TOID = " & gintTOID + Set moRSMeas = New Recordset + moRSMeas.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSMeas.EOF Then + strSQLMS = "SELECT * FROM tblMEASURE" + Set oRSMEAS = New Recordset + oRSMEAS.Open strSQLMS, goConn, adOpenKeyset, adLockOptimistic + End If + + If Not oRSMEAS.EOF Then + Do Until moRSMeas.EOF + oRSMEAS.AddNew + oRSMEAS!toid = mintNTOID + oRSMEAS!Desc = moRSMeas!Desc + oRSMEAS!sq_yds = moRSMeas!sq_yds + oRSMEAS!Type = moRSMeas!Type + oRSMEAS!Location = moRSMeas!Location + oRSMEAS.Update + moRSMeas.MoveNext + Loop + oRSMEAS.Close + End If + + strSQL = "SELECT * FROM tblTOMATRL WHERE TOID = " & gintTOID + Set moRSTMAT = New Recordset + moRSTMAT.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSTMAT.EOF Then + strSQLTMAT = "SELECT * FROM tblTOMATRL" + Set oRSMAT = New Recordset + oRSMAT.Open strSQLTMAT, goConn, adOpenKeyset, adLockOptimistic + End If + + If Not oRSMAT.EOF Then + Do Until moRSTMAT.EOF + oRSMAT.AddNew + oRSMAT!toid = mintNTOID + oRSMAT!inv_no = moRSTMAT!inv_no + oRSMAT!Desc = moRSTMAT!Desc + oRSMAT!qty = moRSTMAT!qty + oRSMAT!price = moRSTMAT!price + oRSMAT!d_flag = moRSTMAT!d_flag + oRSMAT!m_type = moRSTMAT!m_type + oRSMAT!calc_flag = moRSTMAT!calc_flag + oRSMAT!calc_amt = moRSTMAT!calc_amt + oRSMAT!trnsflag = moRSTMAT!trnsflag + oRSMAT!cflag = moRSTMAT!cflag + oRSMAT.Update + moRSTMAT.MoveNext + Loop + oRSMAT.Close + End If + + strSQL = "SELECT * FROM tblTOLABOR WHERE TOID = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSLAB.EOF Then + strSQLLAB = "SELECT * FROM tblTOLABOR" + Set oRSLAB = New Recordset + oRSLAB.Open strSQLLAB, goConn, adOpenKeyset, adLockOptimistic + End If + + If Not oRSLAB.EOF Then + Do Until moRSLAB.EOF + oRSLAB.AddNew + oRSLAB!toid = mintNTOID + oRSLAB!texture = moRSLAB!texture + oRSLAB!l_rate = moRSLAB!l_rate + oRSLAB!s_rate = moRSLAB!s_rate + oRSLAB!M_Rate = moRSLAB!M_Rate + oRSLAB!CMU = moRSLAB!CMU + oRSLAB!matmu = moRSLAB!matmu + oRSLAB!scr = moRSLAB!scr + oRSLAB!tp = moRSLAB!tp + oRSLAB!ohp = moRSLAB!ohp + oRSLAB!mu = moRSLAB!mu + oRSLAB!bidprice = moRSLAB!bidprice + oRSLAB!C_USER = gstrLOGIN + oRSLAB!OptNum = moRSLAB!OptNum + oRSLAB!PTex = moRSLAB!PTex + oRSLAB.Update + moRSLAB.MoveNext + Loop + oRSLAB.Close + End If + + strSQL = "SELECT * FROM tblOPTION WHERE TOID = " & gintTOID + Set moRSOpt = New Recordset + moRSOpt.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSOpt.EOF Then + mintOPTID = moRSOpt!OPTID + strSQLOPT = "SELECT * FROM tblOPTION" + Set oRSOPT = New Recordset + oRSOPT.Open strSQLOPT, goConn, adOpenKeyset, adLockOptimistic + End If + + If Not oRSOPT.EOF Then + Do Until moRSOpt.EOF + oRSOPT.AddNew + mintOPTID = moRSOpt!OPTID + oRSOPT!toid = mintNTOID +' oRSOPT!OPTID OPTID + oRSOPT!Desc = moRSOpt!Desc + oRSOPT!price = moRSOpt!price + oRSOPT!yards = moRSOpt!yards + oRSOPT!texture = moRSOpt!texture + oRSOPT!fin2 = moRSOpt!fin2 + oRSOPT!f_adj = moRSOpt!f_adj +' oRSOPT!NOTES NOTES + oRSOPT!ostone = moRSOpt!ostone + oRSOPT!OSt_SqFt = moRSOpt!OSt_SqFt + oRSOPT!otstone = moRSOpt!otstone + oRSOPT!invoice = moRSOpt!invoice + oRSOPT!Scaf6 = moRSOpt!Scaf6 + oRSOPT!scaf10 = moRSOpt!scaf10 + oRSOPT.Update + + strSQL = "SELECT * FROM tblOPTMATRL WHERE OPTID = " & mintOPTID + Set moRSOptMat = New Recordset + moRSOptMat.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + If Not moRSOptMat.EOF Then + + strSQLMAX = "SELECT Max(OPTID) as MAXOPTID from tblOPTION" + Set oRSMAX = New Recordset + oRSMAX.Open strSQLMAX, goConn, adOpenForwardOnly, adLockReadOnly + + mintNOPTID = oRSMAX!maxoptid + oRSMAX.Close + + strSQLOPTM = "SELECT * FROM tblOPTMatrl" ' WHERE OptID = " & mintNOPTID + Set oRSOPTMAT = New Recordset + oRSOPTMAT.Open strSQLOPTM, goConn, adOpenKeyset, adLockOptimistic + + If Not oRSOPTMAT.EOF Then + Do Until moRSOptMat.EOF + oRSOPTMAT.AddNew + oRSOPTMAT!toid = mintNTOID + oRSOPTMAT!OPTID = mintNOPTID + oRSOPTMAT!inv_no = moRSOptMat!inv_no + oRSOPTMAT!Desc = moRSOptMat!Desc + oRSOPTMAT!qty = moRSOptMat!qty + oRSOPTMAT!price = moRSOptMat!price + oRSOPTMAT!d_flag = moRSOptMat!d_flag + oRSOPTMAT!m_type = moRSOptMat!m_type + oRSOPTMAT!calc_flag = moRSOptMat!calc_flag + oRSOPTMAT!calc_amt = moRSOptMat!calc_amt + oRSOPTMAT.Update + + moRSOptMat.MoveNext + Loop + + End If + + End If + moRSOpt.MoveNext + Loop + oRSOPTMAT.Close + oRSOPT.Close + End If + + + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + Else + Exit Sub + End If + MsgBox "Take Off Move Is Complete", vbOKOnly, "Complete" + lstMod_Elv.ListIndex = mintBOOKMARK12 + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdMoveOld_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!PROJ_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdMove2_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset +'**** On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!PROJ_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove2_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String, intYN As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str(txtMatInvNo) <> "" Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Str(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Str2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Str2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSelectTex1_Click() +Dim intYN As Integer, oRS As Recordset, strSQL As String + +' If chkOpt(0) = vbUnchecked And Not optPTex(0) Then +' txtBidPr1 = "" +' If Not IsNull(lblT1) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = " & lblT1 & " and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' ' Exit Sub +' End If +' End If +' End If + + If lblT1 <> "" Then + intYN = MsgBox("Do You Want To Change The Current Texture 1?", vbYesNo, "Change Texture") + If intYN = vbYes Then + txtBidPr1 = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT1 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + Else + Exit Sub + End If + End If + cboFinish.col = 1 + lblT1 = cboFinish.ColText + mstrFINISH = lblT1 + cboFinish.col = 2 + lblFDesc1 = cboFinish.ColText + chkOpt(0) = vbChecked + cboFinish.ListIndex = -1 + cboFinish.SearchText = "" + mintTexNum = 1 + Call GetLabor +End Sub + +Private Sub cmdSelectTex2_Click() +Dim intYN As Integer, oRS As Recordset, strSQL As String + + If lblT2 <> "" Then + intYN = MsgBox("Do You Want To Change The Current Texture 2?", vbYesNo, "Change Texture") + If intYN = vbYes Then + txtBidPr2 = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = '" & lblT2 & "' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + Else + Exit Sub + End If + End If + + cboFinish.col = 1 + lblT2 = cboFinish.ColText + mstrFINISH = lblT2 + cboFinish.col = 2 + lblFDesc2 = cboFinish.ColText + chkOpt(1) = vbChecked + cboFinish.ListIndex = -1 + cboFinish.SearchText = "" + mintTexNum = 2 + Call GetLabor +End Sub + +Private Sub cmdSelectTex3_Click() +Dim intYN As Integer, oRS As Recordset, strSQL As String + + If lblT3 <> "" Then + intYN = MsgBox("Do You Want To Change The Current Texture 3?", vbYesNo, "Change Texture") + If intYN = vbYes Then + txtBidPr3 = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = " & lblT3 & " and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + Else + Exit Sub + End If + End If + + cboFinish.col = 1 + lblT3 = cboFinish.ColText + mstrFINISH = lblT3 + cboFinish.col = 2 + lblFDesc3 = cboFinish.ColText + chkOpt(2) = vbChecked + cboFinish.ListIndex = -1 + cboFinish.SearchText = "" + mintTexNum = 3 + Call GetLabor +End Sub + +Private Sub cmdSelectTex4_Click() +Dim intYN As Integer, oRS As Recordset, strSQL As String + + If lblT4 <> "" Then + intYN = MsgBox("Do You Want To Change The Current Texture 4?", vbYesNo, "Change Texture") + If intYN = vbYes Then + txtBidPr4 = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = " & lblT4 & " and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + Else + Exit Sub + End If + End If + + cboFinish.col = 1 + lblT4 = cboFinish.ColText + mstrFINISH = lblT4 + cboFinish.col = 2 + lblFDesc4 = cboFinish.ColText + chkOpt(3) = vbChecked + cboFinish.ListIndex = -1 + cboFinish.SearchText = "" + mintTexNum = 4 + Call GetLabor +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(0) Then + mstrFINISH = Field2Str(lblT1) + ElseIf optPTex(1) Then + mstrFINISH = Field2Str(lblT2) + ElseIf optPTex(2) Then + mstrFINISH = Field2Str(lblT3) + ElseIf optPTex(3) Then + mstrFINISH = Field2Str(lblT4) + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + + lstMInventory.col = 0 + strINVNO = lstMInventory.ColText + + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = '" & strINVNO & "'" + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = '" & strINVNO & "' and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtOMInvNo.Text & "' AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = '" & txtOMInvNo.Text & "' AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstInventory.col = 0 + strINVNO = lstInventory.ColText + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = '" & strINVNO & "' AND Inv_Type = " & gbytINV_TYPE + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + + mboolNOCALC = False + Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 + + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 + mintTexNum = 0 + If moRSProj!BagSand Then + lblSand = "Sand Bags:" + Else + lblSand = "Sand Tons:" + End If +End Sub + +Private Sub SecondLoad() +Dim strSQL As String, strOpt As String, strMOD As String +Dim oRS As Recordset, intCNT As Integer, boolSKIP As Boolean +Dim strSEARCH As String, strDESC As String, strTEXTURE As String +Dim oRSF As Recordset, strSQLF As String, intPTex As Integer, strPTex As String + + On Error GoTo Error_EH + boolSKIP = False + strPTex = Field2Str(moRS!finish) + + strSQL = "SELECT toid, texture, bidprice, OptNum FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + +' intCnt = 1 + Do Until oRS.EOF + intCNT = Field2Integer(oRS!OptNum) + strSEARCH = oRS!texture + strSQLF = "SELECT id, desc FROM tblFINISH WHERE id = '" & strSEARCH & "'" + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenForwardOnly, adLockReadOnly + If oRSF.EOF Then + MsgBox "Texture Was Not Found", vbOKOnly + oRSF.Close + Exit Sub + Else + strTEXTURE = Field2Str(oRSF!id) + strDESC = Field2Str(oRSF!Desc) + oRSF.Close + End If + + + If intCNT = 1 Then + chkOpt(0) = vbChecked + lblT1 = strTEXTURE + lblFDesc1 = strDESC + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + If strPTex = strTEXTURE Then + optPTex(0) = True + End If + End If + If intCNT = 2 Then + chkOpt(1) = vbChecked + lblT2 = strTEXTURE + lblFDesc2 = strDESC + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + If strPTex = strTEXTURE Then + optPTex(1) = True + End If + End If + If intCNT = 3 Then + chkOpt(2) = vbChecked + lblT3 = strTEXTURE + lblFDesc3 = strDESC + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + If strPTex = strTEXTURE Then + optPTex(2) = True + End If + End If + If intCNT = 4 Then + chkOpt(3) = vbChecked + lblT4 = strTEXTURE + lblFDesc4 = strDESC + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + If strPTex = strTEXTURE Then + optPTex(3) = True + End If + End If +' intCnt = intCnt + 1 + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module SecondLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + + mboolBAG100 = False + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + mstrWIRE = Field2Str(moRSProj!wire) + gbytINV_TYPE = Field2Str(moRSProj!inv_type) + + If moRSProj!BagSand Then + mboolBAG100 = True + ElseIf moRSProj!bag100 Then + mboolBAG100 = True + Else + mboolBAG100 = False + End If + + If moRSProj!P_SW Then + mboolPSW = True + Else + mboolPSW = False + End If + + If moRSProj!NoCalc Then +' lblSupercede.Caption = "Special Calculation Enabled" +' lblSupercede.Visible = True +' lblCALC.Visible = True + mboolNOCALC = True + Else +' lblCALC.Visible = False +' lblSupercede.Caption = "Plan has been Superceded, Press CTRL-R to View" +' lblSupercede.Visible = False + mboolNOCALC = False + End If +' mboolBAG100 = Field2CheckBox(moRSProj!bag100) +' mboolSilica = Field2CheckBox(moRSProj!Silica) + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, ID, Desc FROM tblFinish" + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboFinish.AddItem oRSFinish!autoid & vbTab & oRSFinish!id & vbTab & Trim(oRSFinish!Desc) + + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkOpt(0) = vbUnchecked + txtBidPr1 = "" + lblT1 = "" + lblFDesc1 = "" + + chkOpt(1) = vbUnchecked + txtBidPr2 = "" + lblT2 = "" + lblFDesc2 = "" + + chkOpt(2) = vbUnchecked + txtBidPr3 = "" + lblT3 = "" + lblFDesc3 = "" + + chkOpt(3) = vbUnchecked + txtBidPr4 = "" + lblT4 = "" + lblFDesc4 = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String +Dim dblSplitCost As Double +Dim oRSF As Recordset, strSQL As String, strFIN2 As String +Dim oRSL As Recordset, tst As String + + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If + If mboolNOCALC Then + lblSupercede.Caption = "Special Calculation Enabled" + lblSupercede.Visible = True +' lblCALC.Visible = True +' mboolNOCALC = True + Else +' lblCALC.Visible = False + lblSupercede.Caption = "Plan has been Superceded, Press CTRL-R to View" + lblSupercede.Visible = False +' mboolNOCALC = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + With moRS + mstrFINISH = Field2Str(!finish) + chkP_RL = Field2CheckBox(!P_RL) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtSLabAdj = Field2Integer(!s_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!TWOSTORY) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtCreated = txtCreated & " " & Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtCreated = txtCreated & " " & Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Not moRSProj!BagSand Then + If Field2Integer(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + strFIN2 = Field2Str(!finish) + strSQL = "SELECT ID, DESC FROM tblFINISH WHERE ID = '" & strFIN2 & "'" + Set oRSF = New Recordset + oRSF.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRSF.EOF Then + txtFinish = Field2Str(oRSF!Desc) + lblTexCode = !finish + lblT1 = !finish + lblFDesc1.Caption = txtFinish + optPTex(0).Value = True + Else + MsgBox "Finish For This Plan Not Found", vbOKOnly + + End If + oRSF.Close + + + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Pre-Mix Stucco" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" +' ElseIf !stype = "P" Then +' cboOneKote = "Pre-Mix Stucco" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type + If txtInvType = "0" Then + lblInvType = "Original" + ElseIf txtInvType = "1" Then + lblInvType = "Tract Homes" + ElseIf txtInvType = "2" Then + lblInvType = "Custom Homes" + ElseIf txtInvType = "3" Then + lblInvType = "Multi Family" + ElseIf txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + +' strSELECT = "texture = '" & mstrFINISH & "'" +' moRSLAB.Filter = strSELECT + + strSELECT = "SELECT * FROM tblTOLabor WHERE Texture = '" & mstrFINISH & "' and TOID = " & gintTOID + Set oRSL = New Recordset + oRSL.Open strSELECT, goConn, adOpenDynamic, adLockOptimistic + + If oRSL.EOF Then + lblFixLbr.Visible = True + Else + lblFixLbr.Visible = False +' End If + With oRSL +' With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!M_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + End If + +' With moRSLAB +' txtSLRate = Format(Field2Str(!s_rate), "##.00") +' txtLLRate = Format(Field2Str(!l_rate), "##.00") +' txtMLRate = Format(Field2Str(!m_Rate), "##.00") +' txtMatMURate = Format(Field2Str(!matmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!CMU), "##.00") + +' End With + + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + lblOptNum = "Option Number " & Trim(Field2Str(!OPTID)) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String, strNEWLAB As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + If Not moRSLAB.EOF Then + moRSLAB!toid = oRSMAX!MAXToid + moRSLAB.Update + End If + oRSMAX.Close + End If +' moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + +' strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + strCOPY = "SELECT * FROM tblTOMatrl" ' where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly +' gintTOID = Field2Integer(oRS!toid) + gintTOID = Field2Long(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Str(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + +' strCOPY = "SELECT * FROM tblMeasure where toid = 1" + strCOPY = "SELECT * FROM tblMeasure" ' where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + +' strCOPY = "SELECT * FROM tbloption where toid = 7" + strCOPY = "SELECT * FROM tbloption" ' where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Str(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer +'Dim strFINISH As String + On Error GoTo Error_EH + +' strFINISH = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else '********* there is a problem here because it tries to add another labor record compare to how it is in frmTAKE + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew +' moRSLAB!texture = Field2Str(strFINISH) + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) +' moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + + lstOptMatrl.col = 4 + strINVNO = lstOptMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstTOMatrl.col = 4 + strINVNO = lstTOMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + moRSCMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + Call FormClear + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + If moRS!P_RL Then + gboolPSpecialCALC = True + End If + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String, strLABOR As String + + On Error GoTo Error_EH + + With moRS + If IsNull(!origTOID) Or !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !P_RL = chkP_RL + !openflg = chkOpen + !TWOSTORY = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Pre-Mix Stucco" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" +' ElseIf cboOneKote.Text = "Pre-Mix Stucco" Then +' !stype = "P" + End If + If optPTex(0) Then + !finish = Field2Str(lblT1) + mstrFINISH = Field2Str(lblT1) +' mstrFINISH = lblFDesc1 + ElseIf optPTex(1) Then + !finish = Field2Str(lblT2) + mstrFINISH = Field2Str(lblT2) +' mstrFINISH = lblFDesc2 + ElseIf optPTex(2) Then + !finish = Field2Str(lblT3) + mstrFINISH = Field2Str(lblT3) +' mstrFINISH = lblFDesc3 + ElseIf optPTex(3) Then + !finish = Field2Str(lblT4) + mstrFINISH = Field2Str(lblT4) +' mstrFINISH = lblFDesc4 + End If + + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + + strLABOR = "SELECT * FROM tblTOLabor WHERE TEXTURE = '" & mstrFINISH & "' AND toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + If moRSLAB.EOF Then + MsgBox "Labor Rates Not Changed", vbOKOnly + + Else + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !M_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + .Update + End With + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + Call Measure_Setup + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" +' txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtBidPr1 = "0" + txtBidPr2 = "0" + txtBidPr3 = "0" + txtBidPr4 = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkOpt(0) = vbUnchecked + chkOpt(1) = vbUnchecked + chkOpt(2) = vbUnchecked + chkOpt(3) = vbUnchecked + lblFDesc1 = "" + lblFDesc2 = "" + lblFDesc3 = "" + lblFDesc4 = "" + lblT1 = "" + lblT2 = "" + lblT3 = "" + lblT4 = "" + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Pre-Mix Stucco") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 +' cboOneKote.AddItem ("Pre-Mix Stucco") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 7 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE TEXTURE = '" & mstrFINISH & "' AND TOID = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + +' strLABOR = "texture = '" & mstrFINISH & "'" +' moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB!OptNum = mintTexNum + moRSLAB.Update +' Call GetLabor + End If + +' strLABOR = "texture = '" & mstrFINISH & "'" +' moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If Not oRS.EOF Then + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!M_Rate), "##.00") + moRSLAB!M_Rate = Field2Str(oRS!M_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) + ' If chk2Story Then + ' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") + ' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) + ' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) + ' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") +' moRSLAB.Update + Else + MsgBox "No Labor Available For This Texture - Add The Figures", vbOKOnly + + End If + +' moRSLAB.Update + Call FormSave + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Option1_Click() + +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID '& " AND OptNum = " & Index + 1 + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +' Select Case Index + If optPTex(0) Then ' Case 0 + mstrFINISH = Field2Str(lblT1) + txtFinish.Text = Field2Str(lblFDesc1) + lblTexCode = mstrFINISH + moRS!finish = mstrFINISH + moRS.Update + mintTexNum = Index + 1 + End If +' optPTex(0).Value = True + If optPTex(1) Then ' Case 1 + mstrFINISH = Field2Str(lblT2) + txtFinish.Text = Field2Str(lblFDesc2) + lblTexCode = mstrFINISH + moRS!finish = mstrFINISH + moRS.Update + mintTexNum = Index + 1 + End If +' optPTex(1).Value = True + If optPTex(2) Then ' Case 2 + mstrFINISH = Field2Str(lblT3) + txtFinish.Text = Field2Str(lblFDesc3) + lblTexCode = mstrFINISH + moRS!finish = mstrFINISH + moRS.Update + mintTexNum = Index + 1 + End If +' optPTex(2).Value = True + If optPTex(3) Then ' Case 3 + mstrFINISH = Field2Str(lblT4) + txtFinish.Text = Field2Str(lblFDesc4) + lblTexCode = mstrFINISH + moRS!finish = mstrFINISH + moRS.Update + mintTexNum = Index + 1 + End If +' optPTex(3).Value = True +' End Select + +'' Select Case Index +'' Case 0 +'' mstrFINISH = Field2Str(lblT1) +'' txtFinish.Text = Field2Str(lblFDesc1) +'' lblTexCode = mstrFINISH +'' moRS!finish = mstrFINISH +'' mintTexNum = Index + 1 +' optPTex(0).Value = True +'' Case 1 +'' mstrFINISH = Field2Str(lblT2) +'' txtFinish.Text = Field2Str(lblFDesc2) +'' lblTexCode = mstrFINISH +'' moRS!finish = mstrFINISH +'' mintTexNum = Index + 1 +' optPTex(1).Value = True +'' Case 2 +'' mstrFINISH = Field2Str(lblT3) +'' txtFinish.Text = Field2Str(lblFDesc3) +'' lblTexCode = mstrFINISH +'' moRS!finish = mstrFINISH +'' mintTexNum = Index + 1 +' optPTex(2).Value = True +'' Case 3 +'' mstrFINISH = Field2Str(lblT4) +'' txtFinish.Text = Field2Str(lblFDesc4) +'' lblTexCode = mstrFINISH +'' moRS!finish = mstrFINISH +'' mintTexNum = Index + 1 +' optPTex(3).Value = True +'' End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE texture = '" & mstrFINISH & "' and toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + +' strLABOR = "texture = '" & mstrFINISH & "'" +' moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If +' Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatInvNo_LostFocus() + txtMatInvNo = UCase(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown +Dim strFINISH As String + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 3 Then + strFINISH = InputBox("Enter The Finish Code (ie SK,MN etc)", "Enter Finish") + moRS!finish = UCase(strFINISH) + moRS.Update + End If + Exit Sub + End If + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMInvNo_LostFocus() + txtOMInvNo = UCase(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(0) Then + mstrFINISH = Field2Str(lblT1) + ElseIf optPTex(1) Then + mstrFINISH = Field2Str(lblT2) + ElseIf optPTex(2) Then + mstrFINISH = Field2Str(lblT3) + ElseIf optPTex(3) Then + mstrFINISH = Field2Str(lblT4) + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!NEWTOID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub + +Private Sub SecondLoad9() +Dim strSQL As String, strOpt As String, strMOD As String +Dim oRS As Recordset, intCNT As Integer, boolSKIP As Boolean +Dim strSEARCH As String, strDESC As String, strTEXTURE As String +Dim oRSF As Recordset, strSQLF As String + + On Error GoTo Error_EH + boolSKIP = False + + strSQL = "SELECT toid, texture, bidprice, OptNum FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic + + + intCNT = 1 + Do Until oRS.EOF + strSEARCH = oRS!texture + strSQLF = "SELECT id, desc FROM tblFINISH WHERE id = '" & strSEARCH & "'" + Set oRSF = New Recordset + oRSF.Open strSQLF, goConn, adOpenForwardOnly, adLockReadOnly + If oRSF.EOF Then + MsgBox "Texture Was Not Found", vbOKOnly + oRSF.Close + Exit Sub + Else + strTEXTURE = Field2Str(oRSF!id) + strDESC = Field2Str(oRSF!Desc) + oRSF.Close + End If + + + If intCNT = 1 Then + chkOpt(0) = vbChecked + lblT1 = strTEXTURE + lblFDesc1 = strDESC + End If + If intCNT = 2 Then + chkOpt(1) = vbChecked + lblT2 = strTEXTURE + lblFDesc2 = strDESC + End If + If intCNT = 3 Then + chkOpt(2) = vbChecked + lblT3 = strTEXTURE + lblFDesc3 = strDESC + End If + If intCNT = 4 Then + chkOpt(3) = vbChecked + lblT4 = strTEXTURE + lblFDesc4 = strDESC + End If + intCNT = intCNT + 1 + oRS.MoveNext + Loop + + Exit Sub + + oRS.MoveFirst + Do Until oRS.EOF + If oRS!texture = "SK" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SKIP TROWEL:" + txtFinish = "SKIP TROWEL" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") +' lblTexCode = "SK" + ElseIf oRS!OptNum = 2 Then 'NEED TO CHECK WHY TEXTURE CODE NOT CHANGING + chkOpt(1) = vbChecked + lblFDesc2 = "SKIP TROWEL: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SKIP TROWEL: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SKIP TROWEL: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSKIP = vbChecked +' txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SAND-16: " + txtFinish = "SAND-16" +' lblTexCode = "SK" + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SAND-16: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SAND-16: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SAND-16: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSand = vbChecked +' txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SAND-20: " + txtFinish = "SAND-20" + lblT1 = oRS!texture +' lblTexCode = "SK" + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SAND-20: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SAND-20: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SAND-20: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSand = vbChecked +' txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SAND-30: " + txtFinish = "SAND-30" + lblT1 = oRS!texture +' lblTexCode = "SK" + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SAND-30: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SAND-30: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SAND-30: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSand = vbChecked +' txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SB" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "EIFS-SAND BLAST: " + txtFinish = "EIFS-SAND BLAST" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "EIFS-SAND BLAST: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "EIFS-SAND BLAST: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "EIFS-SAND BLAST: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSB = vbChecked +' txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "DASH: " + txtFinish = "DASH" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "DASH: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "DASH: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "DASH: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkDash = vbChecked +' txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "MONTERREY: " + txtFinish = "MONTERREY" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "MONTERREY: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "MONTERREY: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "MONTERREY: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkMonterrey = vbChecked +'' txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SMOOTH: " + txtFinish = "SMOOTH" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SMOOTH: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SMOOTH: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SMOOTH: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSmooth = vbChecked +' txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "QUERNAVACA: " + txtFinish = "QUERNAVACA" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "QUERNAVACA: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "QUERNAVACA: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "QUERNAVACA: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkQU = vbChecked +' txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SKIP AND SAND FINISH: " + txtFinish = "SKIP AND SAND FINISH" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SKIP AND SAND FINISH: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SKIP AND SAND FINISH: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SKIP AND SAND FINISH: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkDF = vbChecked +' txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "MONTERREY & SAND: " + txtFinish = "MONTERREY & SAND" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "MONTERREY & SAND: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "MONTERREY & SAND: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "MONTERREY & SAND: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkMF = vbChecked +' txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SKIP && RIVER SAND FINISH: " + txtFinish = "SKIP && RIVER SAND FINISH" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SKIP && RIVER SAND FINISH: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SKIP && RIVER SAND FINISH: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SKIP && RIVER SAND FINISH: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If +' chkSS = vbChecked +' txtSS = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QS" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "QUERNAVACA & SAND 20: " + txtFinish = "QUERNAVACA & SAND 20" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "QUERNAVACA & SAND 20: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "QUERNAVACA & SAND 20: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "QUERNAVACA & SAND 20: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "CS" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "CORNERSTONE SKIP: " + txtFinish = "CORNERSTONE SKIP" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "CORNERSTONE SKIP: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "CORNERSTONE SKIP: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "CORNERSTONE SKIP: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "S4" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SAND - RIVER: " + txtFinish = "SAND - RIVER" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SAND - RIVER: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SAND - RIVER: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SAND - RIVER: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "M2" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "MONTERREY 20 SILICA: " + txtFinish = "MONTERREY 20 SILICA" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "MONTERREY 20 SILICA: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "MONTERREY 20 SILICA: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "MONTERREY 20 SILICA: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "M3" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "MONTERREY 30 SILICA: " + txtFinish = "MONTERREY 30 SILICA" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "MONTERREY 30 SILICA: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "MONTERREY 30 SILICA: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "MONTERREY 30 SILICA: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "RL" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "RANDOM LACE: " + txtFinish = "RANDOM LACE" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "RANDOM LACE: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "RANDOM LACE: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "RANDOM LACE: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "RF" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "RANDOM LACE & SAND: " + txtFinish = "RANDOM LACE & SAND" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "RANDOM LACE & SAND: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "RANDOM LACE & SAND: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "RANDOM LACE & SAND: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "MW" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "MORTAR WASH: " + txtFinish = "MORTAR WASH" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "MORTAR WASH: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "MORTAR WASH: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "MORTAR WASH: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "SC" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "SAND 16 W/ 20 PO: " + txtFinish = "SAND 16 W/ 20 PO" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "SAND 16 W/ 20 PO: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "SAND 16 W/ 20 PO: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "SAND 16 W/ 20 PO: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "RS" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "RYLAND SKIP: " + txtFinish = "RYLAND SKIP" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "RYLAND SKIP: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "RYLAND SKIP: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "RYLAND SKIP: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "RM" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "RYLAND MONTERREY: " + txtFinish = "RYLAND MONTERREY" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "RYLAND MONTERREY: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "RYLAND MONTERREY: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "RYLAND MONTERREY: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + ElseIf oRS!texture = "RD" Then + If oRS!OptNum = 1 Then + optPTex(0).Value = True + chkOpt(0) = vbChecked + lblFDesc1 = "RYLAND SAND: " + txtFinish = "RYLAND SAND" + lblT1 = oRS!texture + txtBidPr1 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 2 Then + chkOpt(1) = vbChecked + lblFDesc2 = "RYLAND SAND: " + lblT2 = oRS!texture + txtBidPr2 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 3 Then + chkOpt(2) = vbChecked + lblFDesc3 = "RYLAND SAND: " + lblT3 = oRS!texture + txtBidPr3 = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!OptNum = 4 Then + chkOpt(3) = vbChecked + lblFDesc4 = "RYLAND SAND: " + lblT4 = oRS!texture + txtBidPr4 = Format(Field2Double(oRS!bidprice), "###,###") + End If + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module SecondLoad9" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frx new file mode 100644 index 0000000..5876be1 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTake5.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frm new file mode 100644 index 0000000..6fecb09 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frm @@ -0,0 +1,8327 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmTakeE + Caption = "Takeoff Information -- Synthetic" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 204 + Top = 1050 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 202 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 199 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 198 + Top = 1020 + Width = 1155 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 185 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 180 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 175 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 166 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 165 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 161 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 160 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 159 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 119 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 116 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 115 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 114 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 113 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 112 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTakeE.frx":0000 + Left = 8520 + List = "frmTakeE.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 150 + TabIndex = 2 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTakeE.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "lblMeDesc" + Tab(0).Control(1)= "lblMeSqFt" + Tab(0).Control(2)= "lblMeLocate" + Tab(0).Control(3)= "lblMeType" + Tab(0).Control(4)= "fraYardage" + Tab(0).Control(5)= "cmdAddMeas" + Tab(0).Control(6)= "cmdDelMeas" + Tab(0).Control(6).Enabled= 0 'False + Tab(0).Control(7)= "cmdSaveMeas" + Tab(0).Control(8)= "cmdUpMeasCalc" + Tab(0).Control(8).Enabled= 0 'False + Tab(0).Control(9)= "lstMeasure" + Tab(0).Control(9).Enabled= 0 'False + Tab(0).Control(10)= "txtMeDesc" + Tab(0).Control(11)= "txtMeSqFt" + Tab(0).Control(12)= "cboMeLocate" + Tab(0).Control(13)= "txtMeType" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTakeE.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "chkTransfer" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "cmdFindMat" + Tab(1).Control(7)= "cmdAddMat" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "cboMetal" + Tab(1).Control(9)= "cboMType" + Tab(1).Control(10)= "cboDFlag" + Tab(1).Control(11)= "txtMetLength" + Tab(1).Control(12)= "txtMatPrice" + Tab(1).Control(13)= "txtMatQty" + Tab(1).Control(14)= "txtMatDesc" + Tab(1).Control(15)= "txtMatInvNo" + Tab(1).Control(16)= "cmdSaveMat" + Tab(1).Control(17)= "cmdDelMat" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "lstMInventory" + Tab(1).Control(19)= "lstTOMatrl" + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTakeE.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "txtNote" + Tab(2).Control(1)= "txtO108" + Tab(2).Control(2)= "txtO68" + Tab(2).Control(3)= "chkNoInvoice" + Tab(2).Control(4)= "chkST_Others" + Tab(2).Control(5)= "txtOST_SqFt" + Tab(2).Control(6)= "chkOStone" + Tab(2).Control(7)= "cmdCopyOpt" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "cmdSaveOptMat" + Tab(2).Control(9)= "cmdSaveOpt" + Tab(2).Control(10)= "lstInventory" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "cmdFindOptMat" + Tab(2).Control(12)= "cboOMMetal" + Tab(2).Control(13)= "cboOMType" + Tab(2).Control(14)= "cboOMDFlag" + Tab(2).Control(15)= "txtOMMetL" + Tab(2).Control(16)= "txtOMPrice" + Tab(2).Control(17)= "txtOMQty" + Tab(2).Control(18)= "txtOMDesc" + Tab(2).Control(19)= "txtOMInvNo" + Tab(2).Control(20)= "cmdDelOptMat" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdAddOptMat" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdDelOpt" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdAddOpt" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "txtOFAdj" + Tab(2).Control(26)= "txtOFin2" + Tab(2).Control(27)= "cboOFinish" + Tab(2).Control(28)= "txtOBAmt" + Tab(2).Control(29)= "txtOYdge" + Tab(2).Control(30)= "txtODesc" + Tab(2).Control(31)= "lstOptions" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "Label1" + Tab(2).Control(33)= "lblOptNum" + Tab(2).Control(34)= "lblScaf10" + Tab(2).Control(35)= "Scaf6" + Tab(2).Control(36)= "lblOScaffold" + Tab(2).Control(37)= "lblOStone" + Tab(2).Control(38)= "lblOMMLength" + Tab(2).Control(39)= "lblOMCFlag" + Tab(2).Control(40)= "lblOMMType" + Tab(2).Control(41)= "lblOMDFlag" + Tab(2).Control(42)= "lblOMPrice" + Tab(2).Control(43)= "lblOMQty" + Tab(2).Control(44)= "lblOMDesc" + Tab(2).Control(45)= "lblOMInvNo" + Tab(2).Control(46)= "lblOFadj" + Tab(2).Control(47)= "lblOFin2" + Tab(2).Control(48)= "lblOTexture" + Tab(2).Control(49)= "lblBAmt" + Tab(2).Control(50)= "lblYrdge" + Tab(2).ControlCount= 51 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTakeE.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblStucLab" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblLathLab" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblMetLab" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblScaf" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblTape" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMisc" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblTtlMat" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblMatMU" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblLaborBurden" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlCost" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMarkup" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblOH" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "Line1" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "Line2" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblBidPrice" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "lblBidwCMU" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "lblCMUPr" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblSQYDPR" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "Line3" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblBurDesc" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "Line4" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "lblFSkip" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblFDash" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "lblFSmooth" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblPrimary" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblOptTextures" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "Line5" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "Line6" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "txtStucLab" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "txtLathLab" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "txtMetLab" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "txtScafGas" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "txtTape" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "txtTtlMat" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "txtMisc" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "txtMatMU" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "txtLabBur" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "txtTtlCost" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "txtMURate" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtTtlMU" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtOH" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtOHRate" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtBidPrice" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtBidPrwCMU" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtCMURate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtCMUPrice" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtPrSQYD" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "fraPrimary" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "fraSecond" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSkipPr" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtSandPr" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtDashPr" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "cmdCalcPrimary" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "cmdCalcOptTexture" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMatMURate" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).ControlCount= 55 + Begin VB.TextBox txtNote + Enabled = 0 'False + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.TextBox txtO108 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 197 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 196 + Top = 1845 + Width = 675 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Enabled = 0 'False + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Enabled = 0 'False + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Enabled = 0 'False + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 184 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 225 + Left = -66780 + TabIndex = 181 + Top = 3405 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1575 + TabIndex = 183 + Top = 30 + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 150 + TabIndex = 182 + Top = 15 + Value = -1 'True + Width = 1215 + End + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 179 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 270 + Left = -64860 + TabIndex = 176 + TabStop = 0 'False + Top = 375 + Width = 1140 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 167 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 164 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 163 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Visible = 0 'False + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Enabled = 0 'False + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 162 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 240 + Left = -64860 + TabIndex = 149 + TabStop = 0 'False + Top = 600 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTakeE.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2700 + Visible = 0 'False + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -65385 + Picture = "frmTakeE.frx":04B6 + Style = 1 'Graphical + TabIndex = 140 + Top = 390 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Enabled = 0 'False + Height = 315 + ItemData = "frmTakeE.frx":08F8 + Left = -65400 + List = "frmTakeE.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Visible = 0 'False + Width = 1275 + End + Begin VB.ComboBox cboOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmTakeE.frx":0913 + Left = -65400 + List = "frmTakeE.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Visible = 0 'False + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Enabled = 0 'False + Height = 315 + ItemData = "frmTakeE.frx":0917 + Left = -68160 + List = "frmTakeE.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Visible = 0 'False + Width = 915 + End + Begin VB.TextBox txtOMDesc + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Visible = 0 'False + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 5 + TabIndex = 37 + Top = 2760 + Visible = 0 'False + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 150 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTakeE.frx":0935 + Left = -68100 + List = "frmTakeE.frx":093F + Style = 2 'Dropdown List + TabIndex = 146 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTakeE.frx":0950 + Left = -68100 + List = "frmTakeE.frx":0952 + Style = 2 'Dropdown List + TabIndex = 145 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTakeE.frx":0954 + Left = -68100 + List = "frmTakeE.frx":095E + Style = 2 'Dropdown List + TabIndex = 144 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 147 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 143 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 142 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 141 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 139 + Top = 480 + Width = 2625 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 128 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTakeE.frx":0972 + Left = -69720 + List = "frmTakeE.frx":0974 + Style = 2 'Dropdown List + TabIndex = 127 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 126 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 125 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 120 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 118 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 129 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 111 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 130 + Top = 2940 + Width = 2115 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 148 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 110 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 109 + TabStop = 0 'False + Top = 4020 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 108 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 107 + TabStop = 0 'False + Top = 1560 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 106 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 105 + TabStop = 0 'False + Top = 900 + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 1065 + Left = 8760 + TabIndex = 101 + Top = 840 + Visible = 0 'False + Width = 495 + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 104 + TabStop = 0 'False + Top = 780 + Visible = 0 'False + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 103 + TabStop = 0 'False + Top = 450 + Visible = 0 'False + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 102 + TabStop = 0 'False + Top = 180 + Visible = 0 'False + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 1065 + Left = 7980 + TabIndex = 97 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 178 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 177 + TabStop = 0 'False + Top = 490 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 99 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 93 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 60 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 91 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 59 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 61 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 90 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 89 + TabStop = 0 'False + Top = 1140 + Width = 1000 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 88 + TabStop = 0 'False + Top = 780 + Width = 1000 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 87 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 86 + TabStop = 0 'False + Top = 420 + Width = 1000 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 78 + TabStop = 0 'False + Top = 3660 + Width = 1000 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 76 + TabStop = 0 'False + Top = 3300 + Width = 1000 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2580 + TabIndex = 58 + Top = 2580 + Width = 1000 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 73 + TabStop = 0 'False + Top = 2940 + Width = 1000 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 72 + TabStop = 0 'False + Top = 2205 + Width = 1000 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 71 + TabStop = 0 'False + Top = 1860 + Width = 1000 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 70 + TabStop = 0 'False + Top = 1500 + Width = 1000 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 69 + TabStop = 0 'False + Top = 1140 + Width = 1000 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 68 + TabStop = 0 'False + Top = 780 + Width = 1000 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Enabled = 0 'False + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Enabled = 0 'False + Height = 315 + ItemData = "frmTakeE.frx":0976 + Left = -70305 + List = "frmTakeE.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Enabled = 0 'False + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Enabled = 0 'False + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 168 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 188 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 186 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 174 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 173 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 172 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 171 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 170 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 169 + Top = 780 + Width = 870 + End + End + Begin LpLib.fpList lstMInventory + Height = 2040 + Left = -66900 + TabIndex = 206 + Top = 1245 + Visible = 0 'False + Width = 3270 + _Version = 196608 + _ExtentX = 5768 + _ExtentY = 3598 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTakeE.frx":097A + End + Begin LpLib.fpList lstTOMatrl + Height = 3960 + Left = -74895 + TabIndex = 207 + Top = 585 + Width = 5355 + _Version = 196608 + _ExtentX = 9446 + _ExtentY = 6985 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 6 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= 0 'False + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmTakeE.frx":0D91 + End + Begin VB.Label Label1 + Alignment = 2 'Center + BackColor = &H0080FFFF& + Caption = "Options are not updated for expanded inventory because no options are allowed with Synthetic" + BeginProperty Font + Name = "Arial" + Size = 14.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 1965 + Left = -67965 + TabIndex = 208 + Top = 2745 + Width = 2820 + End + Begin VB.Line Line6 + BorderWidth = 2 + X1 = 6375 + X2 = 11325 + Y1 = 1920 + Y2 = 1920 + End + Begin VB.Line Line5 + BorderWidth = 2 + X1 = 0 + X2 = 2820 + Y1 = 0 + Y2 = 0 + End + Begin VB.Label lblOptNum + Height = 270 + Left = -74745 + TabIndex = 205 + Top = 390 + Width = 2400 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 195 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 194 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 193 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Enabled = 0 'False + Height = 195 + Left = -66285 + TabIndex = 187 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 158 + Top = 4380 + Visible = 0 'False + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 157 + Top = 3990 + Visible = 0 'False + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 156 + Top = 3600 + Visible = 0 'False + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 155 + Top = 4380 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 154 + Top = 3990 + Visible = 0 'False + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 153 + Top = 3600 + Visible = 0 'False + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 152 + Top = 3210 + Visible = 0 'False + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 151 + Top = 2820 + Visible = 0 'False + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 138 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 137 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 136 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 135 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 134 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 133 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 132 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 131 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 124 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 123 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 122 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 121 + Top = 660 + Width = 840 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 100 + Top = 420 + Visible = 0 'False + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 98 + Top = 420 + Width = 735 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Texture Synthetic" + Height = 195 + Left = 6705 + TabIndex = 96 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblFDash + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sahara Synthetic: " + Height = 195 + Left = 6645 + TabIndex = 95 + Top = 1305 + Width = 1305 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Fine Synthetic: " + Height = 195 + Left = 6855 + TabIndex = 94 + Top = 1005 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 92 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 85 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 84 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 83 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 82 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 81 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 80 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 79 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 77 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 75 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1500 + TabIndex = 74 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1380 + TabIndex = 67 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 1620 + TabIndex = 66 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 1485 + TabIndex = 65 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EMPL Metal/Plastic Labor:" + Height = 195 + Left = 675 + TabIndex = 64 + Top = 1560 + Width = 1905 + End + Begin VB.Label lblLathLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EFSH,EFOA,ERAS,ENET Lath Labor:" + Height = 435 + Left = 495 + TabIndex = 63 + Top = 1110 + Width = 2070 + WordWrap = -1 'True + End + Begin VB.Label lblStucLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ESEN,EFIN,EHIM Stucco Labor:" + Height = 195 + Left = 60 + TabIndex = 62 + Top = 855 + Width = 2505 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Enabled = 0 'False + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Enabled = 0 'False + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Enabled = 0 'False + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Enabled = 0 'False + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 203 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 201 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 200 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 192 + Top = 1380 + Width = 795 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 945 + Left = 8625 + TabIndex = 191 + Top = 1005 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 190 + Top = 1200 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 189 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 117 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 21 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTakeE" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long, mboolBAD As Boolean +Dim mboolSHOW As Boolean, mboolCALC As Boolean, mstrWIRE As String +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean +Dim mboolSYN As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + +' If chkDash = vbUnchecked And Not optPTex(4) Then +' txtDashPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkDF = vbUnchecked And Not optPTex(8) Then +' txtDFPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkMF = vbUnchecked And Not optPTex(10) Then +' txtMFPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkSS = vbUnchecked And Not optPTex(11) Then +' txtSS = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkMonterrey = vbUnchecked And Not optPTex(6) Then +' txtMonterreyPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkQU = vbUnchecked And Not optPTex(7) Then +' txtQUPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(0) Then +' txtSandPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(1) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +'' oRS.Delete +' End If +' End If +' If Not chkSand = vbUnchecked And optPTex(2) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSB = vbUnchecked And Not optPTex(9) Then +' txtSBPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSkip = vbUnchecked And Not optPTex(3) Then +' txtSkipPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSmooth = vbUnchecked And Not optPTex(5) Then +' txtSmoothPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() + Dim intBOOKMARK As Integer + intBOOKMARK = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If +' If moRS!finish = "DW" Then +' +' Else +'' If moRS!stype <> "T" Then + Call CalcOneKote +'' End If +'' If moRS!stype = "T" Then +'' Call CalcThreeKote +'' End If +' End If + If mboolBAD Then + MsgBox "Takeoff Calculation Was Not Completed - Wire Error" + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + Exit Sub + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBOOKMARK + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + mboolCALC = False + + Call UpTexture + +' strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID +' goConn.Execute strSELECT + +' Call LoadCMat + +' If Not mboolCALC Then +' MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" +' Exit Sub +' End If + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + +'' moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) +'' oRSS.Close + +' moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) +' moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) +' moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) +' moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + +' moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + +'' dblLC = Int(((Field2Long(txtLathYds) / 25) * 2) + 0.99) + +'' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1820 and toid = " & gintTOID +'' Set oRC = New Recordset +'' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly +'' If oRC.EOF Then +'' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1820 and Inv_Type = " & gbytINV_TYPE +'' Set oRSS = New Recordset +'' oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSS.EOF Then +'' moRSCMat.AddNew +'' moRSCMat!toid = gintTOID +'' moRSCMat!inv_no = Field2Str(oRSS!inv_no) +'' moRSCMat!Desc = Field2Str(oRSS!Desc) +'' moRSCMat!qty = dblLC +'' moRSCMat!price = Field2Str(oRSS!tprice) +'' moRSCMat!d_flag = Field2Str(oRSS!d_flag) +'' moRSCMat!m_type = Field2Str(oRSS!m_type) +'' moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) +'' moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) +'' moRSCMat!cflag = vbChecked +'' moRSCMat!trnsflag = vbUnchecked +'' moRSCMat.Update +'' End If +'' End If + + +'Calculate Foam +'' dblFOAM = Field2Long(txtLathYds) - Field2Integer(txtFoamAdj) + + +'' txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) +'' txtTape = Int((Field2Long(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) +'' txtOH = Int((Field2Long(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +'' txtStucLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) +'' txtLathLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) +'' txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) +'' txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + + txtMatMU = Int((Field2Long(txtTtlMat) * (Format(Field2Str2(txtMatMURate), "general number")) + 0.99)) + dblSUM = CDbl(Field2Str2(txtStucLab)) + CDbl(Field2Str2(txtLathLab)) + dblSUM = dblSUM + Field2Long(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Long(txtMisc) + Field2Long(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(Field2Str2(txtMURate), "general number")) + 0.99) + txtOH = Int((Field2Long(txtTtlCost) * Field2Str(txtOHRate)) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + + If mstrWIRE = "O" Then + MsgBox "The Wire Type selected in projects is not correct for Three Coat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = 0 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2412' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2412' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2411' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2411' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2432' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2432' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2431' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2431' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + End If + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + +' If dblRS > 0 Then +' txtSandTons = dblRS +' End If + +'''' lngSandBatch = dblKote1 + dblCMNT +'''' dblSandBag = lngSandBatch * dblBagBatch + +'''' If moRSProj!BagSand Then +'''' If dblSandBag > 0 Then +'''' lblSand = "Sand Bags:" +'''' dblSandBag = Int((dblSandBag) + 0.99) +'''' txtSandTons = dblSandBag +'''' End If +'''' Else +'''' If dblRS > 0 Then +'''' lblSand = "Sand Tons:" +'''' dblRS = Int((dblRS) + 0.99) +'''' txtSandTons = dblRS +'''' End If +'''' End If + + +'Calculate Black paper +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + 'Changed from 1.5 to 2 layers per Jesse 03/24/2010 + If moRSProj!bp_type <> "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1809' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1809' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + If mstrWIRE = "P" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1450' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1450' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 27) + 0.99) 'For bid purposes - use 33 for production purposes + ' moRSCMat!qty = Int((dblWire / 33) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + If mstrWIRE = "F" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1417' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1417' and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) ' For bid purposes - use 45 for production + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1616'" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Long(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1705'" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1820'" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) +'' txtMetalFt = dblMETAL +' If Field2Integer(txtSandTons) < 16 Then +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + 30 +' Else +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' End If +'''' If Not moRSProj!BagSand Then +'''' If Field2Str(txtSandTons) < 16 Then +'''' dblSplitCost = Field2Str2(moRSProj!splitcst) +'''' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +'''' txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 +'''' Else +'''' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +'''' End If +'''' Else +'''' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +'''' End If +'' If chk2Story Then +'' txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) +'' Else +'' txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) +'' End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) +'''' txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) +'''' txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +'' txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) +'' txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) +'' txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) +' dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > '1899' and Inv_no < '2000' and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOPTMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOPTMatrl.ListCount > 0 Then + If lstOPTMatrl.ListCount > mintBOOKMARK2 Then + lstOPTMatrl.ListIndex = mintBOOKMARK2 + Else + lstOPTMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOPTMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = '" & txtMatInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!PROJ_ID + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!PROJ_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset, intYN As Integer +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String, intYN As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + intYN = MsgBox("Do You Want To Print To Printer?", vbYesNo, "Printer or Window") + If intYN = vbNo Then + crTake.Destination = crptToWindow + ElseIf intYN = vbYes Then + crTake.Destination = crptToPrinter + End If + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> "" Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOSt_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOSt_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Str(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Str2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDflag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDflag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Str2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDflag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDflag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOPTMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOPTMatrl.ListIndex = intSAVE2 + lstOPTMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Str(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(0) Then + mstrFINISH = "FN" + ElseIf optPTex(1) Then + mstrFINISH = "SH" + ElseIf optPTex(2) Then + mstrFINISH = "TX" +'' ElseIf optPTex(9) Then +'' mstrFINISH = "SB" +'' ElseIf optPTex(1) Then +'' mstrFINISH = "S2" +'' ElseIf optPTex(2) Then +'' mstrFINISH = "S3" +'' ElseIf optPTex(8) Then +'' mstrFINISH = "DF" +'' ElseIf optPTex(5) Then +'' mstrFINISH = "SM" +'' ElseIf optPTex(7) Then +'' mstrFINISH = "QU" +'' ElseIf optPTex(6) Then +'' mstrFINISH = "MN" +'' ElseIf optPTex(10) Then +'' mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False +' txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset, strINVNO As String +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + lstMInventory.col = 0 + strINVNO = lstMInventory.ColText + + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = '" & strINVNO & "'" + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = '" & strINVNO & "' and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE & " ORDER BY Inv_No" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" & " ORDER BY Inv_No" + End If + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + ' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDflag.Text = "Supplier" + Else + cboOMDflag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDflag.Text = "Supplier" + Else + cboOMDflag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds)) ' - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) +' txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) +' txtStuccoYds = Field2Long(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +'' If moRSProj!BagSand Then +'' lblSand = "Sand Bags:" +'' Else +'' lblSand = "Sand Tons:" +'' End If +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "FN" Then +' chkSkip = vbChecked +' txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SH" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "TX" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "S3" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SB" Then +' chkSB = vbChecked +' txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "TX" Then +' chkDash = vbChecked +' txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "MN" Then +' chkMonterrey = vbChecked +' txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SM" Then +' chkSmooth = vbChecked +' txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "QU" Then +' chkQU = vbChecked +' txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "DF" Then +' chkDF = vbChecked +' txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "MF" Then +' chkMF = vbChecked +' txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SS" Then +' chkSS = vbChecked +' txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module SecondLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + mstrWIRE = Field2Str(moRSProj!wire) + gbytINV_TYPE = Field2Str(moRSProj!inv_type) + + If moRSProj!SYNTHETIC Then + mboolSYN = True + Else + mboolSYN = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish WHERE area = 'E'" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" +' chkSB = vbUnchecked +' txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" +' chkMonterrey = vbUnchecked +' txtMonterreyPr = "" +' chkSmooth = vbUnchecked +' txtSmoothPr = "" +' chkQU = vbUnchecked +' txtQUPr = "" +' chkDF = vbUnchecked +' txtDFPr = "" +' chkSS = vbUnchecked +' txtSS = "" +' chkMF = vbUnchecked +' txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String +Dim dblSplitCost As Double + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + With moRS + mstrFINISH = Field2Str(!finish) +'' chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) +'' txtSandTons = Field2Integer(!SAND_TONS) +'' txtSandPrice = Format(Field2Str(!sand), "##.00") +'' txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") +'' chk2Story = Field2CheckBox(!twostory) +'' If chk2Story Then +'' lbl2S.Caption = "2S" +'' Else +'' lbl2S.Caption = "" +'' End If +'' txt68 = Field2Str2(!Scaf6) +'' txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtCreated = txtCreated & " " & Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtCreated = txtCreated & " " & Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) +' If Not moRSProj!BagSand Then +' If Field2Integer(txtSandTons) < 16 Then +' dblSplitCost = Field2Str2(moRSProj!spitcst) +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Str2(txtSandAmt) + 40 +' Else +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +' End If +' Else +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +' End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") + txtMatMURate = Format(Field2Str(!MTMU), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "FN" Then + txtFinish.Text = "FINE SYNTHETIC" + txtSkipPr = Format(Field2Str2(!bidp), "#,#") + optPTex(0).Value = True + ElseIf !finish = "SH" Then + txtFinish.Text = "SAHARA SYNTHETIC" + txtSandPr = Format(Field2Str2(!bidp), "#,#") + optPTex(1).Value = True + ElseIf !finish = "TX" Then + txtFinish.Text = "TEXTURE SYNTHETIC" + txtDashPr = Format(Field2Str2(!bidp), "#,#") + optPTex(2).Value = True +' ElseIf !finish = "S2" Then +' txtFinish.Text = "Sand - 20" +' optPTex(1).Value = True +' ElseIf !finish = "S3" Then +' txtFinish.Text = "Sand - 30" +' optPTex(2).Value = True +' ElseIf !finish = "DA" Then +' txtFinish.Text = "Dash" +' optPTex(4).Value = True +' ElseIf !finish = "DF" Then +' txtFinish.Text = "Skip and Sand Finish" +' optPTex(8).Value = True +' ElseIf !finish = "SM" Then +' txtFinish.Text = "Smooth" +' optPTex(5).Value = True +' ElseIf !finish = "QU" Then +' txtFinish.Text = "Quernavaca" +' optPTex(7).Value = True +' ElseIf !finish = "MN" Then +' txtFinish.Text = "Monterrey" +' optPTex(6).Value = True +' ElseIf !finish = "MF" Then +' txtFinish.Text = "Monterrey & Sand" +' optPTex(10).Value = True +' ElseIf !finish = "SS" Then +' txtFinish.Text = "Skip and R Sand Finish" +' optPTex(11).Value = True + End If + + ' On Error Resume Next +' If !stype = "S" Then +' cboOneKote = "Superwall" +' ElseIf !stype = "M" Then +' cboOneKote = "Magna Wall" +' ElseIf !stype = "T" Then +' cboOneKote = "Three Coat" + If !stype = "C" Then + cboOneKote = "Synthetic" +' ElseIf !stype = "B" Then +' cboOneKote = "Synthetic over 1 Kote" +' ElseIf !stype = "W" Then +' cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type +' If txtInvType = "0" Then +' lblInvType = "Original" +' ElseIf txtInvType = "1" Then +' lblInvType = "Tract Homes" +' ElseIf txtInvType = "2" Then +' lblInvType = "Custom Homes" +' ElseIf txtInvType = "3" Then +' lblInvType = "Multi Family" + If txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB +' txtSLRate = Format(Field2Str(!s_rate), "##.00") +' txtLLRate = Format(Field2Str(!l_rate), "##.00") +' txtMLRate = Format(Field2Str(!m_Rate), "##.00") +'' txtMatMURate = Format(Field2Str(!matmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +'' txtMURate = Format(Field2Str(!mu), "percent") +'' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + ElseIf !d_flag = "Y" Then + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOSt_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + lblOptNum = "Option Number " & Trim(Field2Str(!OPTID)) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDflag.Text = "Supplier" + Else + cboOMDflag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!PROJ_ID = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True 'is this causing problems when moving + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Long(oRS!toid) +' gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Str(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblOption" ' where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Str(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String, strINVNO As String + +' lstOptMatrl.col = 4 + strINVNO = lstOPTMatrl.ItemData(lstOPTMatrl.ListIndex) + + strSQL = "SELECT * FROM tblOptMatrl WHERE OPTID = " & gintOPTID & " and Inv_No = '" & strINVNO & "'" + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String, strINVNO As String + On Error GoTo Error_EH + + lstTOMatrl.col = 4 + strINVNO = lstTOMatrl.ColText + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = '" & strINVNO & "'" +' strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If IsNull(!origTOID) Or !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) +'' !SAND_TONS = Integer2Field(txtSandTons) +'' !sand = Str2Field(txtSandPrice) +'' !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) + !MTMU = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !mu = Str2Field(Format(txtMURate, "general number")) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) +'' !openflg = chkOpen +'' !twostory = chk2Story +'' !Scaf6 = Integer2Field(txt68) +'' !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + +' If cboOneKote.Text = "Superwall" Then +' !stype = "S" +' ElseIf cboOneKote.Text = "Magna Wall" Then +' !stype = "M" +' ElseIf cboOneKote.Text = "Three Coat" Then +' !stype = "T" + If cboOneKote.Text = "Synthetic" Then + !stype = "C" +' ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then +' !stype = "B" +' ElseIf cboOneKote.Text = "San Man" Then +' !stype = "N" +' ElseIf cboOneKote.Text = "Western 1 Kote" Then +' !stype = "W" + End If +' If optPTex(3) Then +' !finish = "SK" +' ElseIf optPTex(4) Then +' !finish = "DA" + If optPTex(0) Then + !finish = "FN" +' ElseIf optPTex(9) Then +' !finish = "SB" + ElseIf optPTex(1) Then + !finish = "SH" + ElseIf optPTex(2) Then + !finish = "TX" +' ElseIf optPTex(8) Then +' !finish = "DF" +' ElseIf optPTex(5) Then +' !finish = "SM" +' ElseIf optPTex(7) Then +' !finish = "QU" +' ElseIf optPTex(6) Then +' !finish = "MN" +' ElseIf optPTex(10) Then +' !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB ' Do Not Delete This From The Code +' !s_rate = Str2Field(txtSLRate) +' !l_rate = Str2Field(txtLLRate) +' !m_Rate = Str2Field(txtMLRate) +' !scr = Str2Field(txtSGRate) +' !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) +' !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) +' !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOPTMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" +' txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" +'' txtSandTons = "0" +'' txtSandPrice = "0" +'' txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" +'' txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" +'' txtSLRate = "0" +'' txtLLRate = "0" +'' txtMLRate = "0" +'' txtSGRate = "0" +'' txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" +' txtSmoothPr = "0" +' txtMonterreyPr = "0" +' txtQUPr = "0" +' txtDFPr = "0" +' txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 +'' txt68 = "" +'' txt108 = "" +'' txtO68 = "" +'' txtO108 = "" +'' chk2Story = vbUnchecked +'''' chkSand.Value = vbUnchecked +'''' chkSkip.Value = vbUnchecked +'''' chkDash.Value = vbUnchecked +' chkSmooth.Value = vbUnchecked +' chkMonterrey.Value = vbUnchecked +' chkQU.Value = vbUnchecked +' chkDF.Value = vbUnchecked +' chkSB.Value = vbUnchecked +' chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() +' cboOneKote.AddItem ("Superwall") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 1 +' cboOneKote.AddItem ("Magna Wall") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 2 +' cboOneKote.AddItem ("Three Coat") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 3 +' cboOneKote.AddItem ("Western 1 Kote") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 +' cboOneKote.AddItem ("Synthetic Over 1 Kote") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID & " ORDER BY Inv_No" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOPTMatrl.Clear + + Do Until oRS.EOF + With lstOPTMatrl + + strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine +' .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOPTMatrl.ListCount Then + lstOPTMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOSt_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOPTMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOSt_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOPTMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDflag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOPTMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOPTMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDflag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOPTMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOPTMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDflag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'' txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") +'' moRSLAB!s_rate = Field2Str(oRS!s_rate) +'' txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") +'' moRSLAB!l_rate = Field2Str(oRS!l_rate) +'' txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") +'' moRSLAB!m_Rate = Field2Str(oRS!m_Rate) +'' txtTPRate = Field2Str(oRS!tp) +'' moRSLAB!tp = Field2Str(oRS!tp) +'' txtMURate = Format(Field2Str(oRS!mu), "percent") +'' moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else +'' txtSGRate = Format(Field2Str(oRS!scr), "##.00") +'' moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "FN" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "SH" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "TX" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH +'' Case 3 +'' mstrFINISH = "SK" +'' txtFinish.Text = "SKIP TROWEL" +'' moRS!finish = mstrFINISH +'' Case 4 +'' mstrFINISH = "DA" +'' txtFinish.Text = "DASH" +'' moRS!finish = mstrFINISH +'' Case 5 +'' mstrFINISH = "SM" +'' txtFinish.Text = "SMOOTH" +'' moRS!finish = mstrFINISH +'' Case 6 +'' mstrFINISH = "MN" +'' txtFinish.Text = "MONTERREY" +'' moRS!finish = mstrFINISH +'' Case 7 +'' mstrFINISH = "QU" +'' txtFinish.Text = "QUERNAVACA" +'' moRS!finish = mstrFINISH +'' Case 8 +'' mstrFINISH = "DF" +'' txtFinish.Text = "SKIP AND SAND FINISH" +'' moRS!finish = mstrFINISH +'' Case 9 +'' mstrFINISH = "SB" +'' txtFinish.Text = "EIFS - SANDBLAST" +'' moRS!finish = mstrFINISH +'' Case 10 +'' mstrFINISH = "MF" +'' txtFinish.Text = "MONTERREY & SAND" +'' moRS!finish = mstrFINISH +'' Case 11 +'' mstrFINISH = "SS" +'' txtFinish.Text = "SKIP AND RSAND FINISH" +'' moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + + If tabTake.Tab = 2 Then + MsgBox "Options Are Not Available For Synthetic Jobs", vbOKOnly, "Invalid Selection" + tabTake.Tab = PreviousTab +' txtNotes.SetFocus + Exit Sub + End If + + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +''Private Sub txt108_GotFocus() +'' Call FieldSelect(txt108) +''End Sub + +''Private Sub txt68_GotFocus() +'' Call FieldSelect(txt68) +''End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatInvNo_LostFocus() + txtMatInvNo = UCase(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +' If tabTake.Tab = 3 Then +' txtSandPrice.SetFocus +' End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOHRate_GotFocus() + Call FieldSelect(txtOHRate) +End Sub + +Private Sub txtOHRate_LostFocus() +Dim dblOHRate As Double, dblOH As Double, dblMatCost + + + +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +'Private Sub txtSandPrice_GotFocus() +' Call FieldSelect(txtSandPrice) +'End Sub + +Private Sub UpTexture() + If optPTex(1) Then + mstrFINISH = "SH" + ElseIf optPTex(2) Then + mstrFINISH = "TX" + ElseIf optPTex(0) Then + mstrFINISH = "FN" +'' ElseIf optPTex(9) Then +'' mstrFINISH = "SB" +'' ElseIf optPTex(1) Then +'' mstrFINISH = "S2" +'' ElseIf optPTex(2) Then +'' mstrFINISH = "S3" +'' ElseIf optPTex(8) Then +'' mstrFINISH = "DF" +'' ElseIf optPTex(5) Then +'' mstrFINISH = "SM" +'' ElseIf optPTex(7) Then +'' mstrFINISH = "QU" +'' ElseIf optPTex(6) Then +'' mstrFINISH = "MN" +'' ElseIf optPTex(10) Then +'' mstrFINISH = "MF" +'' ElseIf optPTex(11) Then +'' mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!NEWTOID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frx new file mode 100644 index 0000000..d4d2ae5 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeE.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHOLD.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHOLD.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHOLD.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHold.frm new file mode 100644 index 0000000..0b33e3b --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakeEHold.frm @@ -0,0 +1,8981 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmTakeE + Caption = "Takeoff Information -- Synthetic" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 206 + Top = 1050 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 204 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 201 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 200 + Top = 1020 + Width = 1155 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 187 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 182 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 177 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 168 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 167 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 162 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 161 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 160 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 119 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 116 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 115 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 114 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 113 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 112 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTakeE.frx":0000 + Left = 8520 + List = "frmTakeE.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 165 + TabIndex = 2 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTakeE.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTakeE.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "lstMInventory" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "chkTransfer" + Tab(1).Control(6).Enabled= 0 'False + Tab(1).Control(7)= "cmdFindMat" + Tab(1).Control(8)= "cmdAddMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cboMetal" + Tab(1).Control(10)= "cboMType" + Tab(1).Control(11)= "cboDFlag" + Tab(1).Control(12)= "txtMetLength" + Tab(1).Control(13)= "txtMatPrice" + Tab(1).Control(14)= "txtMatQty" + Tab(1).Control(15)= "txtMatDesc" + Tab(1).Control(16)= "txtMatInvNo" + Tab(1).Control(17)= "lstTOMatrl" + Tab(1).Control(17).Enabled= 0 'False + Tab(1).Control(18)= "cmdSaveMat" + Tab(1).Control(19)= "cmdDelMat" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "lblMatDesc" + Tab(1).Control(21)= "lblMetLength" + Tab(1).Control(22)= "lblMetal" + Tab(1).Control(23)= "lblMType" + Tab(1).Control(24)= "lblDFlag" + Tab(1).Control(25)= "lblMatPrice" + Tab(1).Control(26)= "lblMatQty" + Tab(1).Control(27)= "lblInvno" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTakeE.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "lblYrdge" + Tab(2).Control(1)= "lblBAmt" + Tab(2).Control(2)= "lblOTexture" + Tab(2).Control(3)= "lblOFin2" + Tab(2).Control(4)= "lblOFadj" + Tab(2).Control(5)= "lblOMInvNo" + Tab(2).Control(6)= "lblOMDesc" + Tab(2).Control(7)= "lblOMQty" + Tab(2).Control(8)= "lblOMPrice" + Tab(2).Control(9)= "lblOMDFlag" + Tab(2).Control(10)= "lblOMMType" + Tab(2).Control(11)= "lblOMCFlag" + Tab(2).Control(12)= "lblOMMLength" + Tab(2).Control(13)= "lblOStone" + Tab(2).Control(14)= "lblOScaffold" + Tab(2).Control(15)= "Scaf6" + Tab(2).Control(16)= "lblScaf10" + Tab(2).Control(17)= "lblOptNum" + Tab(2).Control(18)= "lstOptions" + Tab(2).Control(18).Enabled= 0 'False + Tab(2).Control(19)= "txtODesc" + Tab(2).Control(20)= "txtOYdge" + Tab(2).Control(21)= "txtOBAmt" + Tab(2).Control(22)= "cboOFinish" + Tab(2).Control(23)= "txtOFin2" + Tab(2).Control(24)= "txtOFAdj" + Tab(2).Control(25)= "lstOptMatrl" + Tab(2).Control(25).Enabled= 0 'False + Tab(2).Control(26)= "cmdAddOpt" + Tab(2).Control(26).Enabled= 0 'False + Tab(2).Control(27)= "cmdDelOpt" + Tab(2).Control(27).Enabled= 0 'False + Tab(2).Control(28)= "cmdAddOptMat" + Tab(2).Control(28).Enabled= 0 'False + Tab(2).Control(29)= "cmdDelOptMat" + Tab(2).Control(29).Enabled= 0 'False + Tab(2).Control(30)= "txtOMInvNo" + Tab(2).Control(31)= "txtOMDesc" + Tab(2).Control(32)= "txtOMQty" + Tab(2).Control(33)= "txtOMPrice" + Tab(2).Control(34)= "txtOMMetL" + Tab(2).Control(35)= "cboOMDFlag" + Tab(2).Control(36)= "cboOMType" + Tab(2).Control(37)= "cboOMMetal" + Tab(2).Control(38)= "cmdFindOptMat" + Tab(2).Control(39)= "lstInventory" + Tab(2).Control(39).Enabled= 0 'False + Tab(2).Control(40)= "cmdSaveOpt" + Tab(2).Control(41)= "cmdSaveOptMat" + Tab(2).Control(42)= "cmdCopyOpt" + Tab(2).Control(42).Enabled= 0 'False + Tab(2).Control(43)= "txtNote" + Tab(2).Control(44)= "chkOStone" + Tab(2).Control(45)= "txtOST_SqFt" + Tab(2).Control(46)= "chkST_Others" + Tab(2).Control(47)= "chkNoInvoice" + Tab(2).Control(48)= "txtO68" + Tab(2).Control(49)= "txtO108" + Tab(2).ControlCount= 50 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTakeE.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblStucLab" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblLathLab" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblMetLab" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblScaf" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblTape" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMisc" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblTtlMat" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblMatMU" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblLaborBurden" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlCost" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMarkup" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblOH" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "Line1" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "Line2" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblBidPrice" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "lblBidwCMU" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "lblCMUPr" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblSQYDPR" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "Line3" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblBurDesc" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "Line4" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "lblFSkip" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblFDash" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "lblFSmooth" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblPrimary" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblOptTextures" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "Line5" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "Line6" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "txtStucLab" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "txtLathLab" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "txtMetLab" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "txtScafGas" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "txtTape" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "txtTtlMat" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "txtMisc" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "txtMatMU" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "txtLabBur" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "txtTtlCost" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "txtMURate" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtTtlMU" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtOH" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtOHRate" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtBidPrice" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtBidPrwCMU" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtCMURate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtCMUPrice" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtPrSQYD" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "fraPrimary" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "fraSecond" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSkipPr" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtSandPr" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtDashPr" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "cmdCalcPrimary" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "cmdCalcOptTexture" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMatMURate" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).ControlCount= 55 + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 199 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 198 + Top = 1860 + Width = 675 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 186 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 183 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 185 + Top = 120 + Value = -1 'True + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 184 + Top = 120 + Width = 1215 + End + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 181 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 315 + Left = -64980 + TabIndex = 178 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 169 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 166 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 165 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 164 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.ListBox lstMInventory + Height = 2010 + Left = -66840 + Sorted = -1 'True + TabIndex = 163 + TabStop = 0 'False + Top = 1260 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 315 + Left = -66360 + TabIndex = 150 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTakeE.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmTakeE.frx":04B6 + Style = 1 'Graphical + TabIndex = 141 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTakeE.frx":08F8 + Left = -65400 + List = "frmTakeE.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTakeE.frx":0913 + Left = -65400 + List = "frmTakeE.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTakeE.frx":0917 + Left = -68160 + List = "frmTakeE.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 5 + TabIndex = 37 + Top = 2760 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 151 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTakeE.frx":0935 + Left = -68100 + List = "frmTakeE.frx":093F + Style = 2 'Dropdown List + TabIndex = 147 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTakeE.frx":0950 + Left = -68100 + List = "frmTakeE.frx":0952 + Style = 2 'Dropdown List + TabIndex = 146 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTakeE.frx":0954 + Left = -68100 + List = "frmTakeE.frx":095E + Style = 2 'Dropdown List + TabIndex = 145 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 148 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 144 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 143 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 142 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 5 + TabIndex = 140 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 130 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 128 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTakeE.frx":0972 + Left = -69720 + List = "frmTakeE.frx":0974 + Style = 2 'Dropdown List + TabIndex = 127 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 126 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 125 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 120 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 118 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 129 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 111 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 131 + Top = 2940 + Width = 2115 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 149 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 110 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 109 + TabStop = 0 'False + Top = 4020 + Visible = 0 'False + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 108 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 107 + TabStop = 0 'False + Top = 1560 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 106 + TabStop = 0 'False + Top = 1260 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 105 + TabStop = 0 'False + Top = 900 + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 1065 + Left = 8760 + TabIndex = 101 + Top = 840 + Visible = 0 'False + Width = 495 + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 104 + TabStop = 0 'False + Top = 780 + Visible = 0 'False + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 103 + TabStop = 0 'False + Top = 450 + Visible = 0 'False + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 102 + TabStop = 0 'False + Top = 180 + Visible = 0 'False + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 1065 + Left = 7980 + TabIndex = 97 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 180 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 179 + TabStop = 0 'False + Top = 490 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 99 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 93 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 60 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 91 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 59 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 61 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 90 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 89 + TabStop = 0 'False + Top = 1140 + Width = 1000 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 88 + TabStop = 0 'False + Top = 780 + Width = 1000 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 87 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5265 + TabIndex = 86 + TabStop = 0 'False + Top = 420 + Width = 1000 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 78 + TabStop = 0 'False + Top = 3660 + Width = 1000 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 76 + TabStop = 0 'False + Top = 3300 + Width = 1000 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2580 + TabIndex = 58 + Top = 2580 + Width = 1000 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 73 + TabStop = 0 'False + Top = 2940 + Width = 1000 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 72 + TabStop = 0 'False + Top = 2220 + Width = 1000 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 71 + TabStop = 0 'False + Top = 1860 + Width = 1000 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 70 + TabStop = 0 'False + Top = 1500 + Width = 1000 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 69 + TabStop = 0 'False + Top = 1140 + Width = 1000 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2580 + TabIndex = 68 + TabStop = 0 'False + Top = 780 + Width = 1000 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTakeE.frx":0976 + Left = -70305 + List = "frmTakeE.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 170 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 190 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 188 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 176 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 175 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 174 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 173 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 172 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 171 + Top = 780 + Width = 870 + End + End + Begin VB.Line Line6 + BorderWidth = 2 + X1 = 6375 + X2 = 11325 + Y1 = 1920 + Y2 = 1920 + End + Begin VB.Line Line5 + BorderWidth = 2 + X1 = 0 + X2 = 2820 + Y1 = 0 + Y2 = 0 + End + Begin VB.Label lblOptNum + Height = 270 + Left = -74745 + TabIndex = 207 + Top = 390 + Width = 2400 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 197 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 196 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 195 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 189 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 159 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 158 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 157 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 156 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 155 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 154 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 153 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 152 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 139 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 138 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 137 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 136 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 135 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 134 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 133 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 132 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 124 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 123 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 122 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 121 + Top = 660 + Width = 840 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 100 + Top = 420 + Visible = 0 'False + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 98 + Top = 420 + Width = 735 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Texture Synthetic" + Height = 195 + Left = 6705 + TabIndex = 96 + Top = 1620 + Width = 1245 + End + Begin VB.Label lblFDash + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sahara Synthetic: " + Height = 195 + Left = 6645 + TabIndex = 95 + Top = 1305 + Width = 1305 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Fine Synthetic: " + Height = 195 + Left = 6855 + TabIndex = 94 + Top = 1005 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 92 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 85 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 84 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 83 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 82 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 81 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 80 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 79 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 77 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 75 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1500 + TabIndex = 74 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1380 + TabIndex = 67 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 1620 + TabIndex = 66 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 1485 + TabIndex = 65 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EMPL Metal/Plastic Labor:" + Height = 195 + Left = 675 + TabIndex = 64 + Top = 1560 + Width = 1905 + End + Begin VB.Label lblLathLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EFSH,EFOA,ERAS,ENET Lath Labor:" + Height = 435 + Left = 495 + TabIndex = 63 + Top = 1110 + Width = 2070 + WordWrap = -1 'True + End + Begin VB.Label lblStucLab + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ESEN,EFIN,EHIM Stucco Labor:" + Height = 195 + Left = 60 + TabIndex = 62 + Top = 855 + Width = 2505 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 205 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 203 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 202 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 194 + Top = 1380 + Width = 795 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 945 + Left = 8625 + TabIndex = 193 + Top = 1005 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 192 + Top = 1200 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 191 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 117 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 21 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTakeE" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long, mboolBAD As Boolean +Dim mboolSHOW As Boolean, mboolCALC As Boolean, mstrWIRE As String +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean +Dim mboolSYN As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + +' If chkDash = vbUnchecked And Not optPTex(4) Then +' txtDashPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkDF = vbUnchecked And Not optPTex(8) Then +' txtDFPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkMF = vbUnchecked And Not optPTex(10) Then +' txtMFPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' Exit Sub +' End If +' End If +' If chkSS = vbUnchecked And Not optPTex(11) Then +' txtSS = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkMonterrey = vbUnchecked And Not optPTex(6) Then +' txtMonterreyPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkQU = vbUnchecked And Not optPTex(7) Then +' txtQUPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(0) Then +' txtSandPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSand = vbUnchecked And Not optPTex(1) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +'' oRS.Delete +' End If +' End If +' If Not chkSand = vbUnchecked And optPTex(2) Then +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +' End If +' End If +' If chkSB = vbUnchecked And Not optPTex(9) Then +' txtSBPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSkip = vbUnchecked And Not optPTex(3) Then +' txtSkipPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' If chkSmooth = vbUnchecked And Not optPTex(5) Then +' txtSmoothPr = "" +' strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' If Not oRS.EOF Then +' oRS.Delete +'' Exit Sub +' End If +' End If +' Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() + Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If +' If moRS!finish = "DW" Then +' +' Else +'' If moRS!stype <> "T" Then + Call CalcOneKote +'' End If +'' If moRS!stype = "T" Then +'' Call CalcThreeKote +'' End If +' End If + If mboolBAD Then + MsgBox "Takeoff Calculation Was Not Completed - Wire Error" + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + Exit Sub + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + +' On Error GoTo Error_EH + mboolBAD = False + mboolCALC = False + + Call UpTexture + +' strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID +' goConn.Execute strSELECT + +' Call LoadCMat + +' If Not mboolCALC Then +' MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" +' Exit Sub +' End If + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + +'' moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) +'' oRSS.Close + +' moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) +' moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) +' moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) +' moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + +' moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + +'' dblLC = Int(((Field2Long(txtLathYds) / 25) * 2) + 0.99) + +'' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1820 and toid = " & gintTOID +'' Set oRC = New Recordset +'' oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly +'' If oRC.EOF Then +'' strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1820 and Inv_Type = " & gbytINV_TYPE +'' Set oRSS = New Recordset +'' oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly +'' If Not oRSS.EOF Then +'' moRSCMat.AddNew +'' moRSCMat!toid = gintTOID +'' moRSCMat!inv_no = Field2Str(oRSS!inv_no) +'' moRSCMat!Desc = Field2Str(oRSS!Desc) +'' moRSCMat!qty = dblLC +'' moRSCMat!price = Field2Str(oRSS!tprice) +'' moRSCMat!d_flag = Field2Str(oRSS!d_flag) +'' moRSCMat!m_type = Field2Str(oRSS!m_type) +'' moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) +'' moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) +'' moRSCMat!cflag = vbChecked +'' moRSCMat!trnsflag = vbUnchecked +'' moRSCMat.Update +'' End If +'' End If + + +'Calculate Foam +'' dblFOAM = Field2Long(txtLathYds) - Field2Integer(txtFoamAdj) + + +'' txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) +'' txtTape = Int((Field2Long(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) +'' txtOH = Int((Field2Long(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +'' txtStucLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) +'' txtLathLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) +'' txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) +'' txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + + txtMatMU = Int((Field2Long(txtTtlMat) * (Format(Field2Str2(txtMatMURate), "general number")) + 0.99)) + dblSUM = CDbl(Field2Str2(txtStucLab)) + CDbl(Field2Str2(txtLathLab)) + dblSUM = dblSUM + Field2Long(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Long(txtMisc) + Field2Long(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(Field2Str2(txtMURate), "general number")) + 0.99) + txtOH = Int((Field2Long(txtTtlCost) * Field2Str(txtOHRate)) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub CalcOneKoteOLD() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double, dblLC As Double +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + +' On Error GoTo Error_EH + mboolBAD = False + mboolCALC = False + + If mstrWIRE = "P" Or mstrWIRE = "F" Then + MsgBox "The Wire Type selected in projects is not correct for OneCoat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = Field2Str2(moRSProj!bagdollars) ' + 1 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close +'****** move to after One Coat calculation +' If dblRS > 0 Then +' dblRS = Int((dblRS) + 0.99) +' txtSandTons = dblRS +' End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + Else + If moRSProj!rg12 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!rg1 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1317 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1317 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + End If + End If +'Calculate Latex Caulking **** This may need to just update the qty in the TOMaterial file. + + dblLC = Int(((Field2Long(txtLathYds) / 25) * 2) + 0.99) + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1820 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1820 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLC + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Long(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If + +'Calculate Foam + dblFOAM = Field2Long(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + ' ** Changed back to 1.77 6/27/2012 per JR because of Shea Homes + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.5) + 0.99) + ' moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + ' ** Changed to 1.5 4/9/2012 per JG + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Long(txtLathYds) / 30)) + 0.99) + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + Else + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + ElseIf moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1809 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1809 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + ElseIf moRSProj!bp_type = "B7" Then + dblBP = Int(((Field2Long(txtLathYds) / 16)) + 0.99) 'Changed per Jesse 10/12/15 +' dblBP = Int(((Field2Long(txtLathYds) / 16) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1811 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1811 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If +' End If + + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 45) + 0.99) '***** Wire changed to 45 yds per Jesse on 3/24/10 + ' moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 + ' moRSCMat!qty = Int((dblWire / 50) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + + lngSandBatch = dblKote1 + dblCMNT '******** complete this + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Long(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Long(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +'' txtStucLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) +'' txtLathLab = Int(((Field2Long(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) +'' txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKoteOLD" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset +' On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String +Dim dblSandBag As Double, dblBagBatch As Double, lngSandBatch As Long +Dim dblSplitCost As Double + + On Error GoTo Error_EH + mboolBAD = False + + If mstrWIRE = "O" Then + MsgBox "The Wire Type selected in projects is not correct for Three Coat - Calculate is not allowed", vbOKOnly, "Invalid Wire Type" + mboolBAD = True + Exit Sub + End If + + dblBagBatch = 0 + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + End If + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + +' If dblRS > 0 Then +' txtSandTons = dblRS +' End If + + lngSandBatch = dblKote1 + dblCMNT + dblSandBag = lngSandBatch * dblBagBatch + + If moRSProj!BagSand Then + If dblSandBag > 0 Then + lblSand = "Sand Bags:" + dblSandBag = Int((dblSandBag) + 0.99) + txtSandTons = dblSandBag + End If + Else + If dblRS > 0 Then + lblSand = "Sand Tons:" + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + End If + + +'Calculate Black paper +' dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + 'Changed from 1.5 to 2 layers per Jesse 03/24/2010 + If moRSProj!bp_type <> "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + + If moRSProj!bp_type = "B6" Then + dblBP = Int(((Field2Long(txtLathYds) / 20) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1809 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1809 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Stucco Wire + If mstrWIRE = "P" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 27) + 0.99) 'For bid purposes - use 33 for production purposes + ' moRSCMat!qty = Int((dblWire / 33) + 0.99) + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + If mstrWIRE = "F" Then + dblWire = Field2Long(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1417 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1417 and Inv_Type = " & gbytINV_TYPE + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) ' For bid purposes - use 45 for production + ' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Long(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Long(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Long(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) +'' txtMetalFt = dblMETAL +' If Field2Integer(txtSandTons) < 16 Then +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + 30 +' Else +' txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") +' End If + If Not moRSProj!BagSand Then + If Field2Str(txtSandTons) < 16 Then + dblSplitCost = Field2Str2(moRSProj!splitcst) + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If +'' If chk2Story Then +'' txtScafGas = Int((Field2Long(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) +'' Else +'' txtScafGas = Int((Field2Long(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) +'' End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) +'' txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) +'' txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) +'' txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String +'***FIX On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + strPROJCODE = UCase(strPROJCODE) + + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!proj_id + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!proj_id + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(0) Then + mstrFINISH = "FN" + ElseIf optPTex(1) Then + mstrFINISH = "SH" + ElseIf optPTex(2) Then + mstrFINISH = "TX" +'' ElseIf optPTex(9) Then +'' mstrFINISH = "SB" +'' ElseIf optPTex(1) Then +'' mstrFINISH = "S2" +'' ElseIf optPTex(2) Then +'' mstrFINISH = "S3" +'' ElseIf optPTex(8) Then +'' mstrFINISH = "DF" +'' ElseIf optPTex(5) Then +'' mstrFINISH = "SM" +'' ElseIf optPTex(7) Then +'' mstrFINISH = "QU" +'' ElseIf optPTex(6) Then +'' mstrFINISH = "MN" +'' ElseIf optPTex(10) Then +'' mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False +' txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE & " ORDER BY Inv_No" + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" & " ORDER BY Inv_No" + End If + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds)) ' - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) +' txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) +' txtStuccoYds = Field2Long(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +'' If moRSProj!BagSand Then +'' lblSand = "Sand Bags:" +'' Else +'' lblSand = "Sand Tons:" +'' End If +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "FN" Then +' chkSkip = vbChecked +' txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SH" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "TX" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "S3" Then +' chkSand = vbChecked +' txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SB" Then +' chkSB = vbChecked +' txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "TX" Then +' chkDash = vbChecked +' txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "MN" Then +' chkMonterrey = vbChecked +' txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SM" Then +' chkSmooth = vbChecked +' txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "QU" Then +' chkQU = vbChecked +' txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "DF" Then +' chkDF = vbChecked +' txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "MF" Then +' chkMF = vbChecked +' txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") +' ElseIf oRS!texture = "SS" Then +' chkSS = vbChecked +' txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module SecondLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + mstrWIRE = Field2Str(moRSProj!wire) + gbytINV_TYPE = Field2Str(moRSProj!inv_type) + + If moRSProj!SYNTHETIC Then + mboolSYN = True + Else + mboolSYN = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish WHERE area = 'E'" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" +' chkSB = vbUnchecked +' txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" +' chkMonterrey = vbUnchecked +' txtMonterreyPr = "" +' chkSmooth = vbUnchecked +' txtSmoothPr = "" +' chkQU = vbUnchecked +' txtQUPr = "" +' chkDF = vbUnchecked +' txtDFPr = "" +' chkSS = vbUnchecked +' txtSS = "" +' chkMF = vbUnchecked +' txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String +Dim dblSplitCost As Double + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc + With moRS + mstrFINISH = Field2Str(!finish) +'' chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) +'' txtSandTons = Field2Integer(!SAND_TONS) +'' txtSandPrice = Format(Field2Str(!sand), "##.00") +'' txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") +'' chk2Story = Field2CheckBox(!twostory) +'' If chk2Story Then +'' lbl2S.Caption = "2S" +'' Else +'' lbl2S.Caption = "" +'' End If +'' txt68 = Field2Str2(!Scaf6) +'' txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtCreated = txtCreated & " " & Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + txtCreated = txtCreated & " " & Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) +' txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) +' If Not moRSProj!BagSand Then +' If Field2Integer(txtSandTons) < 16 Then +' dblSplitCost = Field2Str2(moRSProj!spitcst) +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") +' txtSandAmt = Field2Str2(txtSandAmt) + dblSplitCost +' txtSandAmt = Field2Str2(txtSandAmt) + 40 +' Else +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +' End If +' Else +' txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") +' End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") + txtMatMURate = Format(Field2Str(!MTMU), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "FN" Then + txtFinish.Text = "FINE SYNTHETIC" + txtSkipPr = Format(Field2Str2(!bidp), "#,#") + optPTex(0).Value = True + ElseIf !finish = "SH" Then + txtFinish.Text = "SAHARA SYNTHETIC" + txtSandPr = Format(Field2Str2(!bidp), "#,#") + optPTex(1).Value = True + ElseIf !finish = "TX" Then + txtFinish.Text = "TEXTURE SYNTHETIC" + txtDashPr = Format(Field2Str2(!bidp), "#,#") + optPTex(2).Value = True +' ElseIf !finish = "S2" Then +' txtFinish.Text = "Sand - 20" +' optPTex(1).Value = True +' ElseIf !finish = "S3" Then +' txtFinish.Text = "Sand - 30" +' optPTex(2).Value = True +' ElseIf !finish = "DA" Then +' txtFinish.Text = "Dash" +' optPTex(4).Value = True +' ElseIf !finish = "DF" Then +' txtFinish.Text = "Skip and Sand Finish" +' optPTex(8).Value = True +' ElseIf !finish = "SM" Then +' txtFinish.Text = "Smooth" +' optPTex(5).Value = True +' ElseIf !finish = "QU" Then +' txtFinish.Text = "Quernavaca" +' optPTex(7).Value = True +' ElseIf !finish = "MN" Then +' txtFinish.Text = "Monterrey" +' optPTex(6).Value = True +' ElseIf !finish = "MF" Then +' txtFinish.Text = "Monterrey & Sand" +' optPTex(10).Value = True +' ElseIf !finish = "SS" Then +' txtFinish.Text = "Skip and R Sand Finish" +' optPTex(11).Value = True + End If + + ' On Error Resume Next +' If !stype = "S" Then +' cboOneKote = "Superwall" +' ElseIf !stype = "M" Then +' cboOneKote = "Magna Wall" +' ElseIf !stype = "T" Then +' cboOneKote = "Three Coat" + If !stype = "C" Then + cboOneKote = "Synthetic" +' ElseIf !stype = "B" Then +' cboOneKote = "Synthetic over 1 Kote" +' ElseIf !stype = "W" Then +' cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type +' If txtInvType = "0" Then +' lblInvType = "Original" +' ElseIf txtInvType = "1" Then +' lblInvType = "Tract Homes" +' ElseIf txtInvType = "2" Then +' lblInvType = "Custom Homes" +' ElseIf txtInvType = "3" Then +' lblInvType = "Multi Family" + If txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB +' txtSLRate = Format(Field2Str(!s_rate), "##.00") +' txtLLRate = Format(Field2Str(!l_rate), "##.00") +' txtMLRate = Format(Field2Str(!m_Rate), "##.00") +'' txtMatMURate = Format(Field2Str(!matmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +'' txtMURate = Format(Field2Str(!mu), "percent") +'' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String +'***FIX On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + lblOptNum = "Option Number " & Trim(Field2Str(!OPTID)) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + +' On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True 'is this causing problems when moving + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String +' On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Long(oRS!toid) +' gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblOption" ' where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If IsNull(!origTOID) Or !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) +'' !SAND_TONS = Integer2Field(txtSandTons) +'' !sand = Str2Field(txtSandPrice) +'' !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) + !MTMU = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !mu = Str2Field(Format(txtMURate, "general number")) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) +'' !openflg = chkOpen +'' !twostory = chk2Story +'' !Scaf6 = Integer2Field(txt68) +'' !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + +' If cboOneKote.Text = "Superwall" Then +' !stype = "S" +' ElseIf cboOneKote.Text = "Magna Wall" Then +' !stype = "M" +' ElseIf cboOneKote.Text = "Three Coat" Then +' !stype = "T" + If cboOneKote.Text = "Synthetic" Then + !stype = "C" +' ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then +' !stype = "B" +' ElseIf cboOneKote.Text = "San Man" Then +' !stype = "N" +' ElseIf cboOneKote.Text = "Western 1 Kote" Then +' !stype = "W" + End If +' If optPTex(3) Then +' !finish = "SK" +' ElseIf optPTex(4) Then +' !finish = "DA" + If optPTex(0) Then + !finish = "FN" +' ElseIf optPTex(9) Then +' !finish = "SB" + ElseIf optPTex(1) Then + !finish = "SH" + ElseIf optPTex(2) Then + !finish = "TX" +' ElseIf optPTex(8) Then +' !finish = "DF" +' ElseIf optPTex(5) Then +' !finish = "SM" +' ElseIf optPTex(7) Then +' !finish = "QU" +' ElseIf optPTex(6) Then +' !finish = "MN" +' ElseIf optPTex(10) Then +' !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB ' Do Not Delete This From The Code +' !s_rate = Str2Field(txtSLRate) +' !l_rate = Str2Field(txtLLRate) +' !m_Rate = Str2Field(txtMLRate) +' !scr = Str2Field(txtSGRate) +' !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) +' !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) +' !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" +' txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" +'' txtSandTons = "0" +'' txtSandPrice = "0" +'' txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" +'' txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" +'' txtSLRate = "0" +'' txtLLRate = "0" +'' txtMLRate = "0" +'' txtSGRate = "0" +'' txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" +' txtSmoothPr = "0" +' txtMonterreyPr = "0" +' txtQUPr = "0" +' txtDFPr = "0" +' txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 +'' txt68 = "" +'' txt108 = "" +'' txtO68 = "" +'' txtO108 = "" +'' chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked +' chkSmooth.Value = vbUnchecked +' chkMonterrey.Value = vbUnchecked +' chkQU.Value = vbUnchecked +' chkDF.Value = vbUnchecked +' chkSB.Value = vbUnchecked +' chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() +' cboOneKote.AddItem ("Superwall") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 1 +' cboOneKote.AddItem ("Magna Wall") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 2 +' cboOneKote.AddItem ("Three Coat") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 3 +' cboOneKote.AddItem ("Western 1 Kote") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 +' cboOneKote.AddItem ("Synthetic Over 1 Kote") +' cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID & " ORDER BY Inv_No" 'cboProject.ListIndex" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'' txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") +'' moRSLAB!s_rate = Field2Str(oRS!s_rate) +'' txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") +'' moRSLAB!l_rate = Field2Str(oRS!l_rate) +'' txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") +'' moRSLAB!m_Rate = Field2Str(oRS!m_Rate) +'' txtTPRate = Field2Str(oRS!tp) +'' moRSLAB!tp = Field2Str(oRS!tp) +'' txtMURate = Format(Field2Str(oRS!mu), "percent") +'' moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else +'' txtSGRate = Format(Field2Str(oRS!scr), "##.00") +'' moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "FN" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "SH" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "TX" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH +'' Case 3 +'' mstrFINISH = "SK" +'' txtFinish.Text = "SKIP TROWEL" +'' moRS!finish = mstrFINISH +'' Case 4 +'' mstrFINISH = "DA" +'' txtFinish.Text = "DASH" +'' moRS!finish = mstrFINISH +'' Case 5 +'' mstrFINISH = "SM" +'' txtFinish.Text = "SMOOTH" +'' moRS!finish = mstrFINISH +'' Case 6 +'' mstrFINISH = "MN" +'' txtFinish.Text = "MONTERREY" +'' moRS!finish = mstrFINISH +'' Case 7 +'' mstrFINISH = "QU" +'' txtFinish.Text = "QUERNAVACA" +'' moRS!finish = mstrFINISH +'' Case 8 +'' mstrFINISH = "DF" +'' txtFinish.Text = "SKIP AND SAND FINISH" +'' moRS!finish = mstrFINISH +'' Case 9 +'' mstrFINISH = "SB" +'' txtFinish.Text = "EIFS - SANDBLAST" +'' moRS!finish = mstrFINISH +'' Case 10 +'' mstrFINISH = "MF" +'' txtFinish.Text = "MONTERREY & SAND" +'' moRS!finish = mstrFINISH +'' Case 11 +'' mstrFINISH = "SS" +'' txtFinish.Text = "SKIP AND RSAND FINISH" +'' moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + + If tabTake.Tab = 2 Then + MsgBox "Options Are Not Available For Synthetic Jobs", vbOKOnly, "Invalid Selection" + tabTake.Tab = PreviousTab +' txtNotes.SetFocus + Exit Sub + End If + + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +''Private Sub txt108_GotFocus() +'' Call FieldSelect(txt108) +''End Sub + +''Private Sub txt68_GotFocus() +'' Call FieldSelect(txt68) +''End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) +' If tabTake.Tab = 3 Then +' txtSandPrice.SetFocus +' End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOHRate_GotFocus() + Call FieldSelect(txtOHRate) +End Sub + +Private Sub txtOHRate_LostFocus() +Dim dblOHRate As Double, dblOH As Double, dblMatCost + + + +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +'Private Sub txtSandPrice_GotFocus() +' Call FieldSelect(txtSandPrice) +'End Sub + +Private Sub UpTexture() + If optPTex(1) Then + mstrFINISH = "SH" + ElseIf optPTex(2) Then + mstrFINISH = "TX" + ElseIf optPTex(0) Then + mstrFINISH = "FN" +'' ElseIf optPTex(9) Then +'' mstrFINISH = "SB" +'' ElseIf optPTex(1) Then +'' mstrFINISH = "S2" +'' ElseIf optPTex(2) Then +'' mstrFINISH = "S3" +'' ElseIf optPTex(8) Then +'' mstrFINISH = "DF" +'' ElseIf optPTex(5) Then +'' mstrFINISH = "SM" +'' ElseIf optPTex(7) Then +'' mstrFINISH = "QU" +'' ElseIf optPTex(6) Then +'' mstrFINISH = "MN" +'' ElseIf optPTex(10) Then +'' mstrFINISH = "MF" +'' ElseIf optPTex(11) Then +'' mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!NEWTOID = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frm new file mode 100644 index 0000000..95f5cc2 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frm @@ -0,0 +1,9248 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx" +Begin VB.Form frmTake + Caption = "Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkUpdate + Alignment = 1 'Right Justify + Caption = "Update:" + Height = 360 + Left = 375 + TabIndex = 260 + Top = 1050 + Width = 930 + End + Begin VB.TextBox txtInvType + Height = 285 + Left = 11520 + TabIndex = 258 + Top = 600 + Visible = 0 'False + Width = 255 + End + Begin VB.CommandButton cmdPrintAllIncrease + Caption = "Print All Increases" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 255 + Top = 1620 + Width = 1155 + End + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print 1 Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 615 + Left = 10620 + TabIndex = 254 + Top = 1020 + Width = 1155 + End + Begin VB.TextBox txt108 + Height = 315 + Left = 10980 + TabIndex = 247 + Top = 2520 + Width = 855 + End + Begin VB.TextBox txt68 + Height = 315 + Left = 9060 + TabIndex = 244 + Top = 2520 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 242 + Top = 1980 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Height = 195 + Left = 420 + TabIndex = 237 + Top = 0 + Width = 3195 + End + Begin VB.CommandButton cmdMove + Caption = "Copy to New Project" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 6660 + TabIndex = 223 + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdDefaultMat + Caption = "De&Fault Materials" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 218 + TabStop = 0 'False + Top = 1440 + Width = 1275 + End + Begin VB.CommandButton cmdPrintAllTake + Caption = "Print &All Takeoffs" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 10620 + TabIndex = 207 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin Crystal.CrystalReport crTake + Left = 3030 + Top = 555 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print &1 Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 9300 + TabIndex = 198 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdCopy + Caption = "&Copy Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5340 + TabIndex = 197 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 192 + TabStop = 0 'False + Top = 240 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 191 + TabStop = 0 'False + Top = 600 + Width = 2115 + End + Begin VB.CommandButton cmdDeleteTakeoff + Caption = "&Delete Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 7980 + TabIndex = 190 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdSave + Caption = "Sa&Ve Takeoff" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 1380 + TabIndex = 149 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNewElv + Height = 315 + Left = 4800 + MaxLength = 8 + TabIndex = 9 + Top = 1020 + Visible = 0 'False + Width = 1395 + End + Begin VB.CommandButton cmdNew + Caption = "&New Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4020 + TabIndex = 146 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 2700 + TabIndex = 145 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPInvPrices + Caption = "Update Inv. Prices" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 144 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.CommandButton cmdUPLabRates + Caption = "&Update Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 143 + TabStop = 0 'False + Top = 2520 + Width = 1275 + End + Begin VB.CommandButton cmdChgLabRates + Caption = "Chan&Ge Labor Rates" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 60 + TabIndex = 142 + TabStop = 0 'False + Top = 1980 + Width = 1275 + End + Begin VB.TextBox txtNotes + Height = 1335 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1620 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Height = 315 + ItemData = "frmTakehold.frx":0000 + Left = 8520 + List = "frmTakehold.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 600 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 8880 + TabIndex = 8 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6660 + TabIndex = 6 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4620 + TabIndex = 3 + TabStop = 0 'False + Top = 180 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 2 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmTakehold.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmTakehold.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "lblInvno" + Tab(1).Control(1)= "lblMatQty" + Tab(1).Control(2)= "lblMatPrice" + Tab(1).Control(3)= "lblDFlag" + Tab(1).Control(4)= "lblMType" + Tab(1).Control(5)= "lblMetal" + Tab(1).Control(6)= "lblMetLength" + Tab(1).Control(7)= "lblMatDesc" + Tab(1).Control(8)= "cmdDelMat" + Tab(1).Control(8).Enabled= 0 'False + Tab(1).Control(9)= "cmdSaveMat" + Tab(1).Control(10)= "lstTOMatrl" + Tab(1).Control(10).Enabled= 0 'False + Tab(1).Control(11)= "txtMatInvNo" + Tab(1).Control(12)= "txtMatDesc" + Tab(1).Control(13)= "txtMatQty" + Tab(1).Control(14)= "txtMatPrice" + Tab(1).Control(15)= "txtMetLength" + Tab(1).Control(16)= "cboDFlag" + Tab(1).Control(17)= "cboMType" + Tab(1).Control(18)= "cboMetal" + Tab(1).Control(19)= "cmdAddMat" + Tab(1).Control(19).Enabled= 0 'False + Tab(1).Control(20)= "cmdFindMat" + Tab(1).Control(21)= "chkTransfer" + Tab(1).Control(21).Enabled= 0 'False + Tab(1).Control(22)= "lstMInventory" + Tab(1).Control(22).Enabled= 0 'False + Tab(1).Control(23)= "cmdSetup" + Tab(1).Control(23).Enabled= 0 'False + Tab(1).Control(24)= "chkCalc" + Tab(1).Control(24).Enabled= 0 'False + Tab(1).Control(25)= "cmdDel1900" + Tab(1).Control(26)= "fraMaterials" + Tab(1).Control(27)= "cmdUpdate" + Tab(1).ControlCount= 28 + TabCaption(2) = "&Options" + TabPicture(2) = "frmTakehold.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "txtO108" + Tab(2).Control(1)= "txtO68" + Tab(2).Control(2)= "chkNoInvoice" + Tab(2).Control(3)= "chkST_Others" + Tab(2).Control(4)= "txtOST_SqFt" + Tab(2).Control(5)= "chkOStone" + Tab(2).Control(6)= "txtNote" + Tab(2).Control(7)= "cmdCopyOpt" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "cmdSaveOptMat" + Tab(2).Control(9)= "cmdSaveOpt" + Tab(2).Control(10)= "lstInventory" + Tab(2).Control(10).Enabled= 0 'False + Tab(2).Control(11)= "cmdFindOptMat" + Tab(2).Control(12)= "cboOMMetal" + Tab(2).Control(13)= "cboOMType" + Tab(2).Control(14)= "cboOMDFlag" + Tab(2).Control(15)= "txtOMMetL" + Tab(2).Control(16)= "txtOMPrice" + Tab(2).Control(17)= "txtOMQty" + Tab(2).Control(18)= "txtOMDesc" + Tab(2).Control(19)= "txtOMInvNo" + Tab(2).Control(20)= "cmdDelOptMat" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdAddOptMat" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdDelOpt" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "cmdAddOpt" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "lstOptMatrl" + Tab(2).Control(24).Enabled= 0 'False + Tab(2).Control(25)= "txtOFAdj" + Tab(2).Control(26)= "txtOFin2" + Tab(2).Control(27)= "cboOFinish" + Tab(2).Control(28)= "txtOBAmt" + Tab(2).Control(29)= "txtOYdge" + Tab(2).Control(30)= "txtODesc" + Tab(2).Control(31)= "lstOptions" + Tab(2).Control(31).Enabled= 0 'False + Tab(2).Control(32)= "lblScaf10" + Tab(2).Control(33)= "Scaf6" + Tab(2).Control(34)= "lblOScaffold" + Tab(2).Control(35)= "lblOStone" + Tab(2).Control(36)= "lblOMMLength" + Tab(2).Control(37)= "lblOMCFlag" + Tab(2).Control(38)= "lblOMMType" + Tab(2).Control(39)= "lblOMDFlag" + Tab(2).Control(40)= "lblOMPrice" + Tab(2).Control(41)= "lblOMQty" + Tab(2).Control(42)= "lblOMDesc" + Tab(2).Control(43)= "lblOMInvNo" + Tab(2).Control(44)= "lblOFadj" + Tab(2).Control(45)= "lblOFin2" + Tab(2).Control(46)= "lblOTexture" + Tab(2).Control(47)= "lblBAmt" + Tab(2).Control(48)= "lblYrdge" + Tab(2).ControlCount= 49 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmTakehold.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Height = 315 + Left = -66660 + TabIndex = 252 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Height = 315 + Left = -66660 + TabIndex = 251 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 241 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 227 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 222 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 219 + Top = 3240 + Width = 2955 + Begin VB.OptionButton optInv + Caption = "Custom Inv." + Height = 195 + Index = 1 + Left = 1560 + TabIndex = 221 + Top = 120 + Value = -1 'True + Width = 1275 + End + Begin VB.OptionButton optInv + Caption = "Full Inv." + Height = 195 + Index = 0 + Left = 120 + TabIndex = 220 + Top = 120 + Width = 1215 + End + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 217 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 213 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Height = 315 + Left = -64980 + TabIndex = 208 + TabStop = 0 'False + Top = 480 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 199 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 196 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 195 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstInventory + Height = 1815 + Left = -74760 + Sorted = -1 'True + TabIndex = 194 + TabStop = 0 'False + Top = 660 + Visible = 0 'False + Width = 3195 + End + Begin VB.ListBox lstMInventory + Height = 2010 + Left = -66840 + Sorted = -1 'True + TabIndex = 193 + TabStop = 0 'False + Top = 1260 + Visible = 0 'False + Width = 3075 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Height = 315 + Left = -66360 + TabIndex = 180 + TabStop = 0 'False + Top = 480 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -67140 + Picture = "frmTakehold.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2700 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -67140 + Picture = "frmTakehold.frx":04B6 + Style = 1 'Graphical + TabIndex = 171 + Top = 360 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Height = 315 + ItemData = "frmTakehold.frx":08F8 + Left = -65400 + List = "frmTakehold.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Height = 315 + ItemData = "frmTakehold.frx":0913 + Left = -65400 + List = "frmTakehold.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Height = 315 + ItemData = "frmTakehold.frx":0917 + Left = -68160 + List = "frmTakehold.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 37 + Top = 2760 + Width = 915 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 181 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Height = 315 + ItemData = "frmTakehold.frx":0935 + Left = -68100 + List = "frmTakehold.frx":093F + Style = 2 'Dropdown List + TabIndex = 177 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Height = 315 + ItemData = "frmTakehold.frx":0950 + Left = -68100 + List = "frmTakehold.frx":0952 + Style = 2 'Dropdown List + TabIndex = 176 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Height = 315 + ItemData = "frmTakehold.frx":0954 + Left = -68100 + List = "frmTakehold.frx":095E + Style = 2 'Dropdown List + TabIndex = 175 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 178 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 174 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 173 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 172 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 170 + Top = 480 + Width = 915 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 160 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 158 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Height = 315 + ItemData = "frmTakehold.frx":0972 + Left = -69720 + List = "frmTakehold.frx":0974 + Style = 2 'Dropdown List + TabIndex = 157 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 156 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 155 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 150 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 148 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 159 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 141 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 161 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 140 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 179 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 136 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 134 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 128 + TabStop = 0 'False + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.Frame fraSecond + Height = 3735 + Left = 8760 + TabIndex = 121 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 240 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 226 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 216 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 122 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Height = 3735 + Left = 7980 + TabIndex = 112 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 238 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 224 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 214 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 212 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 211 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 138 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 118 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 120 + TabIndex = 117 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 114 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 105 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 64 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 63 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 65 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 99 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 90 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 62 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 83 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 67 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 61 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 59 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Height = 315 + ItemData = "frmTakehold.frx":0976 + Left = -70305 + List = "frmTakehold.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 200 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 230 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 228 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 206 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 205 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 204 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 203 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 202 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 201 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 253 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 250 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 249 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 248 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 239 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Height = 195 + Left = -66285 + TabIndex = 229 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 225 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 215 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 210 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 209 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 189 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 188 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 187 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 186 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 185 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 184 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 183 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 182 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 169 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 168 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 167 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 166 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 165 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 164 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 163 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 162 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 154 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 153 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 152 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 151 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 137 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 120 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 113 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 111 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 110 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 109 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 108 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 107 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 106 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 104 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 97 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 96 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 95 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 94 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 93 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 92 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 91 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 89 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 87 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 86 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 73 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 72 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 71 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 70 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 69 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 68 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 66 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 60 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 420 + TabIndex = 58 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 2205 + Left = 1380 + Sorted = -1 'True + TabIndex = 0 + Top = 660 + Width = 1395 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 259 + Top = 300 + Width = 540 + End + Begin VB.Label lblInvType + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9960 + TabIndex = 257 + Top = 180 + Width = 1875 + End + Begin VB.Label lblSupercede + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "Plan has been Superceded, Press CTRL-R to View" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 555 + Left = 4260 + TabIndex = 256 + Top = 1020 + Visible = 0 'False + Width = 3315 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 246 + Top = 2580 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 245 + Top = 2580 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 243 + Top = 2280 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7785 + TabIndex = 236 + Top = 1650 + Width = 795 + End + Begin VB.Label txtLSave + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 235 + Top = 1320 + Width = 1730 + End + Begin VB.Label txtUpdate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 234 + Top = 1650 + Width = 1730 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 8625 + TabIndex = 233 + Top = 1005 + Width = 1730 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7650 + TabIndex = 232 + Top = 1320 + Width = 930 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7845 + TabIndex = 231 + Top = 1005 + Width = 735 + End + Begin VB.Label lblNewElv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "New Plan/Elevation:" + Height = 195 + Left = 3225 + TabIndex = 147 + Top = 1080 + Visible = 0 'False + Width = 1470 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 660 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 3930 + TabIndex = 21 + Top = 600 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 7770 + TabIndex = 7 + Top = 240 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5745 + TabIndex = 5 + Top = 240 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3660 + TabIndex = 4 + Top = 240 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 1 + Top = 660 + Width = 1215 + End +End +Attribute VB_Name = "frmTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset +Dim mintOLDTOID As Long +Dim mboolSHOW As Boolean, mboolCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() + cmdAddMat.Enabled = False + cmdSaveMat.Enabled = True + cmdDel1900.Enabled = False + cmdDelMat.Enabled = False + cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdSave.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False + cmdSave.Enabled = False + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double + + On Error GoTo Error_EH + mboolCALC = False + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close + If dblRS > 0 Then + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1310 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1310" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1315 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1315" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1330 and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1330" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1815 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1815" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1816 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1816" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 +' moRSCMat!qty = Int((dblWire / 50) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 5220 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 5220" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2210 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2210" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2250 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2250" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2260 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2260" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = 1610" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1710" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1720" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Str(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub Supersede() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = lstMod_Elv.Text '(lstMod_Elv.ListIndex) + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv, supersede from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then + txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Supersede" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String + + On Error GoTo Error_EH + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2410 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2410" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2412 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2412" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2411 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2411" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2600 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2600" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2610 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = 2610" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2430 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2430" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2432 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2432" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2431 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2431" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2316 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2316" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 2366 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 2366" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblRS > 0 Then + txtSandTons = dblRS + End If + + +'Calculate Black paper + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1810 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1810" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1450 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = 1450" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 33) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1616" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1730" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1705" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = 1820" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 30 + Else + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str(txtSandPrice)) + 0.99), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) +' txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14) + (Field2Str2(txtScafGas) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + gbytINV_TYPE = moRSProj!inv_type + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad + cmdSaveMeas.Enabled = False + cmdDelMeas.Enabled = False + cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " AND Inv_Type = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else + lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) + Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() + cmdAddMeas.Enabled = False + cmdSaveMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdSave.Enabled = False + cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then + txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!proj_id + strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE not supersede and Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!proj_id + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE not supersede and proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdSave.Enabled = True + cmdSaveMat.Enabled = False + cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False + lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() + cmdSaveMeas.Enabled = False + cmdSave.Enabled = True + cmdAddMeas.Enabled = True + cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdCopyOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOpt.Enabled = True + cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Integer(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Integer2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Integer2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex + cmdAddOptMat.Enabled = True + cmdAddOpt.Enabled = True + lstOptions.Visible = True + lstInventory.Visible = False + cmdSaveOptMat.Enabled = False + cmdSaveOpt.Enabled = False + cmdSave.Enabled = True + cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdUpdate.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear + lstMInventory.Visible = True + Call LoadMInventory + lstMInventory.ListIndex = 0 + lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True + cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False + lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False + cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True + cmdAddMat.Enabled = False + cmdSave.Enabled = False + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdUPLabRates.Enabled = False + cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False + cmdChgLabRates.Enabled = False + cmdNew.Enabled = False + cboOneKote.Enabled = False + cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False + cmdAddMat.Enabled = True + cmdSaveMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdUPLabRates.Enabled = True + cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True + cmdChgLabRates.Enabled = True + cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strFIND As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + strSQL = "SELECT inv_no, tprice FROM tblInvtry WHERE Inv_Type = " & moRSProj!inv_type & " ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strFIND = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.Find strFIND + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + If optInv(0) Then + ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtMatInvNo.Text + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + ElseIf optInv(1) Then + ' strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtMatInvNo.Text & " and estimator = '" & gstrLOGIN & "'" + strSQL = "SELECT * from tblInvTake where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, tprice from tblInvtry where Inv_no = " & lstMInventory.ItemData(lstMInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + + If Not mboolSETUP Then + lstMInventory.Visible = False + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMInventory.Clear + + Do Until oRS.EOF + With lstMInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMInventory.ListCount Then + lstMInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + If optInv(0) Then + strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT * from tblInvTake WHERE Inv_no = " & txtOMInvNo.Text & " AND INV_TYPE = " & gbytINV_TYPE & " and estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT * from tblInvtry WHERE Inv_no = " & txtOMInvNo.Text + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False + lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) + Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + If optInv(0) Then + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + ElseIf optInv(1) Then + strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE Inv_Type = " & gbytINV_TYPE & " AND estimator = '" & gstrLOGIN & "'" + End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) & " AND Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + + lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then + Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE not supersede and Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!pln_elv) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String + On Error GoTo Error_EH + Call ClearSecond +' If moRS!origTOID <> 0 Then + If moRS!toid <> moRS!origTOID Then + lblSupercede.Visible = True + Else + lblSupercede.Visible = False + End If +' End If + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!proj_code) & " " & moRSProj!proj_desc + With moRS + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + +' txtSLRate = Format(Field2Str(!sr), "##.00") +' txtLLRate = Format(Field2Str(!lr), "##.00") +' txtMLRate = Format(Field2Str(!mr), "##.00") +' txtMatMURate = Format(Field2Str(!mtmu), "percent") +' txtSGRate = Format(Field2Str(!scr), "##.00") +' txtTPRate = Format(Field2Str(!tp), "##.00") +' txtMURate = Format(Field2Str(!mu), "percent") +' txtOHRate = Format(Field2Str(!ohp), "##.00") +' txtCMURate = Format(Field2Str(!cr), "##.00") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + txtInvType = moRSProj!inv_type + If txtInvType = "0" Then + lblInvType = "Original" + ElseIf txtInvType = "1" Then + lblInvType = "Tract Homes" + ElseIf txtInvType = "2" Then + lblInvType = "Custom Homes" + ElseIf txtInvType = "3" Then + lblInvType = "Multi Family" + ElseIf txtInvType = "4" Then + lblInvType = "Commercial" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Integer(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Integer(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) +' moRS!origtoid = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!origTOID = mintOLDTOID + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew + moRS!pln_elv = Field2Str(txtNewElv) + moRS!proj_id = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' If IsNull(moRS!origTOID) Then +' moRS!origTOID = oRSMAX!maxtoid +' moRS.Update +' End If +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + moRS.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True + Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff + Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT toid FROM tblTake where not supersede and proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Integer(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Integer(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then + If Not cmdSave.Enabled Then + Call ToggleButtons + End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = " & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = " & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad + cmdDeleteTakeoff.Enabled = False + cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + If !origTOID = 0 Then + !origTOID = !toid +' !origtoid = !toid + End If +' !origTOID = gintTOID + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date + If chkUpdate Then + !LUUser = gstrLOGIN + !Update = Date + End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True + cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True + cmdNew.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = False + cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear + lblNewElv.Visible = True + txtNewElv.Visible = True + lstMod_Elv.Enabled = False + txtNewElv = "" + txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then + Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If + cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True + cmdNew.Enabled = True + cmdCopy.Enabled = True + cmdPrintTake.Enabled = True + cmdPrintAllTake.Enabled = True + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = False + chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 + Call CBFindString(lstMod_Elv, txtNewElv) + Call Measure_Setup + Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + + lblNewElv.Visible = False + txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False + chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Plan/Elevation, do you wish to add one?", vbYesNo + vbQuestion, "Add Records") + If intResponse = vbYes Then + strSQL = "SELECT * FROM tbltake WHERE toid = 1" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + strSql2 = "SELECT * FROM tblTOLabor where toid = 1" + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + Call cmdNew_Click + Else + Unload Me + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSave.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + Exit Sub + End Select + End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If + gintTOID = 0 + gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" + txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Integer2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True + cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True + cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdDeleteTakeoff.Enabled = True + cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() + cmdSaveOpt.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False + cmdAddOptMat.Enabled = False + cmdSaveOptMat.Enabled = True + cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = True + cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) + If optInv(0) Then + mstrFILE = "tblInvtry" + End If + If optInv(1) Then + mstrFILE = "tblInvTake" + End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then + If cmdSaveMeas.Enabled = True Then + strMSG = "Measure Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MeasSave + + Case vbNo + + Case vbCancel + tabTake.Tab = 0 + Exit Sub + End Select + End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If + If cmdSaveMat.Enabled = True Then + strMSG = "Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call MatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 1 + Exit Sub + End Select + End If +' Exit Sub + End If + If PreviousTab = 2 Then + If cmdSaveOpt.Enabled = True Then + strMSG = "Option Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If + If cmdSaveOptMat.Enabled = True Then + strMSG = "Option Material Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call OptMatSave + Case vbNo + + Case vbCancel + tabTake.Tab = 2 + Exit Sub + End Select + End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then + txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + If lstMInventory.ListCount > lstMInventory.ListIndex Then + Call ListFindItem2(lstMInventory, lngFind) + lstMInventory.ListIndex = lstMInventory.ListIndex + 1 + Else + Call ListFindItem2(lstMInventory, lngFind) + End If + lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then + txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + On Error GoTo Error_EH + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then + Call cmdDelMat_Click + cmdDel1900.Enabled = True + cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then + Call cmdDelMeas_Click + cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then + cmdDelOptMat.Enabled = True + cmdDelOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyR Then + If CtrlDown Then +' gintNTOID = moRS!toid + gintNTOID = moRS!origTOID + frmViewTake.Show 1 + End If + ElseIf KeyCode = vbKeyS Then + If CtrlDown Then + moRS!Supersede = vbChecked + moRS!superdate = Date + moRS.Update + mintOLDTOID = Field2Str2(moRS!origTOID) + Call Supersede + Call UpTOID +' txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then + Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then + Call cmdDelMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 Then + Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then + Call cmdAddMat_Click + KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then + Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then + Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then + txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdNew.Enabled = False + cmdCopy.Enabled = False + cmdPrintTake.Enabled = False + cmdPrintAllTake.Enabled = False + End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdUpMeasCalc.Enabled = False + cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then + cmdSaveMat.Enabled = True + cmdAddMat.Enabled = False + cmdDelMat.Enabled = False + cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then + cmdSaveOpt.Enabled = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdCopyOpt.Enabled = False + cmdSaveOptMat.Enabled = True + cmdAddOptMat.Enabled = False + cmdDelOptMat.Enabled = False + End If + End If + End If + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Form_KeyDown" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub + +Private Sub UpTOID() +Dim oRS As Recordset +Dim strSQL As String + + strSQL = "SELECT TOID, NEWTOID from tblTAKE where TOID = " & mintOLDTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + oRS!newtoid = lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + oRS.Update + End If + mintOLDTOID = 0 +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTakehold.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture.frm new file mode 100644 index 0000000..97a80f8 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture.frm @@ -0,0 +1,1397 @@ +VERSION 5.00 +Begin VB.Form frmTexture + Caption = "Texture Information" + ClientHeight = 8595 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 6150 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8595 + ScaleWidth = 6150 + StartUpPosition = 3 'Windows Default + Begin VB.TextBox txtTCTBLime + Height = 315 + Left = 5040 + TabIndex = 79 + Top = 7635 + Width = 600 + End + Begin VB.TextBox txtTCTBCmnt + Height = 315 + Left = 3855 + TabIndex = 78 + Top = 7620 + Width = 600 + End + Begin VB.TextBox txtTCTBRS + Height = 315 + Left = 2595 + TabIndex = 77 + Top = 7635 + Width = 600 + End + Begin VB.TextBox txtTCTBYds + Height = 315 + Left = 1425 + TabIndex = 76 + Top = 7635 + Width = 600 + End + Begin VB.TextBox txtTCTSLime + Height = 315 + Left = 5040 + TabIndex = 75 + Top = 7185 + Width = 600 + End + Begin VB.TextBox txtTCTSCmnt + Height = 315 + Left = 3855 + TabIndex = 74 + Top = 7185 + Width = 600 + End + Begin VB.TextBox txtTCTSRS + Height = 315 + Left = 2595 + TabIndex = 73 + Top = 7185 + Width = 600 + End + Begin VB.TextBox txtTCTSYds + Height = 315 + Left = 1425 + TabIndex = 72 + Top = 7185 + Width = 600 + End + Begin VB.TextBox txtTCOBLime + Height = 315 + Left = 5040 + TabIndex = 71 + Top = 6735 + Width = 600 + End + Begin VB.TextBox txtTCOBCmnt + Height = 315 + Left = 3855 + TabIndex = 70 + Top = 6750 + Width = 600 + End + Begin VB.TextBox txtTCOBRS + Height = 315 + Left = 2595 + TabIndex = 69 + Top = 6735 + Width = 600 + End + Begin VB.TextBox txtTCOBYds + Height = 315 + Left = 1410 + TabIndex = 68 + Top = 6750 + Width = 600 + End + Begin VB.TextBox txtTCOSLime + Height = 315 + Left = 5040 + TabIndex = 67 + Top = 6330 + Width = 600 + End + Begin VB.TextBox txtTCOSCmnt + Height = 315 + Left = 3855 + TabIndex = 66 + Top = 6330 + Width = 600 + End + Begin VB.TextBox txtTCOSRS + Height = 315 + Left = 2595 + TabIndex = 65 + Top = 6330 + Width = 600 + End + Begin VB.TextBox txtTCOSYds + Height = 315 + Left = 1410 + TabIndex = 64 + Top = 6330 + Width = 600 + End + Begin VB.TextBox txtOYards + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 18 + Top = 3120 + Width = 600 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update Three Coat" + Height = 450 + Left = 4470 + TabIndex = 80 + Top = 8085 + Width = 1605 + End + Begin VB.TextBox txtTSYds + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + TabIndex = 29 + Top = 4920 + Width = 600 + End + Begin VB.TextBox txtTYards + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + TabIndex = 28 + Top = 4560 + Width = 600 + End + Begin VB.TextBox txtTS30 + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 27 + Top = 4245 + Width = 600 + End + Begin VB.TextBox txtTS20 + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + TabIndex = 26 + Top = 4245 + Width = 600 + End + Begin VB.TextBox txtTS16 + Alignment = 1 'Right Justify + Height = 315 + Left = 2310 + TabIndex = 25 + Top = 4245 + Width = 600 + End + Begin VB.TextBox txtTXRS + Alignment = 1 'Right Justify + Height = 315 + Left = 1005 + TabIndex = 24 + Top = 4245 + Width = 600 + End + Begin VB.TextBox txtTTRS + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 23 + Top = 3930 + Width = 600 + End + Begin VB.TextBox txtTLime + Alignment = 1 'Right Justify + Height = 315 + Left = 2310 + TabIndex = 21 + Top = 3930 + Width = 600 + End + Begin VB.TextBox txtTCement + Alignment = 1 'Right Justify + Height = 315 + Left = 1020 + TabIndex = 20 + Top = 3930 + Width = 600 + End + Begin VB.TextBox txtTBRS + Alignment = 1 'Right Justify + Height = 315 + Left = 3975 + TabIndex = 22 + Top = 3930 + Width = 600 + End + Begin VB.TextBox txtOSYds + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 19 + Top = 3450 + Width = 600 + End + Begin VB.TextBox txtPrimary + Height = 315 + Left = 4260 + TabIndex = 8 + Top = 630 + Width = 600 + End + Begin VB.TextBox txtSecondary + Height = 315 + Left = 4260 + TabIndex = 9 + Top = 945 + Width = 600 + End + Begin VB.TextBox txtOS30 + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 17 + Top = 2790 + Width = 600 + End + Begin VB.TextBox txtOS20 + Alignment = 1 'Right Justify + Height = 315 + Left = 3930 + TabIndex = 16 + Top = 2790 + Width = 600 + End + Begin VB.TextBox txtOS16 + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 15 + Top = 2460 + Width = 600 + End + Begin VB.TextBox txtOXRS + Alignment = 1 'Right Justify + Height = 315 + Left = 3930 + TabIndex = 14 + Top = 2460 + Width = 600 + End + Begin VB.TextBox txtOTRS + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 13 + Top = 2115 + Width = 600 + End + Begin VB.TextBox txtOBRS + Alignment = 1 'Right Justify + Height = 315 + Left = 3930 + TabIndex = 12 + Top = 2145 + Width = 600 + End + Begin VB.TextBox txtOLime + Alignment = 1 'Right Justify + Height = 315 + Left = 5490 + TabIndex = 11 + Top = 1815 + Width = 600 + End + Begin VB.TextBox txtOCement + Alignment = 1 'Right Justify + Height = 315 + Left = 3930 + TabIndex = 10 + Top = 1815 + Width = 600 + End + Begin VB.TextBox txtDesc + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 3705 + MaxLength = 30 + TabIndex = 7 + Top = 270 + Width = 2415 + End + Begin VB.TextBox txtTexture + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2895 + MaxLength = 2 + TabIndex = 6 + Top = 270 + Width = 735 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + Height = 555 + Left = 4995 + TabIndex = 4 + TabStop = 0 'False + Top = 5325 + Width = 1080 + End + Begin VB.CommandButton cmdThree + Caption = "&Three Coat" + Height = 555 + Left = 3355 + TabIndex = 3 + TabStop = 0 'False + Top = 5325 + Width = 1080 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + Height = 555 + Left = 1725 + TabIndex = 31 + Top = 5325 + Width = 1080 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 555 + Left = 105 + TabIndex = 2 + TabStop = 0 'False + Top = 5325 + Width = 1080 + End + Begin VB.ListBox lstTexture + Height = 2790 + Left = 180 + Sorted = -1 'True + TabIndex = 0 + Top = 285 + Width = 2595 + End + Begin VB.Line Line13 + X1 = 6090 + X2 = 6090 + Y1 = 6255 + Y2 = 8010 + End + Begin VB.Line Line12 + X1 = 4740 + X2 = 4740 + Y1 = 6255 + Y2 = 8010 + End + Begin VB.Line Line11 + X1 = 3570 + X2 = 3570 + Y1 = 6255 + Y2 = 8010 + End + Begin VB.Line Line10 + X1 = 2325 + X2 = 2325 + Y1 = 6255 + Y2 = 8010 + End + Begin VB.Line Line9 + X1 = 1245 + X2 = 1245 + Y1 = 6255 + Y2 = 8010 + End + Begin VB.Line Line8 + X1 = 60 + X2 = 6105 + Y1 = 8010 + Y2 = 8010 + End + Begin VB.Line Line7 + X1 = 45 + X2 = 6090 + Y1 = 7560 + Y2 = 7560 + End + Begin VB.Line Line6 + X1 = 45 + X2 = 6090 + Y1 = 7140 + Y2 = 7140 + End + Begin VB.Line Line5 + X1 = 45 + X2 = 6090 + Y1 = 6690 + Y2 = 6690 + End + Begin VB.Line Line4 + X1 = 45 + X2 = 6090 + Y1 = 6255 + Y2 = 6255 + End + Begin VB.Label lblTOBrown + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "TO-Brown" + Height = 195 + Left = 375 + TabIndex = 63 + Top = 7650 + Width = 720 + End + Begin VB.Label lblTOScratch + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "TO-Scratch" + Height = 195 + Left = 270 + TabIndex = 62 + Top = 7245 + Width = 825 + End + Begin VB.Label lblOBrown + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Orders-Brown" + Height = 195 + Left = 135 + TabIndex = 61 + Top = 6810 + Width = 960 + End + Begin VB.Label lblOScratch + AutoSize = -1 'True + Caption = "Orders-Scratch" + Height = 195 + Left = 30 + TabIndex = 60 + Top = 6360 + Width = 1065 + End + Begin VB.Label lblTCLime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lime" + Height = 195 + Left = 5160 + TabIndex = 59 + Top = 6030 + Width = 330 + End + Begin VB.Label lblTCCement + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cement" + Height = 195 + Left = 3915 + TabIndex = 58 + Top = 6030 + Width = 540 + End + Begin VB.Label lblTCORS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "River Sand" + Height = 195 + Left = 2565 + TabIndex = 57 + Top = 6030 + Width = 795 + End + Begin VB.Label lblTCOYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yds/Batch" + Height = 195 + Left = 1320 + TabIndex = 56 + Top = 6030 + Width = 765 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 1665 + X2 = 0 + Y1 = 3135 + Y2 = 3135 + End + Begin VB.Label lblTSYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Footage for Synthetic Finish around popouts:" + Height = 195 + Left = 210 + TabIndex = 55 + Top = 4980 + Width = 3720 + End + Begin VB.Label lblTYards + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yards Per Batch/SqFootage for Synthetic:" + Height = 195 + Left = 945 + TabIndex = 54 + Top = 4665 + Width = 2985 + End + Begin VB.Label lblTS30 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 30:" + Height = 195 + Left = 4800 + TabIndex = 53 + Top = 4305 + Width = 645 + End + Begin VB.Label lblTS20 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 20:" + Height = 195 + Left = 3285 + TabIndex = 52 + Top = 4305 + Width = 645 + End + Begin VB.Label lblTS16 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 16:" + Height = 195 + Left = 1650 + TabIndex = 51 + Top = 4305 + Width = 645 + End + Begin VB.Label lblTTRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture RS:" + Height = 195 + Left = 4650 + TabIndex = 50 + Top = 4005 + Width = 855 + End + Begin VB.Label lblTXRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Extra RSand:" + Height = 195 + Left = 45 + TabIndex = 49 + Top = 4305 + Width = 945 + End + Begin VB.Label lblTBRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown RSand:" + Height = 195 + Left = 2940 + TabIndex = 48 + Top = 4005 + Width = 1035 + End + Begin VB.Label lblTLime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lime:" + Height = 195 + Left = 1920 + TabIndex = 47 + Top = 4005 + Width = 375 + End + Begin VB.Label lblTCement + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cement:" + Height = 195 + Left = 405 + TabIndex = 46 + Top = 4005 + Width = 585 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 1665 + X2 = 1665 + Y1 = 3825 + Y2 = 3135 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 6135 + X2 = 1665 + Y1 = 3825 + Y2 = 3825 + End + Begin VB.Label lblSYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Footage for Synthetic Finish around popouts:" + Height = 195 + Left = 1740 + TabIndex = 45 + Top = 3555 + Width = 3720 + End + Begin VB.Label lblYards + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yards Per Batch/SqFootage for Synthetic:" + Height = 195 + Left = 2490 + TabIndex = 44 + Top = 3195 + Width = 2985 + End + Begin VB.Label lblSecondary + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Secondary Txture:" + Height = 195 + Left = 2910 + TabIndex = 43 + Top = 1035 + Width = 1305 + End + Begin VB.Label lblPrimary + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Primary Txture:" + Height = 195 + Left = 3165 + TabIndex = 42 + Top = 675 + Width = 1050 + End + Begin VB.Label lblOS30 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 30:" + Height = 195 + Left = 4815 + TabIndex = 41 + Top = 2850 + Width = 645 + End + Begin VB.Label lblOS20 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 20:" + Height = 195 + Left = 3240 + TabIndex = 40 + Top = 2880 + Width = 645 + End + Begin VB.Label lblOS16 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Silica 16:" + Height = 195 + Left = 4815 + TabIndex = 39 + Top = 2535 + Width = 645 + End + Begin VB.Label lblOXRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Extra RSand:" + Height = 195 + Left = 2940 + TabIndex = 38 + Top = 2565 + Width = 945 + End + Begin VB.Label lblOTRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture RS:" + Height = 195 + Left = 4605 + TabIndex = 37 + Top = 2190 + Width = 855 + End + Begin VB.Label lblOBRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown RSand:" + Height = 195 + Left = 2850 + TabIndex = 36 + Top = 2220 + Width = 1035 + End + Begin VB.Label lblOLime + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lime:" + Height = 195 + Left = 5085 + TabIndex = 35 + Top = 1860 + Width = 375 + End + Begin VB.Label lblOCement + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cement:" + Height = 195 + Left = 3285 + TabIndex = 34 + Top = 1890 + Width = 585 + End + Begin VB.Label lblAmts + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "All Amounts Are Per Batch" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 270 + Left = 2895 + TabIndex = 33 + Top = 1275 + Width = 3225 + End + Begin VB.Label lblTakeOff + Alignment = 2 'Center + Caption = "TakeOff Information" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 450 + Left = 240 + TabIndex = 32 + Top = 3330 + Width = 1080 + End + Begin VB.Label lblOrders + AutoSize = -1 'True + Caption = "Orders Information" + Height = 195 + Left = 2865 + TabIndex = 30 + Top = 1575 + Width = 1290 + End + Begin VB.Label lblNew + AutoSize = -1 'True + Caption = "Enter New Texture/Description" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 2895 + TabIndex = 5 + Top = 45 + Visible = 0 'False + Width = 2655 + End + Begin VB.Label lblTexture + AutoSize = -1 'True + Caption = "Texture Type/Description" + Height = 195 + Left = 180 + TabIndex = 1 + Top = 45 + Width = 1815 + End +End +Attribute VB_Name = "frmTexture" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim mintCONTID As Integer +Dim moRSFinish As Recordset, moRSTC As Recordset +Dim mboolSHOW As Boolean, mboolAdding As Boolean, mboolTCShow As Boolean + +Private Sub TextureLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String, lngRET As Long, aTabs(2) As Long +Dim dblSUM As Double + + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, ID, Desc FROM tblFinish" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTexture.Clear + + Do Until oRS.EOF + With lstTexture + + strLine = Field2Str(oRS!id) & " " & oRS!Desc ' & vbTab & oRS!o_qty + .AddItem strLine + .ItemData(.NewIndex) = oRS!autoid + End With + oRS.MoveNext + Loop + oRS.Close + + If lstTexture.ListCount Then + lstTexture.ListIndex = 0 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form TEXTURE - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False + cmdSave.Enabled = True + cmdExit.Enabled = False + mboolAdding = True + lstTexture.Enabled = False + Call FormClear + lblNew.Visible = True + txtTexture.Enabled = True + txtDesc.Enabled = True + txtTexture.SetFocus +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + lstTexture.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + cmdExit.Enabled = True + Call FormSave + lstTexture.SetFocus + txtTexture.Enabled = False + txtDesc.Enabled = False + lblNew.Visible = False +End Sub + +Private Sub cmdThree_Click() + frmTexture.Height = 9000 + cmdSave.Enabled = False + cmdAdd.Enabled = False + cmdThree.Enabled = False + lstTexture.Enabled = False + If TCFind() Then + Call TCShow + End If + txtTCOSYds.SetFocus +End Sub + +Private Sub cmdUpdate_Click() + Call TCSave + frmTexture.Height = 6375 + lstTexture.Enabled = True + cmdAdd.Enabled = True + cmdThree.Enabled = True +End Sub + +Private Sub Form_Load() + frmTexture.Height = 6375 + Call TextureLoad +End Sub + +Private Sub FormClear() + txtDesc = "" + txtTexture = "" + txtOCement = 0 + txtOLime = 0 + txtOBRS = 0 + txtOTRS = 0 + txtOXRS = 0 + txtOS16 = 0 + txtOS20 = 0 + txtOS30 = 0 + txtOYards = 0 + txtOSYds = 0 + txtPrimary = "" + txtSecondary = "" + txtTCement = 0 + txtTLime = 0 + txtTBRS = 0 + txtTTRS = 0 + txtTXRS = 0 + txtTS16 = 0 + txtTS20 = 0 + txtTS30 = 0 + txtTYards = 0 + txtTSYds = 0 +End Sub + +Private Sub TCClear() + txtTCOBCmnt = 0 + txtTCOBLime = 0 + txtTCOBYds = 0 + txtTCOBRS = 0 + txtTCOSCmnt = 0 + txtTCOSLime = 0 + txtTCOSYds = 0 + txtTCOSRS = 0 + txtTCTBCmnt = 0 + txtTCTBLime = 0 + txtTCTBYds = 0 + txtTCTBRS = 0 + txtTCTSCmnt = 0 + txtTCTSLime = 0 + txtTCTSYds = 0 + txtTCTSRS = 0 +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblFinish " + strSQL = strSQL & "WHERE AUTOID = " & mintCONTID + + Set moRSFinish = New Recordset + + moRSFinish.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSFinish.EOF Then + FormFind = False + Call FormClear + Else + FormFind = True + End If +End Function + +Private Function TCFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTCInfo " + + Set moRSTC = New Recordset + + moRSTC.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSTC.EOF Then + TCFind = False + Call TCClear + Else + TCFind = True + End If +End Function + +Private Sub FieldsSave() + On Error GoTo Error_EH + + + With moRSFinish + !cmnt = Field2Str2(txtOCement) + !lime = Field2Str2(txtOLime) + !brs = Field2Str2(txtOBRS) + !trs = Field2Str2(txtOTRS) + !xrs = Field2Str2(txtOXRS) + !s16 = Field2Str2(txtOS16) + !s20 = Field2Str2(txtOS20) + !s30 = Field2Str2(txtOS30) + !yds = Field2Str2(txtOYards) + !s_yds = Field2Str2(txtOSYds) + !Primary = Field2Str2(txtPrimary) + !Secondary = Field2Str2(txtSecondary) + !t_cmnt = Field2Str2(txtTCement) + !t_lime = Field2Str2(txtTLime) + !t_brs = Field2Str2(txtTBRS) + !t_trs = Field2Str2(txtTTRS) + !t_xrs = Field2Str2(txtTXRS) + !t_s16 = Field2Str2(txtTS16) + !t_s20 = Field2Str2(txtTS20) + !t_s30 = Field2Str2(txtTS30) + !t_yds = Field2Str2(txtTYards) + !t_s_yds = Field2Str2(txtTSYds) + !Update = Now() + !U_USER = gstrLOGIN + End With + + Exit Sub +Error_EH: + gstrMODULE = " Form Contractor - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim intBookmark As Integer + + On Error GoTo Error_EH + + If mboolAdding Then + moRSFinish.AddNew + moRSFinish!Desc = Field2Str2(txtDesc) + moRSFinish!id = Field2Str2(txtTexture) + Else + intBookmark = lstTexture.ListIndex + End If + + Call FieldsSave + + moRSFinish.Update + + + If mboolAdding Then + mboolAdding = False + intBookmark = 0 + End If + + Call TextureLoad + + lstTexture.ListIndex = intBookmark + Exit Sub + +Error_EH: + Call ErrorHandler(moRSFinish.ActiveConnection) + Exit Sub +End Sub + +Private Sub TCSave() + + On Error GoTo Error_EH + + With moRSTC + !brn_cmnt = Field2Str2(txtTCOBCmnt) + !brn_lime = Field2Str2(txtTCOBLime) + !brn_yd = Field2Str2(txtTCOBYds) + !brn_rs = Field2Str2(txtTCOBRS) + !scr_cmnt = Field2Str2(txtTCOSCmnt) + !scr_lime = Field2Str2(txtTCOSLime) + !scr_yd = Field2Str2(txtTCOSYds) + !scr_rs = Field2Str2(txtTCOSRS) + !t_brn_cmnt = Field2Str2(txtTCTBCmnt) + !t_brn_lime = Field2Str2(txtTCTBLime) + !t_brn_yd = Field2Str2(txtTCTBYds) + !t_brn_rs = Field2Str2(txtTCTBRS) + !t_scr_cmnt = Field2Str2(txtTCTSCmnt) + !t_scr_lime = Field2Str2(txtTCTSLime) + !t_scr_yd = Field2Str2(txtTCTSYds) + !t_scr_rs = Field2Str2(txtTCTSRS) + !Update = Now() + !U_USER = gstrLOGIN + End With + + moRSTC.Update + + Exit Sub + +Error_EH: + Call ErrorHandler(moRSFinish.ActiveConnection) + Exit Sub +End Sub + +Private Sub FormShow() +Dim oRS As Recordset, strSQL As String, intPCount As Integer + + mboolSHOW = True + mintCONTID = moRSFinish!autoid + + With moRSFinish + txtDesc = Field2Str(!Desc) + txtTexture = Field2Str(!id) + txtOCement = Field2Str(!cmnt) + txtOLime = Field2Str(!lime) + txtOBRS = Field2Str(!brs) + txtOTRS = Field2Str(!trs) + txtOXRS = Field2Str(!xrs) + txtOS16 = Field2Str(!s16) + txtOS20 = Field2Str(!s20) + txtOS30 = Field2Str(!s30) + txtOYards = Field2Str(!yds) + txtOSYds = Field2Str(!s_yds) + txtPrimary = Field2Str(!Primary) + txtSecondary = Field2Str(!Secondary) + txtTCement = Field2Str(!t_cmnt) + txtTLime = Field2Str(!t_lime) + txtTBRS = Field2Str(!t_brs) + txtTTRS = Field2Str(!t_trs) + txtTXRS = Field2Str(!t_xrs) + txtTS16 = Field2Str(!t_s16) + txtTS20 = Field2Str(!t_s20) + txtTS30 = Field2Str(!t_s30) + txtTYards = Field2Str(!t_yds) + txtTSYds = Field2Str(!t_s_yds) + End With + + mboolSHOW = False +End Sub + +Private Sub TCShow() +Dim oRS As Recordset, strSQL As String, intPCount As Integer + + mboolSHOW = True + + With moRSTC + txtTCOBCmnt = Field2Str(!brn_cmnt) + txtTCOBLime = Field2Str(!brn_lime) + txtTCOBYds = Field2Str(!brn_yd) + txtTCOBRS = Field2Str(!brn_rs) + txtTCOSCmnt = Field2Str(!scr_cmnt) + txtTCOSLime = Field2Str(!scr_lime) + txtTCOSYds = Field2Str(!scr_yd) + txtTCOSRS = Field2Str(!scr_rs) + txtTCTBCmnt = Field2Str(!t_brn_cmnt) + txtTCTBLime = Field2Str(!t_brn_lime) + txtTCTBYds = Field2Str(!t_brn_yd) + txtTCTBRS = Field2Str(!t_brn_rs) + txtTCTSCmnt = Field2Str(!t_scr_cmnt) + txtTCTSLime = Field2Str(!t_scr_lime) + txtTCTSYds = Field2Str(!t_scr_yd) + txtTCTSRS = Field2Str(!t_scr_rs) + End With + + mboolSHOW = False +End Sub + +Private Sub lstTexture_Click() + If lstTexture.ListIndex <> -1 Then + mintCONTID = lstTexture.ItemData(lstTexture.ListIndex) + If FormFind() Then + Call FormShow + + End If + End If + +End Sub + +Private Sub lstTexture_DblClick() + cmdSave.Enabled = True +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtOBRS_GotFocus() + Call FieldSelect(txtOBRS) +End Sub + +Private Sub txtOCement_GotFocus() + Call FieldSelect(txtOCement) +End Sub + +Private Sub txtOLime_GotFocus() + Call FieldSelect(txtOLime) +End Sub + +Private Sub txtOS16_GotFocus() + Call FieldSelect(txtOS16) +End Sub + +Private Sub txtOS20_GotFocus() + Call FieldSelect(txtOS20) +End Sub + +Private Sub txtOS30_GotFocus() + Call FieldSelect(txtOS30) +End Sub + +Private Sub txtOSYds_GotFocus() + Call FieldSelect(txtOSYds) +End Sub + +Private Sub txtOTRS_GotFocus() + Call FieldSelect(txtOTRS) +End Sub + +Private Sub txtOXRS_GotFocus() + Call FieldSelect(txtOXRS) +End Sub + +Private Sub txtOYards_GotFocus() + Call FieldSelect(txtOYards) +End Sub + +Private Sub txtPrimary_GotFocus() + Call FieldSelect(txtPrimary) +End Sub + +Private Sub txtPrimary_LostFocus() + txtPrimary = UCase(txtPrimary) +End Sub + +Private Sub txtSecondary_GotFocus() + Call FieldSelect(txtSecondary) +End Sub + +Private Sub txtSecondary_LostFocus() + txtSecondary = UCase(txtSecondary) +End Sub + +Private Sub txtTBRS_GotFocus() + Call FieldSelect(txtTBRS) +End Sub + +Private Sub txtTCement_GotFocus() + Call FieldSelect(txtTCement) +End Sub + +Private Sub txtTCOBCmnt_GotFocus() + Call FieldSelect(txtTCOBCmnt) +End Sub + +Private Sub txtTCOBLime_GotFocus() + Call FieldSelect(txtTCOBLime) +End Sub + +Private Sub txtTCOBRS_GotFocus() + Call FieldSelect(txtTCOBRS) +End Sub + +Private Sub txtTCOBYds_GotFocus() + Call FieldSelect(txtTCOBYds) +End Sub + +Private Sub txtTCOSCmnt_GotFocus() + Call FieldSelect(txtTCOSCmnt) +End Sub + +Private Sub txtTCOSLime_GotFocus() + Call FieldSelect(txtTCOSLime) +End Sub + +Private Sub txtTCOSRS_GotFocus() + Call FieldSelect(txtTCOSRS) +End Sub + +Private Sub txtTCOSYds_GotFocus() + Call FieldSelect(txtTCOSYds) +End Sub + +Private Sub txtTCTBCmnt_GotFocus() + Call FieldSelect(txtTCTBCmnt) +End Sub + +Private Sub txtTCTBLime_GotFocus() + Call FieldSelect(txtTCTBLime) +End Sub + +Private Sub txtTCTBRS_GotFocus() + Call FieldSelect(txtTCTBRS) +End Sub + +Private Sub txtTCTBYds_GotFocus() + Call FieldSelect(txtTCTBYds) +End Sub + +Private Sub txtTCTSCmnt_GotFocus() + Call FieldSelect(txtTCTSCmnt) +End Sub + +Private Sub txtTCTSLime_GotFocus() + Call FieldSelect(txtTCTSLime) +End Sub + +Private Sub txtTCTSRS_GotFocus() + Call FieldSelect(txtTCTSRS) +End Sub + +Private Sub txtTCTSYds_GotFocus() + Call FieldSelect(txtTCTSYds) +End Sub + +Private Sub txtTexture_GotFocus() + Call FieldSelect(txtTexture) +End Sub + +Private Sub txtTexture_LostFocus() + txtTexture = UCase(txtTexture) +End Sub + +Private Sub txtTLime_GotFocus() + Call FieldSelect(txtTLime) +End Sub + +Private Sub txtTS16_GotFocus() + Call FieldSelect(txtTS16) +End Sub + +Private Sub txtTS20_GotFocus() + Call FieldSelect(txtTS20) +End Sub + +Private Sub txtTS30_GotFocus() + Call FieldSelect(txtTS30) +End Sub + +Private Sub txtTSYds_GotFocus() + Call FieldSelect(txtTSYds) +End Sub + +Private Sub txtTTRS_GotFocus() + Call FieldSelect(txtTTRS) +End Sub + +Private Sub txtTXRS_GotFocus() + Call FieldSelect(txtTXRS) +End Sub + +Private Sub txtTYards_GotFocus() + Call FieldSelect(txtTYards) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frm new file mode 100644 index 0000000..7742c8f --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frm @@ -0,0 +1,465 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmTexture + Caption = "Texture Information" + ClientHeight = 4200 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 4200 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 10380 + TabIndex = 8 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 6940 + TabIndex = 7 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3500 + TabIndex = 6 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 5220 + Picture = "frmTexture1.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 5580 + Picture = "frmTexture1.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5925 + Picture = "frmTexture1.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 6285 + Picture = "frmTexture1.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 3435 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 11700 + _ExtentX = 20638 + _ExtentY = 6059 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Texture" + Columns(0).DataField= "id" + Columns(0).DataWidth= 2 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Yards" + Columns(2).DataField= "yds" + Columns(2).DataWidth= 3 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Cement" + Columns(3).DataField= "cmnt" + Columns(3).DataWidth= 3 + Columns(3).DefaultValue= "0" + Columns(3).DefaultValue.vt= 8 + Columns(3).NumberFormat= "General Number" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "Lime" + Columns(4).DataField= "lime" + Columns(4).DataWidth= 3 + Columns(4).DefaultValue= "0" + Columns(4).DefaultValue.vt= 8 + Columns(4).NumberFormat= "General Number" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "Brown RS" + Columns(5).DataField= "brs" + Columns(5).DataWidth= 3 + Columns(5).DefaultValue= "0" + Columns(5).DefaultValue.vt= 8 + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Texture RS" + Columns(6).DataField= "trs" + Columns(6).DataWidth= 3 + Columns(6).DefaultValue= "0" + Columns(6).DefaultValue.vt= 8 + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 0 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "Extra RS" + Columns(7).DataField= "xrs" + Columns(7).DataWidth= 3 + Columns(7).DefaultValue= "0" + Columns(7).DefaultValue.vt= 8 + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "Silica 16" + Columns(8).DataField= "s16" + Columns(8).DataWidth= 2 + Columns(8).DefaultValue= "0" + Columns(8).DefaultValue.vt= 8 + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(9)._VlistStyle= 0 + Columns(9)._MaxComboItems= 5 + Columns(9).Caption= "Silica 20" + Columns(9).DataField= "s20" + Columns(9).DataWidth= 2 + Columns(9).DefaultValue= "0" + Columns(9).DefaultValue.vt= 8 + Columns(9)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(10)._VlistStyle= 0 + Columns(10)._MaxComboItems= 5 + Columns(10).Caption= "Silica 30" + Columns(10).DataField= "s30" + Columns(10).DataWidth= 2 + Columns(10).DefaultValue= "0" + Columns(10).DefaultValue.vt= 8 + Columns(10)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 11 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=11" + Splits(0)._ColumnProps(1)= "Column(0).Width=1323" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1244" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=3704" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=3625" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1588" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1508" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=1588" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=1508" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=1244" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=1164" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=1667" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=1588" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1931" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1852" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1588" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1508" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1588" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1508" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits(0)._ColumnProps(37)= "Column(9).Width=1588" + Splits(0)._ColumnProps(38)= "Column(9).DividerColor=0" + Splits(0)._ColumnProps(39)= "Column(9)._WidthInPix=1508" + Splits(0)._ColumnProps(40)= "Column(9).Order=10" + Splits(0)._ColumnProps(41)= "Column(10).Width=1588" + Splits(0)._ColumnProps(42)= "Column(10).DividerColor=0" + Splits(0)._ColumnProps(43)= "Column(10)._WidthInPix=1508" + Splits(0)._ColumnProps(44)= "Column(10).Order=11" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + Caption = "All Amounts Are Per Batch" + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34,.bold=-1,.fontsize=825,.italic=0" + _StyleDefs(9) = ":id=2,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(10) = ":id=2,.fontname=MS Sans Serif" + _StyleDefs(11) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(12) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(13) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(14) = "EditorStyle:id=7,.parent=1" + _StyleDefs(15) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(16) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(17) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(18) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(19) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(20) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(21) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(22) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(23) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(24) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(25) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(26) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(27) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(28) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(29) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(30) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(31) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(32) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(33) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(34) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(35) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(36) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(37) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(38) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(39) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(40) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(41) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(42) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(43) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(44) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(45) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(46) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(47) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(48) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(49) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(50) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(51) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(52) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(53) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(54) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(55) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(56) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(57) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(58) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(59) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(60) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(61) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(62) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(63) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(64) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(65) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(66) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(67) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(68) = "Splits(0).Columns(9).Style:id=74,.parent=13" + _StyleDefs(69) = "Splits(0).Columns(9).HeadingStyle:id=71,.parent=14" + _StyleDefs(70) = "Splits(0).Columns(9).FooterStyle:id=72,.parent=15" + _StyleDefs(71) = "Splits(0).Columns(9).EditorStyle:id=73,.parent=17" + _StyleDefs(72) = "Splits(0).Columns(10).Style:id=78,.parent=13" + _StyleDefs(73) = "Splits(0).Columns(10).HeadingStyle:id=75,.parent=14" + _StyleDefs(74) = "Splits(0).Columns(10).FooterStyle:id=76,.parent=15" + _StyleDefs(75) = "Splits(0).Columns(10).EditorStyle:id=77,.parent=17" + _StyleDefs(76) = "Named:id=33:Normal" + _StyleDefs(77) = ":id=33,.parent=0" + _StyleDefs(78) = "Named:id=34:Heading" + _StyleDefs(79) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(80) = ":id=34,.wraptext=-1" + _StyleDefs(81) = "Named:id=35:Footing" + _StyleDefs(82) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(83) = "Named:id=36:Selected" + _StyleDefs(84) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(85) = "Named:id=37:Caption" + _StyleDefs(86) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(87) = "Named:id=38:HighlightRow" + _StyleDefs(88) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(89) = "Named:id=39:EvenRow" + _StyleDefs(90) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(91) = "Named:id=40:OddRow" + _StyleDefs(92) = ":id=40,.parent=33" + _StyleDefs(93) = "Named:id=41:RecordSelector" + _StyleDefs(94) = ":id=41,.parent=34" + _StyleDefs(95) = "Named:id=42:FilterBar" + _StyleDefs(96) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmTexture" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.AddNew +' TDBGLabor.Text = "aa" +' moRS.Update + TDBGLabor.SetFocus + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Delete + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Update + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub Form_Load() + Err.Clear + On Error GoTo Error_EH + + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + Exit Sub + + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + Err.Clear + + strSQL = "SELECT * FROM tblfinish" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture1.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frm new file mode 100644 index 0000000..34595ac --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frm @@ -0,0 +1,465 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "TODG7.OCX" +Begin VB.Form frmTexture1 + Caption = "Texture Information" + ClientHeight = 4200 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 11880 + LinkTopic = "Form1" + ScaleHeight = 4200 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 10380 + TabIndex = 8 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 6940 + TabIndex = 7 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3500 + TabIndex = 6 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 3540 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 5220 + Picture = "frmTexture.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 5580 + Picture = "frmTexture.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5925 + Picture = "frmTexture.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 6285 + Picture = "frmTexture.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 3660 + UseMaskColor = -1 'True + Width = 345 + End + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 3435 + Left = 60 + TabIndex = 0 + Top = 60 + Width = 11700 + _ExtentX = 20638 + _ExtentY = 6059 + _LayoutType = 4 + _RowHeight = -2147483647 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 5 + Columns(0).Caption= "Texture" + Columns(0).DataField= "id" + Columns(0).DataWidth= 2 + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Yards" + Columns(2).DataField= "yds" + Columns(2).DataWidth= 3 + Columns(2).DefaultValue= "0" + Columns(2).DefaultValue.vt= 8 + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 0 + Columns(3)._MaxComboItems= 5 + Columns(3).Caption= "Cement" + Columns(3).DataField= "cmnt" + Columns(3).DataWidth= 3 + Columns(3).DefaultValue= "0" + Columns(3).DefaultValue.vt= 8 + Columns(3).NumberFormat= "General Number" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 0 + Columns(4)._MaxComboItems= 5 + Columns(4).Caption= "Lime" + Columns(4).DataField= "lime" + Columns(4).DataWidth= 3 + Columns(4).DefaultValue= "0" + Columns(4).DefaultValue.vt= 8 + Columns(4).NumberFormat= "General Number" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(5)._VlistStyle= 0 + Columns(5)._MaxComboItems= 5 + Columns(5).Caption= "Brown RS" + Columns(5).DataField= "brs" + Columns(5).DataWidth= 3 + Columns(5).DefaultValue= "0" + Columns(5).DefaultValue.vt= 8 + Columns(5)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(6)._VlistStyle= 0 + Columns(6)._MaxComboItems= 5 + Columns(6).Caption= "Texture RS" + Columns(6).DataField= "trs" + Columns(6).DataWidth= 3 + Columns(6).DefaultValue= "0" + Columns(6).DefaultValue.vt= 8 + Columns(6)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(7)._VlistStyle= 0 + Columns(7)._MaxComboItems= 5 + Columns(7).Caption= "Extra RS" + Columns(7).DataField= "xrs" + Columns(7).DataWidth= 3 + Columns(7).DefaultValue= "0" + Columns(7).DefaultValue.vt= 8 + Columns(7)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(8)._VlistStyle= 0 + Columns(8)._MaxComboItems= 5 + Columns(8).Caption= "Silica 16" + Columns(8).DataField= "s16" + Columns(8).DataWidth= 2 + Columns(8).DefaultValue= "0" + Columns(8).DefaultValue.vt= 8 + Columns(8)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(9)._VlistStyle= 0 + Columns(9)._MaxComboItems= 5 + Columns(9).Caption= "Silica 20" + Columns(9).DataField= "s20" + Columns(9).DataWidth= 2 + Columns(9).DefaultValue= "0" + Columns(9).DefaultValue.vt= 8 + Columns(9)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(10)._VlistStyle= 0 + Columns(10)._MaxComboItems= 5 + Columns(10).Caption= "Silica 30" + Columns(10).DataField= "s30" + Columns(10).DataWidth= 2 + Columns(10).DefaultValue= "0" + Columns(10).DefaultValue.vt= 8 + Columns(10)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 11 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=11" + Splits(0)._ColumnProps(1)= "Column(0).Width=1323" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=1244" + Splits(0)._ColumnProps(4)= "Column(0).Order=1" + Splits(0)._ColumnProps(5)= "Column(1).Width=3704" + Splits(0)._ColumnProps(6)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(7)= "Column(1)._WidthInPix=3625" + Splits(0)._ColumnProps(8)= "Column(1).Order=2" + Splits(0)._ColumnProps(9)= "Column(2).Width=1588" + Splits(0)._ColumnProps(10)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(11)= "Column(2)._WidthInPix=1508" + Splits(0)._ColumnProps(12)= "Column(2).Order=3" + Splits(0)._ColumnProps(13)= "Column(3).Width=1588" + Splits(0)._ColumnProps(14)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(15)= "Column(3)._WidthInPix=1508" + Splits(0)._ColumnProps(16)= "Column(3).Order=4" + Splits(0)._ColumnProps(17)= "Column(4).Width=1244" + Splits(0)._ColumnProps(18)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(19)= "Column(4)._WidthInPix=1164" + Splits(0)._ColumnProps(20)= "Column(4).Order=5" + Splits(0)._ColumnProps(21)= "Column(5).Width=1667" + Splits(0)._ColumnProps(22)= "Column(5).DividerColor=0" + Splits(0)._ColumnProps(23)= "Column(5)._WidthInPix=1588" + Splits(0)._ColumnProps(24)= "Column(5).Order=6" + Splits(0)._ColumnProps(25)= "Column(6).Width=1931" + Splits(0)._ColumnProps(26)= "Column(6).DividerColor=0" + Splits(0)._ColumnProps(27)= "Column(6)._WidthInPix=1852" + Splits(0)._ColumnProps(28)= "Column(6).Order=7" + Splits(0)._ColumnProps(29)= "Column(7).Width=1588" + Splits(0)._ColumnProps(30)= "Column(7).DividerColor=0" + Splits(0)._ColumnProps(31)= "Column(7)._WidthInPix=1508" + Splits(0)._ColumnProps(32)= "Column(7).Order=8" + Splits(0)._ColumnProps(33)= "Column(8).Width=1588" + Splits(0)._ColumnProps(34)= "Column(8).DividerColor=0" + Splits(0)._ColumnProps(35)= "Column(8)._WidthInPix=1508" + Splits(0)._ColumnProps(36)= "Column(8).Order=9" + Splits(0)._ColumnProps(37)= "Column(9).Width=1588" + Splits(0)._ColumnProps(38)= "Column(9).DividerColor=0" + Splits(0)._ColumnProps(39)= "Column(9)._WidthInPix=1508" + Splits(0)._ColumnProps(40)= "Column(9).Order=10" + Splits(0)._ColumnProps(41)= "Column(10).Width=1588" + Splits(0)._ColumnProps(42)= "Column(10).DividerColor=0" + Splits(0)._ColumnProps(43)= "Column(10)._WidthInPix=1508" + Splits(0)._ColumnProps(44)= "Column(10).Order=11" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + Caption = "All Amounts Are Per Batch" + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34,.bold=-1,.fontsize=825,.italic=0" + _StyleDefs(9) = ":id=2,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(10) = ":id=2,.fontname=MS Sans Serif" + _StyleDefs(11) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(12) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(13) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(14) = "EditorStyle:id=7,.parent=1" + _StyleDefs(15) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(16) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(17) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(18) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(19) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(20) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(21) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(22) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(23) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(24) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(25) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(26) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(27) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(28) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(29) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(30) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(31) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(32) = "Splits(0).Columns(0).Style:id=28,.parent=13" + _StyleDefs(33) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(34) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(35) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(36) = "Splits(0).Columns(1).Style:id=32,.parent=13" + _StyleDefs(37) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(38) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(39) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(40) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(41) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(42) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(43) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(44) = "Splits(0).Columns(3).Style:id=50,.parent=13" + _StyleDefs(45) = "Splits(0).Columns(3).HeadingStyle:id=47,.parent=14" + _StyleDefs(46) = "Splits(0).Columns(3).FooterStyle:id=48,.parent=15" + _StyleDefs(47) = "Splits(0).Columns(3).EditorStyle:id=49,.parent=17" + _StyleDefs(48) = "Splits(0).Columns(4).Style:id=54,.parent=13" + _StyleDefs(49) = "Splits(0).Columns(4).HeadingStyle:id=51,.parent=14" + _StyleDefs(50) = "Splits(0).Columns(4).FooterStyle:id=52,.parent=15" + _StyleDefs(51) = "Splits(0).Columns(4).EditorStyle:id=53,.parent=17" + _StyleDefs(52) = "Splits(0).Columns(5).Style:id=58,.parent=13" + _StyleDefs(53) = "Splits(0).Columns(5).HeadingStyle:id=55,.parent=14" + _StyleDefs(54) = "Splits(0).Columns(5).FooterStyle:id=56,.parent=15" + _StyleDefs(55) = "Splits(0).Columns(5).EditorStyle:id=57,.parent=17" + _StyleDefs(56) = "Splits(0).Columns(6).Style:id=62,.parent=13" + _StyleDefs(57) = "Splits(0).Columns(6).HeadingStyle:id=59,.parent=14" + _StyleDefs(58) = "Splits(0).Columns(6).FooterStyle:id=60,.parent=15" + _StyleDefs(59) = "Splits(0).Columns(6).EditorStyle:id=61,.parent=17" + _StyleDefs(60) = "Splits(0).Columns(7).Style:id=66,.parent=13" + _StyleDefs(61) = "Splits(0).Columns(7).HeadingStyle:id=63,.parent=14" + _StyleDefs(62) = "Splits(0).Columns(7).FooterStyle:id=64,.parent=15" + _StyleDefs(63) = "Splits(0).Columns(7).EditorStyle:id=65,.parent=17" + _StyleDefs(64) = "Splits(0).Columns(8).Style:id=70,.parent=13" + _StyleDefs(65) = "Splits(0).Columns(8).HeadingStyle:id=67,.parent=14" + _StyleDefs(66) = "Splits(0).Columns(8).FooterStyle:id=68,.parent=15" + _StyleDefs(67) = "Splits(0).Columns(8).EditorStyle:id=69,.parent=17" + _StyleDefs(68) = "Splits(0).Columns(9).Style:id=74,.parent=13" + _StyleDefs(69) = "Splits(0).Columns(9).HeadingStyle:id=71,.parent=14" + _StyleDefs(70) = "Splits(0).Columns(9).FooterStyle:id=72,.parent=15" + _StyleDefs(71) = "Splits(0).Columns(9).EditorStyle:id=73,.parent=17" + _StyleDefs(72) = "Splits(0).Columns(10).Style:id=78,.parent=13" + _StyleDefs(73) = "Splits(0).Columns(10).HeadingStyle:id=75,.parent=14" + _StyleDefs(74) = "Splits(0).Columns(10).FooterStyle:id=76,.parent=15" + _StyleDefs(75) = "Splits(0).Columns(10).EditorStyle:id=77,.parent=17" + _StyleDefs(76) = "Named:id=33:Normal" + _StyleDefs(77) = ":id=33,.parent=0" + _StyleDefs(78) = "Named:id=34:Heading" + _StyleDefs(79) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(80) = ":id=34,.wraptext=-1" + _StyleDefs(81) = "Named:id=35:Footing" + _StyleDefs(82) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(83) = "Named:id=36:Selected" + _StyleDefs(84) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(85) = "Named:id=37:Caption" + _StyleDefs(86) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(87) = "Named:id=38:HighlightRow" + _StyleDefs(88) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(89) = "Named:id=39:EvenRow" + _StyleDefs(90) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(91) = "Named:id=40:OddRow" + _StyleDefs(92) = ":id=40,.parent=33" + _StyleDefs(93) = "Named:id=41:RecordSelector" + _StyleDefs(94) = ":id=41,.parent=34" + _StyleDefs(95) = "Named:id=42:FilterBar" + _StyleDefs(96) = ":id=42,.parent=33" + End +End +Attribute VB_Name = "frmTexture1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.AddNew +' TDBGLabor.Text = "aa" +' moRS.Update + TDBGLabor.SetFocus + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdDelete_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Delete + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + Err.Clear + On Error GoTo Error_EH + + moRS.Update + Exit Sub + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub Form_Load() + Err.Clear + On Error GoTo Error_EH + + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + Exit Sub + + +Error_EH: + If Err = "-2147217887" Then + Resume Next + Else + Call ErrorHandler(moRS.ActiveConnection) + Exit Sub + End If +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + Err.Clear + + strSQL = "SELECT * FROM tblfinish" + + Set moRS = New Recordset + + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTexture2.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTextureold.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTextureold.frm new file mode 100644 index 0000000..699b2f1 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmTextureold.frm @@ -0,0 +1,254 @@ +VERSION 5.00 +Begin VB.Form frmTexture1 + Caption = "Texture Information" + ClientHeight = 5010 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 8460 + LinkTopic = "Form1" + ScaleHeight = 5010 + ScaleWidth = 8460 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdTExit + Caption = "Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 6540 + TabIndex = 24 + Top = 3240 + Width = 1635 + End + Begin VB.CommandButton cmdTSave + Caption = "Save" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 6540 + TabIndex = 23 + Top = 2280 + Width = 1635 + End + Begin VB.CommandButton cmdTAdd + Caption = "Add" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 795 + Left = 6540 + TabIndex = 22 + Top = 1320 + Width = 1635 + End + Begin VB.TextBox txtTS30 + Height = 315 + Left = 5340 + TabIndex = 21 + Top = 4440 + Width = 855 + End + Begin VB.TextBox txtTS20 + Height = 315 + Left = 5340 + TabIndex = 20 + Top = 4020 + Width = 855 + End + Begin VB.TextBox txtTS16 + Height = 315 + Left = 5340 + TabIndex = 19 + Top = 3600 + Width = 855 + End + Begin VB.TextBox txtTERS + Height = 315 + Left = 5340 + TabIndex = 18 + Top = 3180 + Width = 855 + End + Begin VB.TextBox txtTTRS + Height = 315 + Left = 5340 + TabIndex = 17 + Top = 2760 + Width = 855 + End + Begin VB.TextBox txtTBRS + Height = 315 + Left = 5340 + TabIndex = 16 + Top = 2340 + Width = 855 + End + Begin VB.TextBox txtTLime + Height = 315 + Left = 5340 + TabIndex = 15 + Top = 1920 + Width = 855 + End + Begin VB.TextBox txtTCmnt + Height = 315 + Left = 5340 + TabIndex = 14 + Top = 1500 + Width = 855 + End + Begin VB.TextBox txtTYPB + Height = 315 + Left = 5340 + TabIndex = 13 + Top = 1080 + Width = 855 + End + Begin VB.TextBox txtTDesc + Height = 315 + Left = 5340 + TabIndex = 12 + Top = 660 + Width = 2655 + End + Begin VB.TextBox txtTID + Height = 315 + Left = 5340 + TabIndex = 11 + Top = 240 + Width = 615 + End + Begin VB.ListBox lslTexture + Height = 4350 + Left = 180 + TabIndex = 0 + Top = 360 + Width = 2535 + End + Begin VB.Label lblTS30 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bags Silica 30 per Batch:" + Height = 195 + Left = 3480 + TabIndex = 10 + Top = 4440 + Width = 1785 + End + Begin VB.Label lblTS20 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bags Silica 20 per Batch:" + Height = 195 + Left = 3480 + TabIndex = 9 + Top = 4080 + Width = 1785 + End + Begin VB.Label lblTS16 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bags Silica 16 per Batch:" + Height = 195 + Left = 3480 + TabIndex = 8 + Top = 3660 + Width = 1785 + End + Begin VB.Label lblTERS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Extra River Sand Pounds:" + Height = 195 + Left = 3480 + TabIndex = 7 + Top = 3240 + Width = 1830 + End + Begin VB.Label lblTTRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture River Sand Pounds:" + Height = 195 + Left = 3240 + TabIndex = 6 + Top = 2820 + Width = 2010 + End + Begin VB.Label lblTBRS + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Brown River Sand Pounds:" + Height = 195 + Left = 3360 + TabIndex = 5 + Top = 2400 + Width = 1920 + End + Begin VB.Label lblTLimeLabel4 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bags Lime Per Batch:" + Height = 195 + Left = 3720 + TabIndex = 4 + Top = 1920 + Width = 1530 + End + Begin VB.Label lblTCmnt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Bags Cement Per Batch:" + Height = 195 + Left = 3540 + TabIndex = 3 + Top = 1500 + Width = 1740 + End + Begin VB.Label lblID + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "ID/Texture:" + Height = 195 + Left = 4440 + TabIndex = 2 + Top = 300 + Width = 825 + End + Begin VB.Label lblYdsBatch + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Yards Per Batch" + Height = 195 + Left = 4080 + TabIndex = 1 + Top = 1080 + Width = 1155 + End +End +Attribute VB_Name = "frmTexture1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmUser.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmUser.frm new file mode 100644 index 0000000..e28e6cb --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmUser.frm @@ -0,0 +1,468 @@ +VERSION 5.00 +Begin VB.Form frmUser + Caption = "User Information" + ClientHeight = 5250 + ClientLeft = 60 + ClientTop = 405 + ClientWidth = 5205 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 5250 + ScaleWidth = 5205 + StartUpPosition = 3 'Windows Default + Begin VB.CheckBox chkINVADD + Alignment = 1 'Right Justify + Caption = "Add ORDERS INV Items" + Height = 225 + Left = 2955 + TabIndex = 21 + Top = 4350 + Width = 2115 + End + Begin VB.CheckBox chkLocked + Alignment = 1 'Right Justify + Caption = "Locked Out:" + Height = 225 + Left = 3855 + TabIndex = 20 + Top = 4095 + Width = 1215 + End + Begin VB.CommandButton cmdExit + Caption = "E&xit" + Height = 555 + Left = 3780 + TabIndex = 19 + Top = 4620 + Width = 1335 + End + Begin VB.CommandButton cmdSave + Caption = "&Save" + Enabled = 0 'False + Height = 555 + Left = 1890 + TabIndex = 18 + Top = 4620 + Width = 1215 + End + Begin VB.CommandButton cmdAdd + Caption = "&Add" + Height = 555 + Left = 60 + TabIndex = 17 + Top = 4620 + Width = 1155 + End + Begin VB.ComboBox cboSecurity + Height = 315 + ItemData = "frmUser.frx":0000 + Left = 3000 + List = "frmUser.frx":0002 + Style = 2 'Dropdown List + TabIndex = 16 + Top = 2250 + Width = 2115 + End + Begin VB.TextBox txtLastLogin + Enabled = 0 'False + Height = 315 + Left = 3000 + TabIndex = 15 + Top = 3660 + Width = 1695 + End + Begin VB.TextBox txtLastUpdate + Enabled = 0 'False + Height = 315 + Left = 3000 + TabIndex = 14 + Top = 3186 + Width = 1695 + End + Begin VB.TextBox txtLastUpUser + Enabled = 0 'False + Height = 315 + Left = 3000 + TabIndex = 13 + Top = 2715 + Width = 1095 + End + Begin VB.TextBox txtPassword + Height = 315 + IMEMode = 3 'DISABLE + Left = 3000 + MaxLength = 15 + TabIndex = 12 + Top = 1773 + Width = 1695 + End + Begin VB.TextBox txtUserId + Height = 315 + Left = 3000 + MaxLength = 6 + TabIndex = 11 + Top = 1302 + Width = 1095 + End + Begin VB.TextBox txtFirst + Height = 315 + Left = 3000 + MaxLength = 20 + TabIndex = 10 + Top = 831 + Width = 2115 + End + Begin VB.TextBox txtLast + Height = 315 + Left = 3000 + MaxLength = 20 + TabIndex = 9 + Top = 360 + Width = 2115 + End + Begin VB.ListBox lstUser + Height = 3570 + Left = 60 + TabIndex = 0 + Top = 420 + Width = 1215 + End + Begin VB.Label lblLastLogDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Login Date:" + Height = 195 + Left = 1725 + TabIndex = 8 + Top = 3720 + Width = 1170 + End + Begin VB.Label lblLastUDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Updated Date:" + Height = 195 + Left = 1500 + TabIndex = 7 + Top = 3246 + Width = 1395 + End + Begin VB.Label lblLastUpUser + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Updated By:" + Height = 195 + Left = 1665 + TabIndex = 6 + Top = 2775 + Width = 1230 + End + Begin VB.Label lblSecurity + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sercurity Level:" + Height = 195 + Left = 1800 + TabIndex = 5 + Top = 2304 + Width = 1095 + End + Begin VB.Label lblPassword + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Password:" + Height = 195 + Left = 2160 + TabIndex = 4 + Top = 1833 + Width = 735 + End + Begin VB.Label lblUserId + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "User Id:" + Height = 195 + Left = 2340 + TabIndex = 3 + Top = 1362 + Width = 555 + End + Begin VB.Label lblFirst + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "First Name:" + Height = 195 + Left = 2100 + TabIndex = 2 + Top = 891 + Width = 795 + End + Begin VB.Label lblLast + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Name:" + Height = 195 + Left = 2085 + TabIndex = 1 + Top = 420 + Width = 810 + End +End +Attribute VB_Name = "frmUser" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSUser As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean +Dim mboolDelete As Boolean + +Private Sub cmdAdd_Click() + cmdAdd.Enabled = False +' cmdDelete.Enabled = False + cmdExit.Enabled = False + lstUser.Enabled = False + mboolAdding = True + Call FormClear +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSave_Click() + lstUser.Enabled = True +' cmdDelete.Enabled = True + cmdSave.Enabled = False + cmdAdd.Enabled = True + cmdExit.Enabled = True + Call FormSave +End Sub + +Private Sub Form_Load() + Call UserLoad + Call SecurityLoad +End Sub + +Private Sub UserLoad() + Dim oRS As Recordset + Dim strSQL As String + Dim strLine As String + + strSQL = "SELECT Userid, LoginId from tblUsers" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstUser.Clear + + Do Until oRS.EOF + With lstUser + + .AddItem Field2Str(oRS!loginid) + .ItemData(.NewIndex) = oRS!userid + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstUser.ListCount Then + lstUser.ListIndex = -1 + End If + +End Sub + +Private Sub FormSave() +Dim intBOOKMARK As Integer + + On Error GoTo Error_EH + + If mboolAdding Then + moRSUser.AddNew + Else + intBOOKMARK = lstUser.ListIndex + End If + + Call FieldsSave + + moRSUser.Update + + + If mboolAdding Then + mboolAdding = False + intBOOKMARK = 0 + End If + + Call UserLoad + + lstUser.ListIndex = intBOOKMARK + Exit Sub + +Error_EH: + Call ErrorHandler(moRSUser.ActiveConnection) + Exit Sub +End Sub + +Private Sub SecurityLoad() + + cboSecurity.Clear + + cboSecurity.AddItem ("Administrative") + cboSecurity.ItemData(cboSecurity.NewIndex) = 1 + cboSecurity.AddItem ("Estimating") + cboSecurity.ItemData(cboSecurity.NewIndex) = 2 + cboSecurity.AddItem ("Orders") + cboSecurity.ItemData(cboSecurity.NewIndex) = 6 + cboSecurity.AddItem ("Billing") + cboSecurity.ItemData(cboSecurity.NewIndex) = 7 + cboSecurity.AddItem ("Payroll View") + cboSecurity.ItemData(cboSecurity.NewIndex) = 8 + cboSecurity.AddItem ("Inventory") + cboSecurity.ItemData(cboSecurity.NewIndex) = 9 + cboSecurity.AddItem ("Payroll Process") + cboSecurity.ItemData(cboSecurity.NewIndex) = 10 + +End Sub + +Private Sub FormClear() + txtLast = "" + txtFirst = "" + txtUserId = "" + txtPassword = "" + txtLastLogin = "" + txtLastUpdate = "" + txtLastUpUser = "" + chkLocked = vbUnchecked + cboSecurity.ListIndex = -1 +End Sub + +Private Function FormFind() As Boolean + Dim strSQL As String, strPlan As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblUsers " + strSQL = strSQL & "WHERE userid = " & lstUser.ItemData(lstUser.ListIndex) + + Set moRSUser = New Recordset + + moRSUser.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSUser.EOF Then + FormFind = False + Else + FormFind = True + End If +End Function +Private Sub FieldsSave() + + With moRSUser + !LastName = Str2Field(txtLast) + !FirstName = Str2Field(txtFirst) + !loginid = Str2Field(txtUserId) + !Password = Str2Field(txtPassword) + !security = cboSecurity.ItemData(cboSecurity.ListIndex) + !lastupdateid = gstrLOGIN + !lastupdatedate = Now() + !lastlogin = Str2Field(txtLastLogin) + !Locked = chkLocked + !INVAdd = chkINVADD + + End With + moRSUser.Update + +End Sub + +Private Sub lstUser_Click() + If lstUser.ListIndex <> -1 Then + If FormFind() Then + Call FormShow + End If + End If + +End Sub + +Private Sub FormShow() + mboolSHOW = True + + With moRSUser + txtLast = Field2Str(!LastName) + txtFirst = Field2Str(!FirstName) + txtUserId = Field2Str(!loginid) + txtPassword = Field2Str(!Password) + txtLastUpUser = Field2Str(!lastupdateid) + txtLastUpdate = Field2Str(!lastupdatedate) + txtLastLogin = Field2Str(!lastlogin) + chkLocked = Field2CheckBox(!Locked) + chkINVADD = Field2CheckBox(!INVAdd) + Select Case Field2Integer(!security) + Case 1 + cboSecurity = "Administrative" + Case 2 + cboSecurity = "Estimating" + Case 6 + cboSecurity = "Orders" + Case 7 + cboSecurity = "Billing" + Case 8 + cboSecurity = "Payroll View" + Case 9 + cboSecurity = "Inventory" + Case 10 + cboSecurity = "Payroll Process" + + End Select + + End With + + mboolSHOW = False +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + + If Shift = 4 Then + Exit Sub + End If + + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If + +End Sub + +Private Sub lstUser_DblClick() + If Not cmdSave.Enabled Then + cmdSave.Enabled = True + cmdAdd.Enabled = False + End If +End Sub + +Private Sub txtFirst_GotFocus() + Call FieldSelect(txtFirst) +End Sub + +Private Sub txtLast_GotFocus() + Call FieldSelect(txtLast) +End Sub + +Private Sub txtPassword_GotFocus() + Call FieldSelect(txtPassword) +End Sub + +Private Sub txtUserId_GotFocus() + Call FieldSelect(txtUserId) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frm new file mode 100644 index 0000000..83ada73 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frm @@ -0,0 +1,8930 @@ +VERSION 5.00 +Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" +Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" +Begin VB.Form frmViewTake + Caption = "View Previous Takeoff Information" + ClientHeight = 8580 + ClientLeft = 165 + ClientTop = 465 + ClientWidth = 11880 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 8580 + ScaleWidth = 11880 + StartUpPosition = 3 'Windows Default + Begin VB.CommandButton cmdPrintIncrease + Caption = "Print Increase" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 4620 + TabIndex = 239 + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txt108 + Enabled = 0 'False + Height = 315 + Left = 10980 + TabIndex = 232 + Top = 2880 + Width = 855 + End + Begin VB.TextBox txt68 + Enabled = 0 'False + Height = 315 + Left = 9060 + TabIndex = 229 + Top = 2880 + Width = 855 + End + Begin VB.CheckBox chk2Story + Caption = "Two Story" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 255 + Left = 8580 + TabIndex = 227 + Top = 3300 + Width = 1515 + End + Begin VB.CheckBox chkOpen + Alignment = 1 'Right Justify + Caption = "Remove Openings From Order Materials:" + Enabled = 0 'False + Height = 195 + Left = 360 + TabIndex = 222 + Top = 360 + Width = 3255 + End + Begin Crystal.CrystalReport crTake + Left = 11340 + Top = 1920 + _ExtentX = 741 + _ExtentY = 741 + _Version = 348160 + PrintFileLinesPerPage= 60 + End + Begin VB.CommandButton cmdPrintTake + Caption = "Print Takeoff" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 5940 + TabIndex = 188 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtProject + Enabled = 0 'False + Height = 285 + Left = 720 + TabIndex = 185 + TabStop = 0 'False + Top = 600 + Width = 2895 + End + Begin VB.TextBox txtFinish + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 184 + TabStop = 0 'False + Top = 1020 + Width = 2115 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3300 + TabIndex = 142 + TabStop = 0 'False + Top = 3060 + Width = 1275 + End + Begin VB.TextBox txtNotes + Enabled = 0 'False + Height = 1275 + Left = 2880 + MultiLine = -1 'True + TabIndex = 11 + Top = 1680 + Width = 4875 + End + Begin VB.ComboBox cboOneKote + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0000 + Left = 8520 + List = "frmViewTake.frx":0002 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 960 + Width = 2955 + End + Begin VB.TextBox txtStuccoYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 9 + TabStop = 0 'False + Top = 540 + Width = 1035 + End + Begin VB.TextBox txtLathYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + TabIndex = 7 + TabStop = 0 'False + Top = 600 + Width = 1035 + End + Begin VB.TextBox txtTTLYds + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4800 + TabIndex = 4 + TabStop = 0 'False + Top = 600 + Width = 1035 + End + Begin TabDlg.SSTab tabTake + Height = 4875 + Left = 180 + TabIndex = 3 + TabStop = 0 'False + Top = 3660 + Width = 11475 + _ExtentX = 20241 + _ExtentY = 8599 + _Version = 393216 + Tabs = 4 + Tab = 3 + TabsPerRow = 4 + TabHeight = 520 + BackColor = -2147483644 + TabCaption(0) = "Mea&Surements" + TabPicture(0) = "frmViewTake.frx":0004 + Tab(0).ControlEnabled= 0 'False + Tab(0).Control(0)= "txtMeType" + Tab(0).Control(1)= "cboMeLocate" + Tab(0).Control(2)= "txtMeSqFt" + Tab(0).Control(3)= "txtMeDesc" + Tab(0).Control(4)= "lstMeasure" + Tab(0).Control(4).Enabled= 0 'False + Tab(0).Control(5)= "cmdUpMeasCalc" + Tab(0).Control(5).Enabled= 0 'False + Tab(0).Control(6)= "cmdSaveMeas" + Tab(0).Control(7)= "cmdDelMeas" + Tab(0).Control(7).Enabled= 0 'False + Tab(0).Control(8)= "cmdAddMeas" + Tab(0).Control(9)= "fraYardage" + Tab(0).Control(10)= "lblMeType" + Tab(0).Control(11)= "lblMeLocate" + Tab(0).Control(12)= "lblMeSqFt" + Tab(0).Control(13)= "lblMeDesc" + Tab(0).ControlCount= 14 + TabCaption(1) = "Ma&Terials" + TabPicture(1) = "frmViewTake.frx":0020 + Tab(1).ControlEnabled= 0 'False + Tab(1).Control(0)= "cmdUpdate" + Tab(1).Control(1)= "fraMaterials" + Tab(1).Control(2)= "cmdDel1900" + Tab(1).Control(3)= "chkCalc" + Tab(1).Control(3).Enabled= 0 'False + Tab(1).Control(4)= "cmdSetup" + Tab(1).Control(4).Enabled= 0 'False + Tab(1).Control(5)= "chkTransfer" + Tab(1).Control(5).Enabled= 0 'False + Tab(1).Control(6)= "cmdFindMat" + Tab(1).Control(7)= "cmdAddMat" + Tab(1).Control(7).Enabled= 0 'False + Tab(1).Control(8)= "cboMetal" + Tab(1).Control(9)= "cboMType" + Tab(1).Control(10)= "cboDFlag" + Tab(1).Control(11)= "txtMetLength" + Tab(1).Control(12)= "txtMatPrice" + Tab(1).Control(13)= "txtMatQty" + Tab(1).Control(14)= "txtMatDesc" + Tab(1).Control(15)= "txtMatInvNo" + Tab(1).Control(16)= "lstTOMatrl" + Tab(1).Control(16).Enabled= 0 'False + Tab(1).Control(17)= "cmdSaveMat" + Tab(1).Control(18)= "cmdDelMat" + Tab(1).Control(18).Enabled= 0 'False + Tab(1).Control(19)= "lblMatDesc" + Tab(1).Control(20)= "lblMetLength" + Tab(1).Control(21)= "lblMetal" + Tab(1).Control(22)= "lblMType" + Tab(1).Control(23)= "lblDFlag" + Tab(1).Control(24)= "lblMatPrice" + Tab(1).Control(25)= "lblMatQty" + Tab(1).Control(26)= "lblInvno" + Tab(1).ControlCount= 27 + TabCaption(2) = "&Options" + TabPicture(2) = "frmViewTake.frx":003C + Tab(2).ControlEnabled= 0 'False + Tab(2).Control(0)= "txtO108" + Tab(2).Control(1)= "txtO68" + Tab(2).Control(2)= "chkNoInvoice" + Tab(2).Control(3)= "chkST_Others" + Tab(2).Control(4)= "txtOST_SqFt" + Tab(2).Control(5)= "chkOStone" + Tab(2).Control(6)= "txtNote" + Tab(2).Control(7)= "cmdCopyOpt" + Tab(2).Control(7).Enabled= 0 'False + Tab(2).Control(8)= "cmdSaveOptMat" + Tab(2).Control(9)= "cmdSaveOpt" + Tab(2).Control(10)= "cmdFindOptMat" + Tab(2).Control(11)= "cboOMMetal" + Tab(2).Control(12)= "cboOMType" + Tab(2).Control(13)= "cboOMDFlag" + Tab(2).Control(14)= "txtOMMetL" + Tab(2).Control(15)= "txtOMPrice" + Tab(2).Control(16)= "txtOMQty" + Tab(2).Control(17)= "txtOMDesc" + Tab(2).Control(18)= "txtOMInvNo" + Tab(2).Control(19)= "cmdDelOptMat" + Tab(2).Control(19).Enabled= 0 'False + Tab(2).Control(20)= "cmdAddOptMat" + Tab(2).Control(20).Enabled= 0 'False + Tab(2).Control(21)= "cmdDelOpt" + Tab(2).Control(21).Enabled= 0 'False + Tab(2).Control(22)= "cmdAddOpt" + Tab(2).Control(22).Enabled= 0 'False + Tab(2).Control(23)= "lstOptMatrl" + Tab(2).Control(23).Enabled= 0 'False + Tab(2).Control(24)= "txtOFAdj" + Tab(2).Control(25)= "txtOFin2" + Tab(2).Control(26)= "cboOFinish" + Tab(2).Control(27)= "txtOBAmt" + Tab(2).Control(28)= "txtOYdge" + Tab(2).Control(29)= "txtODesc" + Tab(2).Control(30)= "lstOptions" + Tab(2).Control(30).Enabled= 0 'False + Tab(2).Control(31)= "lblScaf10" + Tab(2).Control(32)= "Scaf6" + Tab(2).Control(33)= "lblOScaffold" + Tab(2).Control(34)= "lblOStone" + Tab(2).Control(35)= "lblOMMLength" + Tab(2).Control(36)= "lblOMCFlag" + Tab(2).Control(37)= "lblOMMType" + Tab(2).Control(38)= "lblOMDFlag" + Tab(2).Control(39)= "lblOMPrice" + Tab(2).Control(40)= "lblOMQty" + Tab(2).Control(41)= "lblOMDesc" + Tab(2).Control(42)= "lblOMInvNo" + Tab(2).Control(43)= "lblOFadj" + Tab(2).Control(44)= "lblOFin2" + Tab(2).Control(45)= "lblOTexture" + Tab(2).Control(46)= "lblBAmt" + Tab(2).Control(47)= "lblYrdge" + Tab(2).ControlCount= 48 + TabCaption(3) = "&Prices" + TabPicture(3) = "frmViewTake.frx":0058 + Tab(3).ControlEnabled= -1 'True + Tab(3).Control(0)= "lblSand" + Tab(3).Control(0).Enabled= 0 'False + Tab(3).Control(1)= "lblX1" + Tab(3).Control(1).Enabled= 0 'False + Tab(3).Control(2)= "lblX2" + Tab(3).Control(2).Enabled= 0 'False + Tab(3).Control(3)= "lblStucLab" + Tab(3).Control(3).Enabled= 0 'False + Tab(3).Control(4)= "lblLathLab" + Tab(3).Control(4).Enabled= 0 'False + Tab(3).Control(5)= "lblMetLab" + Tab(3).Control(5).Enabled= 0 'False + Tab(3).Control(6)= "lblScaf" + Tab(3).Control(6).Enabled= 0 'False + Tab(3).Control(7)= "lblTape" + Tab(3).Control(7).Enabled= 0 'False + Tab(3).Control(8)= "lblMisc" + Tab(3).Control(8).Enabled= 0 'False + Tab(3).Control(9)= "lblTtlMat" + Tab(3).Control(9).Enabled= 0 'False + Tab(3).Control(10)= "lblMatMU" + Tab(3).Control(10).Enabled= 0 'False + Tab(3).Control(11)= "lblLaborBurden" + Tab(3).Control(11).Enabled= 0 'False + Tab(3).Control(12)= "lblTtlCost" + Tab(3).Control(12).Enabled= 0 'False + Tab(3).Control(13)= "lblMarkup" + Tab(3).Control(13).Enabled= 0 'False + Tab(3).Control(14)= "lblOH" + Tab(3).Control(14).Enabled= 0 'False + Tab(3).Control(15)= "Line1" + Tab(3).Control(15).Enabled= 0 'False + Tab(3).Control(16)= "Line2" + Tab(3).Control(16).Enabled= 0 'False + Tab(3).Control(17)= "lblBidPrice" + Tab(3).Control(17).Enabled= 0 'False + Tab(3).Control(18)= "lblBidwCMU" + Tab(3).Control(18).Enabled= 0 'False + Tab(3).Control(19)= "lblCMUPr" + Tab(3).Control(19).Enabled= 0 'False + Tab(3).Control(20)= "lblSQYDPR" + Tab(3).Control(20).Enabled= 0 'False + Tab(3).Control(21)= "Line3" + Tab(3).Control(21).Enabled= 0 'False + Tab(3).Control(22)= "lblBurDesc" + Tab(3).Control(22).Enabled= 0 'False + Tab(3).Control(23)= "Line4" + Tab(3).Control(23).Enabled= 0 'False + Tab(3).Control(24)= "lblFSand" + Tab(3).Control(24).Enabled= 0 'False + Tab(3).Control(25)= "lblFSkip" + Tab(3).Control(25).Enabled= 0 'False + Tab(3).Control(26)= "lblFDash" + Tab(3).Control(26).Enabled= 0 'False + Tab(3).Control(27)= "lblFSmooth" + Tab(3).Control(27).Enabled= 0 'False + Tab(3).Control(28)= "lblFMont" + Tab(3).Control(28).Enabled= 0 'False + Tab(3).Control(29)= "lblFQuern" + Tab(3).Control(29).Enabled= 0 'False + Tab(3).Control(30)= "lblPrimary" + Tab(3).Control(30).Enabled= 0 'False + Tab(3).Control(31)= "lblOptTextures" + Tab(3).Control(31).Enabled= 0 'False + Tab(3).Control(32)= "lblDF" + Tab(3).Control(32).Enabled= 0 'False + Tab(3).Control(33)= "lblFS2" + Tab(3).Control(33).Enabled= 0 'False + Tab(3).Control(34)= "lblFS3" + Tab(3).Control(34).Enabled= 0 'False + Tab(3).Control(35)= "lblSYN" + Tab(3).Control(35).Enabled= 0 'False + Tab(3).Control(36)= "lblMF" + Tab(3).Control(36).Enabled= 0 'False + Tab(3).Control(37)= "lblSS" + Tab(3).Control(37).Enabled= 0 'False + Tab(3).Control(38)= "lbl2S" + Tab(3).Control(38).Enabled= 0 'False + Tab(3).Control(39)= "txtSandTons" + Tab(3).Control(39).Enabled= 0 'False + Tab(3).Control(40)= "txtSandPrice" + Tab(3).Control(40).Enabled= 0 'False + Tab(3).Control(41)= "txtSandAmt" + Tab(3).Control(41).Enabled= 0 'False + Tab(3).Control(42)= "txtSLRate" + Tab(3).Control(42).Enabled= 0 'False + Tab(3).Control(43)= "txtStucLab" + Tab(3).Control(43).Enabled= 0 'False + Tab(3).Control(44)= "txtLLRate" + Tab(3).Control(44).Enabled= 0 'False + Tab(3).Control(45)= "txtLathLab" + Tab(3).Control(45).Enabled= 0 'False + Tab(3).Control(46)= "txtMLRate" + Tab(3).Control(46).Enabled= 0 'False + Tab(3).Control(47)= "txtMetLab" + Tab(3).Control(47).Enabled= 0 'False + Tab(3).Control(48)= "txtMetalFt" + Tab(3).Control(48).Enabled= 0 'False + Tab(3).Control(49)= "txtSGRate" + Tab(3).Control(49).Enabled= 0 'False + Tab(3).Control(50)= "txtScafGas" + Tab(3).Control(50).Enabled= 0 'False + Tab(3).Control(51)= "txtTPRate" + Tab(3).Control(51).Enabled= 0 'False + Tab(3).Control(52)= "txtTape" + Tab(3).Control(52).Enabled= 0 'False + Tab(3).Control(53)= "txtTtlMat" + Tab(3).Control(53).Enabled= 0 'False + Tab(3).Control(54)= "txtMisc" + Tab(3).Control(54).Enabled= 0 'False + Tab(3).Control(55)= "txtMatMU" + Tab(3).Control(55).Enabled= 0 'False + Tab(3).Control(56)= "txtLabBur" + Tab(3).Control(56).Enabled= 0 'False + Tab(3).Control(57)= "txtTtlCost" + Tab(3).Control(57).Enabled= 0 'False + Tab(3).Control(58)= "txtMURate" + Tab(3).Control(58).Enabled= 0 'False + Tab(3).Control(59)= "txtTtlMU" + Tab(3).Control(59).Enabled= 0 'False + Tab(3).Control(60)= "txtOH" + Tab(3).Control(60).Enabled= 0 'False + Tab(3).Control(61)= "txtOHRate" + Tab(3).Control(61).Enabled= 0 'False + Tab(3).Control(62)= "txtBidPrice" + Tab(3).Control(62).Enabled= 0 'False + Tab(3).Control(63)= "txtBidPrwCMU" + Tab(3).Control(63).Enabled= 0 'False + Tab(3).Control(64)= "txtCMURate" + Tab(3).Control(64).Enabled= 0 'False + Tab(3).Control(65)= "txtCMUPrice" + Tab(3).Control(65).Enabled= 0 'False + Tab(3).Control(66)= "txtPrSQYD" + Tab(3).Control(66).Enabled= 0 'False + Tab(3).Control(67)= "fraPrimary" + Tab(3).Control(67).Enabled= 0 'False + Tab(3).Control(68)= "fraSecond" + Tab(3).Control(68).Enabled= 0 'False + Tab(3).Control(69)= "txtSandPr" + Tab(3).Control(69).Enabled= 0 'False + Tab(3).Control(70)= "txtSkipPr" + Tab(3).Control(70).Enabled= 0 'False + Tab(3).Control(71)= "txtDashPr" + Tab(3).Control(71).Enabled= 0 'False + Tab(3).Control(72)= "txtSmoothPr" + Tab(3).Control(72).Enabled= 0 'False + Tab(3).Control(73)= "txtMonterreyPr" + Tab(3).Control(73).Enabled= 0 'False + Tab(3).Control(74)= "txtQUPr" + Tab(3).Control(74).Enabled= 0 'False + Tab(3).Control(75)= "cmdCalcPrimary" + Tab(3).Control(75).Enabled= 0 'False + Tab(3).Control(76)= "cmdCalcOptTexture" + Tab(3).Control(76).Enabled= 0 'False + Tab(3).Control(77)= "txtDFPr" + Tab(3).Control(77).Enabled= 0 'False + Tab(3).Control(78)= "txtMatMURate" + Tab(3).Control(78).Enabled= 0 'False + Tab(3).Control(79)= "txtSBPr" + Tab(3).Control(79).Enabled= 0 'False + Tab(3).Control(80)= "txtMFPr" + Tab(3).Control(80).Enabled= 0 'False + Tab(3).Control(81)= "txtSS" + Tab(3).Control(81).Enabled= 0 'False + Tab(3).ControlCount= 82 + Begin VB.TextBox txtO108 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 237 + Top = 2280 + Width = 675 + End + Begin VB.TextBox txtO68 + Enabled = 0 'False + Height = 315 + Left = -66660 + TabIndex = 236 + Top = 1860 + Width = 675 + End + Begin VB.TextBox txtSS + BackColor = &H0080FFFF& + Height = 285 + Left = 9300 + TabIndex = 226 + Top = 4200 + Width = 1155 + End + Begin VB.CheckBox chkNoInvoice + Alignment = 1 'Right Justify + Caption = "No Invoice" + Height = 195 + Left = -71400 + TabIndex = 34 + ToolTipText = "This Option Will Not Print On Invoice." + Top = 1260 + Width = 1275 + End + Begin VB.CheckBox chkST_Others + Alignment = 1 'Right Justify + Caption = "Stone by Others" + Enabled = 0 'False + Height = 195 + Left = -69960 + TabIndex = 33 + Top = 1260 + Width = 1515 + End + Begin VB.TextBox txtOST_SqFt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64665 + TabIndex = 31 + Top = 1185 + Width = 915 + End + Begin VB.CheckBox chkOStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer Option:" + Enabled = 0 'False + Height = 270 + Left = -68280 + TabIndex = 32 + Top = 1200 + Width = 1905 + End + Begin VB.TextBox txtMFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 212 + Top = 3900 + Width = 1155 + End + Begin VB.TextBox txtNote + Height = 975 + Left = -74760 + MultiLine = -1 'True + TabIndex = 36 + Top = 2700 + Width = 5475 + End + Begin VB.CommandButton cmdUpdate + Caption = "Update &Materials On" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 208 + Top = 3720 + Width = 1695 + End + Begin VB.Frame fraMaterials + BorderStyle = 0 'None + Height = 435 + Left = -66780 + TabIndex = 207 + Top = 3255 + Width = 2955 + End + Begin VB.TextBox txtSBPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 206 + TabStop = 0 'False + Top = 3600 + Width = 1155 + End + Begin VB.CommandButton cmdDel1900 + Caption = "Delete 19XX Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 202 + Top = 3720 + Width = 1695 + End + Begin VB.CheckBox chkCalc + Caption = "Calculated" + Enabled = 0 'False + Height = 270 + Left = -64965 + TabIndex = 197 + TabStop = 0 'False + Top = 345 + Width = 1335 + End + Begin VB.CommandButton cmdSetup + Caption = "Setup Materials &On" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 189 + TabStop = 0 'False + Top = 3720 + Width = 1695 + End + Begin VB.TextBox txtMatMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 187 + TabStop = 0 'False + Top = 3300 + Width = 615 + End + Begin VB.CommandButton cmdCopyOpt + Caption = "Copy Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 186 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOptMat + Caption = "&Save Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 46 + Top = 2640 + Width = 1695 + End + Begin VB.CommandButton cmdSaveOpt + Caption = "&Save Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -69360 + TabIndex = 35 + Top = 1575 + Width = 1695 + End + Begin VB.CheckBox chkTransfer + Caption = "No Transfer" + Enabled = 0 'False + Height = 300 + Left = -64965 + TabIndex = 174 + TabStop = 0 'False + Top = 555 + Width = 1215 + End + Begin VB.CommandButton cmdFindOptMat + Height = 435 + Left = -65910 + Picture = "frmViewTake.frx":0074 + Style = 1 'Graphical + TabIndex = 38 + Top = 2295 + Width = 435 + End + Begin VB.CommandButton cmdFindMat + Height = 435 + Left = -65460 + Picture = "frmViewTake.frx":04B6 + Style = 1 'Graphical + TabIndex = 165 + Top = 405 + Width = 435 + End + Begin VB.ComboBox cboOMMetal + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":08F8 + Left = -65400 + List = "frmViewTake.frx":0902 + Style = 2 'Dropdown List + TabIndex = 44 + Top = 3930 + Width = 1275 + End + Begin VB.ComboBox cboOMType + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0913 + Left = -65400 + List = "frmViewTake.frx":0915 + Style = 2 'Dropdown List + TabIndex = 43 + Top = 3540 + Width = 1275 + End + Begin VB.ComboBox cboOMDFlag + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0917 + Left = -68160 + List = "frmViewTake.frx":0921 + Style = 2 'Dropdown List + TabIndex = 42 + Top = 4320 + Width = 1155 + End + Begin VB.TextBox txtOMMetL + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -65400 + MaxLength = 4 + TabIndex = 45 + Top = 4320 + Width = 915 + End + Begin VB.TextBox txtOMPrice + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 6 + TabIndex = 41 + Top = 3930 + Width = 915 + End + Begin VB.TextBox txtOMQty + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 4 + TabIndex = 40 + Top = 3540 + Width = 915 + End + Begin VB.TextBox txtOMDesc + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 50 + TabIndex = 39 + Top = 3165 + Width = 4275 + End + Begin VB.TextBox txtOMInvNo + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68160 + MaxLength = 18 + TabIndex = 37 + Top = 2745 + Width = 2625 + End + Begin VB.CommandButton cmdAddMat + Caption = "Add Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -69120 + TabIndex = 175 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.ComboBox cboMetal + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0935 + Left = -68100 + List = "frmViewTake.frx":093F + Style = 2 'Dropdown List + TabIndex = 171 + Top = 2640 + Width = 1155 + End + Begin VB.ComboBox cboMType + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0950 + Left = -68100 + List = "frmViewTake.frx":0952 + Style = 2 'Dropdown List + TabIndex = 170 + Top = 2280 + Width = 1155 + End + Begin VB.ComboBox cboDFlag + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0954 + Left = -68100 + List = "frmViewTake.frx":095E + Style = 2 'Dropdown List + TabIndex = 169 + Top = 1920 + Width = 1155 + End + Begin VB.TextBox txtMetLength + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 172 + Top = 3000 + Width = 915 + End + Begin VB.TextBox txtMatPrice + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0.00" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 6 + TabIndex = 168 + Top = 1560 + Width = 915 + End + Begin VB.TextBox txtMatQty + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 4 + TabIndex = 167 + Top = 1200 + Width = 915 + End + Begin VB.TextBox txtMatDesc + BackColor = &H00FFFFFF& + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 50 + TabIndex = 166 + Top = 840 + Width = 4275 + End + Begin VB.TextBox txtMatInvNo + BackColor = &H00FFFFFF& + Enabled = 0 'False + Height = 315 + Left = -68100 + MaxLength = 18 + TabIndex = 164 + Top = 480 + Width = 2625 + End + Begin VB.ListBox lstTOMatrl + Height = 4155 + Left = -74820 + TabIndex = 154 + TabStop = 0 'False + Top = 480 + Width = 5535 + End + Begin VB.TextBox txtMeType + Enabled = 0 'False + Height = 315 + Left = -65520 + MaxLength = 1 + TabIndex = 152 + Top = 1080 + Width = 915 + End + Begin VB.ComboBox cboMeLocate + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0972 + Left = -69720 + List = "frmViewTake.frx":0974 + Style = 2 'Dropdown List + TabIndex = 151 + Top = 1080 + Width = 2235 + End + Begin VB.TextBox txtMeSqFt + Alignment = 1 'Right Justify + BeginProperty DataFormat + Type = 1 + Format = "#,##0" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 1 + EndProperty + Enabled = 0 'False + Height = 315 + Left = -65520 + MaxLength = 8 + TabIndex = 150 + Top = 600 + Width = 915 + End + Begin VB.TextBox txtMeDesc + Enabled = 0 'False + Height = 315 + Left = -70380 + MaxLength = 30 + TabIndex = 149 + Top = 600 + Width = 2835 + End + Begin VB.ListBox lstMeasure + Height = 2205 + Left = -74760 + TabIndex = 144 + TabStop = 0 'False + Top = 600 + Width = 3135 + End + Begin VB.CommandButton cmdUpMeasCalc + Caption = "Update Takeoff Yardage" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -72540 + TabIndex = 143 + TabStop = 0 'False + Top = 2940 + Width = 1935 + End + Begin VB.CommandButton cmdSaveMeas + Caption = "Save Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 153 + Top = 3540 + Width = 2115 + End + Begin VB.CommandButton cmdDelMeas + Caption = "Delete Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 141 + TabStop = 0 'False + Top = 4140 + Width = 2115 + End + Begin VB.CommandButton cmdAddMeas + Caption = "Add Measurement" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -74760 + TabIndex = 155 + Top = 2940 + Width = 2115 + End + Begin VB.TextBox txtDFPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 140 + TabStop = 0 'False + Top = 3300 + Width = 1155 + End + Begin VB.CommandButton cmdSaveMat + Caption = "Save Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -67260 + TabIndex = 173 + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdDelMat + Caption = "Delete Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = -65400 + TabIndex = 136 + TabStop = 0 'False + Top = 4260 + Width = 1695 + End + Begin VB.CommandButton cmdCalcOptTexture + Caption = "Clear Optional Te&Xtures" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 4920 + TabIndex = 135 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.CommandButton cmdCalcPrimary + Caption = "Calculate Primar&Y Texture" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 735 + Left = 3540 + TabIndex = 134 + TabStop = 0 'False + Top = 4020 + Width = 1215 + End + Begin VB.TextBox txtQUPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 133 + TabStop = 0 'False + Top = 3000 + Width = 1155 + End + Begin VB.TextBox txtMonterreyPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 132 + TabStop = 0 'False + Top = 2700 + Width = 1155 + End + Begin VB.TextBox txtSmoothPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 131 + TabStop = 0 'False + Top = 2400 + Width = 1155 + End + Begin VB.TextBox txtDashPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 130 + TabStop = 0 'False + Top = 2100 + Width = 1155 + End + Begin VB.TextBox txtSkipPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9300 + TabIndex = 129 + TabStop = 0 'False + Top = 1800 + Width = 1155 + End + Begin VB.TextBox txtSandPr + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 9300 + TabIndex = 128 + TabStop = 0 'False + Top = 960 + Width = 1155 + End + Begin VB.Frame fraSecond + Enabled = 0 'False + Height = 3735 + Left = 8760 + TabIndex = 121 + Top = 840 + Width = 495 + Begin VB.CheckBox chkSS + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 225 + Top = 3420 + Width = 195 + End + Begin VB.CheckBox chkMF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 211 + Top = 3060 + Width = 195 + End + Begin VB.CheckBox chkSB + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 205 + TabStop = 0 'False + Top = 2760 + Width = 195 + End + Begin VB.CheckBox chkDF + Caption = "Check1" + Height = 255 + Left = 150 + TabIndex = 139 + TabStop = 0 'False + Top = 2460 + Width = 195 + End + Begin VB.CheckBox chkQU + Caption = "Check6" + Height = 195 + Left = 150 + TabIndex = 127 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.CheckBox chkMonterrey + Caption = "Check5" + Height = 195 + Left = 150 + TabIndex = 126 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.CheckBox chkSmooth + Caption = "Check4" + Height = 195 + Left = 150 + TabIndex = 125 + TabStop = 0 'False + Top = 1620 + Width = 195 + End + Begin VB.CheckBox chkDash + Caption = "Check3" + Height = 195 + Left = 150 + TabIndex = 124 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.CheckBox chkSkip + Caption = "Check2" + Height = 255 + Left = 150 + TabIndex = 123 + TabStop = 0 'False + Top = 960 + Width = 195 + End + Begin VB.CheckBox chkSand + Caption = "Check1" + Height = 195 + Left = 150 + TabIndex = 122 + TabStop = 0 'False + Top = 180 + Width = 195 + End + End + Begin VB.Frame fraPrimary + Enabled = 0 'False + Height = 3735 + Left = 7980 + TabIndex = 112 + Top = 840 + Width = 495 + Begin VB.OptionButton optPTex + Caption = "Option1" + Height = 255 + Index = 11 + Left = 150 + TabIndex = 223 + Top = 3360 + Width = 195 + End + Begin VB.OptionButton optPTex + Caption = "Option2" + Height = 255 + Index = 10 + Left = 150 + TabIndex = 209 + Top = 3060 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 9 + Left = 150 + TabIndex = 203 + TabStop = 0 'False + Top = 2820 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 2 + Left = 150 + TabIndex = 201 + TabStop = 0 'False + Top = 780 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 1 + Left = 150 + TabIndex = 200 + TabStop = 0 'False + Top = 480 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 8 + Left = 150 + TabIndex = 138 + TabStop = 0 'False + Top = 2520 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 7 + Left = 150 + TabIndex = 119 + TabStop = 0 'False + Top = 2220 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 6 + Left = 150 + TabIndex = 118 + TabStop = 0 'False + Top = 1920 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 5 + Left = 120 + TabIndex = 117 + TabStop = 0 'False + Top = 1620 + Value = -1 'True + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 4 + Left = 150 + TabIndex = 116 + TabStop = 0 'False + Top = 1320 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 3 + Left = 150 + TabIndex = 115 + TabStop = 0 'False + Top = 1020 + Width = 195 + End + Begin VB.OptionButton optPTex + Height = 195 + Index = 0 + Left = 150 + TabIndex = 114 + TabStop = 0 'False + Top = 200 + Width = 195 + End + End + Begin VB.TextBox txtPrSQYD + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 105 + TabStop = 0 'False + Top = 3360 + Width = 855 + End + Begin VB.TextBox txtCMUPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 315 + Left = 5400 + MaxLength = 6 + TabIndex = 64 + Top = 3000 + Width = 855 + End + Begin VB.TextBox txtCMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 103 + TabStop = 0 'False + Top = 3000 + Width = 615 + End + Begin VB.TextBox txtBidPrwCMU + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + Height = 375 + Left = 5100 + MaxLength = 8 + TabIndex = 63 + Top = 2220 + Width = 1155 + End + Begin VB.TextBox txtBidPrice + Alignment = 1 'Right Justify + BackColor = &H00FFFF80& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 420 + Left = 5100 + TabIndex = 65 + TabStop = 0 'False + Top = 1680 + Width = 1155 + End + Begin VB.TextBox txtOHRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 102 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtOH + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 101 + TabStop = 0 'False + Top = 1140 + Width = 855 + End + Begin VB.TextBox txtTtlMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 100 + TabStop = 0 'False + Top = 780 + Width = 855 + End + Begin VB.TextBox txtMURate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 4560 + TabIndex = 99 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtTtlCost + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 5400 + TabIndex = 98 + TabStop = 0 'False + Top = 420 + Width = 855 + End + Begin VB.TextBox txtLabBur + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 90 + TabStop = 0 'False + Top = 3660 + Width = 825 + End + Begin VB.TextBox txtMatMU + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 88 + TabStop = 0 'False + Top = 3300 + Width = 825 + End + Begin VB.TextBox txtMisc + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Height = 315 + Left = 2640 + MaxLength = 6 + TabIndex = 62 + Top = 2580 + Width = 825 + End + Begin VB.TextBox txtTtlMat + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 85 + TabStop = 0 'False + Top = 2940 + Width = 825 + End + Begin VB.TextBox txtTape + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 84 + TabStop = 0 'False + Top = 2220 + Width = 825 + End + Begin VB.TextBox txtTPRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 83 + TabStop = 0 'False + Top = 2220 + Width = 615 + End + Begin VB.TextBox txtScafGas + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 82 + TabStop = 0 'False + Top = 1860 + Width = 825 + End + Begin VB.TextBox txtSGRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 81 + TabStop = 0 'False + Top = 1860 + Width = 615 + End + Begin VB.TextBox txtMetalFt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 120 + TabIndex = 80 + TabStop = 0 'False + Top = 1500 + Width = 735 + End + Begin VB.TextBox txtMetLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 79 + TabStop = 0 'False + Top = 1500 + Width = 825 + End + Begin VB.TextBox txtMLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 78 + TabStop = 0 'False + Top = 1500 + Width = 615 + End + Begin VB.TextBox txtLathLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 77 + TabStop = 0 'False + Top = 1140 + Width = 825 + End + Begin VB.TextBox txtLLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 76 + TabStop = 0 'False + Top = 1140 + Width = 615 + End + Begin VB.TextBox txtStucLab + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 75 + TabStop = 0 'False + Top = 780 + Width = 825 + End + Begin VB.TextBox txtSLRate + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1800 + TabIndex = 74 + TabStop = 0 'False + Top = 780 + Width = 615 + End + Begin VB.TextBox txtSandAmt + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 2640 + TabIndex = 67 + TabStop = 0 'False + Top = 420 + Width = 825 + End + Begin VB.TextBox txtSandPrice + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + Height = 315 + Left = 1800 + MaxLength = 6 + TabIndex = 61 + Top = 420 + Width = 615 + End + Begin VB.TextBox txtSandTons + Alignment = 1 'Right Justify + BackColor = &H0080FFFF& + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 900 + TabIndex = 59 + TabStop = 0 'False + Top = 420 + Width = 555 + End + Begin VB.CommandButton cmdDelOptMat + Caption = "&Delete Option Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 57 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOptMat + Caption = "Add Option &Material" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -65400 + TabIndex = 56 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.CommandButton cmdDelOpt + Caption = "&Delete Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 55 + TabStop = 0 'False + Top = 2130 + Width = 1695 + End + Begin VB.CommandButton cmdAddOpt + Caption = "&Add Option" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 510 + Left = -71340 + TabIndex = 54 + TabStop = 0 'False + Top = 1575 + Width = 1695 + End + Begin VB.ListBox lstOptMatrl + Height = 840 + Left = -74760 + TabIndex = 53 + TabStop = 0 'False + Top = 3720 + Width = 5475 + End + Begin VB.TextBox txtOFAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 4 + TabIndex = 30 + Top = 810 + Width = 915 + End + Begin VB.TextBox txtOFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66885 + MaxLength = 4 + TabIndex = 29 + Top = 840 + Width = 915 + End + Begin VB.ComboBox cboOFinish + Enabled = 0 'False + Height = 315 + ItemData = "frmViewTake.frx":0976 + Left = -70305 + List = "frmViewTake.frx":0978 + Style = 2 'Dropdown List + TabIndex = 28 + Top = 840 + Width = 2235 + End + Begin VB.TextBox txtOBAmt + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -64680 + MaxLength = 6 + TabIndex = 27 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtOYdge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = -66900 + MaxLength = 4 + TabIndex = 26 + Top = 495 + Width = 915 + End + Begin VB.TextBox txtODesc + Enabled = 0 'False + Height = 315 + Left = -71340 + MaxLength = 30 + TabIndex = 25 + Top = 495 + Width = 3495 + End + Begin VB.ListBox lstOptions + Height = 2010 + Left = -74760 + TabIndex = 24 + TabStop = 0 'False + Top = 660 + Width = 3195 + End + Begin VB.Frame fraYardage + Caption = "Takeoff Yardage Information " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2460 + Left = -68700 + TabIndex = 190 + Top = 2175 + Width = 4995 + Begin VB.TextBox txtWireAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 19 + Top = 1140 + Width = 795 + End + Begin VB.CheckBox chkStone + Alignment = 1 'Right Justify + Caption = "Stone Veneer" + Enabled = 0 'False + Height = 255 + Left = 1080 + TabIndex = 16 + Top = 1995 + Width = 1335 + End + Begin VB.TextBox txtStone + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + TabIndex = 15 + Top = 1560 + Width = 1035 + End + Begin VB.TextBox txtFin2 + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 20 + Top = 1560 + Width = 795 + End + Begin VB.TextBox txtLaborAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 18 + Top = 720 + Width = 795 + End + Begin VB.TextBox txtFoamAdj + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 3960 + MaxLength = 4 + TabIndex = 17 + Top = 300 + Width = 795 + End + Begin VB.TextBox txtCMUYds + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 5 + TabIndex = 14 + Top = 1140 + Width = 1035 + End + Begin VB.TextBox txtPrcntge + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 4 + TabIndex = 13 + Top = 720 + Width = 1035 + End + Begin VB.TextBox txtOpenings + Alignment = 1 'Right Justify + Enabled = 0 'False + Height = 315 + Left = 1380 + MaxLength = 6 + TabIndex = 12 + Top = 300 + Width = 1035 + End + Begin VB.Label lblWireAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Wire Adj. Ydge:" + Height = 195 + Left = 2760 + TabIndex = 215 + Top = 1200 + Width = 1110 + End + Begin VB.Label lblStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Sq Ft:" + Height = 195 + Left = 225 + TabIndex = 213 + Top = 1620 + Width = 1080 + End + Begin VB.Label lblFin2 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Finish 2 Yardage:" + Height = 195 + Left = 2640 + TabIndex = 196 + Top = 1620 + Width = 1230 + End + Begin VB.Label lblLaborAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Adj. Ydge:" + Height = 195 + Left = 2685 + TabIndex = 195 + Top = 780 + Width = 1185 + End + Begin VB.Label lblFoamAdj + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = 2700 + TabIndex = 194 + Top = 360 + Width = 1170 + End + Begin VB.Label lblCMUYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "CMU Sq Ft:" + Height = 195 + Left = 480 + TabIndex = 193 + Top = 1200 + Width = 825 + End + Begin VB.Label lblOpenings + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Openings:" + Height = 195 + Left = 180 + TabIndex = 192 + Top = 360 + Width = 1125 + End + Begin VB.Label lblPrcntge + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Percentage:" + Height = 195 + Left = 435 + TabIndex = 191 + Top = 780 + Width = 870 + End + End + Begin VB.Label lbl2S + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "2S" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 375 + TabIndex = 238 + Top = 1920 + Width = 240 + End + Begin VB.Label lblScaf10 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10'8""" + Height = 195 + Left = -67140 + TabIndex = 235 + Top = 2340 + Width = 375 + End + Begin VB.Label Scaf6 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6'8""" + Height = 195 + Left = -67050 + TabIndex = 234 + Top = 1920 + Width = 285 + End + Begin VB.Label lblOScaffold + Alignment = 2 'Center + Caption = "Option Scaffolding" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = -67380 + TabIndex = 233 + Top = 1560 + Width = 1695 + End + Begin VB.Label lblSS + Alignment = 1 'Right Justify + Caption = "Skip/RSand Finish:" + Height = 255 + Left = 6420 + TabIndex = 224 + Top = 4200 + Width = 1455 + End + Begin VB.Label lblOStone + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stone V. Option Sq Ft:" + Enabled = 0 'False + Height = 195 + Left = -66285 + TabIndex = 214 + Top = 1230 + Width = 1590 + End + Begin VB.Label lblMF + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Monterrey/Sand:" + Height = 195 + Left = 6675 + TabIndex = 210 + Top = 3900 + Width = 1200 + End + Begin VB.Label lblSYN + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "EIFS SandBlast:" + Height = 195 + Left = 6720 + TabIndex = 204 + Top = 3660 + Width = 1155 + End + Begin VB.Label lblFS3 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 30 Finish:" + Height = 195 + Left = 6780 + TabIndex = 199 + Top = 1620 + Width = 1095 + End + Begin VB.Label lblFS2 + AutoSize = -1 'True + Caption = "Sand 20 Finish:" + Height = 195 + Left = 6780 + TabIndex = 198 + Top = 1320 + Width = 1095 + End + Begin VB.Label lblOMMLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -66420 + TabIndex = 183 + Top = 4380 + Width = 975 + End + Begin VB.Label lblOMCFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -66225 + TabIndex = 182 + Top = 3990 + Width = 780 + End + Begin VB.Label lblOMMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -66450 + TabIndex = 181 + Top = 3600 + Width = 1005 + End + Begin VB.Label lblOMDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Flag:" + Height = 195 + Left = -69180 + TabIndex = 180 + Top = 4380 + Width = 960 + End + Begin VB.Label lblOMPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Price:" + Height = 195 + Left = -68625 + TabIndex = 179 + Top = 3990 + Width = 405 + End + Begin VB.Label lblOMQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68850 + TabIndex = 178 + Top = 3600 + Width = 630 + End + Begin VB.Label lblOMDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -69060 + TabIndex = 177 + Top = 3210 + Width = 840 + End + Begin VB.Label lblOMInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69180 + TabIndex = 176 + Top = 2820 + Width = 960 + End + Begin VB.Label lblMatDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -68985 + TabIndex = 163 + Top = 900 + Width = 840 + End + Begin VB.Label lblMetLength + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Length:" + Height = 195 + Left = -69120 + TabIndex = 162 + Top = 3060 + Width = 975 + End + Begin VB.Label lblMetal + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Metal Flag:" + Height = 195 + Left = -68925 + TabIndex = 161 + Top = 2700 + Width = 780 + End + Begin VB.Label lblMType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Type:" + Height = 195 + Left = -69150 + TabIndex = 160 + Top = 2340 + Width = 1005 + End + Begin VB.Label lblDFlag + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Delivery Type:" + Height = 195 + Left = -69165 + TabIndex = 159 + Top = 1980 + Width = 1020 + End + Begin VB.Label lblMatPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Unit Price:" + Height = 195 + Left = -68880 + TabIndex = 158 + Top = 1620 + Width = 735 + End + Begin VB.Label lblMatQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Quantity:" + Height = 195 + Left = -68775 + TabIndex = 157 + Top = 1260 + Width = 630 + End + Begin VB.Label lblInvno + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory No:" + Height = 195 + Left = -69105 + TabIndex = 156 + Top = 540 + Width = 960 + End + Begin VB.Label lblMeType + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Type:" + Height = 195 + Left = -67080 + TabIndex = 148 + Top = 1140 + Width = 1410 + End + Begin VB.Label lblMeLocate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Measurement Location:" + Height = 195 + Left = -71460 + TabIndex = 147 + Top = 1140 + Width = 1665 + End + Begin VB.Label lblMeSqFt + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Square Feet:" + Height = 195 + Left = -66600 + TabIndex = 146 + Top = 660 + Width = 915 + End + Begin VB.Label lblMeDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Left = -71460 + TabIndex = 145 + Top = 660 + Width = 840 + End + Begin VB.Label lblDF + AutoSize = -1 'True + Caption = "Skip/Sand Finish:" + Height = 195 + Left = 6615 + TabIndex = 137 + Top = 3360 + Width = 1260 + End + Begin VB.Label lblOptTextures + Caption = "Optional Textures" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 8640 + TabIndex = 120 + Top = 420 + Width = 795 + End + Begin VB.Label lblPrimary + Caption = "Primary Texture" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 375 + Left = 7800 + TabIndex = 113 + Top = 420 + Width = 735 + End + Begin VB.Label lblFQuern + AutoSize = -1 'True + Caption = "Quernavaca Finish:" + Height = 195 + Left = 6570 + TabIndex = 111 + Top = 3060 + Width = 1305 + End + Begin VB.Label lblFMont + AutoSize = -1 'True + Caption = "Monterrey Finish:" + Height = 195 + Left = 6675 + TabIndex = 110 + Top = 2760 + Width = 1200 + End + Begin VB.Label lblFSmooth + AutoSize = -1 'True + Caption = "Smooth Finish:" + Height = 195 + Left = 6840 + TabIndex = 109 + Top = 2460 + Width = 1035 + End + Begin VB.Label lblFDash + AutoSize = -1 'True + Caption = "Dash Finish:" + Height = 195 + Left = 7020 + TabIndex = 108 + Top = 2160 + Width = 870 + End + Begin VB.Label lblFSkip + AutoSize = -1 'True + Caption = "Skip Trowel:" + Height = 195 + Left = 6990 + TabIndex = 107 + Top = 1860 + Width = 885 + End + Begin VB.Label lblFSand + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Sand 16 Finish:" + Height = 195 + Left = 6780 + TabIndex = 106 + Top = 1035 + Width = 1095 + End + Begin VB.Line Line4 + BorderWidth = 2 + X1 = 6360 + X2 = 6360 + Y1 = 360 + Y2 = 4920 + End + Begin VB.Label lblBurDesc + Alignment = 1 'Right Justify + Appearance = 0 'Flat + BackColor = &H80000004& + BorderStyle = 1 'Fixed Single + Caption = "Burden Rates Stucco .16 Lath .14 Scaffold .14 " + ForeColor = &H80000008& + Height = 855 + Left = 240 + TabIndex = 104 + Top = 3780 + Width = 1155 + End + Begin VB.Line Line3 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 2880 + Y2 = 2880 + End + Begin VB.Label lblSQYDPR + AutoSize = -1 'True + Caption = "Price Per SQ YD:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 3840 + TabIndex = 97 + Top = 3420 + Width = 1485 + End + Begin VB.Label lblCMUPr + AutoSize = -1 'True + Caption = "CMU Price:" + Height = 195 + Left = 3600 + TabIndex = 96 + Top = 3060 + Width = 810 + End + Begin VB.Label lblBidwCMU + Alignment = 1 'Right Justify + Caption = "BID PRICE w/CMU:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 495 + Left = 3660 + TabIndex = 95 + Top = 2160 + Width = 1335 + End + Begin VB.Label lblBidPrice + AutoSize = -1 'True + Caption = "BID PRICE:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 3780 + TabIndex = 94 + Top = 1740 + Width = 1185 + End + Begin VB.Line Line2 + BorderWidth = 2 + X1 = 3540 + X2 = 6360 + Y1 = 1560 + Y2 = 1560 + End + Begin VB.Line Line1 + BorderWidth = 2 + X1 = 2460 + X2 = 3420 + Y1 = 4080 + Y2 = 4080 + End + Begin VB.Label lblOH + Caption = "Overhead:" + Height = 195 + Left = 3720 + TabIndex = 93 + Top = 1200 + Width = 795 + End + Begin VB.Label lblMarkup + AutoSize = -1 'True + Caption = "Markup:" + Height = 195 + Left = 3900 + TabIndex = 92 + Top = 840 + Width = 585 + End + Begin VB.Label lblTtlCost + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 4170 + TabIndex = 91 + Top = 480 + Width = 945 + End + Begin VB.Label lblLaborBurden + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Labor Burden:" + Height = 195 + Left = 1530 + TabIndex = 89 + Top = 3720 + Width = 1005 + End + Begin VB.Label lblMatMU + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Material Markup:" + Height = 195 + Left = 540 + TabIndex = 87 + Top = 3360 + Width = 1185 + End + Begin VB.Label lblTtlMat + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Materials:" + Height = 195 + Left = 1395 + TabIndex = 86 + Top = 3000 + Width = 1080 + End + Begin VB.Label lblMisc + AutoSize = -1 'True + Caption = "Misc. Items Cost:" + Height = 195 + Left = 1260 + TabIndex = 73 + Top = 2640 + Width = 1200 + End + Begin VB.Label lblTape + AutoSize = -1 'True + Caption = "Tape/Plastic:" + Height = 195 + Left = 825 + TabIndex = 72 + Top = 2280 + Width = 960 + End + Begin VB.Label lblScaf + AutoSize = -1 'True + Caption = "Scaffold && Gas:" + Height = 195 + Left = 690 + TabIndex = 71 + Top = 1920 + Width = 1095 + End + Begin VB.Label lblMetLab + AutoSize = -1 'True + Caption = "Metal Labor:" + Height = 195 + Left = 900 + TabIndex = 70 + Top = 1560 + Width = 885 + End + Begin VB.Label lblLathLab + AutoSize = -1 'True + Caption = "Lath Labor:" + Height = 195 + Left = 975 + TabIndex = 69 + Top = 1200 + Width = 810 + End + Begin VB.Label lblStucLab + AutoSize = -1 'True + Caption = "Stucco Labor:" + Height = 195 + Left = 780 + TabIndex = 68 + Top = 840 + Width = 1005 + End + Begin VB.Label lblX2 + AutoSize = -1 'True + Caption = "=" + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 300 + Left = 2460 + TabIndex = 66 + Top = 420 + Width = 165 + End + Begin VB.Label lblX1 + AutoSize = -1 'True + Caption = "X" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 1560 + TabIndex = 60 + Top = 480 + Width = 150 + End + Begin VB.Label lblSand + AutoSize = -1 'True + Caption = "Sand:" + Height = 195 + Left = 420 + TabIndex = 58 + Top = 480 + Width = 420 + End + Begin VB.Label lblOFadj + AutoSize = -1 'True + Caption = "Foam Adj. Ydge:" + Height = 195 + Left = -65865 + TabIndex = 52 + Top = 900 + Width = 1170 + End + Begin VB.Label lblOFin2 + AutoSize = -1 'True + Caption = "Finish 2 Ydge:" + Height = 195 + Left = -67965 + TabIndex = 51 + Top = 900 + Width = 1005 + End + Begin VB.Label lblOTexture + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Option Texture:" + Height = 195 + Left = -71505 + TabIndex = 50 + Top = 900 + Width = 1095 + End + Begin VB.Label lblBAmt + AutoSize = -1 'True + Caption = "Billing Amount:" + Height = 195 + Left = -65745 + TabIndex = 49 + Top = 555 + Width = 1035 + End + Begin VB.Label lblYrdge + AutoSize = -1 'True + Caption = "Yardage:" + Height = 195 + Left = -67620 + TabIndex = 48 + Top = 555 + Width = 645 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + Height = 195 + Index = 0 + Left = -71505 + TabIndex = 47 + Top = 660 + Width = 840 + End + End + Begin VB.ListBox lstMod_Elv + Height = 1620 + Left = 1380 + Sorted = -1 'True + TabIndex = 1 + Top = 1380 + Width = 1395 + End + Begin VB.Label lblTitle + Alignment = 2 'Center + BackColor = &H0000FFFF& + Caption = "* * * * This is a superceded takeoff * * * *" + BeginProperty Font + Name = "MS Sans Serif" + Size = 13.5 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H000000FF& + Height = 375 + Left = 60 + TabIndex = 244 + Top = 0 + Width = 11775 + End + Begin VB.Label txtModElv + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 1380 + TabIndex = 243 + Top = 960 + Width = 1395 + End + Begin VB.Label lblSDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Supercede Date:" + Height = 195 + Left = 60 + TabIndex = 242 + Top = 1440 + Width = 1215 + End + Begin VB.Label txtSuperDate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 241 + Top = 2280 + Width = 1725 + End + Begin VB.Label lblSUperDate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Superceded: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 240 + Top = 2340 + Width = 1620 + End + Begin VB.Label lbl108 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "10' 8"" Frames" + Height = 195 + Left = 9960 + TabIndex = 231 + Top = 2940 + Width = 975 + End + Begin VB.Label lbl68 + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "6' 8"" Frames" + Height = 195 + Left = 8130 + TabIndex = 230 + Top = 2940 + Width = 885 + End + Begin VB.Label lblScaffold + Alignment = 2 'Center + Caption = "Scaffolding Frames Required" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 7800 + TabIndex = 228 + Top = 2640 + Width = 4035 + End + Begin VB.Label lblUpdate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Updated: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8535 + TabIndex = 221 + Top = 2025 + Width = 855 + End + Begin VB.Label txtLSave + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 220 + Top = 1635 + Width = 1725 + End + Begin VB.Label txtUpdate + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 219 + Top = 1950 + Width = 1725 + End + Begin VB.Label txtCreated + Caption = " " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 285 + Left = 9420 + TabIndex = 218 + Top = 1305 + Width = 1725 + End + Begin VB.Label lblLSave + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Last Save: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8400 + TabIndex = 217 + Top = 1695 + Width = 990 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Created: " + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 8595 + TabIndex = 216 + Top = 1380 + Width = 795 + End + Begin VB.Label lblNotes + AutoSize = -1 'True + Caption = "Notes:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 2940 + TabIndex = 23 + Top = 1380 + Width = 690 + End + Begin VB.Label lblOneKote + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Type:" + Height = 195 + Left = 7395 + TabIndex = 22 + Top = 1020 + Width = 1020 + End + Begin VB.Label lblFinish + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Texture:" + Height = 195 + Left = 4110 + TabIndex = 21 + Top = 1020 + Width = 585 + End + Begin VB.Label lblStuccoYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Stucco Yards:" + Height = 195 + Left = 8190 + TabIndex = 8 + Top = 600 + Width = 1005 + End + Begin VB.Label lblLathYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Lath Yards:" + Height = 195 + Left = 5925 + TabIndex = 6 + Top = 660 + Width = 810 + End + Begin VB.Label lblTTLYds + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Total Yards:" + Height = 195 + Left = 3840 + TabIndex = 5 + Top = 660 + Width = 855 + End + Begin VB.Label lblMod_Elv + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Model/Elevation:" + Height = 195 + Left = 60 + TabIndex = 2 + Top = 1020 + Width = 1215 + End + Begin VB.Label lblProject + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Project:" + Height = 195 + Left = 60 + TabIndex = 0 + Top = 660 + Width = 540 + End +End +Attribute VB_Name = "frmViewTake" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset +Dim moRSMat As Recordset, moRSCMat As Recordset +Dim moRSMeas As Recordset +Dim moRSOpt As Recordset +Dim moRSOptMat As Recordset +Dim moRSProj As Recordset +Dim moRSLAB As Recordset + +Dim mboolSHOW As Boolean, mboolCALC As Boolean +Dim mboolAdding As Boolean, mboolENTER As Boolean, mboolMEAS As Boolean +Dim mstrType As String, mstrFILE As String, mboolUPDATE As Boolean +Dim mboolCopy As Boolean, mintBOOKMARK As Integer, mintBOOKMARK2 As Integer +Dim mintTOID As Long, mintOPTID As Long, mintPROJID As Long +Dim mstrFINISH As String, mboolSETUP As Boolean, mboolMove As Boolean, strTYPE As String + +Private Sub cboMeLocate_Click() + On Error GoTo Error_EH + + If cboMeLocate.ListIndex = 4 Or cboMeLocate.ListIndex = 5 Then + txtMeType.Text = "B" + ElseIf cboMeLocate.ListIndex = 6 Then + txtMeType.Text = "M" + Else + txtMeType.Text = " " + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cboMeLocate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub cboOFinish_KeyDown(KeyCode As Integer, Shift As Integer) + If KeyCode = vbKeyDelete Then + cboOFinish.ListIndex = -1 + End If + +End Sub + + +Private Sub cmdAddMat_Click() +' cmdAddMat.Enabled = False +' cmdSaveMat.Enabled = True +' cmdDel1900.Enabled = False +' cmdDelMat.Enabled = False +' cmdSave.Enabled = False + mboolAdding = True + Call MatClear + txtMatInvNo.SetFocus + cmdFindMat.Visible = True + +End Sub + +Private Sub cmdAddOptMat_Click() + mboolAdding = True + Call OptMatClear +' cmdAddOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdAddOptMat.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdSave.Enabled = False + cmdDelOptMat.Enabled = False +' cmdSaveOpt.Enabled = False + cmdFindOptMat.Visible = True + lstMod_Elv.Enabled = False + lstOptions.Enabled = False + txtOMInvNo.SetFocus + +End Sub + +Private Sub cmdAddOpt_Click() + Call OptClear + mboolAdding = True + cmdAddOpt.Enabled = False + cmdDelOpt.Enabled = False + cmdAddOptMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveOptMat.Enabled = False + cmdDelOptMat.Enabled = False +' cmdSaveOpt.Enabled = True + lstMod_Elv.Enabled = False + txtODesc.SetFocus +End Sub + +Private Sub cmdCalcOptTexture_Click() +Dim strSQL As String +Dim oRS As Recordset + + If chkDash = vbUnchecked And Not optPTex(4) Then + txtDashPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkDF = vbUnchecked And Not optPTex(8) Then + txtDFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'DF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMF = vbUnchecked And Not optPTex(10) Then + txtMFPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MF' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSS = vbUnchecked And Not optPTex(11) Then + txtSS = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SS' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkMonterrey = vbUnchecked And Not optPTex(6) Then + txtMonterreyPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'MN' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkQU = vbUnchecked And Not optPTex(7) Then + txtQUPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'QU' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSand = vbUnchecked And Not optPTex(0) Then + txtSandPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SA' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSand = vbUnchecked And Not optPTex(1) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S2' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If Not chkSand = vbUnchecked And optPTex(2) Then + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'S3' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete + End If + End If + If chkSB = vbUnchecked And Not optPTex(9) Then + txtSBPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SB' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSkip = vbUnchecked And Not optPTex(3) Then + txtSkipPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SK' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + If chkSmooth = vbUnchecked And Not optPTex(5) Then + txtSmoothPr = "" + strSQL = "SELECT * FROM tblTOLabor WHERE texture = 'SM' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + If Not oRS.EOF Then + oRS.Delete +' Exit Sub + End If + End If + Call SecondLoad +End Sub + +Private Sub cmdCalcPrimary_Click() +Dim intBookmark As Integer + intBookmark = lstMod_Elv.ListIndex + If Not Field2Str2(txtTTLYds) > 0 Then + MsgBox "No Measurements Have Been Entered - Calculation Not Allowed", vbOKOnly, "No Measurement" + Exit Sub + End If + Call cmdUpMeasCalc_Click +' Call GetLabor + If IsNull(moRS!stype) Then + MsgBox "No Stucco Type has been Selected" + Exit Sub + End If + If moRS!stype <> "T" Then + Call CalcOneKote + End If + If moRS!stype = "T" Then + Call CalcThreeKote + End If + Call cmdSave_Click + tabTake.Tab = 3 + lstMod_Elv.ListIndex = intBookmark + MsgBox "Takeoff Calculation is Complete" +End Sub + +Private Sub CalcOneKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, strCHECK As String +Dim boolOK As Boolean, dblWire As Double + + On Error GoTo Error_EH + mboolCALC = False + + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + If Not mboolCALC Then + MsgBox "No Materials Entered Yet - Calc Not Allowed", vbOKOnly, "No Materials" + Exit Sub + End If + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + If moRS!stype = "S" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "B" Then 'Superwall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 9) + 0.99) + End If + End If + If moRS!stype = "W" Then 'Western 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "M" Then 'Magna Wall 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + If moRS!stype = "N" Then 'San Man 1 Kote + If Field2Str2(moRSProj!sw_adj) > 0 Then + dblKote1 = Int((Field2Str(txtLathYds) / Field2Str(moRSProj!sw_adj)) + 0.99) + Else + dblKote1 = Int((Field2Str(txtLathYds) / 10) + 0.99) + End If + End If + + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!yds)) + 0.99) + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + If Field2Str2(moRSProj!syn_t) > 0 Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(moRSProj!syn_t)) + 0.99) + Else + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.99) + End If + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + + If Field2Str(oRS!t_brs) > 0 Then + dblRS = (((dblKote1 * Field2Integer(oRS!t_brs)) + (dblBatch * (Field2Integer(oRS!t_trs))) + (Field2Integer(oRS!t_xrs))) / 2000) + Else + dblRS = 0 + End If + oRS.Close + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int(((Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + ((dblBatch * Field2Integer(oRS!t_trs)) / 2000) + End If + End If +' oRS.Close + + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str2(moRS!c_l) + Int((dblSYN * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + oRC.Close + End If + +' oRSS.Close + If dblRS > 0 Then + dblRS = Int((dblRS) + 0.99) + txtSandTons = dblRS + End If + +'Calculate Black Board + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'B' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblBB = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblBB > 0 Then + If moRSProj!bb Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1310' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1310'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1315' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1315'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblBB / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + End If +'Calculate Metal Lath + strSELECT = "SELECT SUM(sq_yds) AS ttlyds FROM tblMeasure WHERE type = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblML = Int((Field2Integer(oRS!ttlyds) / 9) + 0.99) + If dblML > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1330' and toid = " & gintTOID +' strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = 1370 and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1330'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblML / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbUnchecked + moRSCMat.Update + End If + End If + +'Calculate Foam + dblFOAM = Field2Integer(txtLathYds) - Field2Integer(txtFoamAdj) + If moRSProj!ftype = "O" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1210'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "T" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1210'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "U" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1260'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 3.5) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + + If moRSProj!ftype = "D" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1250'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((dblFOAM - (dblML + dblBB)) / 1.77) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Black paper + If moRSProj!bp_type = "BD" Then + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 2) + 0.99) + ElseIf moRSProj!bp_type = "B1" Then + dblBP = 1 + ElseIf moRSProj!bp_type = "TV" Then + dblBP = Int(((Field2Integer(txtLathYds) / 30)) + 0.99) + Else + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + End If + If moRSProj!bp_type = "TV" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1815' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1815'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = dblBP + moRSCMat.Update + End If + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1816' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1816'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + Else + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 300)) + 0.99) + moRSCMat.Update + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + End If + +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1410'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 40) + 0.99) '***** Wire changed to 40 yds per Jesse on 6/28/05 +' moRSCMat!qty = Int((dblWire / 50) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 50) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate 1 Kote + If moRS!stype = "S" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "B" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '5220' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '5220'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "W" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2210' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2210'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "M" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2250' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2250'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + ElseIf moRS!stype = "N" Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2260' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2260'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + boolOK = True + End If + End If + If boolOK Then + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblKote1 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + moRSCMat.MoveFirst + strSELECT = "inv_no = '1610'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1710'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1720'" + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 200) + 0.05), 1) + moRSCMat.Update + End If + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Str(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Integer(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If + txtTape = Int((Field2Integer(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Integer(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int(((Field2Integer(txtLathYds) - Field2Integer(txtLaborAdj)) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Integer(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + txtMatMU = Int((Field2Long(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + dblSUM = Field2Long(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Long(txtScafGas) + Field2Long(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Long(txtMatMU) + dblSUM = dblSUM + Field2Long(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Str2(txtTtlCost) + Field2Long(txtTtlMU) + Field2Integer(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Str2(txtBidPrwCMU) - Field2Str2(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcOneKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdCopy_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + mboolCopy = True + strMODEL = InputBox("Enter the New Model/Elevation for this Takeoff", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount = 0 Then +' txtNewElv = UCase(strMODEL) + mboolCopy = True + mintPROJID = gintPROJID + Call cmdSave_Click + Else + MsgBox "The Model/Elevation you entered is already being used. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopy_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdCopyOpt_Click() +Dim strMODEL As String, strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strMODEL = InputBox("Enter the Model/Elevation to Copy this Option", "Model/Elevation") + If strMODEL <> "" Then + strSQL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & gintPROJID & " and pln_elv = '" & strMODEL & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + mintTOID = oRS!toid + mboolCopy = True + Call cmdSaveOpt_Click + Else + MsgBox "The Model/Elevation you entered was not found. Verify the Model/Elevation and try again!", vbOKOnly, "Invalid Model/Elevation" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdCopyOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub CalcThreeKote() +Dim dblKote1 As Double, dblCMNT As Double, dblLime As Double +Dim dblSCmnt As Double, dblSLime As Double +Dim dblBCMNT As Double, dblBLime As Double +Dim dblS16 As Double, dblS20 As Double, dblS30 As Double +Dim dblBP As Double, dblRS As Double, dblBatch As Double +Dim dblBB As Double, dblML As Double, dblFOAM As Double +Dim dblMETAL As Double, dblSUM As Double, dblSYN As Double +Dim oRS As Recordset, oRSS As Recordset, oRC As Recordset +Dim strSQL As String, strSELECT As String, dblWire As Double +Dim boolOK As Boolean, strCHECK As String + + On Error GoTo Error_EH + Call UpTexture + + strSELECT = "DELETE * FROM tblTOMatrl where cflag and toid = " & gintTOID + goConn.Execute strSELECT + + Call LoadCMat + + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + + strSQL = "SELECT * from tbltcinfo" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +'Brown + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_brn_yd)) + 0.99) + If Field2Str(oRS!t_brn_cmnt) > 0 Then + dblBCMNT = dblBatch * Field2Integer(oRS!t_brn_cmnt) + Else + dblBCMNT = 0 + End If + + If Field2Str(oRS!t_brn_lime) > 0 Then + dblBLime = dblBatch * Field2Integer(oRS!t_brn_lime) + Else + dblBLime = 0 + End If + + If Field2Str(oRS!t_brn_rs) > 0 Then + dblRS = (dblBatch * Field2Integer(oRS!t_brn_rs)) + Else + dblRS = 0 + End If + +'Scratch + dblBatch = Int((Field2Str(txtLathYds) / Field2Str(oRS!t_scr_yd)) + 0.99) + If Field2Str(oRS!t_scr_cmnt) > 0 Then + dblSCmnt = dblBatch * Field2Integer(oRS!t_scr_cmnt) + Else + dblSCmnt = 0 + End If + + If Field2Str(oRS!t_scr_lime) > 0 Then + dblSLime = dblBatch * Field2Integer(oRS!t_scr_lime) + Else + dblSLime = 0 + End If + + If Field2Str(oRS!t_scr_rs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_scr_rs)) + Else + dblRS = 0 + End If + +'Texture + strSQL = "SELECT * from tblfinish WHERE ID = '" & mstrFINISH & "'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((((Field2Str(txtLathYds) - 10) - Field2Str(txtFin2)) / Field2Str(oRS!t_yds)) + 0.99) + If oRS!id = "SB" Then + dblSYN = Int((((Field2Str(txtLathYds) - 10) * 9) / Field2Str(oRS!t_yds)) + 0.5) + End If + + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblBatch * Field2Integer(oRS!t_cmnt) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblBatch * Field2Integer(oRS!t_lime) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30)) + Else + dblS16 = 0 + End If + + If Field2Str(txtFin2) > 0 Then + strSQL = "SELECT * from tblfinish WHERE ID = 'SA'" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + dblBatch = Int((Field2Str(txtFin2) / Field2Str(oRS!t_yds)) + 0.99) + If Field2Str(oRS!t_cmnt) > 0 Then + dblCMNT = dblCMNT + (dblBatch * Field2Integer(oRS!t_cmnt)) + Else + dblCMNT = 0 + End If + + If Field2Str(oRS!t_lime) > 0 Then + dblLime = dblLime + (dblBatch * Field2Integer(oRS!t_lime)) + Else + dblLime = 0 + End If + + If Field2Str(oRS!t_trs) > 0 Then + dblRS = dblRS + (dblBatch * Field2Integer(oRS!t_trs)) + Field2Integer(oRS!t_xrs) +' Else +' dblRS = 0 + End If + + If Field2Str(oRS!t_s16) > 0 Or Field2Str(oRS!t_s20) > 0 Or Field2Str(oRS!t_s30) > 0 Then + dblS16 = dblS16 + (dblBatch * (Field2Integer(oRS!t_s16) + Field2Integer(oRS!t_s20) + Field2Integer(oRS!t_s30))) +' Else +' dblS16 = 0 + End If + End If + dblRS = Int((dblRS / 2000) + 0.99) + +'Setup Cement + If dblCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2410' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblCMNT = Int((dblCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2410'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Int((dblCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSCmnt > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2412' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSCmnt = Int((dblSCmnt) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2412'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSCmnt + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblBCMNT > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2411' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBCMNT = Int((dblBCMNT) + 0.99) + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2411'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBCMNT + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBCMNT * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + If dblSYN > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2600' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2600'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2610' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblInvtry where Inv_no = '2610'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + dblSYN = Int((dblSYN / 10) + 0.5) + moRSCMat!qty = dblSYN + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSCmnt * Field2Str(oRSS!tprice)) + 0.99) + oRSS.Close + End If + End If + + +'Setup Lime + If dblLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2430' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblLime = Int((dblLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2430'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblSLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2432' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblSLime = Int((dblSLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2432'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblSLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblSLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + + If dblBLime > 0 Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2431' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblBLime = Int((dblBLime) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2431'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBLime + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!c_l = Field2Str(moRS!c_l) + Int((dblBLime * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + +'Setup Silica Sand + If dblS16 > 0 Then + If moRSProj!silica Then + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2316' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2316'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + Else + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '2366' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + dblS16 = Int((dblS16) + 0.99) + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '2366'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblS16 + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + moRS!silica = Int((dblS16 * Field2Str(oRSS!tprice)) + 0.99) + End If + End If + End If + + If dblRS > 0 Then + txtSandTons = dblRS + End If + + +'Calculate Black paper + dblBP = Int(((Field2Integer(txtLathYds) / 33) * 1.5) + 0.99) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1810' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1810'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = dblBP + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If +'Calculate Stucco Wire + dblWire = Field2Integer(txtLathYds) - Field2Integer(txtWireAdj) + strCHECK = "SELECT * FROM tblTOMatrl WHERE inv_no = '1450' and toid = " & gintTOID + Set oRC = New Recordset + oRC.Open strCHECK, goConn, adOpenForwardOnly, adLockReadOnly + If oRC.EOF Then + strSELECT = "SELECT * FROM tblINVtry where Inv_no = '1450'" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + moRSCMat.AddNew + moRSCMat!toid = gintTOID + moRSCMat!inv_no = Field2Str(oRSS!inv_no) + moRSCMat!Desc = Field2Str(oRSS!Desc) + moRSCMat!qty = Int((dblWire / 33) + 0.99) +' moRSCMat!qty = Int((Field2Integer(txtLathYds) / 33) + 0.99) + moRSCMat!price = Field2Str(oRSS!tprice) + moRSCMat!d_flag = Field2Str(oRSS!d_flag) + moRSCMat!m_type = Field2Str(oRSS!m_type) + moRSCMat!calc_flag = Field2Str(oRSS!calc_flag) + moRSCMat!calc_amt = Field2Str(oRSS!calc_amt) + moRSCMat!cflag = vbChecked + moRSCMat!trnsflag = vbChecked + moRSCMat.Update + End If + +'Calculate Nails & Staples + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1616'" '4d Blue Nails + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 400) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1730'" 'Rapid Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int((Field2Integer(txtLathYds) / 400) + 0.99) + moRSCMat.Update + End If + + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1705'" '7/8 Staples + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Round(((Field2Integer(txtLathYds) / 250) + 0.05), 1) + moRSCMat.Update + End If + + moRSCMat.MoveFirst + strSELECT = "inv_no = '1820'" 'Latex Caulking + moRSCMat.Find strSELECT + If Not moRSCMat.EOF Then + moRSCMat!qty = Int(((Field2Integer(txtLathYds) / 100) * 1.5) + 0.99) + moRSCMat.Update + End If + + +'Calculate Metal Feet + strSELECT = "SELECT SUM(Calc_amt * qty) AS ttlmetal FROM tbltomatrl WHERE calc_flag = 'M' and toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + dblMETAL = Field2Str2(oRS!ttlmetal) + txtMetalFt = dblMETAL + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str2(txtSandPrice)) + 0.99), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 30 + Else + txtSandAmt = Format(Int((Field2Integer(txtSandTons) * Field2Str2(txtSandPrice)) + 0.99), "##,###") + End If + If chk2Story Then + txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.2)) + 0.99) +' txtScafGas = Int((Field2Integer(txtTTLYds) * (Field2Str(txtSGRate) * 1.5)) + 0.99) + Else + txtScafGas = Int((Field2Integer(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + End If +' txtScafGas = Int((Field2Str2(txtTTLYds) * Field2Str(txtSGRate)) + 0.99) + txtTape = Int((Field2Str2(txtTTLYds) * Field2Str(txtTPRate)) + 0.99) + txtOH = Int((Field2Str2(txtTTLYds) * Field2Str(txtOHRate)) + 0.99) + txtStucLab = Int((Field2Str2(txtLathYds) * Field2Str(txtSLRate)) + 0.99) + txtLathLab = Int((Field2Str2(txtLathYds) * Field2Str(txtLLRate)) + 0.99) + txtMetLab = Int((Field2Str2(txtMetalFt) * Field2Str(txtMLRate)) + 0.99) + txtCMUPrice = Int((Field2Str2(txtCMUYds) * Field2Str(txtCMURate)) + 0.99) + txtLabBur = Int(((Field2Str2(txtLathLab) * 0.14) + (Field2Str2(txtStucLab) * 0.16) + (Field2Str2(txtMetLab) * 0.14)) + 0.99) + +'update prices + strSQL = "SELECT SUM(qty * price) as MatPrice FROM tblTOMatrl WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + txtTtlMat = Int(Field2Str(oRS!matprice) + 0.99) + dblSUM = Field2Integer(txtSandAmt) + Field2Str2(txtStucLab) + Field2Str2(txtLathLab) + dblSUM = dblSUM + Field2Str2(txtMetLab) + Field2Str2(txtScafGas) + Field2Str2(txtTape) + dblSUM = dblSUM + Field2Str2(txtMisc) + Field2Str2(txtTtlMat) + Field2Str2(txtMatMU) + dblSUM = dblSUM + Field2Str2(txtLabBur) + txtTtlCost = dblSUM + dblSUM = 0 + txtMatMU = Int((Field2Str2(txtTtlMat) * Field2Str(Format(txtMatMURate, "general number"))) + 0.99) + txtTtlMU = Int((Field2Str2(txtTtlCost) * Format(txtMURate, "general number")) + 0.99) + txtBidPrwCMU = Int((Field2Long(txtTtlCost) + Field2Long(txtTtlMU) + Field2Long(txtOH) + Field2Long(txtCMUPrice)) + 0.99) + txtBidPrice = Field2Long(txtBidPrwCMU) - Field2Long(txtCMUPrice) + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CalcThreeKote" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdDefaultMat_Click() + frmInvTake.Show 1 +End Sub + +Private Sub cmdDel1900_Click() +Dim strYN As String +Dim strSQL As String + strYN = MsgBox("Are You Sure You Want To Delete all 1900 series PopOuts?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + strSQL = "DELETE * FROM tblTOMatrl WHERE Inv_no > 1899 and Inv_no < 2000 and toid = " & gintTOID + goConn.Execute strSQL + Call MatLoad +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdAddMat.Enabled = True + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + +End Sub + +Private Sub cmdDelMat_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete TO Material?") + If strYN = vbNo Then + Exit Sub + End If + mintBOOKMARK = lstTOMatrl.ListIndex + moRSMat.Delete + Call MatLoad +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False + If Not mboolUPDATE Then + cmdAddMat.Enabled = True + End If + If lstTOMatrl.ListCount > 0 Then + If lstTOMatrl.ListCount > mintBOOKMARK Then + lstTOMatrl.ListIndex = mintBOOKMARK + Else + lstTOMatrl.ListIndex = mintBOOKMARK - 1 + End If + End If + lstTOMatrl.SetFocus + mintBOOKMARK = 0 +End Sub + +Private Sub cmdDelMeas_Click() +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Measurement?") + If strYN = vbNo Then + Exit Sub + End If + moRSMeas.Delete + Call MeasLoad +' cmdSaveMeas.Enabled = False +' cmdDelMeas.Enabled = False +' cmdAddMeas.Enabled = True + +End Sub + +Private Sub cmdDelOptMat_Click() +Dim strYN As String + + mintBOOKMARK = lstOptions.ListIndex + mintBOOKMARK2 = lstOptMatrl.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option Material?") + If strYN = vbNo Then + Exit Sub + End If +' cmdAddOpt.Enabled = True +' cmdAddOptMat.Enabled = True +' cmdSaveOptMat.Enabled = False +' cmdDelOptMat.Enabled = False + moRSOptMat.Delete + lstOptions.Enabled = True + Call OptLoad + lstOptions.ListIndex = mintBOOKMARK + If lstOptMatrl.ListCount > 0 Then + If lstOptMatrl.ListCount > mintBOOKMARK2 Then + lstOptMatrl.ListIndex = mintBOOKMARK2 + Else + lstOptMatrl.ListIndex = mintBOOKMARK2 - 1 + End If + Else + lstOptMatrl.ListIndex = -1 + End If + mintBOOKMARK = 0 + mintBOOKMARK2 = 0 +End Sub + +Private Sub cmdDelOpt_Click() +Dim strSQL As String +Dim strYN As String + mintBOOKMARK = lstOptions.ListIndex + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete Option?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + +' cmdDelOpt.Enabled = False +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdAddOptMat.Enabled = True +' cmdCopyOpt.Enabled = False + strSQL = "DELETE * FROM tblOptMatrl WHERE OPTid = " & gintOPTID + goConn.Execute strSQL + strSQL = "DELETE * FROM tblOption WHERE Optid = " & gintOPTID 'lstLOptions.ItemData(lstLOptions.ListIndex) + goConn.Execute strSQL + Call OptLoad + If lstOptions.ListCount > 0 Then + If lstOptions.ListCount > mintBOOKMARK Then + lstOptions.ListIndex = mintBOOKMARK + Else + lstOptions.ListIndex = mintBOOKMARK - 1 + End If + Else + lstOptions.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDelOpt_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdFindMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + + If Field2Str(txtMatInvNo) = "" Then + txtMatInvNo = 1 + End If + + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount > 0 Then + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + txtMatQty.SetFocus + Else +' lstMInventory.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtMatInvNo) +' Call ListFindItem2(lstMInventory, lngFind) + + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdAddMeas_Click() +' cmdAddMeas.Enabled = False +' cmdSaveMeas.Enabled = True +' cmdDelMeas.Enabled = False +' cmdSave.Enabled = False +' cmdUpMeasCalc.Enabled = False + mboolAdding = True + Call MeasClear + txtMeDesc.SetFocus + +End Sub + +Private Sub cmdMove_Click() + + 'This module allows you to copy a takeoff from the current active project + 'to a new project that you will enter. You are prompted for the project code + 'which is a code of 1 to 6 alpha charaters. The program then looks to make sure + 'that it is a valid project and then copies all information for that takeoff + +Dim strPROJCODE As String, strSQL As String, strSQLL As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + +' mboolCopy = True + strPROJCODE = InputBox("Enter the New Project Code for this Takeoff", "Copy to New Project") + If strPROJCODE <> "" Then + + strSQL = "SELECT proj_id, proj_code, cont_id from tblProject WHERE Proj_Code = '" & strPROJCODE & " '" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + If oRS.RecordCount <> 0 Then +' txtNewElv = lstMod_Elv.Text + mintPROJID = oRS!Proj_ID + ' strSQLL = "SELECT Toid, proj_id, pln_elv from tblTake WHERE Proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + + Set oRSS = New Recordset + + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If oRSS.RecordCount <> 0 Then + MsgBox "The Project you entered already has this Model/Elevation. Verify Project or Select a different Model/Elevation", vbOKOnly, "Duplicate Model/Elevation" + ' cmdAddOpt.Enabled = True + ' cmdSaveOpt.Enabled = False + ' cmdDelOpt.Enabled = False + ' cmdCopyOpt.Enabled = False + ' cmdAddOptMat.Enabled = True + Exit Sub + Else +' txtNewElv = lstMod_Elv.Text(lstMod_Elv.ListIndex) + mintPROJID = oRS!Proj_ID + mboolMove = True + Call cmdSave_Click + End If + Else + MsgBox "The Project Code you entered is not valid. Verify the Project Code and try again!", vbOKOnly, "Invalid Project Code" +' cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdAddOptMat.Enabled = True + Exit Sub + End If + + Else + Exit Sub + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdMove_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + + +End Sub + +Private Sub cmdPrintAllIncrease_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdPrintIncrease_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + + strSQL = "{tblTake.toid} = " & gintTOID + + crTake.ReportFileName = App.Path & "\takeoffAdj.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintTake_Click() +Dim strDate As String, strSQL As String, intSUP As Integer +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True +' gstrFLAG = "B" +' gstrTYPE = "S" +' Call ShowPrint + If gboolPRINT Then +' strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'B'" +' Set oRS = New Recordset +' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + +' moRS!forder = Field2Str(oRS!order_date) +' moRS.Update + + strSQL = "{tblTake.toid} = " & gintTOID + +' strSQL = strSQL & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'B'" + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + + gboolPRINT = False +' cmdBrownPrint.Enabled = False +' Call Form_Load + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdPrintAllTake_Click() +Dim strSQL As String +Dim oRS As Recordset +Dim strSELECT As String + On Error GoTo Error_EH + + gboolPRINT = True + If gboolPRINT Then + strSELECT = "SELECT * FROM tblTake WHERE proj_id = " & gintPROJID & " ORDER BY pln_elv" + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + strSQL = "{tblTake.toid} = " & oRS!toid + + crTake.ReportFileName = App.Path & "\takeoff.rpt" + crTake.SelectionFormula = strSQL +' crTake.Destination = crptToWindow + crTake.Destination = crptToPrinter + crTake.Action = 1 + oRS.MoveNext + Loop + gboolPRINT = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdPrintAllTake_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub + +End Sub + +Private Sub cmdSaveMat_Click() +Dim intSAVE As Integer + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False +' cmdSave.Enabled = True +' cmdSaveMat.Enabled = False +' cmdAddMat.Enabled = True +' cmdFindMat.Visible = False +' cmdSetup.Enabled = False +' lstMInventory.Visible = False + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +End Sub + +Private Sub cmdSaveMeas_Click() +' cmdSaveMeas.Enabled = False +' cmdSave.Enabled = True +' cmdAddMeas.Enabled = True +' cmdDelMeas.Enabled = False + cmdUpMeasCalc.Enabled = True + Call MeasSave + Call MeasLoad + Call cmdUpMeasCalc_Click + lstMeasure.SetFocus + +End Sub + +Private Sub cmdSaveOpt_Click() +Dim intSAVE As Integer, strINDEX As String + intSAVE = lstOptions.ListIndex + strINDEX = txtODesc +' cmdSaveOpt.Enabled = False +' cmdSave.Enabled = True +' cmdCopyOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdAddOpt.Enabled = True +' cmdAddOptMat.Enabled = True + Call OptSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.ListIndex = intSAVE + Call CBFindString(lstOptions, strINDEX) + +End Sub + +Private Sub OptSave() +Dim oRSMAX As Recordset +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + If moRSOpt.State = adStateClosed Then + strSQL = "SELECT * FROM tblOption WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + oRS!toid = gintTOID + + oRS!yards = Integer2Field(txtOYdge) + oRS!Desc = Str2Field(txtODesc) + oRS!fin2 = Integer2Field(txtOFin2) + oRS!f_adj = Integer2Field(txtOFAdj) + oRS!price = Str2Field(txtOBAmt) + oRS!notes = Str2Field(txtNote) + oRS!ostone = chkOStone + oRS!OSt_SqFt = Integer2Field(txtOST_SqFt) + oRS!otstone = chkST_Others + oRS!invoice = chkNoInvoice + oRS!Scaf6 = Integer2Field(txtO68) + oRS!scaf10 = Integer2Field(txtO108) + Call FindTexture(cboOFinish, strTYPE) + oRS!texture = strTYPE + + oRS.Update + + Call OptLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + End If + + If mboolAdding Then + moRSOpt.AddNew + End If + + If mboolCopy Then + moRSOpt.AddNew + moRSOpt!toid = mintTOID + Else + moRSOpt!toid = gintTOID + End If + + moRSOpt!yards = Integer2Field(txtOYdge.Text) + moRSOpt!Desc = Str2Field(txtODesc.Text) + moRSOpt!fin2 = Integer2Field(txtOFin2.Text) + moRSOpt!f_adj = Integer2Field(txtOFAdj.Text) + moRSOpt!price = Str2Field(txtOBAmt) + moRSOpt!notes = Str2Field(txtNote) + moRSOpt!ostone = chkOStone + moRSOpt!otstone = chkST_Others + moRSOpt!invoice = chkNoInvoice + moRSOpt!Scaf6 = Integer2Field(txtO68) + moRSOpt!scaf10 = Integer2Field(txtO108) + moRSOpt!OSt_SqFt = Integer2Field(txtOST_SqFt) + + Call FindTexture(cboOFinish, strTYPE) + moRSOpt!texture = strTYPE + + moRSOpt.Update + strSQL = "SELECT Max(OPTID) as MAXOptid from tblOption" + + Set oRSMAX = New Recordset + + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + mintOPTID = oRSMAX!maxoptid + oRSMAX.Close + + If mboolAdding Then + mboolAdding = False + End If + + If mboolCopy Then + Call CopyOptMat + mboolCopy = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOpt.ActiveConnection) + Exit Sub + +End Sub + +Private Sub CopyOptMat() +Dim oRS As Recordset +Dim strSQL As String + + On Error GoTo Error_EH + + strSQL = "Select * from tblOptMatrl where OPTID = " & gintOPTID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + If mboolCopy Then + moRSOptMat.AddNew + End If + With oRS + + moRSOptMat!OPTID = mintOPTID + moRSOptMat!inv_no = Field2Str(!inv_no) + moRSOptMat!Desc = Field2Str(!Desc) + moRSOptMat!qty = Field2Str(!qty) + moRSOptMat!calc_amt = Field2Integer(!calc_amt) + moRSOptMat!d_flag = Field2Str(!d_flag) + moRSOptMat!m_type = Field2Str(!m_type) + moRSOptMat!calc_flag = Field2Str(!calc_flag) + moRSOptMat.Update + End With + oRS.MoveNext + Loop + If mboolAdding Then + mboolAdding = False + End If + oRS.Close + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub OptMatSave() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + If moRSOptMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblOptMatrl WHERE optid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + oRS!toid = gintTOID + oRS!OPTID = gintOPTID + oRS!inv_no = Str2Field(txtOMInvNo) + oRS!Desc = Str2Field(txtOMDesc) + oRS!qty = Str2Field(txtOMQty) + oRS!calc_amt = Integer2Field(txtOMMetL) + oRS!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + oRS!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + oRS!d_flag = "Y" + End If + + oRS!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + oRS!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + oRS!calc_flag = "" + End If + + oRS.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSOptMat.AddNew + End If + + moRSOptMat!OPTID = gintOPTID + moRSOptMat!toid = gintTOID + moRSOptMat!inv_no = Str2Field(txtOMInvNo) + moRSOptMat!Desc = Str2Field(txtOMDesc) + moRSOptMat!qty = Str2Field(txtOMQty) + moRSOptMat!calc_amt = Integer2Field(txtOMMetL) + moRSOptMat!price = Str2Field(txtOMPrice) + + If cboOMDFlag.Text = "Supplier" Then + moRSOptMat!d_flag = "S" + ElseIf cboOMDFlag.Text = "Yard" Then + moRSOptMat!d_flag = "Y" + End If + + moRSOptMat!m_type = Left$(cboOMType.Text, 1) + + If cboOMMetal.Text = "Metal" Then + moRSOptMat!calc_flag = "M" + ElseIf cboOMMetal.Text = "None" Then + moRSOptMat!calc_flag = "" + End If + + moRSOptMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSOptMat.ActiveConnection) + Exit Sub + +End Sub + +Private Sub cmdSaveOptMat_Click() +Dim intSAVE As Integer, intSAVE2 As Integer + intSAVE = lstOptions.ListIndex + intSAVE2 = lstOptMatrl.ListIndex +' cmdAddOptMat.Enabled = True +' cmdAddOpt.Enabled = True + lstOptions.Visible = True +' lstInventory.Visible = False +' cmdSaveOptMat.Enabled = False +' cmdSaveOpt.Enabled = False +' cmdSave.Enabled = True +' cmdDelOptMat.Enabled = False + Call OptMatSave + Call OptLoad + lstMod_Elv.Enabled = True + lstOptions.Enabled = True + lstOptions.ListIndex = intSAVE + lstOptMatrl.ListIndex = intSAVE2 + lstOptMatrl.SetFocus +End Sub + +Private Sub cmdSetup_Click() +Dim intSAVE As Integer + + If cmdSetup.Caption = "Setup Materials &On" Then + cmdSetup.Caption = "Setup Materials &Off" + lstMod_Elv.Enabled = False + lstTOMatrl.Enabled = False + mboolSETUP = True + mboolENTER = True +' cmdAddMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdUpdate.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdUPLabRates.Enabled = False +' cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False +' cmdChgLabRates.Enabled = False +' cmdNew.Enabled = False + cboOneKote.Enabled = False +' cmdDeleteTakeoff.Enabled = False + mboolAdding = True + Call MatClear +' lstMInventory.Visible = True + Call LoadMInventory +' lstMInventory.ListIndex = 0 +' lstMInventory.SetFocus + Exit Sub + End If + If cmdSetup.Caption = "Setup Materials &Off" Then + cmdSetup.Caption = "Setup Materials &On" + lstMod_Elv.Enabled = True + lstTOMatrl.Enabled = True +' cmdUpdate.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolSETUP = False + mboolENTER = False +' cmdAddMat.Enabled = True +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True +' cmdCopy.Enabled = True +' cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdUPLabRates.Enabled = True +' cmdUPInvPrices.Enabled = True +' cmdExit.Enabled = True +' cmdChgLabRates.Enabled = True +' cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' lstMInventory.Visible = False +' cmdSave.Enabled = True + If Field2Str2(txtMatInvNo) <> 0 Then + Call MatSave + End If + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus +' lstMInventory.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUpdate_Click() +Dim intSAVE As Integer + + If cmdUpdate.Caption = "Update &Materials On" Then + cmdUpdate.Caption = "Update &Materials Off" + lstMod_Elv.Enabled = False +' lstTOMatrl.Enabled = False +' cmdSetup.Enabled = False + mboolUPDATE = True + mboolENTER = True +' cmdAddMat.Enabled = False +' cmdSave.Enabled = False +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdUPLabRates.Enabled = False +' cmdUPInvPrices.Enabled = False + cmdExit.Enabled = False +' cmdChgLabRates.Enabled = False +' cmdNew.Enabled = False + cboOneKote.Enabled = False +' cmdDeleteTakeoff.Enabled = False + lstTOMatrl.SetFocus + Exit Sub + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + cmdUpdate.Caption = "Update &Materials On" + lstMod_Elv.Enabled = True + cmdSetup.Enabled = True + intSAVE = lstTOMatrl.ListIndex + mboolUPDATE = False + mboolENTER = False +' cmdAddMat.Enabled = True +' cmdSaveMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True +' cmdCopy.Enabled = True +' cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdUPLabRates.Enabled = True +' cmdUPInvPrices.Enabled = True + cmdExit.Enabled = True +' cmdChgLabRates.Enabled = True +' cmdNew.Enabled = True + cboOneKote.Enabled = True + mboolAdding = False +' cmdSave.Enabled = + Call MatLoad + lstTOMatrl.ListIndex = intSAVE + lstTOMatrl.SetFocus + Exit Sub + End If + + +End Sub + +Private Sub cmdUPInvPrices_Click() +Dim strSQL As String, strSELECT As String, strfind As String +Dim oRS As Recordset, oRSS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT inv_no, tprice FROM tblInvtry ORDER BY Inv_no" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT toid, inv_no, price from tblTOMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strfind = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" + oRS.Find strfind + If Not oRS.EOF Then + oRSS!price = Field2Str(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + strSELECT = "SELECT toid, optid, inv_no, price from tblOptMatrl where toid = " & gintTOID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRSS.EOF + oRS.MoveFirst + strfind = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" + oRS.Find strfind + If Not oRS.EOF Then + oRSS!price = Field2Str2(oRS!tprice) + oRSS.Update + End If + oRSS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPInvPrices_Click" + Call ErrorHandler2 + gstrMODULE = "" + + Exit Sub +End Sub + +Private Sub cmdUPLabRates_Click() + On Error GoTo Error_EH + + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + End If + + Call GetLabor + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUPLabRates_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMeasure_DblClick() + cmdSaveMeas.Enabled = True + cmdAddMeas.Enabled = False + cmdDelMeas.Enabled = True + cmdUpMeasCalc.Enabled = False + txtMeSqFt.SetFocus +End Sub + +Private Sub lstMInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + If mboolSETUP Then + mboolENTER = True + End If + + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMetLength = Field2Integer(!calc_amt) + txtMatPrice = Field2Str(!tprice) + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + End With + + oRS.Close + txtMatQty.SetFocus + +' If Not mboolSETUP Then +' lstMInventory.Visible = False +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + +' If optInv(0) Then +' strSQL = "SELECT Inv_no, Desc from tblInvtry" +' ElseIf optInv(1) Then +' strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" +' End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstMInventory.Clear + + Do Until oRS.EOF +' With lstMInventory + +' strLine = oRS!inv_no & vbTab & oRS!Desc +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no +' End With + + oRS.MoveNext + Loop + oRS.Close + +' If lstMInventory.ListCount Then +' lstMInventory.ListIndex = -1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadMInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdFindOptMat_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long +Dim strTYPE As String + On Error GoTo Error_EH + If Len(txtOMInvNo) = 0 Then + txtOMInvNo = 1 + End If + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + txtOMQty.SetFocus + Else + lstOptions.Visible = False +' lstInventory.Visible = True + Call LoadOInventory + lngFind = Field2Long(txtOMInvNo) +' Call ListFindItem2(lstInventory, lngFind) + End If + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdFindOptMat_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub LoadOInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + +' If optInv(0) Then +' strSQL = "SELECT Inv_no, Desc from tblInvtry" +' ElseIf optInv(1) Then +' strSQL = "SELECT Inv_no, Desc FROM tblInvTake WHERE estimator = '" & gstrLOGIN & "'" +' End If +' strSQL = "SELECT Inv_no, Desc from tblInvtry" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + +' lstInventory.Clear + + Do Until oRS.EOF +' With lstInventory + +' strLine = oRS!inv_no & vbTab & oRS!Desc +' .AddItem strLine +' .ItemData(.NewIndex) = oRS!inv_no +' End With + + oRS.MoveNext + Loop + oRS.Close + +' If lstInventory.ListCount Then +' lstInventory.ListIndex = -1 +' End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadOInventory" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String + On Error GoTo Error_EH + +' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, TPrice from tblInvtry where Inv_no = " & lstInventory.ItemData(lstInventory.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMMetL = Field2Integer(!calc_amt) + txtOMPrice = Field2Str(!tprice) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + End With + + oRS.Close + +' lstInventory.Visible = False + lstOptions.Visible = True + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstInventory_DblClick" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + If mboolSETUP Then + If mboolENTER Then +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + ElseIf mboolUPDATE Then + If mboolENTER Then + txtMatQty.SetFocus +' Call lstMInventory_DblClick + KeyAscii = 0 + mboolENTER = False + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + Else + SendKeys "{TAB}" + KeyAscii = 0 + End If + End If + +End Sub + +Private Sub cmdDeleteTakeoff_Click() +Dim strDELETE As String +Dim strYN As String + strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") + If strYN = vbNo Then + Exit Sub + End If + On Error GoTo Error_EH + + mintBOOKMARK = lstMod_Elv.ListIndex + + strDELETE = "DELETE * FROM tblOptMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblOption WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOMatrl WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblmeasure WHERE toid = " & gintTOID + goConn.Execute strDELETE + + strDELETE = "DELETE * FROM tblTOLabor WHERE toid = " & gintTOID + goConn.Execute strDELETE + + moRS.Delete + Call ListLoad + If lstMod_Elv.ListCount > 0 Then + If lstMod_Elv.ListCount > mintBOOKMARK Then + lstMod_Elv.ListIndex = mintBOOKMARK + Else + lstMod_Elv.ListIndex = -1 + End If + Else + Unload Me + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdDeleteTakeoff_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdUpMeasCalc_Click() +Dim oRS As Recordset +Dim strSQL As String, intSQYD As Long, intTTLFeet As Long + On Error GoTo Error_EH + + intSQYD = 0 + intTTLFeet = 0 + + strSQL = "SELECT sum(SQ_YDS) as TTLFt FROM tblmeasure WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + 'Do Until oRS.EOF + intTTLFeet = Field2Str2(oRS!ttlft) + +' oRS.MoveNext +' Loop + + If intTTLFeet <> 0 Then + intSQYD = Int((intTTLFeet / 9) + 0.99) + txtTTLYds.Text = intSQYD + txtLathYds = Int((txtTTLYds - (((Field2Integer(txtOpenings)) * (Field2Integer(txtPrcntge))) / 100)) + 0.99) + txtStuccoYds = Field2Integer(txtLathYds) - 5 + End If + + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdUpMeasCalc_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_Load() + Set moRS = New Recordset + Set moRSProj = New Recordset + Set moRSMeas = New Recordset + Set moRSMat = New Recordset + Set moRSOpt = New Recordset + Set moRSOptMat = New Recordset + Call MTypeLoad(cboOMType) + Call MTypeLoad(cboMType) + Call ProjLoad + Call TextureLoad + Call StuccoLoad + Call MeLocateLoad + Call ListLoad + tabTake.Tab = 3 + mintBOOKMARK = 0 +End Sub +Private Sub SecondLoad() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT texture, bidprice FROM tblTOLabor WHERE toid = " & gintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + Do Until oRS.EOF + If oRS!texture = "SK" Then + chkSkip = vbChecked + txtSkipPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SA" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S2" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "S3" Then + chkSand = vbChecked + txtSandPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SB" Then + chkSB = vbChecked + txtSBPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DA" Then + chkDash = vbChecked + txtDashPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MN" Then + chkMonterrey = vbChecked + txtMonterreyPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SM" Then + chkSmooth = vbChecked + txtSmoothPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "QU" Then + chkQU = vbChecked + txtQUPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "DF" Then + chkDF = vbChecked + txtDFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "MF" Then + chkMF = vbChecked + txtMFPr = Format(Field2Double(oRS!bidprice), "###,###") + ElseIf oRS!texture = "SS" Then + chkSS = vbChecked + txtSS = Format(Field2Double(oRS!bidprice), "###,###") + End If + oRS.MoveNext + Loop + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID + + moRSProj.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub TextureLoad() +Dim oRSFinish As Recordset +Dim strSQL As String, intRows As Integer +Dim row, col As Long + On Error GoTo Error_EH + + strSQL = "SELECT AUTOID, Desc FROM tblFinish" + + Set oRSFinish = New Recordset + oRSFinish.Open strSQL, goConn, _ + adOpenForwardOnly, adLockReadOnly + oRSFinish.MoveLast + oRSFinish.MoveFirst + intRows = oRSFinish.RecordCount + Do Until oRSFinish.EOF + cboOFinish.AddItem oRSFinish("Desc") + cboOFinish.ItemData(cboOFinish.NewIndex) = Field2Long(oRSFinish("AUTOID")) + oRSFinish.MoveNext + Loop + oRSFinish.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module TextureLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub ListLoad() +Dim oRS As Recordset +Dim strSQL As String, strProj As String + On Error GoTo Error_EH + txtModElv = "" + strSQL = "SELECT TOID, Pln_Elv, superdate from tblTake WHERE supersede and origtoid = " & gintNTOID +' strSQL = "SELECT TOID, Pln_Elv from tblTake WHERE Proj_ID = " & gintPROJID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMod_Elv.Clear + + Do Until oRS.EOF + With lstMod_Elv + .AddItem Field2Str(oRS!superdate) + .ItemData(.NewIndex) = oRS("toid") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMod_Elv.ListCount Then + lstMod_Elv.ListIndex = 0 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module ListLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ClearSecond() + + chkSkip = vbUnchecked + txtSkipPr = "" + chkSand = vbUnchecked + txtSandPr = "" + chkSB = vbUnchecked + txtSBPr = "" + chkDash = vbUnchecked + txtDashPr = "" + chkMonterrey = vbUnchecked + txtMonterreyPr = "" + chkSmooth = vbUnchecked + txtSmoothPr = "" + chkQU = vbUnchecked + txtQUPr = "" + chkDF = vbUnchecked + txtDFPr = "" + chkSS = vbUnchecked + txtSS = "" + chkMF = vbUnchecked + txtMFPr = "" + +End Sub + +Private Sub FormShow() +Dim dblOPENINGS As Double, strSELECT As String + On Error GoTo Error_EH + Call ClearSecond + mboolSHOW = True + gintTOID = moRS!toid + txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc + With moRS + txtModElv = Field2Str(!pln_elv) + mstrFINISH = Field2Str(!finish) + chkOpen = Field2CheckBox(!openflg) + txtTTLYds = Field2Str2(!TTL_Yds) + txtOpenings = Format(Field2Str2(!opening), "#,#") + txtPrcntge = Field2Integer(!openpr) + If Field2Integer(!lath_yds) = 0 Then + txtLathYds = Int((Field2Str2(txtTTLYds) - (((Field2Str2(txtOpenings)) * (Field2Str2(txtPrcntge))) / 100)) + 0.99) + Else + txtLathYds = Field2Str(!lath_yds) + End If + txtLathYds = Format(Field2Double(txtLathYds), "###,###") + txtCMUYds = Field2Str2(!CMUYDS) + txtStone = Field2Str2(!ST_SQFT) + chkStone = Field2CheckBox(!stone) + txtNotes = Field2Str(!notes) + txtFoamAdj = Field2Integer(!f_adj) + txtLaborAdj = Field2Integer(!l_adj) + txtWireAdj = Field2Integer(!w_adj) + txtFin2 = Field2Integer(!fin2) + txtSandTons = Field2Integer(!SAND_TONS) + txtSandPrice = Format(Field2Str(!sand), "##.00") + txtMetalFt = Format(Field2Str2(!METAL), "#,#") + txtStucLab = Format(Field2Str2(!pl), "#,#") + txtLathLab = Format(Field2Str2(!ll), "#,#") + txtMetLab = Format(Field2Str2(!mlab), "#,#") + txtMisc = Format(Field2Str2(!MISC), "#,#") + txtMatMU = Format(Field2Str(!MATMUPR), "#,#") + txtBidPrwCMU = Format(Field2Double(!bidp), "###,###") + txtCMUPrice = Format(Field2Long(!cmulab), "###,###") + txtBidPrice = Format((Field2Double(txtBidPrwCMU) - Field2Double(txtCMUPrice)), "###,###") + txtTtlCost = Format(Field2Double(!BIDC), "###,###") + txtTtlMU = Format(Field2Str(!OH), "#,#") + txtOH = Format(Field2Str2(!OHPR), "##,###") + chk2Story = Field2CheckBox(!twostory) + If chk2Story Then + lbl2S.Caption = "2S" + Else + lbl2S.Caption = "" + End If + txt68 = Field2Str2(!Scaf6) + txt108 = Field2Str2(!scaf10) + txtCreated = Format(Field2Str(!Create), "mm/dd/yyyy") & " - " & Field2Str(!createuser) + txtUpdate = Format(Field2Str(!Update), "mm/dd/yyyy") & " - " & Field2Str(!LUUser) + txtLSave = Format(Field2Str(!LSave), "mm/dd/yyyy") & " - " & Field2Str(!LSUser) + If Field2Integer(txtSandTons) < 16 Then + txtSandAmt = Format((Field2Str(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + txtSandAmt = Field2Str2(txtSandAmt) + 40 + Else + txtSandAmt = Format((Field2Str2(txtSandTons.Text) * Field2Str2(txtSandPrice.Text)), "##,###") + End If + txtScafGas = Format(Field2Str2(!SL_TG), "#,#") + txtTape = Format(Field2Str(!tp), "##.00") + txtTtlMat = Format(Field2Str2(!MATCOST), "###,###") + txtLabBur = Format(Field2Str2(!BRDN), "##,###") + txtTape = Format(Field2Str2(!TPE), "###,###") + If Field2Str2(txtLathYds) <> 0 Then + txtStuccoYds = Format((Field2Str2(txtLathYds) - 5), "##,###") + Else + txtStuccoYds = "" + End If + + If !finish = "SK" Then + txtFinish.Text = "SKIP TROWEL" + optPTex(3).Value = True + ElseIf !finish = "SA" Then + txtFinish.Text = "Sand - 16" + optPTex(0).Value = True + ElseIf !finish = "SB" Then + txtFinish.Text = "EIFS - SANDBLAST" + optPTex(9).Value = True + ElseIf !finish = "S2" Then + txtFinish.Text = "Sand - 20" + optPTex(1).Value = True + ElseIf !finish = "S3" Then + txtFinish.Text = "Sand - 30" + optPTex(2).Value = True + ElseIf !finish = "DA" Then + txtFinish.Text = "Dash" + optPTex(4).Value = True + ElseIf !finish = "DF" Then + txtFinish.Text = "Skip and Sand Finish" + optPTex(8).Value = True + ElseIf !finish = "SM" Then + txtFinish.Text = "Smooth" + optPTex(5).Value = True + ElseIf !finish = "QU" Then + txtFinish.Text = "Quernavaca" + optPTex(7).Value = True + ElseIf !finish = "MN" Then + txtFinish.Text = "Monterrey" + optPTex(6).Value = True + ElseIf !finish = "MF" Then + txtFinish.Text = "Monterrey & Sand" + optPTex(10).Value = True + ElseIf !finish = "SS" Then + txtFinish.Text = "Skip and R Sand Finish" + optPTex(11).Value = True + End If + + ' On Error Resume Next + If !stype = "S" Then + cboOneKote = "Superwall" + ElseIf !stype = "M" Then + cboOneKote = "Magna Wall" + ElseIf !stype = "T" Then + cboOneKote = "Three Coat" + ElseIf !stype = "N" Then + cboOneKote = "Synthetic" + ElseIf !stype = "B" Then + cboOneKote = "Synthetic over 1 Kote" + ElseIf !stype = "W" Then + cboOneKote = "Western 1 Kote" + End If + ' On Error GoTo Error_EH + + + If Field2Decimal(txtLathYds) <> 0 Then + txtPrSQYD = Format(Round((Field2Decimal(txtBidPrwCMU.Text) / Field2Decimal(txtLathYds.Text)), 2), "###.00") + Else + txtPrSQYD = "" + End If + + End With + Call SecondLoad + + strSELECT = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strSELECT + With moRSLAB + txtSLRate = Format(Field2Str(!s_rate), "##.00") + txtLLRate = Format(Field2Str(!l_rate), "##.00") + txtMLRate = Format(Field2Str(!m_Rate), "##.00") + txtMatMURate = Format(Field2Str(!matmu), "percent") + txtSGRate = Format(Field2Str(!scr), "##.00") + txtTPRate = Format(Field2Str(!tp), "##.00") + txtMURate = Format(Field2Str(!mu), "percent") + txtOHRate = Format(Field2Str(!ohp), "##.00") + txtCMURate = Format(Field2Str(!CMU), "##.00") + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShow" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMeas() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMeas + txtMeDesc = Field2Str(!Desc) + txtMeSqFt = Field2Str(!sq_yds) + txtMeType = Field2Str(!Type) + If !Location = "FR" Then + cboMeLocate.Text = "Front" + ElseIf !Location = "BA" Then + cboMeLocate.Text = "Back" + ElseIf !Location = "LE" Then + cboMeLocate.Text = "Left" + ElseIf !Location = "RI" Then + cboMeLocate.Text = "Right" + ElseIf !Location = "GA" Then + cboMeLocate.Text = "Gables" ' (4) 'cboMeLocate.List(4) + ElseIf !Location = "FI" Then + cboMeLocate.Text = "Fireplace" + ElseIf !Location = "LI" Then + cboMeLocate.Text = "Lid - Metal Lath" + End If + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormShowMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtMatInvNo = Field2Str(!inv_no) + txtMatDesc = Field2Str(!Desc) + txtMatQty = Field2Str(!qty) + txtMatPrice = Format$(Field2Str(!price), "##,###.00") + txtMetLength = Field2Integer(!calc_amt) + chkTransfer = Field2CheckBox(!trnsflag) + chkCalc = Field2CheckBox(!cflag) + + If !d_flag = "S" Then + cboDFlag.Text = "Supplier" + Else + cboDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboMType, strTYPE) + + If !calc_flag = "M" Then + cboMetal.Text = "Metal" + Else + cboMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOpt() + On Error GoTo Error_EH + + mboolSHOW = True + gintOPTID = moRSOpt!OPTID + + With moRSOpt + txtOYdge = Field2Integer(!yards) + txtODesc = Field2Str(!Desc) + txtOFin2 = Field2Integer(!fin2) + txtOBAmt = Format$(Field2Str(!price), "##,###") + txtOFAdj = Field2Integer(!f_adj) + txtNote = Field2Str(!notes) + chkOStone = Field2CheckBox(!ostone) + txtOST_SqFt = Field2Str2(!OSt_SqFt) + txtO68 = Field2Str2(!Scaf6) + txtO108 = Field2Str2(!scaf10) + chkST_Others = Field2CheckBox(!otstone) + chkNoInvoice = Field2CheckBox(!invoice) + Call FindTexture2(Field2Str(!texture), strTYPE) + If strTYPE = "" Then + cboOFinish.ListIndex = -1 + Else + cboOFinish = strTYPE + End If + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormShowOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormShowOptMat() +Dim strTYPE As String + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSOptMat + txtOMInvNo = Field2Str(!inv_no) + txtOMDesc = Field2Str(!Desc) + txtOMQty = Field2Str(!qty) + txtOMPrice = Format(Field2Str(!price), "##,###.00") + txtOMMetL = Field2Integer(!calc_amt) + + If !d_flag = "S" Then + cboOMDFlag.Text = "Supplier" + Else + cboOMDFlag.Text = "Yard" + End If + + strTYPE = Field2Str(!m_type) + Call FindType(cboOMType, strTYPE) + + If !calc_flag = "M" Then + cboOMMetal.Text = "Metal" + Else + cboOMMetal.Text = "None" + End If + + + End With + mboolSHOW = False + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSHowOptMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FormSave() +Dim strName As String, strMAX As String +Dim oRSMAX As Recordset + + On Error GoTo Error_EH + + If mboolAdding Then + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!Proj_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolCopy Then + mintTOID = gintTOID + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!Proj_ID = gintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + End If + If mboolMove Then + mintTOID = gintTOID + moRS.AddNew +' moRS!pln_elv = Field2Str(txtNewElv) + moRS!Proj_ID = mintPROJID + moRS!stype = Field2Str(moRSProj!stype) + moRS!createuser = gstrLOGIN + moRSLAB.AddNew + moRSLAB!C_USER = gstrLOGIN + mboolCopy = True + End If + ' Store the controls to the recordset + Call FieldsSave + + moRS.Update + + If mboolAdding Or mboolCopy Then + strMAX = "SELECT Max(TOID) as MAXToid from tblTake" + Set oRSMAX = New Recordset + oRSMAX.Open strMAX, goConn, adOpenForwardOnly, adLockReadOnly + moRSLAB!toid = oRSMAX!MAXToid +' moRSLAB!texture = "SM" +' moRSLAB.Update + oRSMAX.Close + End If + moRSLAB.Update + If mboolAdding Then + mboolAdding = False + mboolMEAS = True +' Call CBFindString(lstMod_Elv, txtNewElv) + End If + If mboolCopy Then + Call CopyTMat 'This will copy all of the old takeoff materials to the new takeoff + Call CopyTMeas 'This will copy all of the old takeoff measurements to the new takeoff + Call CopyTOpt 'This will copy all of the old takeoff options and option materials to the new takeoff +' Call CBFindString(lstMod_Elv, txtNewElv) 'This sets the bookmark in the Model/Elevation list to the new takeoff + mintBOOKMARK = lstMod_Elv.ListIndex + ' mboolCopy = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FormSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMat() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblTOMatrl where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + +' strSQL = "SELECT toid FROM tblTake where proj_id = " & mintPROJID & " and pln_elv = '" & Field2Str(txtNewElv) & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + gintTOID = Field2Integer(oRS!toid) + + strSQL = "SELECT * FROM tblTOMatrl where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!inv_no = Field2Str(oRS!inv_no) + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!qty = Field2Str2(oRS!qty) + oRSC!price = Field2Str2(oRS!price) + oRSC!d_flag = Field2Str(oRS!d_flag) + oRSC!m_type = Field2Str(oRS!m_type) + oRSC!calc_flag = Field2Str(oRS!calc_flag) + oRSC!calc_amt = Field2Integer(oRS!calc_amt) + oRSC!trnsflag = Field2Str(oRS!trnsflag) + oRSC!cflag = Field2Str(oRS!cflag) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTMeas() +Dim oRS As Recordset, oRSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tblMeasure where toid = 1" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblMeasure where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!sq_yds = Field2Str2(oRS!sq_yds) + oRSC!Type = Field2Str(oRS!Type) + oRSC!Location = Field2Str(oRS!Location) + oRSC.Update + End With + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyTOpt() +Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, oRSC As Recordset +Dim strSQL As String, strSELECT As String, strCOPY As String + On Error GoTo Error_EH + + strCOPY = "SELECT * FROM tbloption where toid = 7" + Set oRSC = New Recordset + oRSC.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT * FROM tblOption where toid = " & mintTOID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRS.EOF + mintOPTID = oRS!OPTID + With oRS + oRSC.AddNew + oRSC!toid = gintTOID + oRSC!Desc = Field2Str(oRS!Desc) + oRSC!yards = Field2Integer(oRS!yards) + oRSC!price = Field2Str2(oRS!price) + oRSC!texture = Field2Str(oRS!texture) + oRSC!fin2 = Field2Integer(oRS!fin2) + oRSC!f_adj = Field2Integer(oRS!f_adj) + oRSC.Update + End With + + strCOPY = "SELECT * FROM tblOptMatrl where toid = 1" + Set oRSSS = New Recordset + oRSSS.Open strCOPY, goConn, adOpenKeyset, adLockOptimistic + + strSELECT = "SELECT MAX(optid) as MAXoptid FROM tblOption" + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + gintOPTID = oRSS!maxoptid + + strSELECT = "SELECT * FROM tblOptMatrl where optid = " & mintOPTID + Set oRSS = New Recordset + oRSS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + With oRSS + oRSSS.AddNew + oRSSS!toid = gintTOID + oRSSS!OPTID = gintOPTID + oRSSS!inv_no = Field2Str(!inv_no) + oRSSS!Desc = Field2Str(!Desc) + oRSSS!qty = Field2Str2(!qty) + oRSSS!price = Field2Str2(!price) + oRSSS!d_flag = Field2Str(!d_flag) + oRSSS!m_type = Field2Str(!m_type) + oRSSS!calc_flag = Field2Str(!calc_flag) + oRSSS!calc_amt = Field2Integer(!calc_amt) + oRSSS.Update + End With + oRSS.MoveNext + Loop + oRS.MoveNext + Loop + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module CopyTOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ToggleButtons() + +End Sub + +Private Sub TextChanged() + If Not mboolSHOW Then +' If Not cmdSave.Enabled Then +' Call ToggleButtons +' End If + End If +End Sub + + + +Private Function FormFind() As Boolean +Dim strSQL As String, strSql2 As String, intTemp As Integer + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTake " + strSQL = strSQL & "WHERE TOID = " & _ + lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + + Set moRS = New Recordset + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRS.EOF Then + FormFind = False + Else + strSql2 = "SELECT * FROM tblTOLabor WHERE toid = " & lstMod_Elv.ItemData(lstMod_Elv.ListIndex) + Set moRSLAB = New Recordset + moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + FormFind = True + End If + Exit Function + +Error_EH: + moRS.Update + Resume Next +End Function +Private Function FormFindMeas() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblMeasure " + strSQL = strSQL & "WHERE ID = " & lstMeasure.ItemData(lstMeasure.ListIndex) + + If moRSMeas.State = adStateOpen Then + moRSMeas.Close + End If + + moRSMeas.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSMeas.EOF Then + FormFindMeas = False + Else + FormFindMeas = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMeas" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Function FormFindOpt() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOption " + strSQL = strSQL & "WHERE OPTID = " & lstOptions.ItemData(lstOptions.ListIndex) + + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + + moRSOpt.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOpt.EOF Then + FormFindOpt = False + Else + FormFindOpt = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindOpt" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function +Private Function FormFindOptMat() As Boolean +Dim strSQL As String + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblOptMatrl " + strSQL = strSQL & "WHERE OPTID = " & gintOPTID & " and Inv_No = '" & lstOptMatrl.ItemData(lstOptMatrl.ListIndex) & "'" + + On Error GoTo Error_UP + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + On Error GoTo 0 + + moRSOptMat.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + + If moRSOptMat.EOF Then + FormFindOptMat = False + Else + FormFindOptMat = True + End If + Exit Function + +Error_UP: + moRSOptMat.Update + moRSOptMat.Close + Resume Next +End Function +Private Function FormFindMat() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID & " AND INV_NO = '" & lstTOMatrl.ItemData(lstTOMatrl.ListIndex) & "'" + + Set moRSMat = New Recordset +' If moRSMat.State = adStateOpen Then +' moRSMat.Close +' End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + If moRSMat.EOF Then + FormFindMat = False + Else + FormFindMat = True + End If + Exit Function + +Error_EH: + gstrMODULE = "Form Take - Module FormFindMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub LoadCMat() +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblTOMatrl " + strSQL = strSQL & "WHERE TOID = " & gintTOID + + Set moRSCMat = New Recordset + + moRSCMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + If Not moRSCMat.EOF Then + moRSCMat.MoveFirst + mboolCALC = True + Else + mboolCALC = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module LoadCMat" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdChgLabRates_Click() + frmLabor.Show 1 +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + + + +Private Sub lstMeasure_Click() + On Error GoTo Error_EH + + If lstMeasure.ListIndex <> -1 Then + If FormFindMeas() Then + Call FormShowMeas + Else + lstMeasure.Clear + txtMeDesc = "" + txtMeSqFt = "" + txtMeType = "" + cboMeLocate.Text = "" + + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMeasure_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_Click() + + On Error GoTo Error_EH + + If lstMod_Elv.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + Call MeasLoad + Call MatLoad + Call OptLoad + Call OptMatLoad +' cmdDeleteTakeoff.Enabled = False +' cmdNew.Enabled = True + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module lstMod_Elv_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Measure_Setup() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BALANCE OF HOUSE" + !sq_yds = 0 + !Type = "" + !Location = "FR" + End With + oRS.Update + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = "BLACK BOARD" + !sq_yds = 0 + !Type = "B" + !Location = "GA" + End With + oRS.Update + oRS.Close + Call MeasLoad + + Exit Sub +Error_EH: + gstrMODULE = "Form Take - Module Measure_Setup" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub FieldsSave() +Dim oRSMAX As Recordset +Dim strMAX As String + + On Error GoTo Error_EH + + With moRS + !TTL_Yds = Single2Field(txtTTLYds) + !lath_yds = Single2Field(txtLathYds) + !opening = Single2Field(txtOpenings) + !openpr = Single2Field(txtPrcntge) + !CMUYDS = Single2Field(txtCMUYds) + !notes = Str2Field(txtNotes) + !f_adj = Integer2Field(txtFoamAdj) + !l_adj = Integer2Field(txtLaborAdj) + !w_adj = Integer2Field(txtWireAdj) + !fin2 = Integer2Field(txtFin2) + !SAND_TONS = Integer2Field(txtSandTons) + !sand = Str2Field(txtSandPrice) + !METAL = Single2Field(txtMetalFt) + !pl = Single2Field(txtStucLab) + !ll = Single2Field(txtLathLab) + !mlab = Single2Field(txtMetLab) + !MISC = Single2Field(txtMisc) +' !mtmu = Str2Field(Format(txtMatMURate, "general number")) + !MATMUPR = Str2Field(txtMatMU) + !bidp = Single2Field(txtBidPrwCMU) + !BIDC = Single2Field(txtTtlCost) + !OH = Str2Field(txtTtlMU) + !OHPR = Single2Field(txtOH) + !SL_TG = Single2Field(txtScafGas) + !tp = Str2Field(txtTape) + !MATCOST = Single2Field(txtTtlMat) + !BRDN = Single2Field(txtLabBur) + !stone = chkStone + !ST_SQFT = Single2Field(txtStone) + !cmulab = Single2Field(txtCMUPrice) + !TPE = Single2Field(txtTape) + !openflg = chkOpen + !twostory = chk2Story + !Scaf6 = Integer2Field(txt68) + !scaf10 = Integer2Field(txt108) + !LSUser = gstrLOGIN + !LSave = Date +' If chkUpdate Then +' !LUUser = gstrLOGIN +' !Update = Date +' End If + + If cboOneKote.Text = "Superwall" Then + !stype = "S" + ElseIf cboOneKote.Text = "Magna Wall" Then + !stype = "M" + ElseIf cboOneKote.Text = "Three Coat" Then + !stype = "T" + ElseIf cboOneKote.Text = "Synthetic" Then + !stype = "C" + ElseIf cboOneKote.Text = "Synthetic w/ 1 Kote" Then + !stype = "B" + ElseIf cboOneKote.Text = "San Man" Then + !stype = "N" + ElseIf cboOneKote.Text = "Western 1 Kote" Then + !stype = "W" + End If + If optPTex(3) Then + !finish = "SK" + ElseIf optPTex(4) Then + !finish = "DA" + ElseIf optPTex(0) Then + !finish = "SA" + ElseIf optPTex(9) Then + !finish = "SB" + ElseIf optPTex(1) Then + !finish = "S2" + ElseIf optPTex(2) Then + !finish = "S3" + ElseIf optPTex(8) Then + !finish = "DF" + ElseIf optPTex(5) Then + !finish = "SM" + ElseIf optPTex(7) Then + !finish = "QU" + ElseIf optPTex(6) Then + !finish = "MN" + ElseIf optPTex(10) Then + !finish = "MF" + End If + If mboolAdding Or mboolCopy Then + moRSLAB!texture = !finish + End If + End With + With moRSLAB + !s_rate = Str2Field(txtSLRate) + !l_rate = Str2Field(txtLLRate) + !m_Rate = Str2Field(txtMLRate) + !scr = Str2Field(txtSGRate) + !tp = Str2Field(txtTPRate) + !mu = Str2Field(Format(txtMURate, "general number")) + !ohp = Str2Field(txtOHRate) + !CMU = Str2Field(txtCMURate) + !matmu = Str2Field(Format(txtMatMURate, "general number")) + !bidprice = Field2Str2(txtBidPrwCMU) + !U_USER = gstrLOGIN + !U_date = Date + End With + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module FieldsSave" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub cmdNew_Click() + On Error GoTo Error_EH + + mboolAdding = True + cboOneKote.Enabled = True +' cmdUPInvPrices.Enabled = False + cmdExit.Caption = "&Cancel" + cmdExit.Enabled = True +' cmdNew.Enabled = False + cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' cmdCopy.Enabled = False +' cmdDeleteTakeoff.Enabled = False +' cmdSave.Enabled = True + lstMod_Elv.Enabled = False + Call FormClear + Call MatClear + Call MeasClear + Call OptClear + gintOPTID = 0 + gintTOID = 0 + lstOptions.Clear + lstMeasure.Clear + lstTOMatrl.Clear + lstOptMatrl.Clear +' lblNewElv.Visible = True +' txtNewElv.Visible = True + lstMod_Elv.Enabled = False + ' txtNewElv = "" +' txtNewElv.SetFocus + + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module cmdNew_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSave_Click() +Dim intSAVE + If Not mboolAdding And Not mboolCopy Then + intSAVE = lstMod_Elv.ListIndex + End If + cboOneKote.TabStop = False + Call cmdUpMeasCalc_Click + Call FormSave + Call ListLoad + If mboolCopy Then +' Call CBFindString(lstMod_Elv, txtNewElv) + intSAVE = lstMod_Elv.ListIndex + mboolCopy = False + End If +' cmdUPInvPrices.Enabled = True + cmdExit.Caption = "&Exit" + cmdExit.Enabled = True +' cmdNew.Enabled = True +' cmdCopy.Enabled = True + cmdPrintTake.Enabled = True +' cmdPrintAllTake.Enabled = True +' cmdDeleteTakeoff.Enabled = True ' +' cmdSave.Enabled = False +' chkUpdate = vbUnchecked + lstMod_Elv.Enabled = True + If mboolMEAS Then + tabTake.Tab = 0 +' Call CBFindString(lstMod_Elv, txtNewElv) +' Call Measure_Setup +' Call lstMeasure_DblClick + mboolMEAS = False + Else + lstMod_Elv.ListIndex = intSAVE + End If + +' lblNewElv.Visible = False +' txtNewElv.Visible = False + lstMod_Elv.Enabled = True + + +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer +Dim strSQL As String, strSql2 As String + + On Error GoTo Error_EH + mboolMove = False + mboolSETUP = False + mboolENTER = False +' chkUpdate = vbUnchecked +' mstrFILE = "tblInvTake" + + If lstMod_Elv.ListCount = 0 Then + intResponse = MsgBox("No Superceded Plan/Elevation", vbOKOnly + vbQuestion, "No Records") +' If intResponse = vbYes Then +' strSQL = "SELECT * FROM tbltake WHERE toid = 1" +' Set moRS = New Recordset +' moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic +' strSql2 = "SELECT * FROM tblTOLabor where toid = 1" +' Set moRSLAB = New Recordset +' moRSLAB.Open strSql2, goConn, adOpenKeyset, adLockOptimistic +' Call cmdNew_Click +' Unload Me +' Else + Unload Me +' End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + +' If cmdSave.Enabled Then + +' strMSG = "Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call FormSave +' +' Case vbNo +' +' Case vbCancel +' Cancel = True +' Exit Sub +' End Select +' End If + + If moRS.State = adStateOpen Then + moRS.Close + End If + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSOpt.State = adStateOpen Then + moRSOpt.Close + End If + If moRSOptMat.State = adStateOpen Then + moRSOptMat.Close + End If + If moRSProj.State = adStateOpen Then + moRSProj.Close + + End If +' gintTOID = 0 +' gintPROJID = 0 + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub FormClear() + chkCalc = vbUnchecked + chkTransfer = vbUnchecked + txtTTLYds = "0" + txtLathYds = "0" + txtStuccoYds = "0" + txtOpenings = "0" + txtPrcntge = "0" + txtCMUYds = "0" + txtCreated = "" + txtUpdate = "" + txtStone = 0 + chkStone = vbUnchecked + txtNotes = "" + txtFoamAdj = 0 + txtLaborAdj = 0 + txtWireAdj = 0 + txtFin2 = "0" + txtSandTons = "0" + txtSandPrice = "0" + txtMetalFt = "0" + txtStucLab = "0" + txtLathLab = "0" + txtMetLab = "0" + txtMisc = "0" + txtMatMU = "0" + txtBidPrwCMU = "0" + txtBidPrice = "0" + txtTtlCost = "0" + txtTtlMU = "0" + txtOH = "0" + txtPrSQYD = "0" + txtSandAmt = "0" + txtScafGas = "0" + txtTape = "0" + txtTtlMat = "0" + txtLabBur = "0" + txtSLRate = "0" + txtLLRate = "0" + txtMLRate = "0" + txtSGRate = "0" + txtTPRate = "0" + txtMURate = "0" + txtMatMURate = "0" + txtOHRate = "0" + txtCMURate = "0" + txtSandPr = "0" + txtSkipPr = "0" + txtDashPr = "0" + txtSmoothPr = "0" + txtMonterreyPr = "0" + txtQUPr = "0" + txtDFPr = "0" + txtSBPr = "0" + txtNote = "" + cboOneKote.ListIndex = -1 + txt68 = "" + txt108 = "" + txtO68 = "" + txtO108 = "" + chk2Story = vbUnchecked + chkSand.Value = vbUnchecked + chkSkip.Value = vbUnchecked + chkDash.Value = vbUnchecked + chkSmooth.Value = vbUnchecked + chkMonterrey.Value = vbUnchecked + chkQU.Value = vbUnchecked + chkDF.Value = vbUnchecked + chkSB.Value = vbUnchecked + chkMF.Value = vbUnchecked + + +End Sub +Private Sub MeasLoad() +Dim oRS As Recordset +Dim strSQL As String, strTYPE As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT ID, TOID, Desc, Sq_yds from tblmeasure WHERE toid = " & gintTOID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstMeasure.Clear + + Do Until oRS.EOF + With lstMeasure + strLine = oRS("sq_yds") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("ID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstMeasure.ListCount Then + lstMeasure.ListIndex = 0 + Else + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MeasLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasClear() + txtMeDesc = "" + txtMeSqFt = "0" + txtMeType = "" + cboMeLocate.ListIndex = -1 + +End Sub + +Private Sub MeLocateLoad() + cboMeLocate.AddItem ("Front") + cboMeLocate.AddItem ("Back") + cboMeLocate.AddItem ("Left Side") + cboMeLocate.AddItem ("Right Side") + cboMeLocate.AddItem ("Gables") + cboMeLocate.AddItem ("Fireplace") + cboMeLocate.AddItem ("Lid - Rib Lath") + cboMeLocate.AddItem ("Stone - Metal Lath") + cboMeLocate.AddItem ("Stone - 17 Gauge") + +End Sub +Private Sub StuccoLoad() + cboOneKote.AddItem ("Superwall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 1 + cboOneKote.AddItem ("Magna Wall") + cboOneKote.ItemData(cboOneKote.NewIndex) = 2 + cboOneKote.AddItem ("Three Coat") + cboOneKote.ItemData(cboOneKote.NewIndex) = 3 + cboOneKote.AddItem ("Western 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 4 + cboOneKote.AddItem ("Synthetic") + cboOneKote.ItemData(cboOneKote.NewIndex) = 5 + cboOneKote.AddItem ("Synthetic Over 1 Kote") + cboOneKote.ItemData(cboOneKote.NewIndex) = 6 + +End Sub + +Private Sub MatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblTOMatrl WHERE toid = " & gintTOID & " ORDER BY Inv_no" 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstTOMatrl.Clear + + Do Until oRS.EOF + With lstTOMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & Format(oRS("Inv_No"), "####") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstTOMatrl.ListCount Then + lstTOMatrl.ListIndex = 0 + Else + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub MeasSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMeas.State = adStateClosed Then + strSQL = "SELECT * FROM tblMeasure WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Rib Lath" Then + !Location = "LI" + ElseIf cboMeLocate.Text = "Stone - Metal Lath" Then + !Location = "ST" + ElseIf cboMeLocate.Text = "Stone - 17 Gauge" Then + !Location = "SG" + End If + + End With + oRS.Update + + oRS.Close + Call MeasLoad + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMeas.AddNew + End If + + With moRSMeas + !toid = gintTOID + !Desc = Str2Field(txtMeDesc) + !sq_yds = Str2Field(txtMeSqFt) + !Type = Str2Field(txtMeType) + + If cboMeLocate.Text = "Front" Then + !Location = "FR" + ElseIf cboMeLocate.Text = "Back" Then + !Location = "BA" + ElseIf cboMeLocate.Text = "Left" Then + !Location = "LE" + ElseIf cboMeLocate.Text = "Right" Then + !Location = "RI" + ElseIf cboMeLocate.Text = "Gables" Then ' (4) 'cboMeLocate.List(4) + !Location = "GA" + ElseIf cboMeLocate.Text = "Fireplace" Then + !Location = "FI" + ElseIf cboMeLocate.Text = "Lid - Metal Lath" Then + !Location = "LI" + End If + End With + moRSMeas.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMeas.ActiveConnection) + Exit Sub + +End Sub + +Private Sub MatSave() +Dim strSQL As String +Dim oRS As Recordset + On Error GoTo Error_EH + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * FROM tblTOMatrl WHERE toid = 1" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic + + oRS.AddNew + + With oRS + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + oRS.Update + + oRS.Close +' Call MatLoad + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + + End If + + If mboolAdding Then + moRSMat.AddNew + End If + + With moRSMat + !toid = gintTOID + !inv_no = Str2Field(txtMatInvNo) + !Desc = Str2Field(txtMatDesc) + !qty = Str2Field(txtMatQty) + !price = Str2Field(txtMatPrice) + !calc_amt = Integer2Field(txtMetLength) + !trnsflag = chkTransfer + !cflag = chkCalc + + If cboDFlag.Text = "Supplier" Then + !d_flag = "S" + ElseIf cboDFlag.Text = "Yard" Then + !d_flag = "Y" + End If + + !m_type = Left$(cboMType.Text, 1) + + If cboMetal.Text = "Metal" Then + !calc_flag = "M" + ElseIf cboMetal.Text = "None" Then + !calc_flag = "" + End If + + End With + moRSMat.Update + + If Not mboolSETUP Then + If mboolAdding Then + mboolAdding = False + End If + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module MatSave" + Call ErrorHandler2 + gstrMODULE = "" + cmdExit.Enabled = True + Exit Sub +' If Err = "-2147467259" Then +' Resume Next +' +' Else +' Call ErrorHandler(moRSMat.ActiveConnection) +' Exit Sub +' End If +End Sub + +Private Sub MatClear() + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + chkTransfer = vbUnchecked + chkCalc = vbUnchecked + +End Sub + +Private Sub OptMatLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblOPTMatrl WHERE optid = " & gintOPTID 'cboProject.ListIndex" + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptMatrl.Clear + + Do Until oRS.EOF + With lstOptMatrl + + strLine = oRS("D_Flag") & " " & oRS("M_Type") & " " & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("inv_no") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptMatrl.ListCount Then + lstOptMatrl.ListIndex = 0 + Else + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptMatLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub OptMatClear() + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + +End Sub + +Private Sub OptClear() + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtNote = "" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + txtO68 = "" + txtO108 = "" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + cmdAddOpt.Enabled = True +' cmdSaveOpt.Enabled = False + cmdAddOptMat.Enabled = True +' cmdSaveOptMat.Enabled = False + gintOPTID = 0 + +End Sub + +Private Sub OptLoad() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT TOID, OPTID, Desc, Yards from tblOption WHERE toid = " & gintTOID + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstOptions.Clear + + Do Until oRS.EOF + With lstOptions + + strLine = oRS("Yards") & vbTab & oRS("desc") + .AddItem strLine + .ItemData(.NewIndex) = oRS("OPTID") + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstOptions.ListCount Then + lstOptions.ListIndex = 0 + Else + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + txtOST_SqFt = "" + chkOStone = vbUnchecked + chkST_Others = vbUnchecked + chkNoInvoice = vbUnchecked + txtNote = "" + cboOFinish.ListIndex = -1 + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.ListIndex = -1 + cboOMType.ListIndex = -1 + cboOMMetal.ListIndex = -1 + gintOPTID = 0 + cmdAddOptMat.Enabled = False + End If + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module OptLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstMod_Elv_DblClick() +' cmdNew.Enabled = False +' cmdCopy.Enabled = False +' cmdDeleteTakeoff.Enabled = True ' +' cmdSave.Enabled = True + +End Sub + +Private Sub lstOptions_Click() + If lstOptions.ListIndex <> -1 Then + If FormFindOpt() Then + Call FormShowOpt + Call OptMatLoad + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + Else + lstOptions.Clear + txtOYdge = "0" + txtODesc = "" + txtOFin2 = "0" + txtOBAmt = "0" + txtOFAdj = "0" + cboOFinish.ListIndex = -1 + End If + End If + + +End Sub + +Private Sub lstOptions_DblClick() +' cmdSaveOpt.Enabled = True +' cmdDelOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdCopyOpt.Enabled = True +End Sub + +Private Sub lstOptMatrl_Click() + If lstOptMatrl.ListIndex <> -1 Then + If FormFindOptMat() Then + Call FormShowOptMat + Else + lstOptMatrl.Clear + txtOMInvNo = "0" + txtOMDesc = "" + txtOMQty = "0" + txtOMPrice = "0" + txtOMMetL = "0" + cboOMDFlag.Text = "" + cboOMType.Text = "" + cboOMMetal.Text = "" + End If + End If + + +End Sub + +Private Sub lstOptMatrl_DblClick() + lstOptions.Enabled = False +' cmdAddOptMat.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdDelOptMat.Enabled = True +End Sub + +Private Sub lstTOMatrl_Click() + If lstTOMatrl.ListIndex <> -1 Then + If FormFindMat() Then + Call FormShowMat + Else + lstTOMatrl.Clear + txtMatInvNo = "0" + txtMatDesc = "" + txtMatQty = "0" + txtMatPrice = "0" + txtMetLength = "0" + cboDFlag.ListIndex = -1 + cboMType.ListIndex = -1 + cboMetal.ListIndex = -1 + End If + End If + +End Sub + +Private Sub lstTOMatrl_DblClick() + mintBOOKMARK = lstTOMatrl.ListIndex +' cmdSaveMat.Enabled = True +' cmdAddMat.Enabled = False +' cmdDelMat.Enabled = True +' cmdDel1900.Enabled = True + If lstTOMatrl.ListCount > 0 Then + lstTOMatrl.ListIndex = mintBOOKMARK + End If +End Sub + +Private Sub optInv_Click(Index As Integer) +' If optInv(0) Then +' mstrFILE = "tblInvtry" +' End If +' If optInv(1) Then +' mstrFILE = "tblInvTake" +' End If +End Sub + +Private Sub GetLabor() +Dim oRS As Recordset +Dim strSQL As String, strLABOR As String + On Error GoTo Error_EH + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + strSQL = "SELECT * from tblPrgInfo WHERE Texture = '" & mstrFINISH & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + txtSLRate = Format(Field2Str(oRS!s_rate), "##.00") + moRSLAB!s_rate = Field2Str(oRS!s_rate) + txtLLRate = Format(Field2Str(oRS!l_rate), "##.00") + moRSLAB!l_rate = Field2Str(oRS!l_rate) + txtMLRate = Format(Field2Str(oRS!m_Rate), "##.00") + moRSLAB!m_Rate = Field2Str(oRS!m_Rate) + txtTPRate = Field2Str(oRS!tp) + moRSLAB!tp = Field2Str(oRS!tp) + txtMURate = Format(Field2Str(oRS!mu), "percent") + moRSLAB!mu = Field2Str(oRS!mu) + txtOHRate = Format(Field2Str(oRS!ohp), "##.00") + moRSLAB!ohp = Field2Str(oRS!ohp) + txtMatMURate = Format(Field2Str(oRS!matmu), "percent") + moRSLAB!matmu = Field2Str(oRS!matmu) + txtCMURate = Format(Field2Str(oRS!CMU), "##.00") + moRSLAB!CMU = Field2Str(oRS!CMU) +' If chk2Story Then +' txtSGRate = Format((Field2Str(oRS!scr) * 1.5), "##.00") +' moRSLAB!scr = Field2Str((oRS!scr) * 1.5) +' Else + txtSGRate = Format(Field2Str(oRS!scr), "##.00") + moRSLAB!scr = Field2Str(oRS!scr) +' End If + moRS!cladj = Format(Field2Str(oRS!cladj), "##.00") + + Call FormSave +' moRSLAB.Update + oRS.Close + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module GetLabor" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub optPTex_Click(Index As Integer) +Dim strLABOR As String, strSQL As String + + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Select Case Index + Case 0 + mstrFINISH = "SA" + txtFinish.Text = "SAND - 16" + moRS!finish = mstrFINISH + Case 1 + mstrFINISH = "S2" + txtFinish.Text = "SAND - 20" + moRS!finish = mstrFINISH + Case 2 + mstrFINISH = "S3" + txtFinish.Text = "SAND - 30" + moRS!finish = mstrFINISH + Case 3 + mstrFINISH = "SK" + txtFinish.Text = "SKIP TROWEL" + moRS!finish = mstrFINISH + Case 4 + mstrFINISH = "DA" + txtFinish.Text = "DASH" + moRS!finish = mstrFINISH + Case 5 + mstrFINISH = "SM" + txtFinish.Text = "SMOOTH" + moRS!finish = mstrFINISH + Case 6 + mstrFINISH = "MN" + txtFinish.Text = "MONTERREY" + moRS!finish = mstrFINISH + Case 7 + mstrFINISH = "QU" + txtFinish.Text = "QUERNAVACA" + moRS!finish = mstrFINISH + Case 8 + mstrFINISH = "DF" + txtFinish.Text = "SKIP AND SAND FINISH" + moRS!finish = mstrFINISH + Case 9 + mstrFINISH = "SB" + txtFinish.Text = "EIFS - SANDBLAST" + moRS!finish = mstrFINISH + Case 10 + mstrFINISH = "MF" + txtFinish.Text = "MONTERREY & SAND" + moRS!finish = mstrFINISH + Case 11 + mstrFINISH = "SS" + txtFinish.Text = "SKIP AND RSAND FINISH" + moRS!finish = mstrFINISH + End Select + + strLABOR = "SELECT * FROM tblTOLabor WHERE toid = " & gintTOID + Set moRSLAB = New Recordset + moRSLAB.Open strLABOR, goConn, adOpenKeyset, adLockOptimistic + + strLABOR = "texture = '" & mstrFINISH & "'" + moRSLAB.Filter = strLABOR + + If moRSLAB.EOF Then + moRSLAB.AddNew + moRSLAB!texture = Field2Str(mstrFINISH) + moRSLAB!toid = gintTOID + moRSLAB!C_USER = gstrLOGIN + moRSLAB.Update + Call GetLabor + End If + Call FormShow + Exit Sub + +Error_EH: + gstrMODULE = "Form Take - Module optPTex_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub tabTake_Click(PreviousTab As Integer) +Dim intResponse As Integer, strMSG As String + If PreviousTab = 0 Then +' If cmdSaveMeas.Enabled = True Then +' strMSG = "Measure Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call MeasSave + +' Case vbNo + +' Case vbCancel +' tabTake.Tab = 0 +' Exit Sub +' End Select +' End If + End If + If PreviousTab = 1 Then + If cmdSetup.Caption = "Setup Materials &Off" Then + Call cmdSetup_Click + End If + If cmdUpdate.Caption = "Update &Materials Off" Then + Call cmdUpdate_Click + End If +' If cmdSaveMat.Enabled = True Then +' strMSG = "Material Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call MatSave +' Case vbNo +' +' Case vbCancel +' tabTake.Tab = 1 +' Exit Sub +' End Select +' End If +' Exit Sub + End If + If PreviousTab = 2 Then +' If cmdSaveOpt.Enabled = True Then +' strMSG = "Option Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call OptSave +' Case vbNo + +' Case vbCancel +' tabTake.Tab = 2 +' Exit Sub +' End Select +' End If +' If cmdSaveOptMat.Enabled = True Then +' strMSG = "Option Material Data Has Been Changed" +' strMSG = strMSG & Chr(13) & Chr(10) +' strMSG = strMSG & "Save Changes ?" +' intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) +' Select Case intResponse +' Case vbYes +' Call OptMatSave +' Case vbNo +' +' Case vbCancel +' tabTake.Tab = 2 +' Exit Sub +' End Select +' End If +' Exit Sub + End If + + If tabTake.Tab = 3 Then +' txtNotes.SetFocus + End If +End Sub + +Private Sub txt108_GotFocus() + Call FieldSelect(txt108) +End Sub + +Private Sub txt68_GotFocus() + Call FieldSelect(txt68) +End Sub + +Private Sub txtBidPrwCMU_GotFocus() + Call FieldSelect(txtBidPrwCMU) +End Sub + +Private Sub txtCMUPrice_GotFocus() + Call FieldSelect(txtCMUPrice) +End Sub + +Private Sub txtCMUYds_GotFocus() + Call FieldSelect(txtCMUYds) +End Sub + +Private Sub txtCMUYds_LostFocus() + If Field2Str2(txtCMUYds) > 32300 Then + Beep + MsgBox "CMU Yardage cannot be over 32,300 -- ReEnter", vbOKOnly, "Re-Enter" + txtCMUYds.SetFocus + End If +End Sub + +Private Sub txtFin2_GotFocus() + Call FieldSelect(txtFin2) +End Sub + +Private Sub txtFoamAdj_GotFocus() + Call FieldSelect(txtFoamAdj) +End Sub + +Private Sub txtLaborAdj_GotFocus() + Call FieldSelect(txtLaborAdj) +End Sub + +Private Sub txtMatDesc_GotFocus() + Call FieldSelect(txtMatDesc) +End Sub + +Private Sub txtMatDesc_LostFocus() + txtMatDesc = UCase(txtMatDesc) +End Sub + +Private Sub txtMatInvNo_GotFocus() + Call FieldSelect(txtMatInvNo) +End Sub + +Private Sub txtMatPrice_GotFocus() + Call FieldSelect(txtMatPrice) +End Sub + +Private Sub txtMatQty_GotFocus() + Call FieldSelect(txtMatQty) +End Sub + +Private Sub txtMatQty_LostFocus() +Dim lngFind As Long +Dim strSQL As String +'dim + If mboolSETUP Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) +' If lstMInventory.ListCount > lstMInventory.ListIndex Then +' Call ListFindItem2(lstMInventory, lngFind) +' lstMInventory.ListIndex = lstMInventory.ListIndex + 1 +' Else +' Call ListFindItem2(lstMInventory, lngFind) +' End If +' lstMInventory.SetFocus + Call MatClear + mboolENTER = True + End If + If mboolUPDATE Then + Call MatSave + lngFind = Field2Long(txtMatInvNo) + Call MatLoad + If lstTOMatrl.ListCount > lstTOMatrl.ListIndex Then + Call ListFindItem2(lstTOMatrl, lngFind) + lstTOMatrl.ListIndex = lstTOMatrl.ListIndex + 1 + Else + Call ListFindItem2(lstTOMatrl, lngFind) + End If + lstTOMatrl.SetFocus +' Call MatClear + mboolENTER = True + End If +End Sub + +Private Sub txtMeDesc_GotFocus() + Call FieldSelect(txtMeDesc) +End Sub + +Private Sub txtMeDesc_LostFocus() + txtMeDesc = UCase(txtMeDesc) +End Sub + +Private Sub txtMeSqFt_GotFocus() + Call FieldSelect(txtMeSqFt) +End Sub + +Private Sub txtMetLength_GotFocus() + Call FieldSelect(txtMetLength) +End Sub + +Private Sub txtMeType_GotFocus() + Call FieldSelect(txtMeType) +End Sub + +Private Sub txtMisc_GotFocus() + Call FieldSelect(txtMisc) +End Sub + +Private Sub txtNewElv_LostFocus() + ' txtNewElv = UCase(txtNewElv) + Call cmdSave_Click + + ' cmdSave.SetFocus +End Sub + +Private Sub txtNote_LostFocus() + txtNote.Text = UCase(txtNote.Text) +End Sub + +Private Sub txtNotes_LostFocus() + txtNotes = UCase(txtNotes) + If tabTake.Tab = 3 Then +' txtSandPrice.SetFocus + End If +End Sub + +Private Sub txtO108_GotFocus() + Call FieldSelect(txtO108) +End Sub + +Private Sub txtO68_GotFocus() + Call FieldSelect(txtO68) +End Sub + +Private Sub txtOBAmt_GotFocus() + Call FieldSelect(txtOBAmt) +End Sub + +Private Sub txtODesc_GotFocus() + Call FieldSelect(txtODesc) +End Sub + +Private Sub txtODesc_LostFocus() + txtODesc = UCase(txtODesc) +End Sub + +Private Sub txtOFAdj_GotFocus() + Call FieldSelect(txtOFAdj) +End Sub + +Private Sub txtOFin2_GotFocus() + Call FieldSelect(txtOFin2) +End Sub + +Private Sub txtOMDesc_GotFocus() + Call FieldSelect(txtOMDesc) +End Sub + +Private Sub txtOMDesc_LostFocus() + txtOMDesc = UCase(txtOMDesc) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + If KeyCode = vbKeyD Then ' Display key combinations. + If CtrlDown And tabTake.Tab = 1 Then +' Call cmdDelMat_Click +' cmdDel1900.Enabled = True +' cmdAddMat.Enabled = False + End If + If CtrlDown And tabTake.Tab = 0 Then +' Call cmdDelMeas_Click +' cmdAddMeas.Enabled = False + End If + If CtrlDown And tabTake.Tab = 2 Then +' cmdDelOptMat.Enabled = True +' cmdDelOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdAddOptMat.Enabled = False + End If + Exit Sub + ElseIf KeyCode = vbKeyT Then + If CtrlDown Then + txtNotes.SetFocus + End If + ElseIf KeyCode = vbKeyF12 Then + If tabTake.Tab = 0 Then +' Call cmdDelMeas_Click + End If + If tabTake.Tab = 1 And Not mboolSETUP Then +' Call cmdDelMat_Click +' KeyCode = 0 + End If + If tabTake.Tab = 2 Then +' Call cmdDelOpt_Click + End If + ElseIf KeyCode = vbKeyF11 Then + If tabTake.Tab = 1 And Not (mboolSETUP Or mboolUPDATE) Then +' Call cmdAddMat_Click +' KeyCode = 0 + End If + If tabTake.Tab = 2 And cmdAddOpt.Enabled Then +' Call cmdAddOpt_Click + End If + ElseIf KeyCode = vbKeyF10 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then +' Call cmdDelOptMat_Click + End If + ElseIf KeyCode = vbKeyF9 Then + If tabTake.Tab = 2 And cmdAddOptMat.Enabled Then +' Call cmdAddOptMat_Click + End If + ElseIf KeyCode = vbKeyO Then + If CtrlDown And tabTake.Tab = 0 Then +' txtOpenings.SetFocus + End If + Else + If Shift = 2 Then + Exit Sub + End If + If mboolSETUP Or mboolUPDATE Then + Exit Sub + ElseIf KeyCode < 48 Then + Exit Sub +' ElseIf KeyCode > 13 And KeyCode < 48 Then +' Exit Sub + Else +' If Not cmdSave.Enabled Then +' cmdSave.Enabled = True +' cmdNew.Enabled = False +' cmdCopy.Enabled = False +' cmdPrintTake.Enabled = False +' cmdPrintAllTake.Enabled = False +' End If + If tabTake.Tab = 0 And Not cmdSaveMeas.Enabled Then +' cmdSaveMeas.Enabled = True +' cmdAddMeas.Enabled = False +' cmdUpMeasCalc.Enabled = False +' cmdDelMeas.Enabled = False + End If + If tabTake.Tab = 1 And Not cmdSaveMat.Enabled Then +' cmdSaveMat.Enabled = True +' cmdAddMat.Enabled = False +' cmdDelMat.Enabled = False +' cmdDel1900.Enabled = False + End If + If tabTake.Tab = 2 And Not cmdSaveOpt.Enabled Then +' cmdSaveOpt.Enabled = True +' cmdAddOpt.Enabled = False +' cmdDelOpt.Enabled = False +' cmdCopyOpt.Enabled = False +' cmdSaveOptMat.Enabled = True +' cmdAddOptMat.Enabled = False +' cmdDelOptMat.Enabled = False + End If + End If + End If + +End Sub + +Private Sub txtOMInvNo_GotFocus() + Call FieldSelect(txtOMInvNo) +End Sub + +Private Sub txtOMMetL_GotFocus() + Call FieldSelect(txtOMMetL) +End Sub + +Private Sub txtOMPrice_GotFocus() + Call FieldSelect(txtOMPrice) +End Sub + +Private Sub txtOMQty_GotFocus() + Call FieldSelect(txtOMQty) +End Sub + +Private Sub txtOpenings_GotFocus() + Call FieldSelect(txtOpenings) +End Sub + +Private Sub txtOpenings_LostFocus() + txtOpenings = Format(txtOpenings, "#,#") +End Sub + +Private Sub txtOYdge_GotFocus() + Call FieldSelect(txtOYdge) +End Sub + +Private Sub txtPrcntge_GotFocus() + Call FieldSelect(txtPrcntge) +End Sub + +Private Sub txtSandPrice_GotFocus() + Call FieldSelect(txtSandPrice) +End Sub +Private Sub UpTexture() + If optPTex(3) Then + mstrFINISH = "SK" + ElseIf optPTex(4) Then + mstrFINISH = "DA" + ElseIf optPTex(0) Then + mstrFINISH = "SA" + ElseIf optPTex(9) Then + mstrFINISH = "SB" + ElseIf optPTex(1) Then + mstrFINISH = "S2" + ElseIf optPTex(2) Then + mstrFINISH = "S3" + ElseIf optPTex(8) Then + mstrFINISH = "DF" + ElseIf optPTex(5) Then + mstrFINISH = "SM" + ElseIf optPTex(7) Then + mstrFINISH = "QU" + ElseIf optPTex(6) Then + mstrFINISH = "MN" + ElseIf optPTex(10) Then + mstrFINISH = "MF" + ElseIf optPTex(11) Then + mstrFINISH = "SS" + End If + +End Sub + +Private Sub txtWireAdj_GotFocus() + Call FieldSelect(txtWireAdj) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frx new file mode 100644 index 0000000..0de65a8 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmViewTake.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frm new file mode 100644 index 0000000..beed839 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frm @@ -0,0 +1,676 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmWOList + Caption = "PO/WO List" + ClientHeight = 4350 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 7230 + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 4350 + ScaleWidth = 7230 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstRepairs + Height = 1320 + Left = 30 + TabIndex = 5 + Top = 1875 + Width = 7140 + _Version = 196608 + _ExtentX = 12594 + _ExtentY = 2328 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 5 + Sorted = 0 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 285 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmWOList.frx":0000 + End + Begin VB.CheckBox chkQUIT + Caption = "QUIT" + Height = 240 + Left = 4770 + TabIndex = 4 + Top = 4065 + Visible = 0 'False + Width = 945 + End + Begin VB.CommandButton cmdADD + Caption = "ADD" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 2085 + TabIndex = 3 + Top = 3915 + Width = 900 + End + Begin LpLib.fpList lstProj + Height = 1320 + Left = 30 + TabIndex = 1 + Top = 300 + Width = 7125 + _Version = 196608 + _ExtentX = 12568 + _ExtentY = 2328 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 4 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= 285 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmWOList.frx":03FD + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 405 + Left = 1050 + TabIndex = 0 + TabStop = 0 'False + Top = 3915 + Width = 900 + End + Begin VB.Label lblRepairs + AutoSize = -1 'True + Caption = "Repair List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 30 + TabIndex = 7 + Top = 1665 + Width = 930 + End + Begin VB.Label lblPOWO + AutoSize = -1 'True + Caption = "PO/WO Invoice List" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 75 + TabIndex = 6 + Top = 30 + Width = 1725 + End + Begin VB.Label lblInst + Caption = "High Light The PO/WO You Want And Then Double Click To Select It. Click the ADD button to Add a new PO/WO." + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + ForeColor = &H00FF0000& + Height = 555 + Left = 15 + TabIndex = 2 + Top = 3315 + Width = 6225 + End +End +Attribute VB_Name = "frmWOList" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSREP As Recordset + +Dim mboolAdding As Boolean, mboolPROJ As Boolean + +Private Sub cmdAdd_Click() + Load frmPOWOLot + frmPOWOLot.chkADD = vbChecked + frmPOWOLot.Show 1 + Call ProjLoad + +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdSearch_Click() + Call ContainLoad + mboolPROJ = True +End Sub + +Private Sub Form_Activate() +Dim intResponse As Integer, intYN As Integer, intYYN As Integer +Dim strSQL As String + + On Error GoTo Error_EH + If chkQUIT = vbChecked Then + Unload Me + End If + + If lstProj.ListCount = 0 Then + If lstRepairs.ListCount > 0 Then + intYYN = MsgBox("No PO/WO For This Lot But There Are Repairs. Do You Want Use A Repair?", vbYesNo, "Use Repair?") + If intYYN Then + Exit Sub + Else + intYN = MsgBox("No PO/WO For This Lot. Do You Want To Add One?", vbYesNo, "Add A PO/WO?") + If intYN = vbYes Then + Call cmdAdd_Click + Else + Unload Me + End If + End If +' intYN = MsgBox("No PO/WO For This Lot. Do You Want To Add One?", vbYesNo, "Add A PO/WO?") +' If intYN = vbYes Then +' Call cmdAdd_Click +' Else +' Unload Me +' End If + End If + End If + + Exit Sub + +Error_EH: + gstrMODULE = "formProjList - Module Form_Activate" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub + +Private Sub Form_Load() + + On Error GoTo Error_EH + + Call RepairLoad + Call ProjLoad + If lstProj.ListIndex <> -1 Then + + mboolPROJ = False + End If + Exit Sub + + +Error_EH: + gstrMODULE = "formProjList - Module Form_Load" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub ProjLoad() +Dim oRS As Recordset, intYN As Integer +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblPOWO WHERE LOT_ID = " & gintLOTID ' & "'" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstProj.Clear + + Do Until oRS.EOF + With lstProj + strLine = Field2Str(oRS!repair_id) & vbTab & Field2Str(oRS!builder_PO) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!Desc) + .AddItem strLine + End With + + oRS.MoveNext + Loop + + If lstProj.ListCount Then + lstProj.ListIndex = 0 + mboolPROJ = False + Else + lstProj.ListIndex = -1 +' Call FormClear + End If + Exit Sub + +Error_EH: + gstrMODULE = "FormProjList - Module ProjLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Function FormFindCrew() As Boolean +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT * FROM tblorders WHERE order_Id = " & lstProj.ItemData(lstProj.ListIndex) + Set moRSREP = New Recordset + moRSREP.Open strSQL, goConn, adOpenKeyset, adLockPessimistic + + If moRSREP.EOF Then + FormFindCrew = False + Else + FormFindCrew = True + End If + Exit Function + +Error_EH: + gstrMODULE = "formProjList - Module FormFindCrew" + Call ErrorHandler2 + gstrMODULE = "" + Exit Function +End Function + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If moRSREP.State = adStateOpen Then + moRSREP.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + End If +End Sub + +Private Sub lstProj_DblClick() + + lstProj.col = 0 + gintREPAIRID = Field2Str2(lstProj.ColText) + frmPOWOLot.Show 1 + Unload Me +End Sub + +Private Sub ContainLoad() +' Dim oRS As Recordset, oRSP As Recordset +' Dim strSQL As String, strSELECT As String, strContain As String +' Dim strSQLP As String, intYN As Integer, strADDRESS As String, strLine As String +' Dim strProj_Desc As String, strProj_Cont As String, strProj_Code As String + + +' lstProj.Clear +' strContain = Trim$(txtContains.Text) + +' strSQL = "SELECT Proj_ID, Proj_Code, Proj_Desc, Proj_Cont FROM tblPROJECT WHERE Create > #01/01/2014#" + +' Set oRS = New Recordset +' oRS.Open strSQL, goConn, _ +' adOpenForwardOnly, adLockReadOnly + +' Do Until oRS.EOF + +' If Len(oRS!Proj_Desc) = 0 Then '1 +' intYN = 0 +' Else +' strADDRESS = Field2Str(oRS!Proj_Desc) +' intYN = InStr(1, UCase(Trim(strADDRESS)), UCase(Trim(txtContains))) ', vbTextCompare) +' End If + +' If intYN > 0 Then + +' strLine = Field2Str2(oRS!Proj_ID) & vbTab & RTrim(Field2Str(oRS!Proj_Code)) & vbTab & RTrim(Field2Str(oRS!Proj_Desc)) & vbTab & RTrim(Field2Str(oRS!Proj_Cont)) ' & " -- " & oRS!Desc +' lstProj.AddItem strLine +' End If + +' oRS.MoveNext +'' mboolSHOW = True +' Loop +' oRS.Close +' If lstProj.ListCount = 0 Then +' MsgBox "No Project Information Found" +'' Call cmdNewSearch_Click +' Else +' lstProj.ListIndex = 0 +' End If +'' End If '1 + +End Sub + +Private Sub RepairLoad() +Dim oRS As Recordset +Dim strSQL As String, strLine As String, strTYPE As String +'Dim lngRET As Long, aTabs(2) As Long + + On Error GoTo Error_EH + + + strSQL = "SELECT Repair_id, Proj_lot, Scheduled, Builder_PO, punch, yrend1, yrend2, wo, repair, backcharge from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstRepairs.Clear + + Do Until oRS.EOF + With lstRepairs + If oRS!punch Then + strTYPE = "PUNCH " + ElseIf oRS!yrend1 Then + strTYPE = "1 YEAR END" + ElseIf oRS!yrend2 Then + strTYPE = "2 YEAR END" + ElseIf oRS!wo Then + strTYPE = "PO WORK " + ElseIf oRS!repair Then + strTYPE = "WARRANTY" + ElseIf oRS!backcharge Then + strTYPE = "BACKCHARGE" + Else + strTYPE = "UNKNOWN" + End If +' strLine = "" + strLine = Field2Str2(oRS!repair_id) & vbTab & Field2Str(oRS!scheduled) & vbTab ' & Field2Str(oRS!completed) & vbTab +' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " + strLine = strLine & strTYPE & vbTab & Field2Str(oRS!builder_PO) & vbTab & Field2Str(oRS!proj_lot) +' strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot) + .AddItem strLine +' .ItemData(.NewIndex) = oRS!repair_ID + End With + oRS.MoveNext + Loop + oRS.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form WOList - Module RepairLoad" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub CopyRepair() +Dim oRSR As Recordset, oRSPO As Recordset +Dim strSQL As String, strSQLL As String +Dim lngREP_ID As Long + +' On Error GoTo Error_EH: + + lstRepairs.col = 0 + lngREP_ID = Field2Str2(lstRepairs.ColText) + strSQL = "SELECT * FROM tblREPAIR WHERE Repair_ID = " & lngREP_ID +' strSQL = "SELECT Repair_ID, SCHEDULED, Builder_Contact, Builder_Phone, Builder_PO, PO_Amt, Owner_Address, " +' strSQL = strSQL & "Owner_Name, VWP_Super, BC_WHO, Desc, Notes, Backcharge, WO, Repair FROM tblREPAIR WHERE Repair_ID = " & lngREP_ID + + Set oRSR = New Recordset + oRSR.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSR.EOF Then + strSQLL = "SELECT * FROM tblPOWO" + Set oRSPO = New Recordset + oRSPO.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSPO.EOF Then + oRSPO.AddNew + oRSPO!scheduled = oRSR!scheduled + oRSPO!builder_contact = Field2Str(oRSR!builder_contact) + oRSPO!builder_phone = Field2Str(oRSR!builder_phone) + oRSPO!builder_PO = Field2Str(oRSR!builder_PO) + oRSPO!PO_Amt = Field2Str2(oRSR!PO_Amt) + oRSPO!Owner_address = Field2Str(oRSR!Owner_address) + oRSPO!Owner_Name = Field2Str(oRSR!Owner_Name) + oRSPO!VWP_Super = Field2Str(oRSR!VWP_Super) + oRSPO!bc_who = Field2Str(oRSR!bc_who) + oRSPO!Desc = "REPAIR - " & Left(Field2Str(oRSR!Desc), 108) + oRSPO!notes = Field2Str(oRSR!notes) + oRSPO!backcharge = oRSR!backcharge + oRSPO!repair = oRSR!repair + oRSPO!wo = oRSR!wo + oRSPO!Orig_ID = oRSR!repair_id + oRSPO!Lot_ID = oRSR!Lot_ID + oRSPO!PROJ_ID = oRSR!PROJ_ID + oRSPO!proj_lot = oRSR!proj_lot + oRSPO.Update + End If + + End If + + Call GetPOID +' lstProj.col = 0 +' gintREPAIRID = Field2Str2(lstProj.ColText) + frmPOWOLot.Show 1 + Unload Me + + +End Sub + +Private Sub GetPOID() +Dim oRSMAX As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Max(REPAIR_ID) as MAXLotid from tblPOWO" + Set oRSMAX = New Recordset + oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + gintREPAIRID = oRSMAX!maxLotid + oRSMAX.Close + + Exit Sub + +Error_EH: + gstrMODULE = "Form LotInfo - Module GetLotID" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub lstRepairs_DblClick() + Call CopyRepair +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frx new file mode 100644 index 0000000..6867949 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmWOList.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frm new file mode 100644 index 0000000..39f0029 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frm @@ -0,0 +1,358 @@ +VERSION 5.00 +Object = "{DEF7CADD-83C0-11D0-A0F1-00A024703500}#7.0#0"; "todg7.ocx" +Begin VB.Form frmYInventory + Caption = "Inventory Information" + ClientHeight = 6720 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10155 + LinkTopic = "Form1" + ScaleHeight = 6720 + ScaleWidth = 10155 + StartUpPosition = 3 'Windows Default + Begin TrueOleDBGrid70.TDBGrid TDBGLabor + Height = 5895 + Left = 60 + TabIndex = 0 + Top = 45 + Width = 10035 + _ExtentX = 17701 + _ExtentY = 10398 + _LayoutType = 4 + _RowHeight = 14 + _WasPersistedAsPixels= 0 + Columns(0)._VlistStyle= 0 + Columns(0)._MaxComboItems= 18 + Columns(0).Caption= "Inv #" + Columns(0).DataField= "inv_no" + Columns(0).DataWidth= 18 + Columns(0).NumberFormat= "General Number" + Columns(0)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(1)._VlistStyle= 0 + Columns(1)._MaxComboItems= 5 + Columns(1).Caption= "Description" + Columns(1).DataField= "desc" + Columns(1).DataWidth= 30 + Columns(1)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(2)._VlistStyle= 0 + Columns(2)._MaxComboItems= 5 + Columns(2).Caption= "Qty" + Columns(2).DataField= "qty" + Columns(2).DataWidth= 4 + Columns(2).NumberFormat= "General Number" + Columns(2)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(3)._VlistStyle= 16 + Columns(3)._MaxComboItems= 5 + Columns(3).ValueItems(0)._DefaultItem= 0 + Columns(3).ValueItems(0).Value= "S" + Columns(3).ValueItems(0).Value.vt= 8 + Columns(3).ValueItems(0).DisplayValue= "Supplier" + Columns(3).ValueItems(0).DisplayValue.vt= 8 + Columns(3).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems(1)._DefaultItem= 0 + Columns(3).ValueItems(1).Value= "Y" + Columns(3).ValueItems(1).Value.vt= 8 + Columns(3).ValueItems(1).DisplayValue= "Yard" + Columns(3).ValueItems(1).DisplayValue.vt= 8 + Columns(3).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(3).ValueItems.Count= 2 + Columns(3).Caption= "Delivery" + Columns(3).DataField= "d_flag" + Columns(3)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns(4)._VlistStyle= 16 + Columns(4)._MaxComboItems= 5 + Columns(4).ValueItems(0)._DefaultItem= 0 + Columns(4).ValueItems(0).Value= "L" + Columns(4).ValueItems(0).Value.vt= 8 + Columns(4).ValueItems(0).DisplayValue= "Lath" + Columns(4).ValueItems(0).DisplayValue.vt= 8 + Columns(4).ValueItems(0)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(1)._DefaultItem= 0 + Columns(4).ValueItems(1).Value= "B" + Columns(4).ValueItems(1).Value.vt= 8 + Columns(4).ValueItems(1).DisplayValue= "Brown" + Columns(4).ValueItems(1).DisplayValue.vt= 8 + Columns(4).ValueItems(1)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(2)._DefaultItem= 0 + Columns(4).ValueItems(2).Value= "S" + Columns(4).ValueItems(2).Value.vt= 8 + Columns(4).ValueItems(2).DisplayValue= "Scratch" + Columns(4).ValueItems(2).DisplayValue.vt= 8 + Columns(4).ValueItems(2)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(3)._DefaultItem= 0 + Columns(4).ValueItems(3).Value= "T" + Columns(4).ValueItems(3).Value.vt= 8 + Columns(4).ValueItems(3).DisplayValue= "Texture" + Columns(4).ValueItems(3).DisplayValue.vt= 8 + Columns(4).ValueItems(3)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems(4)._DefaultItem= 0 + Columns(4).ValueItems(4).Value= "P" + Columns(4).ValueItems(4).Value.vt= 8 + Columns(4).ValueItems(4).DisplayValue= "PreOrder" + Columns(4).ValueItems(4).DisplayValue.vt= 8 + Columns(4).ValueItems(4)._PropDict= "_DefaultItem,517,2" + Columns(4).ValueItems.Count= 5 + Columns(4).Caption= "Type" + Columns(4).DataField= "m_type" + Columns(4)._PropDict= "_MaxComboItems,516,2;_VlistStyle,514,3" + Columns.Count = 5 + Splits(0)._UserFlags= 0 + Splits(0).RecordSelectorWidth= 503 + Splits(0)._SavedRecordSelectors= 0 'False + Splits(0).DividerColor= 12632256 + Splits(0).SpringMode= 0 'False + Splits(0)._PropDict= "_ColumnProps,515,0;_UserFlags,518,3" + Splits(0)._ColumnProps(0)= "Columns.Count=5" + Splits(0)._ColumnProps(1)= "Column(0).Width=2117" + Splits(0)._ColumnProps(2)= "Column(0).DividerColor=0" + Splits(0)._ColumnProps(3)= "Column(0)._WidthInPix=2037" + Splits(0)._ColumnProps(4)= "Column(0)._ColStyle=8196" + Splits(0)._ColumnProps(5)= "Column(0).Order=1" + Splits(0)._ColumnProps(6)= "Column(1).Width=7329" + Splits(0)._ColumnProps(7)= "Column(1).DividerColor=0" + Splits(0)._ColumnProps(8)= "Column(1)._WidthInPix=7250" + Splits(0)._ColumnProps(9)= "Column(1)._ColStyle=8196" + Splits(0)._ColumnProps(10)= "Column(1).Order=2" + Splits(0)._ColumnProps(11)= "Column(2).Width=979" + Splits(0)._ColumnProps(12)= "Column(2).DividerColor=0" + Splits(0)._ColumnProps(13)= "Column(2)._WidthInPix=900" + Splits(0)._ColumnProps(14)= "Column(2).Order=3" + Splits(0)._ColumnProps(15)= "Column(3).Width=1746" + Splits(0)._ColumnProps(16)= "Column(3).DividerColor=0" + Splits(0)._ColumnProps(17)= "Column(3)._WidthInPix=1667" + Splits(0)._ColumnProps(18)= "Column(3)._ColStyle=8196" + Splits(0)._ColumnProps(19)= "Column(3).Order=4" + Splits(0)._ColumnProps(20)= "Column(4).Width=1667" + Splits(0)._ColumnProps(21)= "Column(4).DividerColor=0" + Splits(0)._ColumnProps(22)= "Column(4)._WidthInPix=1588" + Splits(0)._ColumnProps(23)= "Column(4)._ColStyle=8196" + Splits(0)._ColumnProps(24)= "Column(4).WrapText=1" + Splits(0)._ColumnProps(25)= "Column(4).Order=5" + Splits.Count = 1 + PrintInfos(0)._StateFlags= 0 + PrintInfos(0).Name= "piInternal 0" + PrintInfos(0).PageHeaderFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageFooterFont= "Size=8.25,Charset=0,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=MS Sans Serif" + PrintInfos(0).PageHeaderHeight= 0 + PrintInfos(0).PageFooterHeight= 0 + PrintInfos.Count= 1 + AllowDelete = -1 'True + AllowAddNew = -1 'True + DefColWidth = 0 + HeadLines = 1 + FootLines = 1 + MultipleLines = 0 + CellTipsWidth = 0 + DeadAreaBackColor= 12632256 + RowDividerColor = 12632256 + RowSubDividerColor= 12632256 + DirectionAfterEnter= 1 + MaxRows = 250000 + ViewColumnCaptionWidth= 0 + ViewColumnWidth = 0 + _PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2" + _StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&" + _StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0" + _StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0" + _StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=825,.italic=0" + _StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=0" + _StyleDefs(5) = ":id=0,.fontname=MS Sans Serif" + _StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33" + _StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37" + _StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34" + _StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35" + _StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36" + _StyleDefs(12) = "EditorStyle:id=7,.parent=1" + _StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38" + _StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39" + _StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40" + _StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41" + _StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42" + _StyleDefs(18) = "Splits(0).Style:id=13,.parent=1" + _StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4" + _StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2" + _StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3" + _StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5" + _StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6" + _StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7" + _StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8" + _StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9" + _StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10" + _StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11" + _StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12" + _StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13,.locked=-1" + _StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14" + _StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15" + _StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17" + _StyleDefs(34) = "Splits(0).Columns(1).Style:id=32,.parent=13,.locked=-1" + _StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=29,.parent=14" + _StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=30,.parent=15" + _StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=31,.parent=17" + _StyleDefs(38) = "Splits(0).Columns(2).Style:id=46,.parent=13" + _StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=43,.parent=14" + _StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=44,.parent=15" + _StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=45,.parent=17" + _StyleDefs(42) = "Splits(0).Columns(3).Style:id=54,.parent=13,.locked=-1" + _StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=51,.parent=14" + _StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=52,.parent=15" + _StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=53,.parent=17" + _StyleDefs(46) = "Splits(0).Columns(4).Style:id=58,.parent=13,.wraptext=-1,.locked=-1" + _StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=55,.parent=14" + _StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=56,.parent=15" + _StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=57,.parent=17" + _StyleDefs(50) = "Named:id=33:Normal" + _StyleDefs(51) = ":id=33,.parent=0,.locked=0" + _StyleDefs(52) = "Named:id=34:Heading" + _StyleDefs(53) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(54) = ":id=34,.wraptext=-1,.bold=-1,.fontsize=975,.italic=0,.underline=0" + _StyleDefs(55) = ":id=34,.strikethrough=0,.charset=0" + _StyleDefs(56) = ":id=34,.fontname=MS Sans Serif" + _StyleDefs(57) = "Named:id=35:Footing" + _StyleDefs(58) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&" + _StyleDefs(59) = "Named:id=36:Selected" + _StyleDefs(60) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(61) = "Named:id=37:Caption" + _StyleDefs(62) = ":id=37,.parent=34,.alignment=2" + _StyleDefs(63) = "Named:id=38:HighlightRow" + _StyleDefs(64) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&" + _StyleDefs(65) = "Named:id=39:EvenRow" + _StyleDefs(66) = ":id=39,.parent=33,.bgcolor=&HFFFF00&" + _StyleDefs(67) = "Named:id=40:OddRow" + _StyleDefs(68) = ":id=40,.parent=33" + _StyleDefs(69) = "Named:id=41:RecordSelector" + _StyleDefs(70) = ":id=41,.parent=34,.bold=-1,.fontsize=1200,.italic=0,.underline=0" + _StyleDefs(71) = ":id=41,.strikethrough=0,.charset=0" + _StyleDefs(72) = ":id=41,.fontname=MS Sans Serif" + _StyleDefs(73) = "Named:id=42:FilterBar" + _StyleDefs(74) = ":id=42,.parent=33" + End + Begin VB.CommandButton cmdExit + Caption = "Exit" + Height = 555 + Left = 8730 + TabIndex = 8 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdAdd + Caption = "Add" + Height = 555 + Left = 5980 + TabIndex = 7 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdDelete + Caption = "Delete" + Height = 555 + Left = 3020 + TabIndex = 6 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdSave + Caption = "Save" + Height = 555 + Left = 60 + TabIndex = 5 + Top = 6060 + Width = 1395 + End + Begin VB.CommandButton cmdFirst + Height = 300 + Left = 4500 + Picture = "frmYInventory.frx":0000 + Style = 1 'Graphical + TabIndex = 4 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdPrevious + Height = 300 + Left = 4860 + Picture = "frmYInventory.frx":0342 + Style = 1 'Graphical + TabIndex = 3 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdNext + Height = 300 + Left = 5205 + Picture = "frmYInventory.frx":0684 + Style = 1 'Graphical + TabIndex = 2 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End + Begin VB.CommandButton cmdLast + Height = 300 + Left = 5565 + Picture = "frmYInventory.frx":09C6 + Style = 1 'Graphical + TabIndex = 1 + Top = 6180 + UseMaskColor = -1 'True + Width = 345 + End +End +Attribute VB_Name = "frmYInventory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRS As Recordset + +Private Sub cmdAdd_Click() + moRS.AddNew + TDBGLabor.SetFocus +End Sub + +Private Sub cmdDelete_Click() + moRS.Delete +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub cmdFirst_Click() + moRS.MoveFirst +End Sub + +Private Sub cmdLast_Click() + moRS.MoveLast +End Sub + +Private Sub cmdNext_Click() + moRS.MoveNext +End Sub + +Private Sub cmdPrevious_Click() + moRS.MovePrevious +End Sub + +Private Sub cmdSave_Click() + moRS.Update +End Sub + +Private Sub Form_Load() + Call LoadLabor + TDBGLabor.DataSource = moRS + TDBGLabor.ReBind + +End Sub + +Private Sub LoadLabor() +Dim strSQL As String + + strSQL = "SELECT * FROM tblInvtry WHERE d_flag = 'Y' ORDER BY inv_no" + Set moRS = New Recordset + moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYInventory.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frm b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frm new file mode 100644 index 0000000..490df56 --- /dev/null +++ b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frm @@ -0,0 +1,1411 @@ +VERSION 5.00 +Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" +Begin VB.Form frmYardOrder + Caption = "Yard Order Information" + ClientHeight = 6225 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 10470 + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + KeyPreview = -1 'True + LinkTopic = "Form1" + ScaleHeight = 6225 + ScaleWidth = 10470 + StartUpPosition = 3 'Windows Default + Begin LpLib.fpList lstInventory + Height = 2805 + Left = 60 + TabIndex = 29 + Top = 660 + Width = 5310 + _Version = 196608 + _ExtentX = 9366 + _ExtentY = 4948 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = 0 'False + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 13 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmYardOrder.frx":0000 + End + Begin LpLib.fpList lstInv + Height = 2025 + Left = 5400 + TabIndex = 28 + Top = 4140 + Width = 3915 + _Version = 196608 + _ExtentX = 6906 + _ExtentY = 3572 + BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Enabled = -1 'True + MousePointer = 0 + Object.TabStop = -1 'True + BackColor = -2147483643 + ForeColor = -2147483640 + Columns = 2 + Sorted = 1 + LineWidth = 1 + SelDrawFocusRect= -1 'True + ColumnSeparatorChar= 9 + ColumnSearch = -1 + ColumnWidthScale= 2 + RowHeight = -1 + MultiSelect = 0 + WrapList = 0 'False + WrapWidth = 0 + SelMax = -1 + AutoSearch = 1 + SearchMethod = 0 + VirtualMode = 0 'False + VRowCount = 0 + DataSync = 3 + ThreeDInsideStyle= 1 + ThreeDInsideHighlightColor= -2147483633 + ThreeDInsideShadowColor= -2147483627 + ThreeDInsideWidth= 1 + ThreeDOutsideStyle= 1 + ThreeDOutsideHighlightColor= -2147483628 + ThreeDOutsideShadowColor= -2147483632 + ThreeDOutsideWidth= 1 + ThreeDFrameWidth= 0 + BorderStyle = 0 + BorderColor = -2147483642 + BorderWidth = 1 + ThreeDOnFocusInvert= 0 'False + ThreeDFrameColor= -2147483633 + Appearance = 2 + BorderDropShadow= 0 + BorderDropShadowColor= -2147483632 + BorderDropShadowWidth= 3 + ScrollHScale = 2 + ScrollHInc = 0 + ColsFrozen = 0 + ScrollBarV = 1 + NoIntegralHeight= 0 'False + HighestPrecedence= 0 + AllowColResize = 0 + AllowColDragDrop= 0 + ReadOnly = 0 'False + VScrollSpecial = 0 'False + VScrollSpecialType= 0 + EnableKeyEvents = -1 'True + EnableTopChangeEvent= -1 'True + DataAutoHeadings= -1 'True + DataAutoSizeCols= 2 + SearchIgnoreCase= -1 'True + ScrollBarH = 1 + VirtualPageSize = 0 + VirtualPagesAhead= 0 + ExtendCol = 0 + ColumnLevels = 1 + ListGrayAreaColor= -2147483637 + GroupHeaderHeight= -1 + GroupHeaderShow = 0 'False + AllowGrpResize = 0 + AllowGrpDragDrop= 0 + MergeAdjustView = 0 'False + ColumnHeaderShow= -1 'True + ColumnHeaderHeight= -1 + GrpsFrozen = 0 + BorderGrayAreaColor= -2147483637 + ExtendRow = 0 + DataField = "" + OLEDragMode = 0 + OLEDropMode = 0 + EnableClickEvent= -1 'True + Redraw = -1 'True + ResizeRowToFont = 0 'False + TextTipMultiLine= 0 + ColDesigner = "frmYardOrder.frx":0613 + End + Begin VB.CommandButton cmdPopulate + Caption = "Retrieve Yard Order" + Height = 555 + Left = 8040 + TabIndex = 25 + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdUpdateIssue + Caption = "Update Issue Date" + Height = 555 + Left = 9240 + TabIndex = 24 + Top = 900 + Visible = 0 'False + Width = 1155 + End + Begin VB.TextBox txtMemo + Height = 1995 + Left = 60 + MultiLine = -1 'True + TabIndex = 9 + Top = 4140 + Width = 5235 + End + Begin VB.TextBox txtQIssue + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + MaxLength = 6 + TabIndex = 7 + Top = 1380 + Width = 855 + End + Begin VB.CommandButton cmdExit + Caption = "&Exit" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9240 + TabIndex = 13 + Top = 1500 + Width = 1155 + End + Begin VB.CommandButton cmdDeleteInv + Caption = "&Delete Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9240 + TabIndex = 12 + Top = 3300 + Visible = 0 'False + Width = 1155 + End + Begin VB.CommandButton cmdSaveInv + Caption = "&Save Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9240 + TabIndex = 10 + Top = 2100 + Width = 1155 + End + Begin VB.CommandButton cmdAddInv + Caption = "&Add Inventory" + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 555 + Left = 9240 + TabIndex = 11 + Top = 2700 + Width = 1155 + End + Begin VB.CommandButton cmdFindInv + Enabled = 0 'False + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 9525 + Picture = "frmYardOrder.frx":09AC + Style = 1 'Graphical + TabIndex = 5 + Top = 60 + Visible = 0 'False + Width = 435 + End + Begin VB.TextBox txtPrice + Alignment = 1 'Right Justify + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + MaxLength = 8 + TabIndex = 8 + Top = 1800 + Width = 855 + End + Begin VB.TextBox txtDesc + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + MaxLength = 30 + TabIndex = 6 + Top = 540 + Width = 3555 + End + Begin VB.TextBox txtInvNo + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 315 + Left = 6840 + MaxLength = 18 + TabIndex = 4 + Top = 135 + Width = 2625 + End + Begin VB.Label lblPO_NUM + BorderStyle = 1 'Fixed Single + BeginProperty Font + Name = "MS Sans Serif" + Size = 12 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 435 + Left = 5820 + TabIndex = 27 + Top = 3480 + Width = 3255 + End + Begin VB.Label lblPO + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "PO:" + Height = 195 + Left = 5400 + TabIndex = 26 + Top = 3600 + Width = 330 + End + Begin VB.Label Label1 + Caption = "Yard Order Notes:" + Height = 255 + Left = 120 + TabIndex = 23 + Top = 3900 + Width = 1575 + End + Begin VB.Label txtQty + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6840 + TabIndex = 22 + Top = 960 + Width = 855 + End + Begin VB.Label lblQIssue + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Qty Issued:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6000 + TabIndex = 21 + Top = 1440 + Width = 795 + End + Begin VB.Label txtIssue + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6840 + TabIndex = 20 + Top = 3060 + Width = 1275 + End + Begin VB.Label txtChange + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 6840 + TabIndex = 19 + Top = 2640 + Width = 1275 + End + Begin VB.Label txtCreate + Alignment = 1 'Right Justify + BorderStyle = 1 'Fixed Single + BeginProperty DataFormat + Type = 1 + Format = "MM/dd/yyyy" + HaveTrueFalseNull= 0 + FirstDayOfWeek = 0 + FirstWeekOfYear = 0 + LCID = 1033 + SubFormatType = 3 + EndProperty + Height = 315 + Left = 6840 + TabIndex = 18 + Top = 2220 + Width = 1275 + End + Begin VB.Label lblIssued + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Issued:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5895 + TabIndex = 17 + Top = 3060 + Width = 900 + End + Begin VB.Label lblChange + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Qty Change:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5520 + TabIndex = 16 + Top = 2640 + Width = 1275 + End + Begin VB.Label lblCreate + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Date Order Printed:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5430 + TabIndex = 15 + Top = 2220 + Width = 1365 + End + Begin VB.Label lblQty + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Original Qty:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5940 + TabIndex = 14 + Top = 1020 + Width = 855 + End + Begin VB.Label lblPrice + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Cost:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 6435 + TabIndex = 3 + Top = 1860 + Width = 360 + End + Begin VB.Label lblDesc + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Description:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5895 + TabIndex = 2 + Top = 600 + Width = 840 + End + Begin VB.Label lblInvNo + Alignment = 1 'Right Justify + AutoSize = -1 'True + Caption = "Inventory #:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 195 + Left = 5880 + TabIndex = 1 + Top = 180 + Width = 855 + End + Begin VB.Label lblInventory + AutoSize = -1 'True + Caption = "Yard Order Inventory Items:" + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 0 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 240 + Left = 120 + TabIndex = 0 + Top = 180 + Width = 2835 + End +End +Attribute VB_Name = "frmYardOrder" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit +Dim moRSMat As Recordset +Dim moRSMemo As Recordset +Dim moRS As Recordset + +Dim mboolSHOW As Boolean +Dim mboolAdding As Boolean + +Private Sub LoadInventory() +Dim oRS As Recordset, oRSS As Recordset +Dim strSQL As String, strSQLL As String, lngORDERID As Long +Dim strLine As String, strORDERNUM As String + On Error GoTo Error_EH + strORDERNUM = "" +' strSQL = "SELECT Yard_id, Inv_no, Desc, qty, qtyissue, Price from tblYardOrder WHERE lot_id = " & gintLOTID + strSQL = "SELECT * from tblYardOrder WHERE lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + lstInventory.Clear + + Do Until oRS.EOF + With lstInventory + strORDERNUM = Field2Str(oRS!po_num) +' If strORDERNUM = "ORIGINAL ORDER" Or strORDERNUM = "HANDWRITTEN PO" Or strORDERNUM = "PARTIAL ORDER" Then + If strORDERNUM <> "ORIGINAL ORDER" And strORDERNUM <> "HANDWRITTEN PO" And strORDERNUM <> "PARTIAL ORDER" And strORDERNUM <> "" Then + strSQLL = "SELECT Order_ID, PO_NUM from tblORDERS WHERE PO_NUM = '" & strORDERNUM & "'" + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly + If Not oRSS.EOF Then + lngORDERID = oRSS!order_id + End If + End If + + If Field2Str(oRS!d_flag) = "" Then + oRS!d_flag = "Y" + oRS.Update + End If +' strLine = oRS!inv_no & " " & oRS!qty & vbTab & oRS!qtyissue & vbTab & oRS!Desc + strLine = Field2Str(oRS!Yard_id) & vbTab & Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!qty) & vbTab + strLine = strLine & Field2Str2(oRS!qtyIssue) & vbTab & Field2Str(oRS!Desc) & vbTab & Field2Str2(oRS!Lot_ID) & vbTab + strLine = strLine & Field2Str(oRS!po_num) & vbTab & Field2Str(oRS!d_flag) & vbTab & Field2Str(oRS!m_type) + strLine = strLine & vbTab & Field2Str(oRS!price) & vbTab & Field2Str(oRS!createuser) & vbTab & oRS!moved & vbTab & lngORDERID + .AddItem strLine + .ItemData(.NewIndex) = oRS!Yard_id ' & oRS!qty + + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInventory.ListCount Then + lstInventory.ListIndex = 0 + cmdPopulate.Visible = False + Else + If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then + cmdPopulate.Visible = True + End If + + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdFindInv_Click() +Dim oRS As Recordset +Dim strSQL As String, lngFind As Long + On Error GoTo Error_EH + If txtInvNo = "" Then + txtInvNo = 1 + End If + strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtInvNo.Text & "' and Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + If oRS.RecordCount > 0 Then + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Field2Str(!price) + + End With + Else + lstInv.Visible = True + Call LoadMInventory + lngFind = Field2Long(txtInvNo) + Call ListFindItem2(lstInv, lngFind) + + End If + txtQIssue.SetFocus + oRS.Close + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub LoadMInventory() +Dim oRS As Recordset +Dim strSQL As String +Dim strLine As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE Inv_Type = " & gbytINV_TYPE + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + lstInv.Clear + + Do Until oRS.EOF + With lstInv + + strLine = oRS!inv_no & vbTab & oRS!Desc + .AddItem strLine + .ItemData(.NewIndex) = oRS!inv_no + End With + + oRS.MoveNext + Loop + oRS.Close + + If lstInv.ListCount Then + lstInv.ListIndex = -1 + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub FormClear() + txtInvNo = "" + txtDesc = "" + txtPrice = 0 + txtQIssue = 0 + txtQty.Caption = 0 + txtCreate = "" + txtChange = "" + txtIssue = "" +End Sub + +Private Function FormFind() As Boolean +Dim strSQL As String, strMEMO As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblYardOrder " + strSQL = strSQL & "WHERE Yard_id = " & lstInventory.ItemData(lstInventory.ListIndex) + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + + strMEMO = "SELECT * FROM tblYardMemo where lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenForwardOnly, adLockOptimistic + If moRSMemo.RecordCount = 0 Then + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + End If + + If moRSMat.EOF Then + FormFind = False + Else + FormFind = True + End If + Exit Function + +Error_EH: + moRSMat.Update + Resume Next +End Function +Private Sub FindLot() +Dim strSQL As String, strPlan As String, strMEMO As String + On Error GoTo Error_EH + + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblLotInfo " + strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID + + If moRS.State = adStateOpen Then + moRS.Close + End If + + moRS.Open strSQL, goConn, _ + adOpenKeyset, adLockPessimistic + Exit Sub + +Error_EH: + gstrMODULE = "Form YardOrder - Module FindLot" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub +Private Sub FormSave() +Dim strName As String, strISSUE As String, strSQL As String +Dim lngPOS As Long +Dim strMEMO As String + + On Error GoTo Error_EH + + If mboolAdding Then +' strSQL = "SELECT * " +' strSQL = strSQL & "FROM tblYardOrder " +' strSQL = strSQL & "WHERE Yard_id = " & lstInventory.ItemData(lstInventory.ListIndex) + + If moRSMat.State = adStateClosed Then + strSQL = "SELECT * " + strSQL = strSQL & "FROM tblYardOrder " + strSQL = strSQL & "WHERE Yard_id = 1" + moRSMat.Open strSQL, goConn, _ + adOpenKeyset, adLockOptimistic + strMEMO = "SELECT * FROM tblYardMemo where lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenForwardOnly, adLockOptimistic + If moRSMemo.RecordCount = 0 Then + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + End If + End If + + 'if morsmat + moRSMat.AddNew + moRSMat!po_num = "HANDWRITTEN PO" + moRSMat!Lot_ID = gintLOTID + strISSUE = InputBox("Enter the Issue Date for This Item", "Issue Date") + lngPOS = InStr(1, strISSUE, "/", 1) + If lngPOS = 0 Then + If Len(strISSUE) > 0 Then + strISSUE = Format(strISSUE, "00/00/####") + If Not IsDate(strISSUE) Then + MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" + Exit Sub + End If + Else + Exit Sub + End If + Else + MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" + Exit Sub + End If + moRSMat!issued = Str2Field(strISSUE) + End If + ' Store the controls to the recordset + Call FieldsSave + + moRSMat.Update + + If mboolAdding Then + mboolAdding = False + End If + Exit Sub + +Error_EH: + Call ErrorHandler(moRSMat.ActiveConnection) + Exit Sub + +End Sub +Private Sub FormShow() + On Error GoTo Error_EH + + mboolSHOW = True + + With moRSMat + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Format$(Field2Str(!price), "##,###.00") + txtQty = Field2Str(!qty) + txtQIssue = Field2Str(!qtyIssue) + txtCreate = Format$(Field2Str(!created), "short date") + txtChange = Format$(Field2Str(!Updated), "short date") + txtIssue = Format$(Field2Str(!issued), "short date") + lblPO_NUM = Field2Str(!po_num) + End With + txtMemo = Field2Str(moRSMemo!notes) + mboolSHOW = False + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub +Private Sub FieldsSave() + On Error GoTo Error_EH + + With moRSMat + !inv_no = Str2Field(txtInvNo) + !Desc = Str2Field(txtDesc) + !qtyIssue = Str2Field(txtQIssue) + !price = Str2Field(txtPrice) + !Updated = Now() + !UpdateUser = gstrLOGIN + + End With + moRSMemo!notes = Field2Str(txtMemo) + moRSMemo.Update + Exit Sub + +Error_EH: + If Err = -2147467259 Then + Resume Next +' Exit Sub + End If + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub cmdAddInv_Click() + cmdAddInv.Enabled = False + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = False + lstInventory.Enabled = False + mboolAdding = True + Call FormClear + txtInvNo.SetFocus + cmdFindInv.Visible = True + +End Sub + +Private Sub cmdDeleteInv_Click() + cmdDeleteInv.Enabled = False + cmdSaveInv.Enabled = False + cmdAddInv.Enabled = True + moRSMat.Delete + Call LoadInventory +End Sub + +Private Sub cmdExit_Click() + Unload Me +End Sub + +Private Sub MovePZ() +Dim oRS As Recordset, strSQL As String, boolMOVE As Boolean, strMSG As String +Dim oRSS As Recordset, strSQLL As String, strPONUM As String + + strSQL = "SELECT * FROM tblORDMatrl WHERE ITEM_ID = 1" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRS.EOF Then + lstInventory.col = 6 + strPONUM = lstInventory.ColText + lstInventory.col = 11 + boolMOVE = lstInventory.ColText + If strPONUM = "ORIGINAL ORDER" Or strPONUM = "HANDWRITTEN PO" Or strPONUM = "PARTIAL ORDER" Or strPONUM = "" Or boolMOVE Then + strMSG = "The Hi-Lited Item Cannot Be Moved To tblORDMatrl " & vbCrLf & vbCrLf + strMSG = strMSG & "Or Has Already Been Moved - Exiting" + MsgBox strMSG, vbOKOnly, "Invalid Record" + Exit Sub + End If + oRS.AddNew + lstInventory.col = 1 + oRS!inv_no = lstInventory.ColText + lstInventory.col = 2 + oRS!o_qty = lstInventory.ColText + lstInventory.col = 3 + oRS!a_qty = lstInventory.ColText + lstInventory.col = 4 + oRS!Desc = lstInventory.ColText + lstInventory.col = 5 + oRS!Lot_ID = lstInventory.ColText + lstInventory.col = 6 + oRS!po_num = lstInventory.ColText + lstInventory.col = 7 + oRS!d_flag = lstInventory.ColText + lstInventory.col = 8 + oRS!m_type = lstInventory.ColText + lstInventory.col = 9 + oRS!price = lstInventory.ColText + lstInventory.col = 10 + oRS!C_USER = lstInventory.ColText + lstInventory.col = 12 + oRS!order_id = lstInventory.ColText + oRS!moved = True + oRS.Update + + lstInventory.col = 0 + strSQLL = "SELECT YARD_ID, MOVED FROM tblYardOrder WHERE Yard_ID = " & CLng(lstInventory.ColText) + Set oRSS = New Recordset + oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic + + If Not oRSS.EOF Then + oRSS!moved = True + oRSS.Update + End If + MsgBox "Hi-lited Item Has Been Moved To Order Material", vbOKOnly, "Item Moved" + End If +End Sub + +Private Sub cmdPopulate_Click() +Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String +Dim oRS As Recordset, oRSS As Recordset +Dim strMSG As String, strMEMO As String + On Error GoTo Error_EH + If Date2Field(moRS!lorder) > Now() Then + strMSG = "This Lot Has Not Been Printed Yet," & vbCrLf + strMSG = strMSG & "The Yard Order Will be Populated" & vbCrLf + strMSG = strMSG & "Automatically When Printed - Call Darv" + MsgBox strMSG, vbCritical + vbOKOnly, "Call Darv" + Exit Sub + End If + strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" + Set oRSS = New Recordset + oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic + + strSQL = "SELECT inv_no, price FROM tblInvtry" + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + If Not oRS.EOF Then + Do Until oRSS.EOF + strSELECT = "inv_no = " & Field2Integer(oRSS!inv_no) + oRS.MoveFirst + oRS.Find strSELECT + If Not oRS.EOF Then + oRSS!price = Str2Field(oRS!price) + oRSS.Update + End If + oRSS.MoveNext + Loop + End If + oRS.Close + oRSS.Close + + strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic + + strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" + Set oRSS = New Recordset + oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly + + Do Until oRSS.EOF + oRS.AddNew + oRS!Lot_ID = gintLOTID + oRS!inv_no = Field2Str(oRSS!inv_no) + oRS!Desc = Field2Str(oRSS!Desc) + oRS!qty = Field2Str2(oRSS!qty) + oRS!qtyIssue = Field2Str2(oRSS!qty) + oRS!price = Field2Str2(oRSS!price) + oRS!createuser = gstrLOGIN + oRS!UpdateUser = gstrLOGIN + oRS.Update + oRSS.MoveNext + Loop + + txtMemo = Field2Str(txtMemo) & " YARD ORDER RETRIEVED - " & Now() & " BY " & gstrLOGIN + If moRSMemo.State = adStateClosed Then + strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID + Set moRSMemo = New Recordset + moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic + If moRSMemo.RecordCount Then + moRSMemo!notes = UCase(Field2Str(txtMemo)) + moRSMemo.Update + Else + moRSMemo.AddNew + moRSMemo!Lot_ID = gintLOTID + moRSMemo!notes = UCase(Field2Str(txtMemo)) + moRSMemo.Update + End If + End If + Call LoadInventory + + Exit Sub + +Error_EH: + gstrMODULE = "Form YardORder - Module cmdPopulate_Click" + Call ErrorHandler2 + gstrMODULE = "" + Exit Sub +End Sub + +Private Sub cmdSaveInv_Click() + cmdSaveInv.Enabled = False + cmdDeleteInv.Enabled = False + cmdAddInv.Enabled = True + cmdFindInv.Visible = False + lstInventory.Enabled = True + Call FormSave + Call LoadInventory +End Sub + +Private Sub cmdUpdateIssue_Click() +Dim oRS As Recordset +Dim strSQL As String, strISSUE As String +Dim lngPOS As Long + + strISSUE = InputBox("Enter the Issue Date for this Yard Order (mmddyyyy)", "Issue Date") + + lngPOS = InStr(1, strISSUE, "/", 1) + If lngPOS = 0 Then + If Len(strISSUE) > 0 Then + strISSUE = Format(strISSUE, "00/00/####") + If Not IsDate(strISSUE) Then + MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" + Exit Sub + End If + Else + Exit Sub + End If + Else + MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" + Exit Sub + End If + + strSQL = "SELECT * FROM tblYardOrder WHERE not locked and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!issued = strISSUE + oRS!Locked = vbChecked + oRS.Update + oRS.MoveNext + Loop + Call LoadInventory + +End Sub + +Private Sub OneIssue() +Dim oRS As Recordset, lngYARDID As Long +Dim strSQL As String, strISSUE As String +Dim lngPOS As Long + + strISSUE = InputBox("Enter The Issue Date For The HiLited Item (mmddyyyy)", "One Issue Date") + + lngPOS = InStr(1, strISSUE, "/", 1) + If lngPOS = 0 Then + If Len(strISSUE) > 0 Then + strISSUE = Format(strISSUE, "00/00/####") + If Not IsDate(strISSUE) Then + MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" + Exit Sub + End If + Else + Exit Sub + End If + Else + MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" + Exit Sub + End If + + lstInventory.col = 0 + lngYARDID = CLng(lstInventory.ColText) 'FIX THIS FOR ONE ITEM + strSQL = "SELECT * FROM tblYardOrder WHERE not locked and lot_id = " & gintLOTID + Set oRS = New Recordset + oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic + + Do Until oRS.EOF + oRS!issued = strISSUE + oRS!Locked = vbChecked + oRS.Update + oRS.MoveNext + Loop + Call LoadInventory + +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) +Dim ShiftDown, AltDown, CtrlDown + + If Shift = 4 Then + Exit Sub + End If + + ShiftDown = (Shift And vbShiftMask) > 0 + AltDown = (Shift And vbAltMask) > 0 + CtrlDown = (Shift And vbCtrlMask) > 0 + + If Not cmdSaveInv.Enabled Then + cmdSaveInv.Enabled = True + cmdAddInv.Enabled = False + End If + + If KeyCode = vbKeyQ And gbytSECURITY = 1 Then + If CtrlDown Then + Call MovePZ +' MsgBox "Hi-lited Item Has Been Moved To Order Material", vbOKOnly, "Item Moved" + End If + Exit Sub + End If + +End Sub + +Private Sub Form_KeyPress(KeyAscii As Integer) + If KeyAscii = 13 Then + SendKeys "{TAB}" + KeyAscii = 0 + End If + +End Sub +Private Sub Form_Load() + Set moRSMat = New Recordset + Set moRSMemo = New Recordset + Set moRS = New Recordset + Call FindLot + Call LoadInventory + + If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then + cmdUpdateIssue.Visible = True + cmdAddInv.Enabled = True +' cmdSaveInv.Enabled = True + cmdFindInv.Enabled = True + End If + If gbytSECURITY = 1 Then + cmdDeleteInv.Visible = True + End If + +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) +Dim intResponse As Integer, strMSG As String + On Error GoTo Error_EH + + If cmdSaveInv.Enabled Then + + strMSG = "Data Has Been Changed" + strMSG = strMSG & Chr(13) & Chr(10) + strMSG = strMSG & "Save Changes ?" + intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) + Select Case intResponse + Case vbYes + Call FormSave + + Case vbNo + + Case vbCancel + Cancel = True + + End Select + End If + + If moRSMat.State = adStateOpen Then + moRSMat.Close + End If + Exit Sub + +Error_EH: + If Err = 3219 Then + Resume Next + Else + End If +End Sub + +Private Sub lstInv_DblClick() +Dim oRS As Recordset +Dim strSQL As String + On Error GoTo Error_EH + + strSQL = "SELECT Inv_no, Desc, price FROM tblInvtry where Inv_no = " & lstInv.ItemData(lstInv.ListIndex) + + Set oRS = New Recordset + + oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly + + With oRS + + txtInvNo = Field2Str(!inv_no) + txtDesc = Field2Str(!Desc) + txtPrice = Field2Str(!price) + End With + + oRS.Close + txtQIssue.SetFocus + lstInv.Visible = False + If gbytSECURITY = 1 Then + cmdDeleteInv.Visible = True + End If + + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_Click() + On Error GoTo Error_EH + + If lstInventory.ListIndex <> -1 Then + If FormFind() Then + + Call FormShow + + End If + End If + Exit Sub + +Error_EH: + Call ErrorHandler2 + Exit Sub +End Sub + +Private Sub lstInventory_DblClick() + If gbytSECURITY = 1 Then +' If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then + cmdPopulate.Visible = True + cmdSaveInv.Enabled = True + cmdDeleteInv.Enabled = True + cmdAddInv.Enabled = False + End If +End Sub + +Private Sub txtDesc_GotFocus() + Call FieldSelect(txtDesc) +End Sub + +Private Sub txtDesc_LostFocus() + txtDesc = UCase(txtDesc) +End Sub + +Private Sub txtInvNo_GotFocus() + Call FieldSelect(txtInvNo) +End Sub + +Private Sub txtMemo_LostFocus() + txtMemo = UCase(txtMemo) +End Sub + +Private Sub txtQIssue_GotFocus() + Call FieldSelect(txtQIssue) +End Sub +Private Sub txtPrice_GotFocus() + Call FieldSelect(txtPrice) +End Sub + +Private Sub txtQIssue_LostFocus() + Call FieldSelect(txtQIssue) +End Sub diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frx new file mode 100644 index 0000000..07c22a3 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmYardOrder.frx differ diff --git a/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmsand.frx b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmsand.frx new file mode 100644 index 0000000..6225942 Binary files /dev/null and b/clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/frmsand.frx differ diff --git a/clients/valleywide/session-logs/2026-06/2026-06-13-mike-vwp-server3-migration-and-orders-source-recovery.md b/clients/valleywide/session-logs/2026-06/2026-06-13-mike-vwp-server3-migration-and-orders-source-recovery.md new file mode 100644 index 0000000..513b365 --- /dev/null +++ b/clients/valleywide/session-logs/2026-06/2026-06-13-mike-vwp-server3-migration-and-orders-source-recovery.md @@ -0,0 +1,160 @@ +# Session 2026-06-13 — VWP SERVER3 retirement, G: migration to VWP-FILES, Orders VB6 source recovery (+ GuruRMM NT 6.0 legacy agent) + +## User +- **User:** Mike Swanson (mike) +- **Machine:** GURU-5070 +- **Role:** admin + +## Session Summary + +Started on the GuruRMM legacy-agent floor: SERVER3 rejected the legacy agent with "not a valid +Win32 application." Confirmed the cause is the PE OS/subsystem version stamp (6.1 = Win7/2008 R2) +vs the box's NT version. Built a **6.0-stamped** legacy agent on Pluto (the office Windows builder) +so the agent loads on Server 2008 / NT 6.0 — needed for Glaztech's pre-R2 2008 servers. Two real +fixes were required: pin `zeroize = =1.8.1` (1.9.0 needs edition2024, which Rust 1.77 can't parse — +a latent break in the production legacy pipeline) and add `-C link-arg=/SUBSYSTEM:CONSOLE,6.00`. +Header verified 6.0/6.0, console subsystem preserved. + +SERVER3 (the VWP XenServer "server 2003" VM) was upgraded in-place to Server 2008 by Mike. That +broke networking (PV NIC gone) and then bricked with 0x7B INACCESSIBLE_BOOT_DEVICE after a XenTools +install. Recovered it: safe-mode XenTools uninstall, then a clean reinstall with the **xenbus/ +xenfilt/xenvbd boot-start** fix applied before reboot. Came up healthy (PV 7.1 build 1270, NIC up +on 192.168.0.20). Snapshots taken at each safe point. + +The main work: **migrated the G: file share off SERVER3 onto a new Hyper-V file server, VWP-FILES** +(pre-staged Gen2 Server 2019 VM on VWP-HYPERV1). Block-migrated the 100 GB G: VDI (XenServer +`vdi-export` streamed straight to HYPERV1 over HTTPS, converted to VHDX), attached, brought online, +recreated all 19 SMB shares with exact perms (via WMI ACL extraction — the registry-import route +was blocked by SMB admin-share refusal), repointed the **MappedDrives GPO** G: → `\\VWP-FILES\G-drive` +(and cleaned two stale G: maps), and did the **IP takeover** so VWP-FILES holds `192.168.0.20` +(VLAN 2 "Old Net") for IP-based stragglers while serving the new net on 172.16.9.132. Verified, +billed 3.5 h remote on #32418, prepay 24.0 → 20.5. + +Finally, hunted for the **lost VWP "Orders" VB6 source** (#32280). It was not loose on any server — +but Darv's full machine backup (`F:\Darv\Darv.rar`, 51 GB, on WINFileSvr) contained the complete +Orders project tree. Staged 12.2 MB of pure source (147 .frm, 4 .bas, 5 .vbp; newest ORDERS_C.vbp +2020-06-09) into the repo. **The source is fully recovered — VB Decompiler is no longer needed.** + +## Key Decisions + +- **6.0 PE stamp, not a separate agent SKU.** A 6.0-stamped image still loads on Win7→11, so one + legacy binary covers 2008 → 11 — just lower the floor. Pin `zeroize=1.8.1` to clear the + edition2024 wall on Rust 1.77 (mirrors the existing uuid/url pins). +- **Block-migrate G:, not file-copy.** ~100 GB of many small files → a whole-volume image move + (VDI export → VHDX) is far faster and preserves NTFS/perms/timestamps. Streamed the export + directly XenServer→HYPERV1 (dom0 has only ~15 GB scratch; can't stage 100 GB locally). +- **WMI ACL extraction for shares, not registry import.** SERVER3's admin share (C$) refused + (error 67) and `reg export` via WMI didn't land, so recreated all 19 shares with `New-SmbShare` + + the exact share-level ACLs pulled via `Win32_LogicalShareSecuritySetting`. Result identical + (mostly Everyone Full; Shelly read-only; G-drive +Domain Users). +- **GPO points G: at `\\VWP-FILES` by name**, decoupled from the .20 IP takeover, so it survives + regardless. Disabled DNS registration on the .20 NIC so the name resolves only to 172.16.9.132 + (avoids new-net clients hitting the asymmetric-route dead end on .20). +- **IP takeover via VLAN tag, no cabling.** UDM "Old Net" = VLAN 2; HYPERV1's uplink already trunks + it (UniFi default), so a tagged 2nd vNIC + .20 was fully remote — no on-site patch needed. +- **Don't decompile — recover the source.** Pursued Darv.rar over the VB-Decompiler path once the + full .vbp tree turned up; we now have real, buildable 2020 source. + +## Problems Encountered + +- **"not a valid Win32 application" on SERVER3** — PE stamped NT 6.1; box was below the floor. + Fixed by building a 6.0-stamped agent (and SERVER3 was upgraded to 2008 anyway). +- **0x7B INACCESSIBLE_BOOT_DEVICE after XenTools** on the 2008 guest — xenvbd took the boot disk + without being boot-critical. Fixed by setting xenbus/xenfilt/xenvbd `Start=0` before reboot. +- **zeroize 1.9.0 edition2024** broke the 1.77 legacy build — pinned `=1.8.1`. (Production legacy + pipeline will hit the same; the pin should be committed to `agent/Cargo.toml`.) +- **RMM JSON transport eats one backslash** from UNC literals — bit me 3× (GPO path stored as + `\VWP-FILES`, Test-Path failures). Worked around by building backslashes from `[char]92`. +- **Asymmetric routing to .20** — dual-homed VWP-FILES replies via its 172.16.9 NIC, so cross-subnet + (DC, my VPN) can't reach .20; only same-subnet Old-Net clients can. Acceptable: stragglers are + Old-Net, new-net uses the GPO `\\VWP-FILES`. Used 172.16.9.132 for my own file pulls. +- **SMB admin-share (C$) refusal + reg-export-via-WMI not landing** on SERVER3 → pivoted to WMI + ACL extraction for the share migration. +- **Per-site MSI installer endpoint 500/"Missing authorization"** when enrolling VWP-FILES — Mike + pushed the agent via ScreenConnect instead (now online, site Main Office). + +## Configuration Changes + +- **VWP-FILES (Hyper-V VM on VWP-HYPERV1):** checkpoint merged (flat VHDX), AutomaticCheckpoints + disabled, RAM 4→16 GB, install ISO ejected. Added 2nd vNIC `OldNet-VLAN2` (AccessVlanId 2), + static `192.168.0.20/24` (no gateway), DNS registration disabled on that NIC. Attached migrated + `C:\VHD\server3-g.vhdx` (SCSI0:2) as G:. 19 SMB shares created. GuruRMM agent installed (via SC). +- **GPO `MappedDrives` (VWP.US):** G: drive map `\\192.168.0.20\G-drive` → `\\VWP-FILES\G-drive`; + version bumped (gpt.ini + AD) to 4980736. +- **GPO `Default Domain Policy`:** removed stale G: map (`\\192.168.0.96\g$`); version → 1114165. +- **Orphaned SYSVOL policy `{FCB17CA3-155F-4BD3-B633-4E1F5CF01679}`** (no AD object) deleted + (backed up to `C:\GPO-backup-Gmig-20260613-170451` on VWP-DC1). +- **SERVER3 (XenServer VM `0c73ce00-...`):** clean-shutdown (retired). Snapshots created: + `server2008-clean-noTools-20260613` (45d56386), `server2008-working-pvtools-20260613` (b2f50da4). +- **Repo:** staged `clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/` + (12.2 MB recovered VB6 source); `darv-G-finds/` (ORDERS0727-2015.exe, ORDERS-2005.exe, + frmPayroll, Package1508); updated `app-modernization/CONTEXT.md` (G: finds + source recovery). +- **Vault:** created `clients/vwp/domain-sysadmin` (VWP\sysadmin). + +## Credentials & Secrets + +- **VWP\sysadmin** (VWP.US domain admin) — `r3tr0gradE99#` — vaulted at `clients/vwp/domain-sysadmin`. + Used for PowerShell Direct into VWP-FILES + WMI/SMB to VWP servers. +- **VWP XenServer** root — `r3tr0gradE99!` — vault `clients/vwp/xenserver` (host 192.168.0.104). +- **VWP UDM** root — `Gptf*77ttb123!@#-vwp` — vault `clients/vwp/udm` (host 172.16.9.1). + +## Infrastructure & Servers + +- **VWP-HYPERV1** 172.16.9.184 — Dell R740, Server 2025, 112 vCPU / 255 GB RAM, C: 10.7 TB (10.37 + free), Hyper-V, one External vSwitch on Intel 10G NIC (NIC1 linked 1 Gbps; NIC2/3/4 spare). + VHDs in `C:\VHD`. RMM agent bdc3e142-1eb3-4034-8ac2-300f46dbc1d9. +- **VWP-FILES** — Hyper-V Gen2, Server 2019, now 16 GB RAM; IPs 172.16.9.132 (primary) + 192.168.0.20 + (VLAN 2). Serves G: (NTFS "G Drive", ~88 GB used). RMM site Main Office. +- **VWP XenServer** 192.168.0.104 — XenServer 7.6, PowerEdge R720. SERVER3 VM `0c73ce00-c4cc-c549-5f55-98657a66b203` + (now off). G: VDI `828ea0ff-...` (100 GB), snapshot for export `9ee0e831-...`. +- **DC 192.168.0.25 (VWP_ADSRVR)** — Old Net DC, Server 2019, healthy (LDAP/SMB/DNS up). +- **VWP-DC1** 172.16.9.x — Server 2019 DC (RMM 8eefbba6-...). +- **WINFileSvr** 192.168.0.35 — Server 2019 file server; holds O:/P: shares AND `F:\Darv\Darv.rar` + (the source backup) + `F:\Darv\Darv-rar` (135 GB extract). RMM 62db0264-88c2-44db-996d-84996afe8706. +- **UDM** 172.16.9.1 — networks: Default 172.16.9.0/24 (untagged), **Old Net 192.168.0.0/24 = VLAN 2** + (gw .1, DHCP .100-.199, DNS=192.168.0.25 + 8.8.8.8), Management 192.168.3.0/24 VLAN 99, OpenVPN .4.0/24. +- **Pluto** 172.16.3.36 — office Windows builder (Rust 1.77 + i686; `C:\gururmm`). GURU-5070 SSH key + added to its `administrators_authorized_keys` this session. + +## Commands & Outputs + +- 6.0 legacy build (Pluto): `cargo +1.77 build --ignore-rust-version --release --features legacy + --target i686-pc-windows-msvc` with `$env:RUSTFLAGS='-C link-arg=/SUBSYSTEM:CONSOLE,6.00'`, after + `cargo +stable add zeroize@=1.8.1` and moving `agent\Cargo.lock` aside. Artifact: + `C:\Users\guru\Downloads\gururmm-agent-legacy-pre2008-x86.exe` (SHA256 0BB363E2…), header 6.0/6.0. +- xenvbd boot-start fix (in-guest, pre-reboot): `reg add HKLM\SYSTEM\CurrentControlSet\Services\ + {xenbus,xenfilt,xenvbd} /v Start /t REG_DWORD /d 0 /f`. +- G: export (HYPERV1 pulls from Xen): `curl.exe -sk -o C:\VHD\server3-g.vhd + "https://192.168.0.104/export_raw_vdi?session_id=&vdi=9ee0e831-...&format=vhd"` + (~100 MB/s, final 99.33 GB), then `Convert-VHD … -VHDType Dynamic` → server3-g.vhdx (99.38 GB). +- Share ACLs via `Get-WmiObject Win32_LogicalShareSecuritySetting … .GetSecurityDescriptor()`. +- Source recovery sweep found `…\Kingston\Project\VWP_Current\ORDERS_C.vbp` (2020-06-09); project + references 80 forms + 10 OCX (TABCTL32, Crystl32, True DBGrid, FarPoint Spread). + +## Pending / Incomplete Tasks + +- **Commit `zeroize = "=1.8.1"`** to `guru-rmm/agent/Cargo.toml` (production legacy build will break + on next run without it). Open as its own fix. +- **Validate the 6.0 legacy agent on a real NT 6.0 box** (Glaztech 2008 server, or a lab VM). Then + correct SPEC-029 §12 / `installer/legacy/README.md` ("blocked / NSIS+NSSM") and pursue unified + x86-MSI + native-SCM. +- **Modernization (#32280):** stand up a VB6 build env, confirm `ORDERS_C.vbp` compiles from the + recovered tree, then scope the modernization from source. Optionally stage `VWP_Inv` / `VWP_Update` + projects too. Bill #32280 for the recovery search. +- **Cleanup (on sign-off):** delete `C:\VHD\server3-g.vhd` (99 GB intermediate) on HYPERV1, the + XenServer G: snapshot, and `F:\Darv\Darv-rar` (135 GB) once source verified; SERVER3 VM stays + off-but-intact as deepest rollback. +- **Commit** the staged source + darv-G-finds (this `/save` syncs them). +- Beast `C:\Temp\gururmm-nsvc*` leftovers from the prior native-SCM probe still pending cleanup. +- Old-Net DHCP secondary DNS = 8.8.8.8 → consider changing to a second internal DC. + +## Reference Information + +- **Tickets:** #32418 G-Drive Migration (Invoiced, 3.5 h remote, $0 prepaid; id 112613439). + #32280 Source Code Data Recovery (New; id 110305931) — recovery write-up posted. +- **Repo paths:** `clients/valleywide/app-modernization/source-code/Orders-VWP_Current-2020/`, + `…/source-analysis/darv-G-finds/`, `…/CONTEXT.md`. +- **Source of record:** WINFileSvr `F:\Darv\Darv-rar` (extract) + `F:\Darv\Darv.rar` (51 GB archive). +- **RMM:** http://172.16.3.30:3001 — VWP site "Main Office" 7c18fe2c-38fe-4ebf-8a26-b47745db2d19 + (code INNER-TIGER-8330). +- **VWP Syncro customer:** 31694734.